Changeset 975
- Timestamp:
- 26.04.2010 23:56:32 (2 years ago)
- Location:
- ZMS/trunk
- Files:
-
- 2 added
- 6 edited
-
_filtermanager.py (modified) (5 diffs)
-
_mimetypes.py (modified) (2 diffs)
-
changes.txt (modified) (1 diff)
-
dtml/ZMS/manage_customizefilterform.dtml (modified) (4 diffs)
-
import/enum.content_type.xml (modified) (1 diff)
-
import/epub.filter.xml (added)
-
version.txt (modified) (1 diff)
-
www/mime_type.application_epub+zip.gif (added)
Legend:
- Unmodified
- Added
- Removed
-
ZMS/trunk/_filtermanager.py
r794 r975 26 26 from App.Common import package_home 27 27 from App.special_dtml import HTMLFile 28 from Products.ExternalMethod import ExternalMethod 29 from Products.PageTemplates import ZopePageTemplate 30 from Products.PythonScripts import PythonScript 31 from Products.ZSQLMethods import SQL 28 32 import ZPublisher.HTTPRequest 29 33 import copy … … 146 150 def setProcess(self, newId, newAcquired=0, newName='', newType='process', newCommand=None, zms_system=0): 147 151 if newCommand is None: 148 if newType == 'DTML Method': 149 newCommand = [] 150 newCommand.append( '<!-- BO %s -->\n\n'%newId) 151 newCommand.append( '<!-- EO %s -->\n'%newId) 152 newCommand = ''.join( newCommand) 153 else: 154 newCommand = '' 152 newCommand = '' 153 if newType in [ 'DTML Method']: 154 newCommand += '<dtml-comment>--// BO '+ newId + ' //--</dtml-comment>\n' 155 newCommand += '\n' 156 newCommand += '<dtml-comment>--// EO '+ newId + ' //--</dtml-comment>\n' 157 elif newType in [ 'Script (Python)']: 158 newCommand += '# --// BO '+ newId + ' //--\n' 159 newCommand += '# Example code:\n' 160 newCommand += '\n' 161 newCommand += '# Import a standard function, and get the HTML request and response objects.\n' 162 newCommand += 'from Products.PythonScripts.standard import html_quote\n' 163 newCommand += 'request = container.REQUEST\n' 164 newCommand += 'RESPONSE = request.RESPONSE\n' 165 newCommand += '\n' 166 newCommand += '# Return a string identifying this script.\n' 167 newCommand += 'print "This is the", script.meta_type, \'"%s"\' % script.getId(),\n' 168 newCommand += 'if script.title:\n' 169 newCommand += ' print "(%s)" % html_quote(script.title),\n' 170 newCommand += 'print "in", container.absolute_url()\n' 171 newCommand += 'return printed\n' 172 newCommand += '\n' 173 newCommand += '# --// EO '+ newId + ' //--\n' 155 174 # Set method. 156 if newType == 'DTML Method': 157 container = self.getHome() 158 if newId in container.objectIds([newType]): 159 dtml_method = getattr( container, newId) 160 dtml_method.manage_edit( newName, newCommand) 161 else: 175 container = self.getHome() 176 if newType in [ 'DTML Method']: 177 if newId not in container.objectIds([newType]): 162 178 container.manage_addDTMLMethod( newId, newName, newCommand) 179 newOb = getattr( container, newId) 180 newOb.manage_edit( newName, newCommand) 181 roles=[ 'Manager'] 182 newOb._proxy_roles=tuple(roles) 183 elif newType in [ 'Script (Python)']: 184 if newId not in container.objectIds([newType]): 185 PythonScript.manage_addPythonScript( container, newId) 186 newOb = getattr( container, newId) 187 newOb.ZPythonScript_setTitle( newName) 188 newOb.write(newCommand) 189 roles=[ 'Manager'] 190 newOb._proxy_roles=tuple(roles) 163 191 # Set. 164 192 obs = getRawProcesses(self) … … 188 216 if key == id: 189 217 # Delete method. 190 if cp[key].get('type','') == 'DTML Method':218 if cp[key].get('type','') in [ 'DTML Method', 'External Method', 'Script (Python)']: 191 219 container = self.getHome() 192 220 dtml_method = getattr( container, id, None) 193 221 if dtml_method is not None: 194 container.manage_delObjects( ids = [id])222 container.manage_delObjects( ids=[id]) 195 223 else: 196 224 obs[key] = cp[key] … … 586 614 transfilename = '%s/%s'%( folder, trans.getFilename()) 587 615 _fileutil.exportObj( trans.getData(), transfilename) 588 if processType == 'DTML Method':616 if processType in [ 'DTML Method', 'External Method', 'Script (Python)']: 589 617 filename = processMethod(self, processId, filename, trans, REQUEST) 590 618 else: … … 646 674 # Synchronize type. 647 675 try: 648 if process.get('type') == 'DTML Method':649 container = self.getHome()676 container = self.getHome() 677 if process.get('type') in [ 'DTML Method']: 650 678 ob = getattr( container, process['id']) 651 679 process['command'] = ob.raw 680 elif process.get('type') in [ 'Script (Python)']: 681 ob = getattr( container, process['id']) 682 process['command'] = ob.read() 652 683 except: 653 684 pass -
ZMS/trunk/_mimetypes.py
r882 r975 25 25 """ Globals. """ 26 26 27 application_epub = "mime_type.application_epub+zip.gif" 27 28 application_msaccess = "mime_type.application_msaccess.gif" 28 29 application_mspowerpoint = "mime_type.application_mspowerpoint.gif" … … 57 58 58 59 dctMimeType = { 59 'application/mspowerpoint':application_mspowerpoint 60 'application/epub+zip':application_epub 61 ,'application/mspowerpoint':application_mspowerpoint 60 62 ,'application/vnd.ms-access':application_msaccess 61 63 ,'application/vnd.ms-excel':application_x_excel 62 64 ,'application/vnd.ms-powerpoint':application_mspowerpoint 63 ,'application/vnd.openxmlformats-officedocument.wordprocessingml.document':application_docx64 ,'application/vnd.openxmlformats-officedocument.presentationml.presentation':application_pptx65 ,'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':application_xlsx65 ,'application/vnd.openxmlformats-officedocument.wordprocessingml.document':application_docx 66 ,'application/vnd.openxmlformats-officedocument.presentationml.presentation':application_pptx 67 ,'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':application_xlsx 66 68 ,'application/msword':application_msword 67 69 ,'application/octet-stream':application_octet_stream -
ZMS/trunk/changes.txt
r974 r975 1502 1502 [974] Added new template-set myZMStheme61 (based on JQuery UI). 1503 1503 -------------------------------------------------- 1504 2010-04-26:zms2-2.12.1-975 1505 [975] Added prototype for epub export-filter (@see epub-reader for Firefox http://www.epubread.com/de/). 1506 -------------------------------------------------- -
ZMS/trunk/dtml/ZMS/manage_customizefilterform.dtml
r750 r975 396 396 <table cellspacing="1" cellpadding="0" border="0"> 397 397 <dtml-let process="getProcess(filterProcess['id'])"> 398 <dtml-if "process.get('type','process') == 'DTML Method'or398 <dtml-if "process.get('type','process') in ['DTML Method','External Method','Script (Python)'] or 399 399 process.get('command','').find('{trans}')>=0"> 400 400 <tr> … … 792 792 <td width="20" rowspan="2"><input class="form-element" type="radio" name="id" value="<dtml-var "process['id']">" onclick="radioOnClick(this,'<dtml-var URL0>');" checked="checked"></td> 793 793 <td> 794 <dtml-if "process.get('type','process') == 'DTML Method'">795 <img src=" /misc_/OFSP/dtmlmethod.gif" title="DTML Method" border="0" align="absmiddle"/>794 <dtml-if "process.get('type','process') in ['DTML Method','External Method','Script (Python)']"> 795 <img src="<dtml-var "getattr(this(),process['id']).icon">" title="<dtml-var "process['type']">" border="0" align="absmiddle"/> 796 796 <dtml-else> 797 797 <img src="<dtml-var MISC_ZMS>process.gif" title="process" border="0" align="absmiddle"/> … … 835 835 <td class="form-small"><input class="form-element" type="radio" name="id" value="<dtml-var "process['id']">" onclick="radioOnClick(this,'<dtml-var URL0>');"></td> 836 836 <td class="form-small" nowrap="nowrap"> 837 <dtml-if "process.get('type','process') == 'DTML Method'">838 <img src=" /misc_/OFSP/dtmlmethod.gif" title="DTML Method" border="0" align="absmiddle"/>837 <dtml-if "process.get('type','process') in ['DTML Method','External Method','Script (Python)']"> 838 <img src="<dtml-var "getattr(this(),process['id']).icon">" title="<dtml-var "process['type']">" border="0" align="absmiddle"/> 839 839 <dtml-else> 840 840 <img src="<dtml-var MISC_ZMS>process.gif" title="process" border="0" align="absmiddle"/> … … 890 890 <option value="process"><dtml-var "getZMILangStr('ATTR_COMMANDLINE')"></option> 891 891 <option value="DTML Method">DTML Method</option> 892 <option value="Script (Python)">Script (Python)</option> 892 893 </select> 893 894 <tr><td align="right" class="form-small"><dtml-var "getZMILangStr('ATTR_TYPE')"></td></tr> -
ZMS/trunk/import/enum.content_type.xml
r121 r975 5 5 <item key="text/html; charset=utf-8">HTML (UTF-8)</item> 6 6 <item key="image/jpeg">JPEG</item> 7 <item key="application/epub+zip">Epub</item> 7 8 <item key="application/x-excel">MS Excel</item> 8 9 <item key="application/x-ms-reader">MS Reader</item> -
ZMS/trunk/version.txt
r974 r975 1 ZMS2 2.12.1-97 41 ZMS2 2.12.1-975
Note: See TracChangeset
for help on using the changeset viewer.
