From 87809cb8de8dec0ef0f4d5d10cf221097add945d Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Wed, 23 Jan 2019 15:01:13 +0100 Subject: [PATCH 1/9] ERP5Configurator: add WebServiceConfiguratorItem --- .../view.xml | 79 ++++++++++++ .../allowed_content_types.xml | 1 + .../Web%20Service%20Configurator%20Item.xml | 60 +++++++++ .../bt/template_action_path_list | 1 + ...late_portal_type_allowed_content_type_list | 1 + .../bt/template_portal_type_id_list | 1 + .../Document/WebServiceConfiguratorItem.py | 115 ++++++++++++++++++ 7 files changed, 258 insertions(+) create mode 100644 bt5/erp5_configurator/ActionTemplateItem/portal_types/Web%20Service%20Configurator%20Item/view.xml create mode 100644 bt5/erp5_configurator/PortalTypeTemplateItem/portal_types/Web%20Service%20Configurator%20Item.xml create mode 100644 product/ERP5Configurator/Document/WebServiceConfiguratorItem.py diff --git a/bt5/erp5_configurator/ActionTemplateItem/portal_types/Web%20Service%20Configurator%20Item/view.xml b/bt5/erp5_configurator/ActionTemplateItem/portal_types/Web%20Service%20Configurator%20Item/view.xml new file mode 100644 index 0000000000..56391a5c36 --- /dev/null +++ b/bt5/erp5_configurator/ActionTemplateItem/portal_types/Web%20Service%20Configurator%20Item/view.xml @@ -0,0 +1,79 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_view + + + + + category + object_view + + + condition + + + + description + + + + icon + + + + id + view + + + permissions + + + View + + + + + priority + 1.0 + + + title + View + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/ConfiguratorItem_view + + + + + diff --git a/bt5/erp5_configurator/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_configurator/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml index 4912ae9da6..bf6adfa501 100644 --- a/bt5/erp5_configurator/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml +++ b/bt5/erp5_configurator/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -44,6 +44,7 @@ Solver Configurator Item Standard BT5 Configurator Item System Preference Configurator Item + Web Service Configurator Item Workflow Security Configurator Item diff --git a/bt5/erp5_configurator/PortalTypeTemplateItem/portal_types/Web%20Service%20Configurator%20Item.xml b/bt5/erp5_configurator/PortalTypeTemplateItem/portal_types/Web%20Service%20Configurator%20Item.xml new file mode 100644 index 0000000000..ad05b04451 --- /dev/null +++ b/bt5/erp5_configurator/PortalTypeTemplateItem/portal_types/Web%20Service%20Configurator%20Item.xml @@ -0,0 +1,60 @@ + + + + + + + + + + content_icon + document.gif + + + content_meta_type + ERP5 Account Configurator Item + + + description + Setup an Accounting Account. + + + factory + addAccountConfiguratorItem + + + id + Web Service Configurator Item + + + init_script + + + + + + permission + + + + + + type_class + WebServiceConfiguratorItem + + + type_interface + + + + + + type_mixin + + + + + + + + diff --git a/bt5/erp5_configurator/bt/template_action_path_list b/bt5/erp5_configurator/bt/template_action_path_list index d65cf7778a..573c77e437 100644 --- a/bt5/erp5_configurator/bt/template_action_path_list +++ b/bt5/erp5_configurator/bt/template_action_path_list @@ -27,6 +27,7 @@ Site Property Configurator Item | view Solver Configurator Item | view Standard BT5 Configurator Item | view System Preference Configurator Item | view +Web Service Configurator Item | view Workflow Security Configurator Item | view Workflow | configurator_settings Workflow | launch_configuration diff --git a/bt5/erp5_configurator/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_configurator/bt/template_portal_type_allowed_content_type_list index 1372997215..0527a31a5e 100644 --- a/bt5/erp5_configurator/bt/template_portal_type_allowed_content_type_list +++ b/bt5/erp5_configurator/bt/template_portal_type_allowed_content_type_list @@ -34,6 +34,7 @@ Configuration Save | Site Property Configurator Item Configuration Save | Solver Configurator Item Configuration Save | Standard BT5 Configurator Item Configuration Save | System Preference Configurator Item +Configuration Save | Web Service Configurator Item Configuration Save | Workflow Security Configurator Item Organisation Configurator Item | Address Organisation Configurator Item | Email diff --git a/bt5/erp5_configurator/bt/template_portal_type_id_list b/bt5/erp5_configurator/bt/template_portal_type_id_list index 88c3441bdc..92f2a8c12c 100644 --- a/bt5/erp5_configurator/bt/template_portal_type_id_list +++ b/bt5/erp5_configurator/bt/template_portal_type_id_list @@ -30,4 +30,5 @@ Site Property Configurator Item Solver Configurator Item Standard BT5 Configurator Item System Preference Configurator Item +Web Service Configurator Item Workflow Security Configurator Item \ No newline at end of file diff --git a/product/ERP5Configurator/Document/WebServiceConfiguratorItem.py b/product/ERP5Configurator/Document/WebServiceConfiguratorItem.py new file mode 100644 index 0000000000..31c5d61815 --- /dev/null +++ b/product/ERP5Configurator/Document/WebServiceConfiguratorItem.py @@ -0,0 +1,115 @@ +############################################################################## +# +# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved. +# Ivan Tyagov +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import zope.interface +from AccessControl import ClassSecurityInfo +from Products.ERP5Type import Permissions, PropertySheet, interfaces +from Products.ERP5Type.XMLObject import XMLObject +from Products.ERP5Type.Message import translateString +from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin + +class WebServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject): + """ This class install a Organisation.""" + + meta_type = 'ERP5 Web Service Configurator' + portal_type = 'Web Service Configurator Item' + add_permission = Permissions.AddPortalContent + isPortalContent = 1 + isRADContent = 1 + + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) + + # Declarative interfaces + zope.interface.implements(interfaces.IConfiguratorItem) + + # Declarative properties + property_sheets = ( PropertySheet.Base + , PropertySheet.XMLObject + , PropertySheet.CategoryCore + , PropertySheet.DublinCore + , PropertySheet.FTPConnectorConfiguration + , PropertySheet.FTPConnector + , PropertySheet.Login + , PropertySheet.Reference + , PropertySheet.Url) + + def _checkConsistency(self, fixit=False, filter=None, **kw): + """ Setup Web Service. """ + property_list = [ + 'url_protocol', + 'url_string', + 'user_id', + 'description', + 'reference', + 'footer', + 'destination', + 'import_filename', + 'header', + 'bind_address', + 'use_temporary_file_on_write', + 'country_code', + 'password', + 'psv', + 'output_filename', + 'source' + ] + portal = self.getPortalObject() + result_list = portal.portal_catalog( + portal_type='FTP Connector', + reference=self.getReference()) + if len(result_list): + web_service = result_list[0] + if not fixit: + for key in property_list: + value = web_service.getProperty(key) + if value is None or value != self.getProperty(key): + return [self._createConstraintMessage( + 'Web Service %s has wrong value:%s' % (self.getReference(), key))] + else: + if not fixit: + return [self._createConstraintMessage( + 'Web Service %s is not created' % self.getReference())] + web_service = portal.portal_web_services.newContent(portal_type='FTP Connector') + + if not fixit: + if web_service.getValidationState() != 'validated': + return [self._createConstraintMessage( + 'Web Service %s is not validated' % self.getReference())] + else: + org_dict = {} + for key in property_list: + org_dict[key] = self.getProperty(key) + web_service.edit(**org_dict) + + if portal.portal_workflow.isTransitionPossible(web_service.getObject(), 'validate'): + web_service.validate(comment=translateString("Validated by Configurator")) + + return [] + -- 2.30.9 From b41ea4e38bc2c188c98fa01d9708ceb2db8226c8 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Wed, 23 Jan 2019 15:50:38 +0100 Subject: [PATCH 2/9] OrganisationConfiguratorItem: get organisation id from user input --- .../Document/OrganisationConfiguratorItem.py | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/product/ERP5Configurator/Document/OrganisationConfiguratorItem.py b/product/ERP5Configurator/Document/OrganisationConfiguratorItem.py index 0fc521503c..5eae2a3ae7 100644 --- a/product/ERP5Configurator/Document/OrganisationConfiguratorItem.py +++ b/product/ERP5Configurator/Document/OrganisationConfiguratorItem.py @@ -60,29 +60,28 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject): """ Setup organisation. """ if fixit: portal = self.getPortalObject() - organisation = portal.organisation_module.newContent(portal_type="Organisation") + organisation = portal.organisation_module[self.getId()] + if organisation is not None: + org_dict = {'price_currency': 'currency_module/%s' % self.getPriceCurrency(), + 'group': self.getGroup(), + 'title': self.getTitle(), + 'corporate_name': self.getCorporateName(), + 'default_address_city': self.getDefaultAddressCity(), + 'default_email_text': self.getDefaultEmailText(), + 'default_telephone_text': self.getDefaultTelephoneText(), + 'default_address_zip_code': self.getDefaultAddressZipCode(), + 'default_address_region': self.getDefaultAddressRegion(), + 'default_address_street_address': self.getDefaultAddressStreetAddress(), + } + organisation.edit(**org_dict) - org_dict = {'price_currency': 'currency_module/%s' % self.getPriceCurrency(), - 'group': self.getGroup(), - 'title': self.getTitle(), - 'corporate_name': self.getCorporateName(), - 'default_address_city': self.getDefaultAddressCity(), - 'default_email_text': self.getDefaultEmailText(), - 'default_telephone_text': self.getDefaultTelephoneText(), - 'default_address_zip_code': self.getDefaultAddressZipCode(), - 'default_address_region': self.getDefaultAddressRegion(), - 'default_address_street_address': self.getDefaultAddressStreetAddress(), - 'site':'main', # First customer's organisation is always main site. - } - organisation.edit(**org_dict) + business_configuration = self.getBusinessConfigurationValue() + # store globally organization_id + business_configuration.setGlobalConfigurationAttr(organisation_id=organisation.getId()) - business_configuration = self.getBusinessConfigurationValue() - # store globally organization_id - business_configuration.setGlobalConfigurationAttr(organisation_id=organisation.getId()) + if self.portal_workflow.isTransitionPossible(organisation, 'validate'): + organisation.validate(comment=translateString("Validated by Configurator")) - if self.portal_workflow.isTransitionPossible(organisation, 'validate'): - organisation.validate(comment=translateString("Validated by Configurator")) - - ## add to customer template - self.install(organisation, business_configuration) - return ['Organisation should be created',] + ## add to customer template + self.install(organisation, business_configuration) + return ['Organisation should be update',] -- 2.30.9 From c2195300d1287499c4618692f26c8bd6e7385c16 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Fri, 25 Jan 2019 14:41:45 +0000 Subject: [PATCH 3/9] erp5_configurator: add fixConsistency action --- .../Configuration%20Save/fixConsistency.xml | 85 +++++++++++++++++++ .../bt/template_action_path_list | 1 + 2 files changed, 86 insertions(+) create mode 100644 bt5/erp5_configurator/ActionTemplateItem/portal_types/Configuration%20Save/fixConsistency.xml diff --git a/bt5/erp5_configurator/ActionTemplateItem/portal_types/Configuration%20Save/fixConsistency.xml b/bt5/erp5_configurator/ActionTemplateItem/portal_types/Configuration%20Save/fixConsistency.xml new file mode 100644 index 0000000000..b589114edb --- /dev/null +++ b/bt5/erp5_configurator/ActionTemplateItem/portal_types/Configuration%20Save/fixConsistency.xml @@ -0,0 +1,85 @@ + + + + + + + + + + action + + AAAAAAAAAAI= + + + + categories + + + action_type/object_action + + + + + category + object_action + + + condition + + + + description + + + + + + icon + + + + id + fixConsistency + + + permissions + + + View + + + + + portal_type + Action Information + + + priority + 1.0 + + + title + FixConsistency + + + visible + 1 + + + + + + + + + + + + text + string:${object_url}/fixConsistency + + + + + diff --git a/bt5/erp5_configurator/bt/template_action_path_list b/bt5/erp5_configurator/bt/template_action_path_list index 573c77e437..32020c5826 100644 --- a/bt5/erp5_configurator/bt/template_action_path_list +++ b/bt5/erp5_configurator/bt/template_action_path_list @@ -7,6 +7,7 @@ Business Process Configurator Item | view Catalog Keyword Key Configurator Item | view Categories Spreadsheet Configurator Item | view Category Configurator Item | view +Configuration Save | fixConsistency Configuration Save | view Configurator Tool | view Currency Configurator Item | view -- 2.30.9 From d3f43ec4be5e928cffad96091592dd908a4b9f21 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Fri, 22 Feb 2019 09:24:42 +0100 Subject: [PATCH 4/9] CurrencyConfiguratorItem: getResultValue is not Case sensitive --- product/ERP5Configurator/Document/CurrencyConfiguratorItem.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/product/ERP5Configurator/Document/CurrencyConfiguratorItem.py b/product/ERP5Configurator/Document/CurrencyConfiguratorItem.py index 5bd6676a33..db5cb84f1a 100644 --- a/product/ERP5Configurator/Document/CurrencyConfiguratorItem.py +++ b/product/ERP5Configurator/Document/CurrencyConfiguratorItem.py @@ -63,9 +63,7 @@ class CurrencyConfiguratorItem(ConfiguratorItemMixin, XMLObject): error_list = [] title = self.getTitle() reference = self.getReference() - # XXX FIXME This is not exactly desired behaviour - currency = self.portal_catalog.getResultValue(id=reference, - portal_type="Currency") + currency = getattr(currency_module, reference, None) if currency is None: error_list.append(self._createConstraintMessage( "Currency %s should be created" % reference)) -- 2.30.9 From 91b4277a287a34937a92699c117c8494b041cba2 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Wed, 19 Jun 2019 18:09:03 +0200 Subject: [PATCH 5/9] PreferenceConfiguratorItem: bt5_obj maybe not existe --- .../Document/PreferenceConfiguratorItem.py | 9 +++++---- .../Document/SystemPreferenceConfiguratorItem.py | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/product/ERP5Configurator/Document/PreferenceConfiguratorItem.py b/product/ERP5Configurator/Document/PreferenceConfiguratorItem.py index 29269de570..ee7bd4d6e8 100644 --- a/product/ERP5Configurator/Document/PreferenceConfiguratorItem.py +++ b/product/ERP5Configurator/Document/PreferenceConfiguratorItem.py @@ -109,9 +109,10 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject): preference_dict['preferred_section'] = organisation_path preference.edit(**preference_dict) bt5_obj = business_configuration.getSpecialiseValue() - current_template_preference_list = list(bt5_obj.getTemplatePreferenceList()) - if preference.getId() not in current_template_preference_list: - current_template_preference_list.append(preference.getId()) - bt5_obj.edit(template_preference_list=current_template_preference_list,) + if bt5_obj: + current_template_preference_list = list(bt5_obj.getTemplatePreferenceList()) + if preference.getId() not in current_template_preference_list: + current_template_preference_list.append(preference.getId()) + bt5_obj.edit(template_preference_list=current_template_preference_list,) return error_list diff --git a/product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py b/product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py index 0eb71723e1..1c2b460a9b 100644 --- a/product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py +++ b/product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py @@ -104,9 +104,10 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject): preference.edit(**preference_dict) business_configuration = self.getBusinessConfigurationValue() bt5_obj = business_configuration.getSpecialiseValue() - current_template_preference_list = list(bt5_obj.getTemplatePreferenceList()) - if preference.getId() not in current_template_preference_list: - current_template_preference_list.append(preference.getId()) - bt5_obj.edit(template_preference_list=current_template_preference_list,) + if bt5_obj: + current_template_preference_list = list(bt5_obj.getTemplatePreferenceList()) + if preference.getId() not in current_template_preference_list: + current_template_preference_list.append(preference.getId()) + bt5_obj.edit(template_preference_list=current_template_preference_list,) return error_list -- 2.30.9 From 242e91f68cc59c4e2d249f76e2d160a89eed4d49 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Thu, 20 Jun 2019 13:05:38 +0000 Subject: [PATCH 6/9] erp5_configurator: get state infos according to transition's condition --- .../BusinessConfiguration_getUIDescription.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator/BusinessConfiguration_getUIDescription.py b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator/BusinessConfiguration_getUIDescription.py index e8a77c4f6e..785961cb7e 100644 --- a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator/BusinessConfiguration_getUIDescription.py +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator/BusinessConfiguration_getUIDescription.py @@ -8,19 +8,21 @@ previous_state_list = [] workflow = business_configuration.getResourceValue() state = workflow.getSourceValue() -while state not in previous_state_list: - transition = state.getDestinationValue() - previous_state_list.append(state) - if transition is None: - break - - state = transition.getDestinationValue() - if state is None: - break - if transition.getTransitionFormId() not in (None, ""): - result.append({'state' : state.getTitle(), +def getStateInfo(state): + if state in previous_state_list or state is None: + return + previous_state_list.append(state) + transition_list = state.getAvailableTransitionList(business_configuration) + for transition in transition_list: + state = transition.getDestinationValue() + if state and transition.getTransitionFormId() not in (None, ""): + result.append({'state' : state.getTitle(), 'description' : state.getDescription(), 'title': state.getTitle()}) + getStateInfo(state) + + +getStateInfo(state) return result -- 2.30.9 From 840281180c919002d9a369ef6a4f848698cf37c6 Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Thu, 20 Jun 2019 17:38:40 +0200 Subject: [PATCH 7/9] ConfiguratorTool: go to initial state if it's end --- product/ERP5Configurator/Tool/ConfiguratorTool.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/product/ERP5Configurator/Tool/ConfiguratorTool.py b/product/ERP5Configurator/Tool/ConfiguratorTool.py index e0e051c629..78d557fba8 100644 --- a/product/ERP5Configurator/Tool/ConfiguratorTool.py +++ b/product/ERP5Configurator/Tool/ConfiguratorTool.py @@ -154,7 +154,10 @@ class ConfiguratorTool(BaseTool): ## client can not go further hist business configuration is already built if business_configuration.isEndConfigurationState() or \ business_configuration.getNextTransition() == None: - return self._terminateConfigurationProcess(response) + workflow = business_configuration.getResourceValue() + business_configuration.setCurrentState(workflow.getSource()) + need_validation = 0 + #return self._terminateConfigurationProcess(response) isMultiEntryTransition = business_configuration._isMultiEntryTransition() ## validate multiple forms -- 2.30.9 From cb252da9e7da3d84a14ba96df2be90d2771a559f Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Thu, 20 Jun 2019 15:46:17 +0000 Subject: [PATCH 8/9] erp5_configurator: display all business process --- .../ConfiguratorTool_getAvailableBusinessConfigurationList.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py index 2f6f9c376b..08677e8e5e 100644 --- a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_getAvailableBusinessConfigurationList.py @@ -5,7 +5,6 @@ """ bc_list = context.business_configuration_module.searchFolder( portal_type="Business Configuration", - simulation_state="draft", resource_relative_url="workflow_module/%") bc_list = [bc.getObject() for bc in bc_list if bc.getResourceValue() is not None] -- 2.30.9 From abca29cab886895a076b65c10253ea4dc649199b Mon Sep 17 00:00:00 2001 From: Xiaowu Zhang Date: Fri, 14 Jun 2019 17:43:03 +0200 Subject: [PATCH 9/9] ERP5Configurator&erp5_configurator: add check/fix existing site action --- ...iguratorTool_generateCheckingJavaScript.py | 59 +++++++++++++++ ...guratorTool_generateCheckingJavaScript.xml | 66 +++++++++++++++++ ...guratorTool_viewCheckingResultRenderer.xml | 58 +++++++++++++++ ...guratorTool_viewCheckingResultRenderer.zpt | 13 ++++ .../ConfiguratorTool_viewCheckingStatus.xml | 58 +++++++++++++++ .../ConfiguratorTool_viewCheckingStatus.zpt | 32 +++++++++ .../wizard_dialog.zpt | 7 ++ .../Document/BusinessConfiguration.py | 71 +++++++++++++++++-- .../ERP5Configurator/Tool/ConfiguratorTool.py | 51 +++++++++++-- 9 files changed, 405 insertions(+), 10 deletions(-) create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.py create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.xml create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.xml create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.zpt create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.xml create mode 100644 bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.zpt diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.py b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.py new file mode 100644 index 0000000000..05d554ae70 --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.py @@ -0,0 +1,59 @@ +REQUEST = context.REQUEST +erp5_site_id = context.getPortalObject().getId() + +js_string = """ + // Initialisation + window.onload = init; + + function getNewXMLHTTP() { + try { + return new XMLHttpRequest(); + } catch(e) { + try { + var aObj = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + var aObj = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + return false; + } + } + } + return aObj; + } + + function checkClientInstallation() { + time_out = window.setTimeout( "checkClientInstallation()", 5000 ); + var xhr_object = null; + xhr_object = getNewXMLHTTP(); + xhr_object.onreadystatechange = function() + { + var status = document.getElementById('client_installation_status'); + if(xhr_object.readyState == 4) + { + if(xhr_object.status == 200) + { + status.innerHTML = xhr_object.responseText; + } + else + status.innerHTML = "Error code " + xhr_object.status; + }; + } + active_process_id = document.querySelector('input[name="active_process_id"]').getAttribute('value') + xhr_object.open( "GET", + "portal_configurator/getCheckingStatusReport?active_process_id=" + active_process_id, + true); + //xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr_object.setRequestHeader("Content-Type", "text/html"); + xhr_object.setRequestHeader("Cache-Control", "no-cache" ) + xhr_object.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" ) + xhr_object.send(null); + } + + function init() { + checkClientInstallation(); + } + +""" + +return js_string diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.xml b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.xml new file mode 100644 index 0000000000..5f0516450d --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_generateCheckingJavaScript.xml @@ -0,0 +1,66 @@ + + + + + + + + + + Script_magic + 3 + + + _bind_names + + + + + + + + + + _asgns + + + + name_container + container + + + name_context + context + + + name_m_self + script + + + name_subpath + traverse_subpath + + + + + + + + + + + _params + + + + id + ConfiguratorTool_generateCheckingJavaScript + + + title + Generate JavaScript code which will query wizard to get installation status + + + + + diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.xml b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.xml new file mode 100644 index 0000000000..bb6c9c46b6 --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.xml @@ -0,0 +1,58 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + name_subpath + traverse_subpath + + + + + + + + + + + content_type + text/html + + + expand + 0 + + + id + ConfiguratorTool_viewCheckingResultRenderer + + + output_encoding + utf-8 + + + title + + + + + + diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.zpt b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.zpt new file mode 100644 index 0000000000..7ef6265934 --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingResultRenderer.zpt @@ -0,0 +1,13 @@ +
+ + + +
    + +
  1. +
    +
+
+
+
+
\ No newline at end of file diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.xml b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.xml new file mode 100644 index 0000000000..e75e42779a --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.xml @@ -0,0 +1,58 @@ + + + + + + + + + + _bind_names + + + + + + + + + + _asgns + + + + name_subpath + traverse_subpath + + + + + + + + + + + content_type + text/html + + + expand + 0 + + + id + ConfiguratorTool_viewCheckingStatus + + + output_encoding + utf-8 + + + title + Installation Status Report Renderer + + + + + diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.zpt b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.zpt new file mode 100644 index 0000000000..cbab092c3c --- /dev/null +++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.zpt @@ -0,0 +1,32 @@ + + + + + + + +