Commit 23ac1f96 authored by Jean-Paul Smets's avatar Jean-Paul Smets
Browse files

Initial upload to trunk

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33545 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8014d92f
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_wizard</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Wizard</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/GadgetTool_viewCreateGadgetDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>new_theme_wizard</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>New Web Theme Wizard</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebSite_viewCreateWebSiteThemeDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>new_theme_wizard</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>20.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>New Web Theme Wizard</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/WebSite_viewCreateWebSiteThemeDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>create_erp5_report</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create ERP5 Report</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewCreateERP5ReportDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_tool</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>5.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Manage Gadgets</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${portal_url}/portal_gadgets/view</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>new_web_view_wizard</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>6.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>New Web View Wizard</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewCreateWebViewActionDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: object is not None and getattr(object, \'isWebMode\', None) is not None and object.isWebMode()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Python Shell</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>python_shell</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Python Shell</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewPythonShellDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>global</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Provides instant access to SQL testing</string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sql_shell</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Manage portal</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>SQL Shell</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="Expression" module="Products.CMFCore.Expression"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewSQLShellDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# -*- coding: utf-8 -*-
"""
This simply sucks, hate doing it this way (Ivan)
"""
import sys
from ZODB.POSException import ConflictError
from Products.Formulator.MethodField import Method
from Products.PythonScripts.PythonScript import PythonScript
def getMethodObject(self, method_id):
return Method(method_id)
def editForm(self, form, update_dicts):
for key, value in update_dicts.items():
setattr(form, key, value)
def Base_runPythonCode(self, code):
"""
Run python code
"""
code_lines = code.split('\r\n')
python_wrapper_code = """class CodeWrapper:
def runMethod(code_wrapper_self, self):
context=self
if 1:
%s
"""%'\n '.join(code_lines)
exec(compile(python_wrapper_code,"-","exec"))
wrapper = CodeWrapper()
return wrapper.runMethod(self)
def Base_runPythonScript(self, code):
script = PythonScript('Python Shell Script').__of__(self)
code_line_list = code.split('\r\n')
code = '\n'.join(code_line_list)
script.write(code)
if script._code is None:
raise ValueError, repr(script.errors)
return script()
def getPythonCodeExecutionError(self):
result = None
try:
self.Base_executePython()
except ConflictError:
raise
except :
result = sys.exc_info()
return result[1]
import lxml
def updateCodeWithMainContent(self, html_code, div_class):
main_content = """
<div class="%s">
<tal:block metal:define-slot="main"/>
</div>
""" % (div_class)
document = lxml.html.fromstring(html_code)
element = document.find_class(div_class)[0]
element.getparent().replace(element, lxml.html.fromstring(main_content))
return lxml.html.tostring(document, pretty_print=True)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="Folder" module="OFS.Folder"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_development</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Create new report dialog\n
\n
GOOD:\n
- dialog provides format options\n
\n
TODO:\n
- where are the report actions ??? Do I have to do it manually... I hope not!\n
"""\n
\n
MARKER = [\'\', None]\n
\n
portal = context.getPortalObject()\n
portal_skins = portal.portal_skins\n
\n
if create_skin_id not in MARKER:\n
# create skin\n
skin_folder = context.Base_createSkinFolder(create_skin_id)\n
else:\n
skin_folder = getattr(portal_skins, selected_skin_id)\n
\n
erp5_report_form_id = erp5_report_form_id.replace(\' \', \'\')\n
form_action_portal_type = action_portal_type.replace(\' \', \'\')\n
form_id = \'%s_view%sReport\' %(form_action_portal_type, erp5_report_form_id)\n
\n
dialog_form_id = None\n
if create_configure_dialog:\n
# copy an existing form and just set method to new form\n
dialog_form_id = \'%sDialog\' %form_id\n
source_form_id = "Folder_generateWorkflowReportDialog"\n
cb_copy_data = context.portal_skins.erp5_core.manage_copyObjects([source_form_id])\n
skin_folder.manage_pasteObjects(cb_copy_data)\n
skin_folder.manage_renameObjects(ids=[source_form_id], new_ids=[dialog_form_id])\n
# set title, and actions\n
form_object = getattr(skin_folder, dialog_form_id)\n
context.editForm(form_object,{\'title\': erp5_report_form_title,\n
\'action\': form_id})\n
\n
if sql_expression not in MARKER:\n
# create ZSQL method\n
listbox_list_method_id = \'%s_zGet%sList\' %(form_action_portal_type, erp5_report_form_id)\n
skin_folder.manage_addProduct[\'ZSQLMethods\'].manage_addZSQLMethod(\n
listbox_list_method_id,\n
listbox_list_method_id, \n
\'erp5_sql_connection\', \n
\'\',\n
sql_expression)\n
zsql_method = getattr(skin_folder, listbox_list_method_id)\n
zsql_method.manage_advanced(max_rows=1000, \n
max_cache=100, \n
cache_time=0,\n
class_name=\'ZSQLBrain\', \n
class_file=\'ZSQLCatalog.zsqlbrain\', \n
direct=None,\n
REQUEST=None)\n
\n
if python_expression not in MARKER:\n
# create Python method\n
listbox_list_method_id = \'%s_get%sList\' %(form_action_portal_type, erp5_report_form_id) \n
skin_folder.manage_addProduct[\'PythonScripts\'].manage_addPythonScript(id=listbox_list_method_id)\n
script = getattr(skin_folder, listbox_list_method_id)\n
script.ZPythonScript_edit(\'**kw\', python_expression)\n
\n
# add report form\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(form_id)\n
form_object = getattr(skin_folder, form_id)\n
context.editForm(form_object,\n
{\'title\': erp5_report_form_title,\n
\'pt\': \'form_list\',})\n
\n
# create real ERP5 Form and configure it ..\n
listbox_id = \'listbox\'\n
form_object.manage_addProduct[\'Formulator\'].manage_addField(\n
id=listbox_id, \n
fieldname=\'ListBox\', \n
title=\'Listbox\')\n
# listbox is in bottom group\n
form_object.move_field_group(listbox_id, \'left\', \'bottom\')\n
listbox = getattr(form_object, listbox_id)\n
listbox.manage_edit_xmlrpc({\'selection_name\': form_id,\n
\'columns\': [[x, x] for x in listbox_column_id_list],\n
\'list_method\': context.getMethodObject(listbox_list_method_id)\n
})\n
\n
if dialog_form_id is not None:\n
form_id = dialog_form_id\n
if portal_type_action:\n
# create action\n
portal.portal_types[action_portal_type].newContent(\n
portal_type=\'Action Information\',\n
reference=form_id,\n
title=erp5_report_form_title,\n
action=\'string:${object_url}/%s\' %form_id,\n
action_permission=\'View\',\n
action_type=\'object_report\',\n
visible=1,\n
priority=1.0)\n
\n
context.REQUEST.RESPONSE.redirect(\'%s/portal_skins/%s/manage_main\' \\\n
%(context.getPortalObject().absolute_url(),\n
selected_skin_id))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>create_skin_id=None, selected_skin_id=None, erp5_report_form_title, erp5_report_form_id, listbox_column_id_list=[], python_expression=None, sql_expression=None, action_portal_type=None,portal_type_action=False, create_configure_dialog=True, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>10</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>create_skin_id</string>
<string>selected_skin_id</string>
<string>erp5_report_form_title</string>
<string>erp5_report_form_id</string>
<string>listbox_column_id_list</string>
<string>python_expression</string>
<string>sql_expression</string>
<string>action_portal_type</string>
<string>portal_type_action</string>
<string>create_configure_dialog</string>
<string>kw</string>
<string>None</string>
<string>MARKER</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>portal_skins</string>
<string>skin_folder</string>
<string>getattr</string>
<string>form_action_portal_type</string>
<string>form_id</string>
<string>dialog_form_id</string>
<string>source_form_id</string>
<string>cb_copy_data</string>
<string>form_object</string>
<string>listbox_list_method_id</string>
<string>_getitem_</string>
<string>zsql_method</string>
<string>script</string>
<string>listbox_id</string>
<string>listbox</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
<list/>
<none/>
<none/>
<none/>
<int>0</int>
<int>1</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewERP5Report</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Create new report dialog\n
"""\n
\n
MARKER = [\'\', None]\n
portal_gadgets = context.getPortalObject().portal_gadgets\n
portal_skins = context.getPortalObject().portal_skins\n
\n
if create_skin_id not in MARKER:\n
# create skin\n
skin_folder = context.Base_createSkinFolder(create_skin_id)\n
else:\n
skin_folder = getattr(portal_skins, selected_skin_id)\n
\n
# create\n
if view_form_id in MARKER:\n
view_form_id = \'ERP5Site_view%sGadget\' % gadget_title.replace(\' \', \'\')\n
if edit_form_id in MARKER:\n
edit_form_id = \'ERP5Site_view%sGadgetPreferences\' % gadget_title.replace(\' \', \'\')\n
\n
kw = {\'id\': gadget_id,\n
\'title\': gadget_title,\n
\'portal_type\': \'Gadget\',\n
\'view_form_id\': view_form_id,\n
\'edit_form_id\': edit_form_id,\n
\'render_type\': render_type,\n
\'gadget_type\': [\'erp5_front\',\'web_front\', \'web_section\']}\n
\n
gadget = portal_gadgets.newContent(**kw)\n
gadget.visible()\n
\n
# XXX: set image (not appears?)\n
erp5_logo = context.logoERP5\n
image = gadget.newContent(portal_type=\'Image\', id=\'default_image\')\n
image.setData(str(erp5_logo))\n
\n
# create code\n
if gadget_code_type==\'erp5\':\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(view_form_id)\n
view_form = getattr(skin_folder, view_form_id)\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(edit_form_id)\n
edit_form = getattr(skin_folder, edit_form_id)\n
context.editForm(view_form, {\'pt\': \'gadget_view\'})\n
context.editForm(edit_form, {\'pt\': \'gadget_view\'})\n
elif gadget_code_type==\'zpt\':\n
skin_folder.manage_addProduct[\'PageTemplates\'].manage_addPageTemplate(view_form_id, gadget_title)\n
skin_folder.manage_addProduct[\'PageTemplates\'].manage_addPageTemplate(edit_form_id, gadget_title)\n
elif gadget_code_type==\'python\':\n
skin_folder.manage_addProduct[\'PythonScripts\'].manage_addPythonScript(id=view_form_id)\n
script = getattr(skin_folder, view_form_id)\n
script.ZPythonScript_edit(\'**kw\', \'return "Replace this script (%s) with your code."\' % view_form_id)\n
skin_folder.manage_addProduct[\'PythonScripts\'].manage_addPythonScript(id=edit_form_id)\n
script = getattr(skin_folder, edit_form_id)\n
script.ZPythonScript_edit(\'**kw\', \'return "Replace this script (%s) with your code."\' % edit_form_id)\n
\n
return gadget.Base_redirect(\'view\', \n
keep_items=dict(portal_status_message="Gadget successfuly created"))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>create_skin_id=None, selected_skin_id=None, gadget_title, gadget_id, view_form_id, edit_form_id, gadget_code_type,render_type, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>8</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>create_skin_id</string>
<string>selected_skin_id</string>
<string>gadget_title</string>
<string>gadget_id</string>
<string>view_form_id</string>
<string>edit_form_id</string>
<string>gadget_code_type</string>
<string>render_type</string>
<string>kw</string>
<string>None</string>
<string>MARKER</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_gadgets</string>
<string>portal_skins</string>
<string>skin_folder</string>
<string>getattr</string>
<string>_apply_</string>
<string>gadget</string>
<string>erp5_logo</string>
<string>image</string>
<string>str</string>
<string>_getitem_</string>
<string>view_form</string>
<string>edit_form</string>
<string>script</string>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewGadget</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
skin_folder = getattr(context.portal_skins, skin_folder_id)\n
\n
# Maybe this is a bit ugly, and lxml should be used\n
template = context.portal_skins.erp5_development.template_theme_web_main\n
template_source = template.document_src()\n
template_body_top, template_body_bottom = template_source.split("<!-- SPLIT -->")\n
new_code_0 = html_text.replace("<body>", template_body_top)\n
new_code_1 = new_code_0.replace("</body>", template_body_bottom)\n
new_code_2 = new_code_1.replace("\'__REPLACE_CSS__\'", css_tales)\n
new_code_3 = new_code_2.replace("\'__REPLACE_JS__\'", js_tales)\n
final_code = context.ERP5Site_updateCodeWithMainContent(new_code_3, main_div_class_name)\n
\n
skin_folder.manage_addProduct[\'PageTemplates\'].manage_addPageTemplate(main_template_id, "Default Template")\n
getattr(skin_folder, main_template_id).write(final_code)\n
\n
return "OK"\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>html_text, main_template_id, skin_folder_id, css_tales, js_tales, main_div_class_name</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>html_text</string>
<string>main_template_id</string>
<string>skin_folder_id</string>
<string>css_tales</string>
<string>js_tales</string>
<string>main_div_class_name</string>
<string>getattr</string>
<string>_getattr_</string>
<string>context</string>
<string>skin_folder</string>
<string>template</string>
<string>template_source</string>
<string>_getiter_</string>
<string>template_body_top</string>
<string>template_body_bottom</string>
<string>new_code_0</string>
<string>new_code_1</string>
<string>new_code_2</string>
<string>new_code_3</string>
<string>final_code</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewWebSiteMainTemplateTheme</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
Create new report theme web.\n
"""\n
portal_skins = context.getPortalObject().portal_skins\n
erp5_development = portal_skins.erp5_development\n
\n
MARKER = [\'\', None]\n
page_template_header = """<tal:block define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \'text/__REPLACE__;; charset=utf-8\')"/>\n
"""\n
theme_id = web_site_theme_id.lower().replace(" ", "_")\n
main_template_id = "template_erp5_web_%s" % theme_id\n
\n
# XXX Should support Web Section too?\n
web_site = context.getWebSiteValue()\n
\n
skin_folder = context.Base_createSkinFolder("%s_theme" % theme_id)\n
\n
# Create Default Folder structure\n
skin_folder.manage_addProduct[\'OFSP\'].manage_addFolder(\'%s_css\' % (theme_id))\n
css_folder = getattr(skin_folder, \'%s_css\' % (theme_id))\n
\n
skin_folder.manage_addProduct[\'OFSP\'].manage_addFolder(\'%s_image\' % (theme_id))\n
image_folder = getattr(skin_folder, \'%s_image\' % (theme_id))\n
\n
skin_folder.manage_addProduct[\'OFSP\'].manage_addFolder(\'%s_js\' % (theme_id))\n
js_folder = getattr(skin_folder, \'%s_js\' % (theme_id))\n
\n
css_id = "%s_web.css" % theme_id\n
css_folder.manage_addProduct[\'PageTemplates\'].manage_addPageTemplate(css_id, "Default CSS" )\n
css_body = page_template_header.replace(\'__REPLACE__\', \'css\')\n
css_body += css_text\n
getattr(css_folder, css_id).write(css_body)\n
\n
js_id = "%s_web.js" % theme_id\n
js_folder.manage_addProduct[\'PageTemplates\'].manage_addPageTemplate(js_id, "Default js")\n
js_body = page_template_header.replace(\'__REPLACE__\', \'javascript\')\n
js_body += js_text\n
getattr(js_folder, js_id).write(js_body)\n
\n
css_tales = "\'%%s/%s_css/%s\' %% portal_path," % (theme_id, css_id)\n
js_tales = "\'%%s/%s_js/%s\' %% portal_path," % (theme_id, js_id)\n
\n
context.Base_createNewWebSiteMainTemplateTheme(html_text, main_template_id, \n
skin_folder.getId(), \n
css_tales, js_tales,\n
main_div_class_name)\n
\n
# Create Configuration Form\n
configuration_form_id = "WebSection_view%sThemeConfiguration" % web_site_theme_title.replace(" ", "")\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(configuration_form_id)\n
configuration_form = getattr(skin_folder, configuration_form_id)\n
context.editForm(configuration_form, {\'pt\': \'form_view\'})\n
context.editForm(configuration_form, {\'action\': \'Base_edit\'})\n
context.editForm(configuration_form, {\'title\': "Web Site Configuration"})\n
\n
# Add Default Field? This can be a form entry.\n
configuration_form.manage_addField(\'my_layout_background\', \'Background\', \'ProxyField\')\n
field = getattr(configuration_form, \'my_layout_background\')\n
field.manage_edit_xmlrpc(dict(form_id=\'Base_viewFieldLibrary\', field_id=\'my_string_field\'))\n
\n
# Create content layout\n
content_layout_form_id = "%s_content_layout" % theme_id\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(content_layout_form_id)\n
layout_form = getattr(skin_folder, content_layout_form_id)\n
context.editForm(layout_form, {\'pt\': main_template_id})\n
\n
# Create default web layout\n
layout_form_id = "%s_layout" % theme_id\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(layout_form_id)\n
layout_form = getattr(skin_folder,layout_form_id)\n
context.editForm(layout_form, {\'pt\': main_template_id})\n
\n
if apply_web_site_theme:\n
web_site.edit(content_layout=content_layout_form_id, \n
container_layout=layout_form_id,\n
layout_configuration_form_id=configuration_form_id)\n
\n
portal_status_message = "New Theme successfuly created, See: %s/manage_main" % (skin_folder.absolute_url())\n
return web_site.Base_redirect("view", \n
keep_items=dict(portal_status_message=portal_status_message))\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>web_site_theme_id, web_site_theme_title, css_text, js_text, html_text, main_div_class_name, apply_web_site_theme=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>7</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>web_site_theme_id</string>
<string>web_site_theme_title</string>
<string>css_text</string>
<string>js_text</string>
<string>html_text</string>
<string>main_div_class_name</string>
<string>apply_web_site_theme</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_skins</string>
<string>erp5_development</string>
<string>None</string>
<string>MARKER</string>
<string>page_template_header</string>
<string>theme_id</string>
<string>main_template_id</string>
<string>web_site</string>
<string>skin_folder</string>
<string>_getitem_</string>
<string>getattr</string>
<string>css_folder</string>
<string>image_folder</string>
<string>js_folder</string>
<string>css_id</string>
<string>css_body</string>
<string>_inplacevar_</string>
<string>js_id</string>
<string>js_body</string>
<string>css_tales</string>
<string>js_tales</string>
<string>configuration_form_id</string>
<string>configuration_form</string>
<string>field</string>
<string>dict</string>
<string>content_layout_form_id</string>
<string>layout_form</string>
<string>layout_form_id</string>
<string>portal_status_message</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewWebSiteTheme</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Create new report dialog\n
"""\n
\n
MARKER = [\'\', None]\n
portal_skins = context.getPortalObject().portal_skins\n
\n
if priority in MARKER:\n
priority = 100.0\n
\n
if create_skin_id not in MARKER:\n
# create skin\n
skin_folder = context.Base_createSkinFolder(create_skin_id)\n
else:\n
skin_folder = getattr(portal_skins, selected_skin_id)\n
\n
portal_type = context.getPortalType()\n
\n
# create\n
if web_form_id in MARKER:\n
web_form_id = \'%s_view%sAsWeb\' % (portal_type.replace(\' \', \'\'), \n
web_view_title.replace(" ", ""))\n
\n
skin_folder.manage_addProduct[\'ERP5Form\'].addERP5Form(web_form_id)\n
web_form = getattr(skin_folder, web_form_id)\n
context.editForm(web_form, {\'action\': \'Base_edit\'})\n
context.editForm(web_form, {\'pt\': \'form_view\'})\n
\n
web_form.manage_addField(\'my_title\', \'Title\', \'ProxyField\')\n
field = getattr(web_form, \'my_title\')\n
field.manage_edit_xmlrpc(dict(\n
form_id=\'Base_viewFieldLibrary\', field_id=\'my_title\'))\n
\n
portal_type_document = context.portal_types[portal_type]\n
action = portal_type_document.newContent(portal_type="Action Information")\n
action.edit(reference="%s_view_as_web" % (web_view_title.lower().replace(" ", "_")),\n
title=web_view_title,\n
action="string:${object_url}/%s" % web_form_id,\n
action_type="object_view",\n
priority=priority,\n
action_permission="View")\n
\n
return context.Base_redirect(web_form_id, \n
keep_items=dict(portal_status_message="Web View Successfuly created"))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>web_view_title, web_form_id=None, priority=None, create_skin_id=None, selected_skin_id=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>web_view_title</string>
<string>web_form_id</string>
<string>priority</string>
<string>create_skin_id</string>
<string>selected_skin_id</string>
<string>kw</string>
<string>None</string>
<string>MARKER</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_skins</string>
<string>skin_folder</string>
<string>getattr</string>
<string>portal_type</string>
<string>_getitem_</string>
<string>web_form</string>
<string>field</string>
<string>dict</string>
<string>portal_type_document</string>
<string>action</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createNewWebView</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal_skins = context.getPortalObject().portal_skins\n
skin_folder = portal_skins.manage_addProduct[\'OFSP\'].manage_addFolder(skin_folder_id)\n
\n
# Add the new skin folder at the top of portal_skins.\n
for skin_name, selection in portal_skins.getSkinPaths():\n
new_selection = (\'%s,\' % skin_folder_id + selection).replace(",,",",")\n
portal_skins.manage_skinLayers(skinpath = (new_selection,) , \n
skinname = skin_name, \n
add_skin = 1)\n
\n
return getattr(portal_skins, skin_folder_id)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>skin_folder_id</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>skin_folder_id</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_skins</string>
<string>_getitem_</string>
<string>skin_folder</string>
<string>_getiter_</string>
<string>skin_name</string>
<string>selection</string>
<string>new_selection</string>
<string>getattr</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_createSkinFolder</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>selection_id = \'python_shell_selection\'\n
portal = context.getPortalObject()\n
portal_selections = portal.portal_selections\n
\n
if python_expression is None:\n
python_expression = context.REQUEST.get(\'python_expression\')\n
if python_expression is None:\n
# take from hard coded selection as when browsing listboxes\n
# sql_expression is simply not available\n
selection_object = portal_selections.getSelectionParamsFor(selection_id)\n
if selection_object:\n
python_expression = selection_object.get(\'python_expression\')\n
\n
# update selection\n
portal_selections.setSelectionParamsFor(selection_id, \\\n
dict(python_expression=python_expression))\n
\n
# pass all to code runner\n
return context.Base_runPythonCode(python_expression)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>python_expression=None,**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>python_expression</string>
<string>kw</string>
<string>selection_id</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>portal_selections</string>
<string>None</string>
<string>selection_object</string>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_executePython</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>selection_id = \'sql_shell_selection\'\n
portal = context.getPortalObject()\n
portal_selections = portal.portal_selections\n
\n
if sql_expression is None:\n
sql_expression = context.REQUEST.get(\'sql_expression\')\n
if sql_expression is None:\n
# take from hard coded selection as when browsing listboxes\n
# sql_expression is simply not available\n
selection_object = portal_selections.getSelectionParamsFor(selection_id)\n
if selection_object:\n
sql_expression = selection_object.get(\'sql_expression\')\n
\n
# If not expression return empty list\n
if not sql_expression: return ()\n
\n
# using semicolumn can kill zope\n
sql_expression = sql_expression.replace(\';\', \' \')\n
\n
# update selection\n
portal_selections.setSelectionParamsFor(selection_id, \\\n
dict(sql_expression=sql_expression))\n
\n
# pass all to code runner\n
return context.Base_zExecuteSQL(sql_expression=sql_expression)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>sql_expression=None,**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>sql_expression</string>
<string>kw</string>
<string>selection_id</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>portal_selections</string>
<string>None</string>
<string>selection_object</string>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_executeSQL</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Return by default previous user input\n
\n
python_expression = context.REQUEST.get(\'python_expression\', None)\n
if python_expression: \n
return python_expression\n
\n
# Else return this string, which could be made more dynamic in the future\n
# to take into account the context\n
\n
\n
return """kw={\'portal_type\': \'Person\'}\n
return context.portal_catalog(**kw)"""\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
<string>python_expression</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getDefaultPythonShellExpression</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# Return by default previous user input\n
\n
sql_expression = context.REQUEST.get(\'sql_expression\', None)\n
if sql_expression: return sql_expression\n
\n
# Else return this string, which could be made more dynamic in the future\n
# to take into account the context\n
\n
\n
return """\n
SELECT\n
catalog.uid,\n
catalog.path,\n
<ADD YOUR COLUMNS>\n
FROM\n
catalog,\n
<DEFINE ANOTHER TABLE>,\n
<DEFINE YET ANOTHER TABLE>\n
WHERE\n
catalog.uid = <OTHER TABLE>.uid\n
AND\n
<DEFINE MORE EXPRESSION>\n
ORDER BY\n
catalog.id ASC\n
GROUP BY\n
<DEFINE GROUPS>\n
"""\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>None</string>
<string>sql_expression</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getDefaultSQLShellExpression</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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