-í sžÐ?cs™dZdkZdkZdklZdklZ dkZ dkZ dk Z dk Z dd„Z #d„Z .d„ZAd„ZZd „Zhd „Zud „Zzd „Z¥d klZlZ§d„Z«d„ZÌd„Zìd„Zód„Zd„ZWd„Z`d„Zhd„Zod„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((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd6zs:''    6  # 3( (s localtimesstrftimecs§¨tdtƒƒSdS(Ns%d.%m.%Y(sstrftimes localtime(sself((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysdate§scsÕ«¬®tiii|dƒ}±y&²ti|idƒdiƒ}Wn,³´ti|idƒdiƒ}nXµti|idƒdiƒ}¶y&·ti|idƒdiƒ}Wnb¸¹y&ºti|idƒdiƒ}Wn,»¼ti|idƒdiƒ}nXnX½d }¾x,¾t iid |ƒo¿|d 7}q9WÀd ||iid <Á||iid <Âd |||f|iid<Étdƒi|ƒ}Ê|ƒSdS(sadd presentation to the paths /index.metasauthorisAuthorstitlesyearsYearsdateis%02d-presentationspresentationnamespaths_ %s %s %s yes s xmlvorschlags#Products/OSA_system/addPresentationN(sxmlsdomsminidomsparsespathsarchivesgetTextsgetElementsByTagNames childNodessauthorstitlesdatesisossexistssselfsREQUESTsSESSIONsPageTemplateFiles__of__s newtemplate(sselfspathstitlesisauthorsdomsdates newtemplate((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddPresentation«s.&&"&&*  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((sN/Users/dwinter/install/CVSZOPE/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((sN/Users/dwinter/install/CVSZOPE/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((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddText2ós" #cs:yIti|ƒiƒ} d} x| D ]} ||}q7WWn  d|SnX t|ƒ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!|ƒ(|i!| ƒ*|idƒ}+|idƒ},|i!|ƒ-|i!|ƒ/|i!|ƒ1t|d dƒ} 2| i|i'ƒi(dƒƒ3| iƒ6tiii|d ƒ}7|idƒd }9y:|idƒd }Wn;<dSnX?yT@|idƒ}Bt|ƒd j o'C|i*|d ƒ} D| i,ƒnWn EFnXH|idƒ}I|i|d|ƒ}J|i!|ƒK|i!|ƒNt|d dƒ} O| i|i'ƒi(dƒƒP| iƒStid|ƒ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((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddTextExternalsz  & #   csNWX|dd!}Zy[tid|ƒ}Wn\]dSnX^dSdS(Nii s .*}¥y%¦|i di ||i di            +  !   S      (