1 | ## Script (Python) "qploneskindump_config_script" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind state=state |
---|
7 | ##bind subpath=traverse_subpath |
---|
8 | ##parameters= |
---|
9 | ##title= |
---|
10 | ## |
---|
11 | |
---|
12 | #from Products.CMFCore.utils import getToolByName |
---|
13 | from Products.qPloneSkinDump.qPloneSkinDump import createProduct |
---|
14 | |
---|
15 | REQUEST = context.REQUEST |
---|
16 | # ZMI data |
---|
17 | zmi_skin_name = REQUEST.get('ZMISkinName') |
---|
18 | zmi_base_skin_name = REQUEST.get('ZMIBaseSkinName') |
---|
19 | |
---|
20 | # File system data |
---|
21 | fs_skin_directory = REQUEST.get('FSSkinDirectory') |
---|
22 | fs_product_name = REQUEST.get('FSProductName') |
---|
23 | erase_from_skin = REQUEST.get('EraseFromSkin') |
---|
24 | |
---|
25 | # Slots customization data |
---|
26 | left_slots = right_slots = slot_forming = main_column = None |
---|
27 | doesCustomizeSlots = REQUEST.get('DoesCustomizeSlots') |
---|
28 | if doesCustomizeSlots: |
---|
29 | slot_forming = REQUEST.get('slot_forming') |
---|
30 | main_column = REQUEST.get('main_column') |
---|
31 | |
---|
32 | left_slots = REQUEST.get('left_slots') |
---|
33 | right_slots = REQUEST.get('right_slots') |
---|
34 | if left_slots: |
---|
35 | left_slots = [i for i in left_slots if i] |
---|
36 | if right_slots: |
---|
37 | right_slots = [i for i in right_slots if i] |
---|
38 | |
---|
39 | # Exporting objects |
---|
40 | import_policy = exporting_objects = None |
---|
41 | doesExportObjects = REQUEST.get('DoesExportObjects') |
---|
42 | if doesExportObjects: |
---|
43 | import_policy = REQUEST.get('import_policy') |
---|
44 | exporting_objects = REQUEST.get('exporting_objects') |
---|
45 | #return [doesExportObjects, import_policy, exporting_objects] |
---|
46 | |
---|
47 | # Exporting portal resources |
---|
48 | dump_CSS = dump_JS = None |
---|
49 | dump_CSS = REQUEST.get('DumpCSSRegistry') |
---|
50 | dump_JS = REQUEST.get('DumpJSRegistry') |
---|
51 | |
---|
52 | # create Product |
---|
53 | result = createProduct(context, zmi_skin_name=zmi_skin_name,\ |
---|
54 | zmi_base_skin_name=zmi_base_skin_name,\ |
---|
55 | fs_skin_directory=fs_skin_directory,\ |
---|
56 | fs_product_name=fs_product_name,\ |
---|
57 | erase_from_skin=erase_from_skin,\ |
---|
58 | doesCustomizeSlots=doesCustomizeSlots,\ |
---|
59 | left_slots=left_slots,\ |
---|
60 | right_slots=right_slots,\ |
---|
61 | slot_forming=slot_forming,\ |
---|
62 | main_column=main_column, |
---|
63 | doesExportObjects=doesExportObjects,\ |
---|
64 | import_policy=import_policy,\ |
---|
65 | exporting_objects=exporting_objects, \ |
---|
66 | dump_CSS=dump_CSS, \ |
---|
67 | dump_JS=dump_JS ) |
---|
68 | |
---|
69 | portal_status_message='"%s" Product successfully created.' % fs_product_name |
---|
70 | if result: |
---|
71 | portal_status_message = portal_status_message + "Failed exporting objects: %s." % str(fail) |
---|
72 | |
---|
73 | return state.set(portal_status_message=portal_status_message) |
---|