\ 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 0000000000000000000000000000000000000000..e75e42779a0f028a25119646a5432c70b822812e
--- /dev/null
+++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+ _bind_names
+
+
+
+
+
+ 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 0000000000000000000000000000000000000000..cbab092c3c913f38aff698c0e40a75d0645b5fe1
--- /dev/null
+++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/ConfiguratorTool_viewCheckingStatus.zpt
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+ Loading ...
+
+
+
\ No newline at end of file
diff --git a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard_dialog.zpt b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard_dialog.zpt
index eddda1152311e4aacbf70913b8fb2105398f5c1b..ac37568ecd8b15609068f6662e1f97f9d66a3bd0 100644
--- a/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard_dialog.zpt
+++ b/bt5/erp5_configurator/SkinTemplateItem/portal_skins/erp5_configurator_wizard/wizard_dialog.zpt
@@ -45,6 +45,13 @@
+
+
+
+
+#
+# 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 []
+
diff --git a/product/ERP5Configurator/Tool/ConfiguratorTool.py b/product/ERP5Configurator/Tool/ConfiguratorTool.py
index e0e051c629e74927c49c22c472d4704dbd6f97f8..188d51d115e4b30ceeb3fa8c8d157b6ca7e55442 100644
--- a/product/ERP5Configurator/Tool/ConfiguratorTool.py
+++ b/product/ERP5Configurator/Tool/ConfiguratorTool.py
@@ -38,6 +38,7 @@ from Products.ERP5Configurator import _dtmldir
from Products.Formulator.Errors import FormValidationError
from DateTime import DateTime
+
referer = None
installation_status = {'bt5': {'current': 0,
'all': 0, },
@@ -137,6 +138,21 @@ class ConfiguratorTool(BaseTool):
next=response['next'])
elif response["command"] == "install":
return self.startInstallation(bc, REQUEST=REQUEST)
+ elif response["command"] == "check existing site":
+ global installation_status
+ # init installation status
+ installation_status['bt5']['all'] = 1
+ installation_status['bt5']['current'] = 0
+ installation_status['activity_list'] = []
+ active_process = self.portal_activities.newActiveProcess()
+ bc.activate(tag='initialERP5Setup'
+ ).checkExistingSite(active_process.getRelativeUrl())
+ return self.ConfiguratorTool_dialogForm(previous=response['previous'],
+ form_html=response["data"],
+ next=response['next'],
+ active_process_id = active_process.getId())
+ elif response["command"] == "fix existing site":
+ return self.startInstallation(bc, REQUEST=REQUEST)
def _next(self, business_configuration, kw):
""" Return next configuration form and validate previous. """
@@ -144,7 +160,6 @@ class ConfiguratorTool(BaseTool):
need_validation = 1
validation_errors = None
response = {}
-
business_configuration.initializeWorkflow()
## initial state no previous form to validate
@@ -154,7 +169,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
@@ -248,7 +266,7 @@ class ConfiguratorTool(BaseTool):
if business_configuration.getNextTransition() == None:
### client can not continue at the momen
return self._terminateConfigurationProcess(response)
- response["previous"], html, form_title, response["next"] \
+ response["previous"], html, form_title, response["next"], command \
= business_configuration._displayNextForm()
else:
## validation passed
@@ -259,13 +277,15 @@ class ConfiguratorTool(BaseTool):
return self._terminateConfigurationProcess(response)
## validation failure
rendered = True
- response["previous"], html, form_title, response["next"] =\
+ response["previous"], html, form_title, response["next"], command =\
business_configuration._displayNextForm(
validation_errors=validation_errors)
- if html is None:
+ if command == "download":
## we have no more forms proceed to build
response.update(command="install", data=None)
+ elif command == 'fix existing site':
+ response.update(command="fix existing site", data=None)
else:
## we have more forms
next_state = self.restrictedTraverse(business_configuration.getNextTransition()\
@@ -274,7 +294,7 @@ class ConfiguratorTool(BaseTool):
form_html = html,
current_state = next_state,
business_configuration = business_configuration)
- response.update(command = "show", data = html_data)
+ response.update(command = command, data = html_data)
return response
def _terminateConfigurationProcess(self, response):
@@ -309,7 +329,7 @@ class ConfiguratorTool(BaseTool):
return self.ConfiguratorTool_dialogForm(form_html = form_html,
next = "Next")
- response['previous'], form_html, form_title, response['next'] = \
+ response['previous'], form_html, form_title, response['next'], command = \
business_configuration._displayPreviousForm()
next_state = self.restrictedTraverse(
@@ -344,6 +364,27 @@ class ConfiguratorTool(BaseTool):
'text/html; charset=utf-8')
return html
+ security.declarePublic('getCheckingStatusReport')
+ def getCheckingStatusReport(self,
+ active_process_id=None, REQUEST=None):
+ """ Query local ERP5 instance for checking status.
+ """
+ global installation_status
+ portal_activities = self.getPortalObject().portal_activities
+
+ if 0 == len(portal_activities.getMessageList()):
+ html = self.ConfiguratorTool_viewCheckingResultRenderer(active_process_id=active_process_id)
+ else:
+ # only if bt5s are installed start tracking number of activities
+ activity_list = portal_activities.getMessageList()
+ installation_status['activity_list'].append(len(activity_list))
+ html = self.ConfiguratorTool_viewRunningInstallationMessage(
+ installation_status = installation_status)
+ # set encoding as this is usually called from asynchronous JavaScript call
+ self.REQUEST.RESPONSE.setHeader('Content-Type',
+ 'text/html; charset=utf-8')
+ return html
+
security.declareProtected(Permissions.ModifyPortalContent, 'startInstallation')
def startInstallation(self, business_configuration, REQUEST):
""" Start installation process as an activity which will
@@ -361,3 +402,4 @@ class ConfiguratorTool(BaseTool):
active_process=active_process, tag='initialERP5Setup'
).build()
return self.ConfiguratorTool_viewInstallationStatus(REQUEST)
+