-í ç‹@cs™dZdkZdkZdklZdklZ dkZ dkZ dk Z dk Z dd„Z #d„Z 2d„ZEd„Z^d „Zld „Zyd „Z~d „Z©d klZlZ«d„Z¯d„ZÔd„Zôd„Zûd„Z d„Z_d„Zhd„Zpd„Zwd„Z ‡d„Z!£d„Z"·d„Z#ßd„Z$dS(s1Methoden zum hinzufügen von Dokumenten ins ArchivN(sPageTemplateFile(s PageTemplateics¹dddg|_tdƒi|ƒ}|id|iid<|djod|iids sProducts/OSA_system/index_metas text/plains no_uploads /index.metas/swi¤sURL2s?path=s/mpiwg/online/(.*)sProducts/OSA_system/OSAS_saveds text/htmls Content-Type(!sparse_query_stringsselfsREQUESTsmetadatasosspathssplitsSESSIONsreftypes add_metadatas metadataprintskeysstagsPageTemplateFiles__of__s newtemplates content_types renderxmlshas_keysmetapathsopensfs writelinesscloseschmodsresponsesredirectsressearchsgroupsviewpaths newtemplate2s setHeader(sselfsfsmetapaths newtemplate2s renderxmlstags newtemplatesmetadata((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd6~s:''    6  # 3( (s localtimesstrftimecs«¬tdtƒƒSdS(Ns%d.%m.%Y(sstrftimes localtime(sself((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysdate«scs ¯°²tiii|dƒ}µy&¶ti|idƒdiƒ}Wnb·¸y&¹ti|idƒdiƒ}Wn,º»ti|idƒdiƒ}nXnX½ti|idƒdiƒ}¾y&¿ti|idƒdiƒ}WnbÀÁy&Âti|idƒdiƒ}Wn,ÃÄti|id ƒdiƒ}nXnXÅd }Æx,Æt iid |ƒoÇ|d 7}qoWÈd ||iid <É||iid <Êd|||f|iid<Ñtdƒi|ƒ}Ò|ƒSdS(sadd presentation to the paths /index.metasauthorisAuthorsEditorstitlesyearsYearsdateis%02d-presentationspresentationnamespaths_ %s %s %s yes s xmlvorschlags#Products/OSA_system/addPresentationN(sxmlsdomsminidomsparsespathsarchivesgetTextsgetElementsByTagNames childNodessauthorstitlesdatesisossexistssselfsREQUESTsSESSIONsPageTemplateFiles__of__s newtemplate(sselfspathstitlesisauthorsdomsdates newtemplate((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddPresentation¯s4&&*"&&*  csÔÕÖ|id}Ø|id}Ú|iid}Ü|iidƒ oÝ|id}Þd}nFá|idi }â|ii di ƒ}äd}å|id}æyçt i |d|ƒWn èénXët|d|d|dƒ}ì|i|ƒí|iƒît i|d|d ƒït i|d|d|d ƒðt|||d ƒò|iii|id d |ƒSdS(sadd presentation s folder_namescontent_descriptionspaths fileuploadsxmltextsinfo.xmls/swiíi¤s presentationsURL2s?path=N(sselfsREQUESTs folder_namescontent_descriptionsSESSIONspathshas_keysxmlinfos file_namesfilenamesformsreadsossmkdirsopensfswritescloseschmodsaddDirsToIndexMetasRESPONSEsredirect(sselfscontent_descriptions folder_names file_namespathsfsxmlinfo((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddPresentation2Ôs,  " #csUôõödg|iid<÷||iid<øtdƒi|ƒ}ù|ƒSdS(sadd fulltext to the pathspageimgsexisting_namesspathsProducts/OSA_system/addTextN(sselfsREQUESTsSESSIONspathsPageTemplateFiles__of__s newtemplate(sselfspaths newtemplate((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddTextôs cs6ûü|id}þ|id}ÿ|iid}|idi}|iidi ƒ}t i |d|ƒt |d|d|dƒ}|i|ƒ|iƒt i|d|dƒt i|d|d|dƒt|||d ƒ |iii|id d |ƒSdS( Ns folder_namescontent_descriptionspaths fileuploads/swiíi¤sfulltextsURL2s?path=(sselfsREQUESTs folder_namescontent_descriptionsSESSIONspathsfilenames file_namesformsreadsfiledatasossmkdirsopensfswritescloseschmodsaddDirsToIndexMetasRESPONSEsredirect(sselfscontent_descriptions folder_names file_namespathsfiledatasf((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddText2ûs" #cs:  yIti|ƒiƒ} d}x| D]}||}q7WWnd|SnXt|ƒod|d|fSnt|ƒ}t i |dƒ}|t|ƒd}y&t|d|d|dƒ} Wn%d|d|d|SnX| i|ƒ| iƒ ti|d|d|dƒ#tiii|d ƒ}$|id ƒd }&|id ƒ}(|id ƒ} )|i|ƒ}*| i!|ƒ+|i!| ƒ-|idƒ} .|id|ƒ}/| i!|ƒ0|i!| ƒ2|idƒ}3|idƒ}4|i!|ƒ5|i!|ƒ7|i!|ƒ9t|d dƒ} :| i|i'ƒi(dƒƒ;| iƒ>tiii|d ƒ}?|idƒd }AyB|idƒd }WnCDdSnXGyTH|idƒ}Jt|ƒd j o'K|i*|d ƒ} L| i,ƒnWn MNnXP|idƒ}Q|i|d|ƒ}R|i!|ƒS|i!|ƒVt|d dƒ} W| i|i'ƒi(dƒƒX| iƒ[tid|ƒiƒSdS(s hinzufügen eines externen textesssERROR: cannot read: %ss received:s/iswsERROR: cannot write: %si¤s /index.metasresourceisdirsnames descriptionsarchimedes text:s content-typesfulltextsutf-8smetastexttoolsBERROR:no presentation configured yet, user Web Front End to do so!stextsFhttp://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%sN(/surllibsurlopenstexturls readlinesstexttempstextslinesTextExternalErrorsgetNewTextPathspathstextpathsstringssplitssplittedslensnamesfiles writefileswritesclosesosschmodsxmlsdomsminidomsparsesgetElementsByTagNamesnodes createElementssubnodesnamenodescreateTextNodes namenodetexts appendChildsdescriptionnodesversionsdescriptionnodetexts contentnodescontentnodetextstoxmlsencodestexttoolnodelists removeChilds subsubnodesunlinkstextfoldernodestextfoldernodetext(sselfspathstexturlsversionsnodesdescriptionnodetextstexts contentnodestexttoolnodelistsdescriptionnodes writefilestexttemps subsubnodesnamenodeslinessubnodestextfoldernodetextstextfoldernodesnamestextpathsdomscontentnodetextssplitteds namenodetext((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddTextExternal sz  & #   csN_`|dd!}byctid|ƒ}WndedSnXfdSdS(Nii s .*}­y%®|i di ||i di nXnX@t)|ddƒ}A|i+|i,ƒi-dƒƒB|i.ƒFt/i0d|ƒi1ƒHt i2dt3i%dd|idd|id ƒƒdS(s&erstellt bzw. ändert texttool meta tags /index.metasmetaistexttools/s presentationsdisplaysyessimagestextsexternals externxmls pagebreaksxsltssbibslangsXsLANG:sresourceswsutf-8sFhttp://nausikaa2.rz-berlin.mpg.de:86/cgi-bin/toc/admin/reg.cgi?path=%ss{ssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 >> /tmp/sc.out &s/mpiwg/online/spathN(4sxmlsdomsminidomsparsespathsgetElementsByTagNamesnodes subnodelistslens removeChildssubnodesunlinks createElementsosslistdirsselfsREQUESTs presentfiles displaynodescreateTextNodesdisplaynodetexts appendChildshas_keysnamenodes namenodetextstextfilestextfoldernodestextfoldernodetextsSESSIONs pagebreaknodespagebreaknodetextspresentationnodespresentationnodetextsxsltnodes xsltnodetextsnode2ssubsssubsmainstextnodeslangsfiles writefileswritestoxmlsencodesclosesurllibsurlopens readlinesspopensre(sselfspathsnodes namenodetextssubss xsltnodetextstextnodes writefilesxsltnodes displaynodesnamenodesdisplaynodetextspagebreaknodetextstextfiles presentfilessubnodestextfoldernodetextstextfoldernodessubsmainspresentationnodes subnodelistsdomspresentationnodetexts pagebreaknodesnode2((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pyscombineTextImage2ßs¨%%)!      (%s__doc__sarchivesoss'Products.PageTemplates.PageTemplateFilesPageTemplateFiles#Products.PageTemplates.PageTemplates PageTemplatesstringsurllibsxml.dom.minidomsxmlsresaddsgetISOsadd2sparse_query_stringsadd3sadd4sadd5sadd6stimes localtimesstrftimesdatesaddPresentationsaddPresentation2saddTextsaddText2saddTextExternalsTextExternalErrorsgetNewTextPaths addImagess addImages2saddDirsToIndexMetasreadArchimedesXMLscombineTextImagescombineTextImage2( sgetNewTextPathsstringsparse_query_strings addImages2saddTextsaddText2saddPresentation2scombineTextImagesaddDirsToIndexMetasdatesarchivesaddPresentationsreadArchimedesXMLsxmlsadd6sadd5sadd4sadd3sadd2saddTextExternalscombineTextImage2s addImagessurllibs PageTemplatesresaddsPageTemplateFilesgetISOsTextExternalErrorsossstrftimes localtime((s@/usr/local/mpiwg/Zope/lib/python/Products/OSA_system/OSAS_add.pys?s>             +  %   S      (