Commit 5c7c0e79 authored by Ivan Tyagov's avatar Ivan Tyagov

Speces cleanup.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23642 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7d1c64fd
...@@ -119,7 +119,7 @@ class GeneratorCall(UserDict): ...@@ -119,7 +119,7 @@ class GeneratorCall(UserDict):
binary_decoder = xmlrpclib.Binary() binary_decoder = xmlrpclib.Binary()
binary_decoder.decode(data) binary_decoder.decode(data)
return binary_decoder.data return binary_decoder.data
def _encodeData(self, data): def _encodeData(self, data):
""" Encode data to transmitable text. """ """ Encode data to transmitable text. """
fp = StringIO() fp = StringIO()
...@@ -140,7 +140,7 @@ def _generateErrorXML(error_message): ...@@ -140,7 +140,7 @@ def _generateErrorXML(error_message):
""" Generate HTML for displaying an error. """ """ Generate HTML for displaying an error. """
log_message = traceback.format_exc() log_message = traceback.format_exc()
return '<table><tr><td class="error">%s</td></tr></table>' % error_message return '<table><tr><td class="error">%s</td></tr></table>' % error_message
## server to local preferences id translation table ## server to local preferences id translation table
_server_to_preference_ids_map = {'client_id': 'preferred_express_client_uid', _server_to_preference_ids_map = {'client_id': 'preferred_express_client_uid',
'current_bc_index': 'preferred_express_erp5_uid', 'current_bc_index': 'preferred_express_erp5_uid',
...@@ -150,7 +150,7 @@ _server_to_preference_ids_map = {'client_id': 'preferred_express_client_uid', ...@@ -150,7 +150,7 @@ _server_to_preference_ids_map = {'client_id': 'preferred_express_client_uid',
class WizardTool(BaseTool): class WizardTool(BaseTool):
""" WizardTool is able to generate custom business templates. """ """ WizardTool is able to generate custom business templates. """
id = 'portal_wizard' id = 'portal_wizard'
meta_type = 'ERP5 Wizard Tool' meta_type = 'ERP5 Wizard Tool'
portal_type = 'Wizard Tool' portal_type = 'Wizard Tool'
...@@ -160,7 +160,7 @@ class WizardTool(BaseTool): ...@@ -160,7 +160,7 @@ class WizardTool(BaseTool):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareProtected(Permissions.ManagePortal, 'manage_overview') security.declareProtected(Permissions.ManagePortal, 'manage_overview')
manage_overview = DTMLFile('explainWizardTool', _dtmldir ) manage_overview = DTMLFile('explainWizardTool', _dtmldir )
# Stop traversing a concatenated path after the proxy method. # Stop traversing a concatenated path after the proxy method.
def __before_publishing_traverse__(self, self2, request): def __before_publishing_traverse__(self, self2, request):
path = request['TraversalRequestNameStack'] path = request['TraversalRequestNameStack']
...@@ -255,7 +255,7 @@ class WizardTool(BaseTool): ...@@ -255,7 +255,7 @@ class WizardTool(BaseTool):
data = None data = None
content_type = self.REQUEST.get_header('content-type') content_type = self.REQUEST.get_header('content-type')
# XXX if ":method" trick is used, then remove it from subpath. # XXX if ":method" trick is used, then remove it from subpath.
if self.REQUEST.traverse_subpath: if self.REQUEST.traverse_subpath:
if data is not None: if data is not None:
...@@ -411,7 +411,7 @@ class WizardTool(BaseTool): ...@@ -411,7 +411,7 @@ class WizardTool(BaseTool):
## save persistently (as preference) ## save persistently (as preference)
self.setExpressConfigurationPreference(_server_to_preference_ids_map[item], self.setExpressConfigurationPreference(_server_to_preference_ids_map[item],
value) value)
def _updateParameterDictWithServerInfo(self, parameter_dict): def _updateParameterDictWithServerInfo(self, parameter_dict):
"""Updates parameter_dict to include local saved server info settings. """ """Updates parameter_dict to include local saved server info settings. """
global _server_to_preference_ids_map global _server_to_preference_ids_map
...@@ -429,7 +429,7 @@ class WizardTool(BaseTool): ...@@ -429,7 +429,7 @@ class WizardTool(BaseTool):
if __ac_express is not None: if __ac_express is not None:
__ac_express = decodestring(unquote(__ac_express)) __ac_express = decodestring(unquote(__ac_express))
parameter_dict['password'] = __ac_express parameter_dict['password'] = __ac_express
def _updateParameterDictWithFileUpload(self, parameter_dict): def _updateParameterDictWithFileUpload(self, parameter_dict):
"""Updates parameter_dict to replace file upload with their file content, """Updates parameter_dict to replace file upload with their file content,
encoded as XML-RPC Binary encoded as XML-RPC Binary
...@@ -456,7 +456,7 @@ class WizardTool(BaseTool): ...@@ -456,7 +456,7 @@ class WizardTool(BaseTool):
#install bt5 #install bt5
portal_workflow = getToolByName(self.getPortalObject(), 'portal_workflow') portal_workflow = getToolByName(self.getPortalObject(), 'portal_workflow')
business_template.install() business_template.install()
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'installBT5FilesFromServer') 'installBT5FilesFromServer')
def installBT5FilesFromServer(self, def installBT5FilesFromServer(self,
...@@ -504,7 +504,7 @@ class WizardTool(BaseTool): ...@@ -504,7 +504,7 @@ class WizardTool(BaseTool):
## we already have stored after setup script id ## we already have stored after setup script id
bt5_after_setup_script_id = self.getExpressConfigurationPreference( bt5_after_setup_script_id = self.getExpressConfigurationPreference(
'preferred_express_after_setup_script_id', None) 'preferred_express_after_setup_script_id', None)
if execute_after_setup_script and bt5_after_setup_script_id is not None: if execute_after_setup_script and bt5_after_setup_script_id is not None:
## Execute script provided (if) in customer specific business template. ## Execute script provided (if) in customer specific business template.
bt5_customer_template_id = server_response["server_buffer"]['filenames'][-1] bt5_customer_template_id = server_response["server_buffer"]['filenames'][-1]
...@@ -525,11 +525,11 @@ class WizardTool(BaseTool): ...@@ -525,11 +525,11 @@ class WizardTool(BaseTool):
"Completed installation for %s" %' '.join(bt5_filenames)) "Completed installation for %s" %' '.join(bt5_filenames))
if use_super_manager: if use_super_manager:
noSecurityManager() noSecurityManager()
###################################################### ######################################################
## Navigation ## ## Navigation ##
###################################################### ######################################################
#security.declareProtected(Permissions.ModifyPortalContent, 'login') #security.declareProtected(Permissions.ModifyPortalContent, 'login')
def login(self, REQUEST): def login(self, REQUEST):
""" Login client and show next form. """ """ Login client and show next form. """
...@@ -569,7 +569,7 @@ class WizardTool(BaseTool): ...@@ -569,7 +569,7 @@ class WizardTool(BaseTool):
'portal_wizard/%s?field_my_ac_name=%s&portal_status_message=%s' \ 'portal_wizard/%s?field_my_ac_name=%s&portal_status_message=%s' \
%(came_from_method, user_id, response['server_buffer']['message'])) %(came_from_method, user_id, response['server_buffer']['message']))
return return
#security.declareProtected(Permissions.ModifyPortalContent, 'next') #security.declareProtected(Permissions.ModifyPortalContent, 'next')
def next(self, REQUEST): def next(self, REQUEST):
""" Validate settings and return a new form to the user. """ """ Validate settings and return a new form to the user. """
...@@ -591,7 +591,7 @@ class WizardTool(BaseTool): ...@@ -591,7 +591,7 @@ class WizardTool(BaseTool):
return self.view(REQUEST=REQUEST) return self.view(REQUEST=REQUEST)
elif command == "install": elif command == "install":
return self.startInstallation(REQUEST=REQUEST) return self.startInstallation(REQUEST=REQUEST)
#security.declareProtected(Permissions.ModifyPortalContent, 'previous') #security.declareProtected(Permissions.ModifyPortalContent, 'previous')
def previous(self, REQUEST): def previous(self, REQUEST):
""" Display the previous form. """ """ Display the previous form. """
...@@ -605,7 +605,7 @@ class WizardTool(BaseTool): ...@@ -605,7 +605,7 @@ class WizardTool(BaseTool):
elif command == "login": elif command == "login":
REQUEST.set('portal_status_message', html) REQUEST.set('portal_status_message', html)
return self.view(REQUEST=REQUEST) return self.view(REQUEST=REQUEST)
security.declarePublic(Permissions.AccessContentsInformation, security.declarePublic(Permissions.AccessContentsInformation,
'getInstallationStatusReportFromClient') 'getInstallationStatusReportFromClient')
def getInstallationStatusReportFromClient(self, def getInstallationStatusReportFromClient(self,
...@@ -621,14 +621,14 @@ class WizardTool(BaseTool): ...@@ -621,14 +621,14 @@ class WizardTool(BaseTool):
else: else:
html = self.WizardTool_viewRunningInstallationMessageRenderer() html = self.WizardTool_viewRunningInstallationMessageRenderer()
return html return html
security.declarePublic(Permissions.AccessContentsInformation, 'getInstallationStatusReportFromServer') security.declarePublic(Permissions.AccessContentsInformation, 'getInstallationStatusReportFromServer')
def getInstallationStatusReportFromServer(self, active_process_id=None, REQUEST=None): def getInstallationStatusReportFromServer(self, active_process_id=None, REQUEST=None):
""" Query remote server (usually only once for some installation status report """ """ Query remote server (usually only once for some installation status report """
response = self._callRemoteMethod("getInstallationStatusReport") response = self._callRemoteMethod("getInstallationStatusReport")
html = response["data"] html = response["data"]
return html return html
security.declareProtected(Permissions.ModifyPortalContent, 'startInstallation') security.declareProtected(Permissions.ModifyPortalContent, 'startInstallation')
def startInstallation(self, REQUEST): def startInstallation(self, REQUEST):
""" Start installation process as an activity which will query generation server and """ Start installation process as an activity which will query generation server and
...@@ -696,13 +696,13 @@ class WizardTool(BaseTool): ...@@ -696,13 +696,13 @@ class WizardTool(BaseTool):
security.declareProtected(Permissions.View, 'getServerRoot') security.declareProtected(Permissions.View, 'getServerRoot')
def getServerRoot(self): def getServerRoot(self):
return self.getExpressConfigurationPreference('preferred_witch_tool_server_root', '') return self.getExpressConfigurationPreference('preferred_witch_tool_server_root', '')
security.declareProtected(Permissions.View, 'getExpressConfigurationPreference') security.declareProtected(Permissions.View, 'getExpressConfigurationPreference')
def getExpressConfigurationPreference(self, preference_id, default = None): def getExpressConfigurationPreference(self, preference_id, default = None):
""" Get Express configuration preference """ """ Get Express configuration preference """
portal_preferences = getToolByName(self, 'portal_preferences') portal_preferences = getToolByName(self, 'portal_preferences')
return portal_preferences.getPreference(preference_id, default) return portal_preferences.getPreference(preference_id, default)
security.declareProtected(Permissions.ModifyPortalContent, 'setExpressConfigurationPreference') security.declareProtected(Permissions.ModifyPortalContent, 'setExpressConfigurationPreference')
def setExpressConfigurationPreference(self, preference_id, value): def setExpressConfigurationPreference(self, preference_id, value):
""" Set Express configuration preference """ """ Set Express configuration preference """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment