Index: /qPloneSkinDump/branches/plone_3.0/exportingObjects.py =================================================================== --- /qPloneSkinDump/branches/plone_3.0/exportingObjects.py (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/exportingObjects.py (revision 70) @@ -34,10 +34,11 @@ ## EXPORTING ## ############################################################### -def exportObjects(context, doesExportObjects, exporting_objects, product_name): +def exportObjects(context, doesExportObjects, exporting_objects, + fs_dest_directory, product_name): # Check whether should perform exporting if not doesExportObjects: return None # Get Instance's exported and Product's imoprt pathes - instance_epath, product_epath = getImportedPathes(product_name) + instance_epath, product_epath = getImportedPathes(fs_dest_directory, product_name) # Move same named files from Instance export dir to Temp dir temp_dir_path, product_elist = moveSameFilesToTemp(instance_epath, product_epath, exporting_objects) @@ -63,9 +64,9 @@ return fail_export -def getImportedPathes(product_name): +def getImportedPathes(fs_dest_directory, product_name): # Based on instance path, construct import pathes cfg = getConfiguration() instance_epath = cfg.clienthome - product_epath = osp.join(PRODUCTS_PATH, product_name, "import") + product_epath = osp.join(fs_dest_directory, product_name, "import") # Check presence of Product import directory if not osp.isdir(product_epath): Index: /qPloneSkinDump/branches/plone_3.0/qPloneSkinDump.py =================================================================== --- /qPloneSkinDump/branches/plone_3.0/qPloneSkinDump.py (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/qPloneSkinDump.py (revision 70) @@ -8,4 +8,8 @@ security = ModuleSecurityInfo( 'Products.qPloneSkinDump.qPloneSkinDump' ) + +security.declarePublic('getProductsPath') +def getProductsPath(): + return PRODUCTS_PATH security.declarePublic('getExportingData') @@ -35,8 +39,17 @@ security.declarePublic('isValidProductName') -def isValidProductName(product_name): +def isValidProductName(product_name, fs_dest_directory): """ Check for product presence in installed products list""" - return (product_name not in get_product_listdirs() \ - and isValidDirName(product_name)) + if not fs_dest_directory==PRODUCTS_PATH: + return (not product_name in os.listdir(fs_dest_directory)) \ + and isValidDirName(product_name) + + return (not product_name in get_product_listdirs()) \ + and isValidDirName(product_name) + +security.declarePublic('isValidDestinationDir') +def isValidDestinationDir(destination_dir): + """ Check for existance of destination directory.""" + return os.path.isdir(destination_dir) DIR_NAME_PATTERN = re.compile("^[a-zA-Z]+[a-zA-Z0-9_]*[a-zA-Z0-9]$") @@ -52,4 +65,5 @@ zmi_base_skin_name='', \ subdir=None,\ + fs_dest_directory=PRODUCTS_PATH, \ fs_skin_directory='custom',\ fs_product_name='QSkinTemplate',\ @@ -70,11 +84,11 @@ dump_custom_views=False): """ Main Skin Product creating procedure.""" - makeNewProduct(context, fs_product_name, fs_skin_directory, \ + makeNewProduct(context, fs_dest_directory, fs_product_name, fs_skin_directory, \ zmi_skin_names, zmi_base_skin_name, subdir, \ doesCustomizeSlots, left_slots, right_slots, slot_forming, main_column, \ doesExportObjects, import_policy, \ dump_CSS, dump_JS, dump_portlets, dump_policy, dump_portlets_selection, dump_custom_views) - dumpSkin(context, zmi_skin_names, fs_product_name, erase_from_skin) - result = exportObjects(context, doesExportObjects, exporting_objects, fs_product_name) + dumpSkin(context, zmi_skin_names, fs_dest_directory, fs_product_name, erase_from_skin) + result = exportObjects(context, doesExportObjects, exporting_objects, fs_dest_directory, fs_product_name) return result Index: /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config.cpt =================================================================== --- /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config.cpt (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config.cpt (revision 70) @@ -42,5 +42,6 @@
Index: /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config_script.cpy =================================================================== --- /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config_script.cpy (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/qploneskindump_config_script.cpy (revision 70) @@ -20,4 +20,5 @@ # File system data +fs_dest_directory = REQUEST.get("FSDestinationDirectory") fs_skin_directory = REQUEST.get('FSSkinDirectory') fs_product_name = REQUEST.get('FSProductName') @@ -61,4 +62,5 @@ result = createProduct(context, zmi_skin_names=zmi_skin_names,\ zmi_base_skin_name=zmi_base_skin_name,\ + fs_dest_directory=fs_dest_directory, \ fs_skin_directory=fs_skin_directory,\ fs_product_name=fs_product_name,\ @@ -75,7 +77,7 @@ dump_JS=dump_JS, \ dump_portlets=dump_portlets, \ - dump_policy=dump_policy, - dump_portlets_selection=dump_portlets_selection, - dump_custom_views=dump_custom_views) + dump_policy=dump_policy, \ + dump_portlets_selection=dump_portlets_selection, \ + dump_custom_views=dump_custom_views ) portal_status_message = u'"%s" Product successfully created.' % fs_product_name Index: /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/validate_qploneskindump_form.vpy =================================================================== --- /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/validate_qploneskindump_form.vpy (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/skins/qploneskindump/validate_qploneskindump_form.vpy (revision 70) @@ -11,5 +11,7 @@ from Products.CMFCore.utils import getToolByName -from Products.qPloneSkinDump.qPloneSkinDump import isValidProductName, isValidDirName +from Products.qPloneSkinDump.qPloneSkinDump import isValidProductName +from Products.qPloneSkinDump.qPloneSkinDump import isValidDirName +from Products.qPloneSkinDump.qPloneSkinDump import isValidDestinationDir errors = state.getErrors() @@ -22,5 +24,5 @@ # Check REQUIRED fields -REQUIRED_FIELDS = ['ZMISkinName', 'ZMIBaseSkinName', 'FSProductName', 'FSSkinDirectory'] +REQUIRED_FIELDS = ['ZMISkinName', 'ZMIBaseSkinName', 'FSProductName', 'FSSkinDirectory', 'FSDestinationDirectory'] theform = {} for f in REQUIRED_FIELDS: @@ -30,6 +32,10 @@ theform[f]=fdata -if not( theform['FSProductName'] and isValidProductName(theform['FSProductName']) ): - update_errors(errors, {'FSProductName': u"Not valid Product name - read help attentively."}) +if not( theform["FSDestinationDirectory"] and isValidDestinationDir(theform["FSDestinationDirectory"]) ): + update_errors(errors, {"FSDestinationDirectory": u"Not valid Destination directory"}) + +if not( theform['FSProductName'] and theform["FSDestinationDirectory"] \ + and isValidProductName(theform['FSProductName'], theform["FSDestinationDirectory"]) ): + update_errors(errors, {'FSProductName': u"Not valid Product name or problem with destination directory - read help attentively."}) if not( theform['FSSkinDirectory'] and isValidDirName(theform['FSSkinDirectory']) ): Index: /qPloneSkinDump/branches/plone_3.0/utils.py =================================================================== --- /qPloneSkinDump/branches/plone_3.0/utils.py (revision 69) +++ /qPloneSkinDump/branches/plone_3.0/utils.py (revision 70) @@ -224,9 +224,9 @@ return "\n".join(['