Site_resetDocids.py 2.26 KB
Newer Older
1 2
from Products.ERP5SyncML.Conduit.ERP5Conduit import ERP5Conduit

Jean-Paul Smets's avatar
Jean-Paul Smets committed
3
def main(self):
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
  xml_workspace = """<erp5><object id="1320758020__0001" portal_type="Workspace">
    <layout_and_schema type="object">None</layout_and_schema>
    <Coverage type="string"></Coverage>
    <CreationDate type="date">2004-06-01 12:57:21</CreationDate>
    <Creator type="string">seb</Creator>
    <Description type="string"></Description>
    <EffectiveDate type="date">None</EffectiveDate>
    <ExpirationDate type="date">None</ExpirationDate>
    <Format type="string">text/html</Format>
    <Language type="string">en</Language>
    <ModificationDate type="date">2004-06-01 12:57:21</ModificationDate>
    <Relation type="string"></Relation>
    <Rights type="string"></Rights>
    <Source type="string"></Source>
    <Title type="string">Root of Workspaces</Title>
    <allow_discussion type="int">0</allow_discussion>
    <hidden_folder type="int">0</hidden_folder>
    <preview type="object">None</preview>
    <local_role id="seb" type="tokens">permission:Modify_portal_content</local_role>
  </object>
  </erp5>"""

  xml_section = """<erp5><object id="628256376__0001" portal_type="Section">
    <layout_and_schema type="object">None</layout_and_schema>
    <Coverage type="string"></Coverage>
    <CreationDate type="date">2004-06-01 12:57:21</CreationDate>
    <Creator type="string">seb</Creator>
    <Description type="string"></Description>
    <EffectiveDate type="date">None</EffectiveDate>
    <ExpirationDate type="date">None</ExpirationDate>
    <Format type="string">text/html</Format>
    <Language type="string">en</Language>
    <ModificationDate type="date">2004-06-01 12:57:21</ModificationDate>
    <Relation type="string"></Relation>
    <Rights type="string"></Rights>
    <Source type="string"></Source>
    <Title type="string">Root of Sections</Title>
    <allow_discussion type="int">0</allow_discussion>
    <hidden_folder type="int">0</hidden_folder>
    <preview type="object">None</preview>
  </object>
  </erp5>"""
Jean-Paul Smets's avatar
Jean-Paul Smets committed
46

47 48 49
  portal_repository = self.portal_repository

  conduit = ERP5Conduit()
Sebastien Robin's avatar
Sebastien Robin committed
50 51
  conduit.addNode(xml=xml_workspace,object=portal_repository)
  conduit.addNode(xml=xml_section,object=portal_repository)
52 53 54 55
  
  self.workspaces.setDocid(1320758020)
  self.sections.setDocid(628256376)
  return "ok"