예제 #1
0
    def _bootstrap(self):
        bt_name = 'erp5_property_sheets'
        from Products.ERP5.ERP5Site import ERP5Generator
        ERP5Generator.bootstrap(
            self,
            bt_name,
            'PropertySheetTemplateItem',
            (
                'BaseType',
                'BusinessTemplate',
                'Folder',
                'SimpleItem',
                'Version',
                'Comment',
                # the following ones are required to upgrade an existing site
                'Reference',
                'BaseCategory',
                'SQLIdGenerator',
            ))

        def install():
            from ZPublisher.BaseRequest import RequestContainer
            from Products.ERP5Type.Globals import get_request
            portal = self.getPortalObject()
            # BusinessTemplate.install needs a request
            template_tool = portal.aq_base.__of__(
                portal.aq_parent.__of__(
                    RequestContainer(REQUEST=get_request()))).portal_templates
            if template_tool.getInstalledBusinessTemplate(bt_name) is None:
                from Products.ERP5.ERP5Site import getBootstrapBusinessTemplateUrl
                url = getBootstrapBusinessTemplateUrl(bt_name)
                template_tool.download(url).install()

        transaction.get().addBeforeCommitHook(unrestricted_apply, (install, ))
예제 #2
0
 def _bootstrap(self):
   bt_name = 'erp5_property_sheets'
   from Products.ERP5.ERP5Site import ERP5Generator
   ERP5Generator.bootstrap(self, bt_name, 'PropertySheetTemplateItem', (
     'BaseType',
     'BusinessTemplate',
     'Folder',
     'SimpleItem',
     'Version',
     'Comment',
     # the following ones are required to upgrade an existing site
     'Reference',
     'BaseCategory',
     'SQLIdGenerator',
   ))
   def install():
     from ZPublisher.BaseRequest import RequestContainer
     from Products.ERP5Type.Globals import get_request
     portal = self.getPortalObject()
     # BusinessTemplate.install needs a request
     template_tool = portal.aq_base.__of__(portal.aq_parent.__of__(
       RequestContainer(REQUEST=get_request()))).portal_templates
     if template_tool.getInstalledBusinessTemplate(bt_name) is None:
       from Products.ERP5.ERP5Site import getBootstrapBusinessTemplateUrl
       url = getBootstrapBusinessTemplateUrl(bt_name)
       template_tool.download(url).install()
   transaction.get().addBeforeCommitHook(unrestricted_apply, (install,))
예제 #3
0
 def _bootstrap(self):
     from Products.ERP5.ERP5Site import ERP5Generator
     ERP5Generator.bootstrap(self, 'erp5_core', 'CategoryTemplateItem', (
         'before_script',
         'before_commit_script',
         'activate_script',
         'after_script',
     ))
예제 #4
0
 def _bootstrap(self):
   from Products.ERP5.ERP5Site import ERP5Generator
   ERP5Generator.bootstrap(self, 'erp5_core', 'PortalTypeTemplateItem', (
     'Business Template',
     'Standard Property',
     'Acquired Property',
     # the following ones are required to upgrade an existing site
     'Category Property',
   ))
예제 #5
0
 def _bootstrap(self):
   from Products.ERP5.ERP5Site import ERP5Generator
   ERP5Generator.bootstrap(self, 'erp5_core', 'PortalTypeTemplateItem', (
     'Business Template',
     'Standard Property',
     'Acquired Property',
     # the following ones are required to upgrade an existing site
     'Category Property',
   ))
예제 #6
0
    def _bootstrap(self):
        from Products.ERP5.ERP5Site import ERP5Generator

        ERP5Generator.bootstrap(
            self,
            "erp5_core",
            "PortalTypeTemplateItem",
            (
                "Business Template",
                "Standard Property",
                "Acquired Property",
                # the following ones are required to upgrade an existing site
                "Category Property",
            ),
        )
예제 #7
0
    def _bootstrap(self):
        bt_name = 'erp5_property_sheets'
        from Products.ERP5.ERP5Site import ERP5Generator
        content_path_list = [
            'BaseType',
            'BusinessTemplate',
            'Folder',
            'SimpleItem',
            'Version',
            'Comment',
            # for workflows
            'Guard',
            'WorkflowVariable',
            'InteractionWorkflowInteraction',
            'ActionInformation/action_name_property',
            'WorkflowState',
            'WorkflowTransition',
            'Predicate',
            'Workflow',
            'Workflow/manager_bypass_property',
            'Workflow/state_variable_property',
            'Workflow/workflow_managed_permission_property',
            # the following ones are required to upgrade an existing site
            'Reference',
            'BaseCategory',
            'SQLIdGenerator'
        ]
        content_path_list.extend([
            'BusinessTemplate/' + bt_property
            for bt_property in self._bootstrap_business_template_property_tuple
        ])
        ERP5Generator.bootstrap(self, bt_name, 'PropertySheetTemplateItem',
                                content_path_list)

        def install():
            from ZPublisher.BaseRequest import RequestContainer
            from Products.ERP5Type.Globals import get_request
            portal = self.getPortalObject()
            # BusinessTemplate.install needs a request
            template_tool = portal.aq_base.__of__(
                portal.aq_parent.__of__(
                    RequestContainer(REQUEST=get_request()))).portal_templates
            if template_tool.getInstalledBusinessTemplate(bt_name) is None:
                from Products.ERP5.ERP5Site import getBootstrapBusinessTemplateUrl
                url = getBootstrapBusinessTemplateUrl(bt_name)
                template_tool.download(url).install()

        transaction.get().addBeforeCommitHook(unrestricted_apply, (install, ))
예제 #8
0
 def _bootstrap(self):
   from Products.ERP5.ERP5Site import ERP5Generator
   ERP5Generator.bootstrap(self,
                           'erp5_core',
                           'PortalTypeTemplateItem',
                           self._bootstrap_type_list)
   getattr(self, 'Workflow Transition Variable').base_category_list = ('causality',)
   ERP5Generator.bootstrap_allow_type(self, 'Catalog Tool')
   ERP5Generator.bootstrap_allow_type(self, 'Workflow Tool')
   ERP5Generator.bootstrap_allow_type(self, 'Workflow')
   ERP5Generator.bootstrap_allow_type(self, 'Workflow Transition')
   ERP5Generator.bootstrap_allow_type(self, 'Interaction Workflow')