Changeset 929 in products


Ignore:
Timestamp:
Aug 2, 2007 3:46:53 PM (17 years ago)
Author:
koval
Message:

added generating main_template.pt based on qMultipleSlots plone site properties

Location:
qPloneSkinDump/branches/multipleslots
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • qPloneSkinDump/branches/multipleslots/qPloneSkinDump.py

    r894 r929  
    88 
    99security = ModuleSecurityInfo( 'Products.qPloneSkinDump.qPloneSkinDump' ) 
    10  
    11 security.declarePublic('getProductsPath') 
    12 def getProductsPath(): 
    13     return PRODUCTS_PATH 
    1410 
    1511security.declarePublic('getExportingData') 
     
    3935 
    4036security.declarePublic('isValidProductName') 
    41 def isValidProductName(product_name, fs_dest_directory): 
     37def isValidProductName(product_name): 
    4238    """ Check for product presence in installed products list""" 
    43     if not fs_dest_directory==PRODUCTS_PATH: 
    44        return (not product_name in os.listdir(fs_dest_directory)) \ 
    45               and isValidDirName(product_name) 
    46  
    47     return (not product_name in get_product_listdirs()) \ 
    48            and isValidDirName(product_name) 
    49  
    50 security.declarePublic('isValidDestinationDir') 
    51 def isValidDestinationDir(destination_dir): 
    52     """ Check for existance of destination directory.""" 
    53     return os.path.isdir(destination_dir) 
     39    return (product_name not in get_product_listdirs() \ 
     40            and isValidDirName(product_name)) 
    5441 
    5542DIR_NAME_PATTERN = re.compile("^[a-zA-Z]+[a-zA-Z0-9_]*[a-zA-Z0-9]$") 
     
    6249security.declarePublic('createProduct') 
    6350def createProduct(context, \ 
    64                   zmi_skin_names=['custom',], \ 
     51                  zmi_skin_name='custom', \ 
    6552                  zmi_base_skin_name='', \ 
    6653                  subdir=None,\ 
    67                   fs_dest_directory=PRODUCTS_PATH, \ 
    6854                  fs_skin_directory='custom',\ 
    6955                  fs_product_name='QSkinTemplate',\ 
     
    7864                  exporting_objects=[], \ 
    7965                  dump_CSS=True, \ 
    80                   dump_JS=True, \ 
    81                   dump_portlets=0, \ 
    82                   dump_policy='root', \ 
    83                   dump_portlets_selection=[], \ 
    84                   dump_custom_views=False): 
     66                  dump_JS=True ): 
    8567    """ Main Skin Product creating procedure.""" 
    86     makeNewProduct(context, fs_dest_directory, fs_product_name, fs_skin_directory, \ 
    87                    zmi_skin_names, zmi_base_skin_name, subdir, \ 
     68    makeNewProduct(context, fs_product_name, fs_skin_directory, \ 
     69                   zmi_skin_name, zmi_base_skin_name, subdir, \ 
    8870                   doesCustomizeSlots, left_slots, right_slots, slot_forming, main_column, \ 
    8971                   doesExportObjects, import_policy, \ 
    90                    dump_CSS, dump_JS, dump_portlets, dump_policy, dump_portlets_selection, dump_custom_views) 
    91     dumpSkin(context, zmi_skin_names, fs_dest_directory, fs_product_name, erase_from_skin) 
    92     result = exportObjects(context, doesExportObjects, exporting_objects, fs_dest_directory, fs_product_name) 
     72                   dump_CSS, dump_JS ) 
     73    dumpSkin(context, zmi_skin_name, subdir, fs_skin_directory.lower(), 
     74             fs_product_name, erase_from_skin) 
     75    result = exportObjects(context, doesExportObjects, exporting_objects, fs_product_name) 
    9376    return result 
    9477 
  • qPloneSkinDump/branches/multipleslots/skins/qploneskindump/qploneskindump_config.cpt

    r503 r929  
    99    <div metal:define-macro="main" 
    1010         tal:define="errors options/state/getErrors | nothing;"> 
    11  
    12         <div metal:use-macro="here/global_statusmessage/macros/portal_message"> 
    13             Portal status message 
     11        <h1 class="QSDFirstHeading"> 
     12            <img tal:replace="structure here/product_icon.gif" /> 
     13            <span tal:replace="here/title_or_id">Title or id</span> 
     14        </h1> 
     15 
     16        <div metal:use-macro="here/document_actions/macros/document_actions"> 
     17            Document actions (print, sendto etc) 
    1418        </div> 
    15  
    16         <h1 class="documentFirstHeading" 
    17             i18n:translate="heading_addremove_products">Skin Dump</h1> 
    1819 
    1920        <a href="" 
    2021           class="link-parent" 
    21            tal:attributes="href string: $portal_url/plone_control_panel" 
    22            i18n:translate="label_up_to_plone_setup"> 
    23             Up to Site Setup 
     22           i18n:translate="label_up_to_product_page" 
     23           tal:define="parent_url python:here.navigationParent(here, template.getId())" 
     24           tal:condition="parent_url" 
     25           tal:attributes="href parent_url"> 
     26            Up to Product page 
    2427        </a> 
    2528 
    26         <p class="documentDescription" 
    27             i18n:translate="description_addremove_products"> 
    28             This is a form for dumping your zmi skin to filesystem based product. 
    29         </p> 
    30  
    31         <p class="discreet" i18n:translate="description_product_location"> 
    32             Navigate through all form tabs to set needed configuration for dump. 
    33         </p> 
    34  
     29        <h2 i18n:translate="heading_portalactions_lists"> 
     30            qPloneSkinDump input FORM 
     31        </h2> 
    3532        <form name="edit_form" 
    3633              action="href" 
    3734              method="post" 
    38               class="enableFormTabbing" 
    3935              enctype="multipart/form-data" 
    4036              tal:attributes="action string:$here_url/$template_id"> 
    41  
    42             <fieldset id="fieldset-product" 
    43                       tal:define="error_fsSkinDir python:errors.get('FSSkinDirectory'); 
    44                                   error_fsProdName python:errors.get('FSProductName'); 
    45                                   error_fsDestinationDir python:errors.get('FSDestinationDirectory');"> 
    46                 <legend id="fieldsetlegend-product"> 
    47                   <label style="font-size: 110%" i18n:translate="label_product">Product</label> 
     37            <fieldset tal:define="error_zmiSN python:errors.get('ZMISkinName'); 
     38                                  error_zmiBSN python:errors.get('ZMIBaseSkinName')"> 
     39                <legend> 
     40                  <label style="font-size: 110%" i18n:translate="legend_ZMI"> ZMI:</label> 
    4841                </legend> 
    49                 <p /> 
    50                 <div class="FSProductName" 
    51                      tal:attributes="class python: test(error_fsProdName, 'FSProductName error', 'FSProductName');"> 
    52                     <label class="FSProductName_title" 
    53                           i18n:translate="label_FSProductName">Product name</label> 
     42                <div class="ZMISkinName" 
     43                     tal:attributes="class python: test(error_zmiSN, 'ZMISkinName error', 'ZMISkinName');"> 
     44                <!-- folder in ZMI .../portal_skins, from which will be copyed content --> 
     45                    <label class="ZMISkinName_title" 
     46                           i18n:translate="label_ZMISkinName">Source ZMI skin folder</label> 
    5447                    <span class="fieldRequired" 
    5548                           title="Required" 
    5649                           i18n:translate="label_required" 
    57                            i18n:attributes="title title_required;">(Required)</span> 
    58                     <div i18n:translate="help_FSProductName" 
    59                          class="formHelp"> 
    60                         Name for dumped product. This name should be unique in Destination directory. The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 
    61                     </div> 
    62                     <div tal:condition="error_fsProdName" 
    63                          tal:content="error_fsProdName" i18n:translate="">Validation Error</div> 
    64  
    65                     <input class="FSProductName_input" 
    66                            type="text" 
    67                            name="FSProductName" 
    68                            value="qPloneSkinTemplate" 
    69                            size="50" 
    70                            tal:attributes="value request/FSProductName|nothing" /> 
    71                 </div> 
    72                 <p /> 
    73                 <div class="FSSkinDirectory" 
    74                      tal:attributes="class python: test(error_fsSkinDir, 'FSSkinDirectory error', 'FSSkinDirectory');"> 
    75                     <label class="FSSkinDirectory_title" 
    76                           i18n:translate="label_FSSkinDirectory">Skin name</label> 
    77                     <span class="fieldRequired" 
    78                            title="Required" 
    79                            i18n:translate="label_required" 
    80                            i18n:attributes="title title_required;">(Required)</span> 
    81                     <div i18n:translate="help_FSSkinDirectory" 
    82                          class="formHelp"> 
    83                          Skin name in dumped product. The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 
    84                     </div> 
    85                     <div tal:condition="error_fsSkinDir" 
    86                          tal:content="error_fsSkinDir" i18n:translate="">Validation Error</div> 
    87  
    88                     <input class="FSSkinDirectory_input" 
    89                            type="text" 
    90                            name="FSSkinDirectory" 
    91                            value="" 
    92                            size="50" 
    93                            tal:attributes="value request/FSSkinDirectory|nothing" /> 
    94                 </div> 
    95                 <p /> 
    96                 <div class="FSDestinationDirectory" 
    97                      tal:define="destinationDir python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getProductsPath();" 
    98                      tal:attributes="class python: test(error_fsDestinationDir, 'FSDestinationDirectory error', 'FSDestinationDirectory');"> 
    99                     <label class="FSDestinationDirectory_title" 
    100                           i18n:translate="label_FSDestinationDirectory">Destination directory</label> 
    101                     <span class="fieldRequired" 
    102                            title="Required" 
    103                            i18n:translate="label_required" 
    104                            i18n:attributes="title title_required;">(Required)</span> 
    105                     <div i18n:translate="help_FSDestinationDirectory" 
    106                          class="formHelp"> 
    107                          Absolute path to directory, where SkinProduct will be created. 
    108                     </div> 
    109                     <div tal:condition="error_fsDestinationDir" 
    110                          tal:content="error_fsDestinationDir" i18n:translate="">Validation Error</div> 
    111  
    112                     <input class="FSDestinationDirectory_input" 
    113                            type="text" 
    114                            name="FSDestinationDirectory" 
    115                            value="" 
    116                            size="50" 
    117                            tal:attributes="value request/FSDestinationDirectory|destinationDir" /> 
    118                 </div> 
    119             </fieldset> 
    120  
    121             <fieldset id="fieldset-zmi" 
    122                       tal:define="error_zmiSN python:errors.get('ZMISkinName'); 
    123                                   error_zmiBSN python:errors.get('ZMIBaseSkinName')"> 
    124                 <legend id="fieldsetlegend-zmi"> 
    125                   <label style="font-size: 110%" i18n:translate="legend_ZMI">Skin</label> 
    126                 </legend> 
    127                 <p /> 
     50                           i18n:attributes="title title_required;"> 
     51                                (Required) 
     52                    </span> 
     53                    <div i18n:translate="help_ZMISkinName" 
     54                         class="formHelp"> 
     55                        Select folder from portal_skins, which content should by copyed to FS product. 
     56                    </div> 
     57                    <div tal:condition="error_zmiSN" 
     58                         tal:content="error_zmiSN" i18n:translate="">Validation Error</div> 
     59 
     60                    <select class="ZMISkinName_input" id="ZMISkinName"  
     61                            size="1" name="ZMISkinName" 
     62                            tal:define="value request/ZMISkinName|string:custom; 
     63                                        p_skins_ids python:portal.portal_skins.objectIds(spec='Folder')" 
     64                            tal:attributes="value value; 
     65                                            tabindex tabindex/next;"> 
     66                        <option selected="" 
     67                                value="#" 
     68                                tal:repeat="ps_folder p_skins_ids" 
     69                                tal:attributes="value nocall:ps_folder; 
     70                                                selected python:test(ps_folder==value, 'selected', None);" 
     71                                tal:content="ps_folder"/> 
     72                         
     73                    </select> 
     74                </div> 
     75                <p/> 
    12876                <div class="ZMIBaseSkinName" 
    12977                     tal:attributes="class python: test(error_zmiBSN, 'ZMIBaseSkinName error', 'ZMIBaseSkinName');"> 
    13078                <!-- base for building layers list --> 
    13179                    <label class="ZMIBaseSkinName_title" 
    132                            i18n:translate="label_ZMIBaseSkinName">Skin selection</label> 
     80                           i18n:translate="label_ZMIBaseSkinName">ZMI base skin name</label> 
    13381                    <span class="fieldRequired" 
    13482                           title="Required" 
    13583                           i18n:translate="label_required" 
    136                            i18n:attributes="title title_required;">(Required)</span> 
     84                           i18n:attributes="title title_required;"> 
     85                                (Required) 
     86                    </span> 
    13787                    <div i18n:translate="help_ZMIBaseSkinName" 
    13888                         class="formHelp"> 
    139                         Select skin selection from portal_skins, which layers list will be used for creating new skin. 
     89                        Select Skin name, which layers list will be used for creating new skin. 
    14090                    </div> 
    14191                    <div tal:condition="error_zmiBSN" 
     
    14494                    <select tal:define="value request/ZMIBaseSkinName|string:Plone Tableless; 
    14595                                        skin_names portal/portal_skins/getSkinSelections" 
    146                             tal:attributes="name string:ZMIBaseSkinName; 
     96                            tal:attributes="value value; 
     97                                            name string:ZMIBaseSkinName; 
    14798                                            id string:ZMIBaseSkinName; 
    14899                                            size string:1; 
     
    154105                                                selected python:test(skin_name==value, 'selected', None);" 
    155106                                tal:content="skin_name"/> 
     107                         
    156108                    </select> 
    157109                </div> 
    158                 <p /> 
    159                 <div class="ZMISkinName" 
    160                      tal:attributes="class python: test(error_zmiSN, 'ZMISkinName error', 'ZMISkinName');"> 
    161                 <!-- folder in ZMI .../portal_skins, from which will be copyed content --> 
    162                     <label class="ZMISkinName_title" 
    163                            i18n:translate="label_ZMISkinName">Skin folders</label> 
     110                <p/> 
     111                <div class="EraseFromSkin"> 
     112                <!-- erase content of folder in ZMI .../portal_skins after copying --> 
     113                    <div i18n:translate="help_Erase" 
     114                         class="formHelp"> 
     115                        Select for erase content of skin's source folder. 
     116                    </div> 
     117 
     118                    <input class="EraseFromSkin_input" 
     119                           type="checkbox" 
     120                           name="EraseFromSkin" 
     121                           value="0" 
     122                           tal:attributes="checked python:test(request.has_key('EraseFromSkin'), 'checked', nothing)" 
     123                           /> 
     124                    <label class="EraseFromSkin_title" 
     125                          i18n:translate="label_Erace">Erase </label> 
     126                </div> 
     127                <p/> 
     128                <!--Next is checkbox to select generating main_template.pt  
     129                <div class="GenerateTemplate" 
     130                     tal:define="isAvailable python:modules['Products.qPloneSkinDump.generatingTemplate'].available(here)"> 
     131                    <div i18n:translate="help_Generate" 
     132                         class="formHelp"> 
     133                        Select next for generating "main_template.pt" from qMultipleSlots plone site properties. 
     134                        <p tal:condition="not:isAvailable"> 
     135                           <b>Not available! qMultipleSlots product isn't installed.</b> 
     136                        </p> 
     137                    </div> 
     138 
     139                    <input class="GenerateTemplate_input" 
     140                           type="checkbox" 
     141                           name="GenerateTemplate" 
     142                           value="0" 
     143                           tal:attributes="checked python:request.get('GenerateTemplate', isAvailable and 'checked'); 
     144                                           disabled python:test(isAvailable, nothing, 'disabled')"/> 
     145 
     146                    <label class="GenerateTemplate_title" 
     147                          i18n:translate="label_Generate">Generate</label> 
     148                </div> 
     149                --> 
     150 
     151                <a href="" 
     152                   tal:attributes="href string:${portal_url}/qploneskindump_generate" 
     153                   tal:condition="python:modules['Products.qPloneSkinDump.generatingTemplate'].available(here)"> 
     154                  Want to generate main template? 
     155                </a> 
     156            </fieldset> 
     157 
     158            <fieldset tal:define="error_fsSkinDir python:errors.get('FSSkinDirectory'); 
     159                                  error_fsProdName python:errors.get('FSProductName')"> 
     160                <legend> 
     161                  <label style="font-size: 110%" i18n:translate="label_FS"> File system:</label> 
     162                </legend> 
     163                <div class="FSSkinDirectory" 
     164                     tal:attributes="class python: test(error_fsSkinDir, 'FSSkinDirectory error', 'FSSkinDirectory');"> 
     165                    <label class="FSSkinDirectory_title" 
     166                          i18n:translate="label_FSSkinDirectory">Skin's name for new product</label> 
    164167                    <span class="fieldRequired" 
    165168                           title="Required" 
    166169                           i18n:translate="label_required" 
    167                            i18n:attributes="title title_required;">(Required)</span> 
    168                     <div i18n:translate="help_ZMISkinName" 
    169                          class="formHelp"> 
    170                         Select folders from portal_skins, which should be dumped to FS product's skins folder. 
    171                     </div> 
    172                     <div tal:condition="error_zmiSN" 
    173                          tal:content="error_zmiSN" i18n:translate="">Validation Error</div> 
    174  
    175                     <select class="ZMISkinName_input" id="ZMISkinName"  
    176                             size="5" name="ZMISkinName" multiple="1" 
    177                             tal:define="value request/ZMISkinName|string:custom; 
    178                                         p_skins_ids python:portal.portal_skins.objectIds(spec='Folder')" 
    179                             tal:attributes="tabindex tabindex/next;"> 
    180                         <option selected="" 
    181                                 value="#" 
    182                                 tal:repeat="ps_folder p_skins_ids" 
    183                                 tal:attributes="value nocall:ps_folder; 
    184                                                 selected python:test(ps_folder==value, 'selected', None);" 
    185                                 tal:content="ps_folder"/> 
    186                     </select> 
    187                 </div> 
    188                 <p /> 
    189                 <div class="EraseFromSkin"> 
    190                 <!-- erase content of folder in ZMI .../portal_skins after copying --> 
    191                     <input class="EraseFromSkin_input" 
    192                            type="checkbox" 
    193                            name="EraseFromSkin" 
    194                            id="EraseFromSkin" 
    195                            value="0" 
    196                            tal:attributes="checked python:test(request.has_key('EraseFromSkin'), 'checked', nothing)" 
    197                            /> 
    198                     <label class="EraseFromSkin_title" for="EraseFromSkin" 
    199                           i18n:translate="label_Erase">Erase folders from portal_skins after dump</label> 
     170                           i18n:attributes="title title_required;"> 
     171                                (Required) 
     172                    </span> 
     173                    <div i18n:translate="help_FSSkinDirectory" 
     174                         class="formHelp"> 
     175                         Input skin's name for new prodct. <br/> 
     176                         This name in lower case will be used as skin's folder name and as layer name too.<br/> 
     177                         The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries.<br/> 
     178                    </div> 
     179                    <div tal:condition="error_fsSkinDir" 
     180                         tal:content="error_fsSkinDir" i18n:translate="">Validation Error</div> 
     181 
     182                    <input class="FSSkinDirectory_input" 
     183                           type="text" 
     184                           name="FSSkinDirectory" 
     185                           value="" 
     186                           size="50" 
     187                           tal:attributes="value request/FSSkinDirectory|nothing" /> 
     188                </div> 
     189                <p/> 
     190                <div class="FSProductName" 
     191                     tal:attributes="class python: test(error_fsProdName, 'FSProductName error', 'FSProductName');"> 
     192                    <label class="FSProductName_title" 
     193                          i18n:translate="label_FSProductName">Product name</label> 
     194                    <span class="fieldRequired" 
     195                           title="Required" 
     196                           i18n:translate="label_required" 
     197                           i18n:attributes="title title_required;"> 
     198                                (Required) 
     199                    </span> 
     200                    <div i18n:translate="help_FSProductName" 
     201                         class="formHelp"> 
     202                         Input name of new product.  <br/> 
     203                         This name can't be identical with other, presenting in your Products directory of Plone's instance. <br/> 
     204                         The name must begin with alphabetical character, following with an alphanumeric combination, also underscore accepts, but not on boundaries. 
     205                    </div> 
     206                    <div tal:condition="error_fsProdName" 
     207                         tal:content="error_fsProdName" i18n:translate="">Validation Error</div> 
     208 
     209                    <input class="FSProductName_input" 
     210                           type="text" 
     211                           name="FSProductName" 
     212                           value="qPloneSkinTemplate" 
     213                           size="50" 
     214                           tal:attributes="value request/FSProductName|nothing" /> 
    200215                </div> 
    201216            </fieldset> 
    202217 
    203             <fieldset id="fieldset-portlets"> 
    204                 <legend id="fieldsetlegend-portlets" class="DoesCustomizeSlots"> 
    205                     <label style="font-size: 110%" i18n:translate="label_portlets">Portlets</label> 
     218            <fieldset> 
     219                <legend class="DoesCustomizeSlots"> 
     220                    <input class="noborder" 
     221                           type="checkbox" 
     222                           name="DoesCustomizeSlots" 
     223                           id="DoesCustomizeSlots" 
     224                           value="DOCustomizeSlots" 
     225                           tal:attributes="checked python:test(request.has_key('DoesCustomizeSlots'),'checked', nothing)"/> 
     226                    <label for="DoesCustomizeSlots" 
     227                           style="font-size: 110%" 
     228                           i18n:translate="label_Slots">Customize portal slots in new product</label> 
    206229                </legend> 
    207                 <p /> 
    208                 <div class="customize-portlets"> 
    209                     <input class="noborder" 
    210                            type="checkbox" 
    211                            name="dump_portlets" 
    212                            id="DoesCustomizeSlots" 
    213                            value="0" 
    214                            tal:attributes="checked request/dump_portlets|nothing" /> 
    215                     <label for="DoesCustomizeSlots" 
    216                            i18n:translate="label_dump_portlets">Dump Portlets</label> 
    217                 </div> 
     230                <div class="formHelp" 
     231                     i18n:translate="help_DoesCustomizeSlots"> 
     232                  Customization portal slots in New Skin Product. 
     233                </div> 
     234 
    218235                <p/> 
    219236                <div class="SlotsCustomizing"> 
    220237                    <label class="SlotsCustomizing_title" 
    221                           i18n:translate="label_dump_policy">Dump Policy</label> 
     238                          i18n:translate="label_SlotsCustomizing">Portal slots</label> 
    222239 
    223240                    <div i18n:translate="help_SlotsCustomizing" 
    224241                         class="formHelp"> 
    225  
    226                     </div> 
    227  
     242                         BE VERY ACCURACY!   
     243                         Leave in the left and right slot lists only those portlets, which relate <br/> 
     244                         to your skin product and either bring with new product or is standard for Plone. 
     245                    </div> 
     246                    <div class="LeftSlotsCustomizing_title"> 
     247                        <label class="LeftSlotsCustomizing_title" 
     248                              i18n:translate="label_LeftsSlotCustomizing">Left portal slots customizing</label> 
     249                        <textarea class="LeftSlotsCustomizing_lines" 
     250                               rows="6" 
     251                               cols="35" 
     252                               name="left_slots:lines" 
     253                               value="" 
     254                               tal:define="value python:'\n'.join(request.get('left_slots', portal.left_slots))" 
     255                               tal:attributes="value value" 
     256                               tal:content="value" ></textarea> 
     257                    </div> 
     258                    <p/> 
     259                    <div class="RightSlotsCustomizing_title"> 
     260                        <label class="RightSlotsCustomizing_title" 
     261                              i18n:translate="label_RightSlotsCustomizing">Right portal slots customizing</label> 
     262                        <textarea class="RightSlotsCustomizing_lines" 
     263                               rows="6" 
     264                               cols="35" 
     265                               name="right_slots:lines" 
     266                               value="" 
     267                               tal:define="value python:'\n'.join(request.get('right_slots', portal.right_slots))" 
     268                               tal:attributes="value value"  
     269                               tal:content="value"></textarea> 
     270                    </div> 
     271 
     272                </div> 
     273                <p/> 
     274                <div class="ColumnSlotsForming" 
     275                     tal:define="formers python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getSlotsFormingList(); 
     276                                 value request/slot_forming|formers/default">  
     277                    <label i18n:translate="label_ColumnSlotsForming">Slot's list forming</label> 
     278                    <div i18n:translate="help_ColumnSlotsForming" 
     279                         class="formHelp"> 
     280                         Choose procedure of forming slots lists.<br/> 
     281                         Blend with skin - to SKIN PRODUCT's slots list added unknown slots from SITE.<br/> 
     282                         Blend with site - to SITE's slots list added unknown slots from SKIN PRODUCT.<br/> 
     283                         Replace - in left and right site's columns placed ONLY SKIN PRODUCT's slots. 
     284                    </div> 
     285                    <tal:loop tal:omit-tag="" 
     286                              tal:repeat="former formers/data"> 
     287                        <div> 
     288                            <input type="radio" 
     289                                   name="slot_forming" 
     290                                   value="#" 
     291                                   tal:attributes="value python:former[0]; 
     292                                                   checked python:test(former[0]==value,'checked', nothing)" /> 
     293                            <label class="ColumnSlotsForming_title" 
     294                                   i18n:translate="" 
     295                                   tal:content="python:former[1]"></label> 
     296                        </div> 
     297                    </tal:loop> 
     298                </div> 
     299                <p/> 
     300                <div class="FavourColumn" 
     301                     tal:define="favour_columns python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getMainColumnList(); 
     302                                 value request/main_column|favour_columns/default"> 
     303                    <label  i18n:translate="label_FavourColumn">Main column</label> 
     304                    <div i18n:translate="help_FavourColumn" 
     305                         class="formHelp"> 
     306                         Choose favour column for slots forming procedure. IMPORTANT only for 'Blend with...' formers.<br/> 
     307                         Left/Right - if find same slots in left and right columns - than slots move accordingly to left/right column.<br/> 
     308                         Both - if find same slots in left and right columns - than slots positionings as in Master's slots lists  
     309                         (from SKIN PRODUCT's slots for 'Blend with skin' procedure and SITE's slots for 'Blend with site'). 
     310                    </div> 
     311                    <tal:loop tal:omit-tag="" 
     312                              tal:repeat="favour favour_columns/data"> 
     313                        <div> 
     314                            <input type="radio" 
     315                                   name="main_column" 
     316                                   value="#" 
     317                                   tal:attributes="value python:favour[0]; 
     318                                                   checked python:test(favour[0]==value,'checked', nothing)" /> 
     319                            <label class="FavourColumn_title" 
     320                                   i18n:translate="" 
     321                                   tal:content="python:favour[1]"></label> 
     322                        </div> 
     323                    </tal:loop> 
     324                </div> 
     325 
     326            </fieldset> 
     327 
     328            <fieldset tal:define="exp_data python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getExportingData(here);"> 
     329                <legend class="DoesExportObjects"> 
    228330                    <input class="noborder" 
    229                            type="radio" 
    230                            name="dump_policy" 
    231                            value="root" 
    232                            id="root_dump_policy" 
    233                            onclick="javascript:document.getElementById('selection_widget').style.display='none';" 
    234                            tal:attributes="checked python:request.get('dump_policy', 'root') == 'root';" /> 
    235                     <label for="root_dump_policy" 
    236                            i18n:translate="label_root_dump_policy"> 
    237                         Dump portlets only for portal root 
    238                     </label> 
    239                     <br /> 
    240  
    241                     <input class="noborder" 
    242                            type="radio" 
    243                            name="dump_policy" 
    244                            value="all" 
    245                            id="all_dump_policy" 
    246                            onclick="javascript:document.getElementById('selection_widget').style.display='none';" 
    247                            tal:attributes="checked python:request.get('dump_policy', 'root') == 'all';" /> 
    248                     <label for="all_dump_policy" 
    249                            i18n:translate="label_all_dump_policy"> 
    250                         Dump portlets for the whole site content 
    251                     </label> 
    252                     <br /> 
    253  
    254                     <input class="noborder" 
    255                            type="radio" 
    256                            name="dump_policy" 
    257                            value="selection" 
    258                            id="selection_dump_policy" 
    259                            onclick="javascript:document.getElementById('selection_widget').style.display='';" 
    260                            tal:attributes="checked python:request.get('dump_policy', 'root') == 'selection';" /> 
    261                     <label for="selection_dump_policy" 
    262                            i18n:translate="label_selection_dump_policy"> 
    263                         Dump portlets only for selected content objects 
    264                     </label> 
    265                     <div id="selection_widget" style="display:none;" 
    266                          tal:define="friendly_types here/@@plone_portal_state/friendly_types; 
    267                                      options python:here.portal_catalog(portal_types=friendly_types)"> 
    268                         <select name="dump_objects" multiple="1" size="7"> 
    269                             <option value="root_path" 
    270                                     tal:content="string:[portal root]" 
    271                                     tal:attributes="value string:" /> 
    272                             <tal:options repeat="option options"> 
    273                             <option value="object_path" 
    274                                     tal:define="ppath python:'/'.join(option.getPath().split('/')[2:])" 
    275                                     tal:content="ppath" 
    276                                     tal:attributes="value ppath" /> 
    277                             </tal:options> 
    278                         </select> 
    279                     </div> 
    280                 </div> 
    281             </fieldset> 
    282  
    283             <fieldset id="fieldset-zexp" 
    284                       tal:define="exp_data python:modules['Products.qPloneSkinDump.qPloneSkinDump'].getExportingData(here);"> 
    285                 <legend id="fieldsetlegend-zexp" class="DoesExportObjects"> 
    286                     <label style="font-size: 110%" i18n:translate="label_portlets">Objects Export</label> 
    287                 </legend> 
    288                 <p /> 
    289                 <div class="objects-export"> 
    290                     <input class="noborder" 
    291331                           type="checkbox" 
    292332                           name="DoesExportObjects" 
    293                            id="DoesExportObjects" 
     333                           id="DoesExportObjects"  
    294334                           value="DoesExportObjects" 
    295335                           tal:attributes="checked python:test(request.has_key('DoesExportObjects'), 'checked', nothing)" /> 
    296336                    <label for="DoesExportObjects" 
    297337                           style="font-size: 110%" 
    298                            i18n:translate="label_DoesExportObjects">Dump Objects</label> 
    299                     <div class="formHelp" 
    300                          i18n:translate="help_DoesExportObjects"> 
    301                       Selected below objects will be exported to New Skin Product. Then on installation generated Skin Product 
    302                       they will be imported to portal root, based on choosed policy. 
    303                     </div> 
    304                 </div> 
     338                           i18n:translate="label_DoesExportObjects">Exporting objects from portal root</label> 
     339                </legend> 
     340                <div class="formHelp" 
     341                     i18n:translate="help_DoesExportObjects"> 
     342                  Selected below objects will be exported to New Skin Product. Then on installation generated Skin Product 
     343                  they will be imported to portal root, based on choosed policy. 
     344                </div> 
     345 
    305346                <p/> 
    306347                <div class="ImportPolicy" 
     
    357398            </fieldset> 
    358399 
    359             <fieldset id="fieldset-resources" 
    360                       tal:define="isFirst python:not request.get('dump_registries', None); 
    361                                   checked_css python:test(isFirst, 'checked', test(request.has_key('DumpCSSRegistry'), 'checked', None)); 
    362                                   checked_js python:test(isFirst, 'checked', test(request.has_key('DumpJSRegistry'), 'checked', None));"> 
    363                 <legend id="fieldsetlegend-resources" class="DoesExportResources"> 
     400            <fieldset tal:define="isFirst python:not request.get('dump_registries', None); 
     401                                  checked_css python:test(isFirst, 'checked', test(request.has_key('DumpCSSRegistry'), 'checked', nothing)); 
     402                                  checked_js python:test(isFirst, 'checked', test(request.has_key('DumpJSRegistry'), 'checked', nothing));"> 
     403                <legend class="DoesExportResources"> 
    364404                    <label for="DoesExportResources" 
    365405                           style="font-size: 110%" 
    366                            i18n:translate="label_DoesExportResources">Resources</label> 
     406                           i18n:translate="label_DoesExportResources">Exporting portal resources</label> 
    367407                </legend> 
    368                 <p /> 
    369408                <div class="formHelp" 
    370409                     i18n:translate="help_DoesExportResources"> 
     
    381420                           type="checkbox" 
    382421                           name="DumpCSSRegistry" 
    383                            id="DumpCSSRegistry" 
    384422                           value="0" 
    385423                           tal:attributes="checked checked_css" 
    386424                           /> 
    387                     <label class="DumpCSSRegistry_title" for="DumpCSSRegistry" 
     425                    <label class="DumpCSSRegistry_title" 
    388426                          i18n:translate="label_DumpCSSRegistry">Dump portal_css registry.</label> 
    389427                </div> 
     
    394432                           type="checkbox" 
    395433                           name="DumpJSRegistry" 
    396                            id="DumpJSRegistry" 
    397434                           value="0" 
    398435                           tal:attributes="checked checked_js" 
    399436                           /> 
    400                     <label class="DumpJSRegistry_title" for="DumpJSRegistry" 
     437                    <label class="DumpJSRegistry_title" 
    401438                          i18n:translate="label_DumpJSRegistry">Dump portal_javascripts registry.</label> 
    402439                </div> 
    403440                <p/> 
    404             </fieldset> 
    405  
    406             <!-- dump views --> 
    407             <fieldset id="fieldset-views" 
    408                       tal:define="error_zmiSN python:errors.get('ZMISkinName'); 
    409                                   error_zmiBSN python:errors.get('ZMIBaseSkinName')"> 
    410                 <legend id="fieldsetlegend-views"> 
    411                   <label style="font-size: 110%" i18n:translate="legend_viewlets">Views</label> 
    412                 </legend> 
    413                 <p /> 
    414                 <div class="dump-viewlets-field"> 
    415                     <div i18n:translate="help_dumpviewlets" 
    416                          class="formHelp"> 
    417                         Check this field for dumping all customized objects in portal_view_customization tool. 
    418                     </div> 
    419  
    420                     <input class="dumpviewlets-input" 
    421                            type="checkbox" 
    422                            name="dump_viewlets" 
    423                            id="dump_viewlets" 
    424                            value="1" 
    425                            tal:attributes="checked python:test(request.has_key('dump_viewlets'), 'checked', nothing)" 
    426                            /> 
    427                     <label class="dumpviewlets-title" for="dump_viewlets" 
    428                           i18n:translate="label_dumpviewlets">Dump views, viewlets and portlets</label> 
    429                 </div> 
    430441            </fieldset> 
    431442 
  • qPloneSkinDump/branches/multipleslots/skins/qploneskindump/qploneskindump_config_script.cpy

    r503 r929  
    1212#from Products.CMFCore.utils import getToolByName 
    1313from Products.qPloneSkinDump.qPloneSkinDump import createProduct 
    14 from Products.CMFPlone import PloneMessageFactory as _ 
    1514 
    1615REQUEST = context.REQUEST 
    1716# ZMI data 
    18 zmi_skin_names = REQUEST.get('ZMISkinName') 
     17zmi_skin_name = REQUEST.get('ZMISkinName') 
    1918zmi_base_skin_name = REQUEST.get('ZMIBaseSkinName') 
    2019 
    2120# File system data 
    22 fs_dest_directory = REQUEST.get("FSDestinationDirectory") 
    2321fs_skin_directory = REQUEST.get('FSSkinDirectory') 
    2422fs_product_name = REQUEST.get('FSProductName') 
     
    3937        right_slots = [i for i in right_slots if i] 
    4038 
    41 # Exporting portlets 
    42 dump_portlets = REQUEST.get('dump_portlets', 0) 
    43 dump_policy = REQUEST.get('dump_policy', 'root') 
    44 dump_portlets_selection = REQUEST.get('dump_objects', []) 
    45  
    4639# Exporting objects 
    4740import_policy = exporting_objects = None 
     
    5750dump_JS = REQUEST.get('DumpJSRegistry') 
    5851 
    59 dump_custom_views = REQUEST.get('dump_viewlets', None) 
    60  
    6152# create Product 
    62 result = createProduct(context, zmi_skin_names=zmi_skin_names,\ 
     53result = createProduct(context, zmi_skin_name=zmi_skin_name,\ 
    6354              zmi_base_skin_name=zmi_base_skin_name,\ 
    64               fs_dest_directory=fs_dest_directory, \ 
    6555              fs_skin_directory=fs_skin_directory,\ 
    6656              fs_product_name=fs_product_name,\ 
     
    7565              exporting_objects=exporting_objects, \ 
    7666              dump_CSS=dump_CSS, \ 
    77               dump_JS=dump_JS, \ 
    78               dump_portlets=dump_portlets, \ 
    79               dump_policy=dump_policy, \ 
    80               dump_portlets_selection=dump_portlets_selection, \ 
    81               dump_custom_views=dump_custom_views ) 
     67              dump_JS=dump_JS ) 
    8268 
    83 portal_status_message = u'"%s" Product successfully created.' % fs_product_name 
     69portal_status_message='"%s" Product successfully created.' % fs_product_name 
    8470if result: 
    85     portal_status_message = portal_status_message + u"Failed exporting objects: %s." % str(result) 
     71    portal_status_message = portal_status_message + "Failed exporting objects: %s." % str(fail) 
    8672 
    87 context.plone_utils.addPortalMessage(_(portal_status_message)) 
    88 return state 
     73return state.set(portal_status_message=portal_status_message) 
Note: See TracChangeset for help on using the changeset viewer.