-í [x?csdZ dkZ dklZ dklZ dkZ dkZdkZ dk Z dd„Z &d„Z 1d„Z Dd„Z]d „Zkd „Zxd „Z}d „Z¨d klZlZªd„Z®d„ZÎd„Zîd„Zõd„Zd„ZYd„Zbd„Zjd„Zqd„Zd„Z ›d„Z!½d„Z"dS(s1Methoden zum hinzufügen von Dokumenten ins ArchivN(sPageTemplateFile(s PageTemplateics¹dddg|_tdƒi|ƒ}|id|iid<|djod|iid/Users/dwinter/Documents/Projekte/OSAS/OSA_system/iso639-1.incsrsasciisreplaces ii( sfiles readlinessfsretslinerawsencodeslinesstringssplitsvalueskey(skeysretsfslineslinerawsvalue((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysgetISO&s  %%csû12|id|_3|i|iid<4hddddddd d d d d ddg d<dddddddddg d<dddddddddg d<|_8|i|i|_9tƒ|_?tdƒi |ƒ}@|ƒSdS(NsReference Typesreftypesauthorsyearstitles series editors series titles series volumesnumber of pagesscitys publisherseditionsnumber of volumess translators ISBN ISSNsBooksjournalsvolumesissuespagessalternate journals call numbersJournal Articleslocations signatureseditorial remarkss descriptionskeywordss Manuscripts$products/OSA_system/OSAS_add_bibdata( sselfsREQUESTsreftypesSESSIONsbibdatasfieldssgetISOsisolistsPageTemplateFiles__of__s newtemplate(sselfs newtemplate((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd21s„cs.DEh}Fd}Gd}Hd}Id}Jti|ƒ}KxÎ|DK]Ã}L|djoM|}Nd}Od}nP|djo#Q|||<Rd}Sd}n\U|djo!V|djo Vd}nnX|djo Xd}nY||}qLWZ|||<[|SdS( Nsskeys=svalues&s+s-s ( squeriesskeysvaluestmpstogglesurllibsunquotesstrsi(sstrstmpstoggleskeysqueriessisvalue((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysparse_query_stringDs0              csá]^_t|idƒ}`||iid<a|dd d|dd d|d}b|idd ƒ|_c|iiid ƒo.d|iid |iid <et|ƒSn#gt d ƒi |ƒ}h|ƒSdS(s Foldernames QUERY_STRINGsmetadatasauthoris_stitlesyearsasciisignores no_uploadspaths folder_names#products/OSA_system/OSAS_add_namingN( sparse_query_stringsselfsREQUESTsmetadatasSESSIONsvorschlag_namingsdecodeshas_keysadd5sPageTemplateFiles__of__s newtemplate(sselfs newtemplatesvorschlag_namingsmetadata((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd3]s-csµkltid|iidƒidƒ|_n|id|_p|iidd|id|iid<s|i|iid<td|_ut dƒi |ƒ}v|ƒSdS(Ns /mpiwg(.*)spathis folder_names/spageimgsproducts/OSA_system/OSAS_upload( sressearchsselfsREQUESTsSESSIONsgroupspaths folder_namesimage_folder_namesPageTemplateFiles__of__s newtemplate(sselfs newtemplate((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd4ks+, cs,xyztdƒi|ƒ}{|ƒSdS(sADD INDEX.METAs%products/OSA_system/OSAS_add_metadataN(sPageTemplateFiles__of__sselfs newtemplate(sselfs newtemplate((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysadd5xscs¥}~t|idƒ}tii|iidƒd|d<tii|iidƒd|d<‚d|d<ƒ|iid |_„||iid <…||_ †|iid |_‡d |_ ˆxL|ii ƒDˆ]8}‰|i d |d|i|d|d|_ qÞW‹t dƒi|ƒ}Œd|_|ƒ}Ž|iiidƒo|iidd}n$‘|i dd|i dd}“t|dƒ}”|i|ƒ•|iƒ–ti|dƒ—|iiidƒo3š|iii|idd|iidƒSnptid|i dƒidƒ|_žt dƒi|ƒ}¡d|_¢|iii ddƒ¥|ƒSdS(Ns QUERY_STRINGspathis archive-pathis folder_namesscanned documents content-typesreftypes add_metadatasmetadatasss 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.pysadd6}s:''    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 xmlvorschlags0/usr/local/mpiwg/Zope/Extensions/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}nLÛ|idi }Ü|ii di ƒ|_Þd}ß|id|_ày"át i |id|iƒWn âãnXädG|GHåt|id|id|d ƒ}æ|i|iƒç|iƒèt i|id|id ƒét i|id|id|d ƒêt|i|i|id ƒì|iiid |iƒSdS(sadd presentation s folder_namescontent_descriptionspaths fileuploadsxmltextsinfo.xmls/sNAME:swiíi¤s presentationsstorefiles?path=N(sselfsREQUESTs folder_namescontent_descriptionsSESSIONspathshas_keysxmlinfos file_namesfilenamesformsreadsossmkdirsopensfswritescloseschmodsaddDirsToIndexMetasRESPONSEsredirect(sselfs file_namesf((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_namesspaths(/usr/local/mpiwg/Zope/Extensions/addTextN(sselfsREQUESTsSESSIONspathsPageTemplateFiles__of__s newtemplate(sselfspaths newtemplate((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddTextîs csgõö|id|_ø|id|_ù|iid|_ú|idi|_û|iidi ƒ|_ üt i |id|iƒýt |id|id|idƒ}þ|i|i ƒÿ|iƒt i|id|idƒt i|id|id|idƒt|i|i|id ƒ|iiid |iƒSdS( Ns folder_namescontent_descriptionspaths fileuploads/swiíi¤sfulltextsstorefiles?path=(sselfsREQUESTs folder_namescontent_descriptionsSESSIONspathsfilenames file_namesformsreadsfilesossmkdirsopensfswritescloseschmodsaddDirsToIndexMetasRESPONSEsredirect(sselfsf((sN/Users/dwinter/install/CVSZOPE/Zope/lib/python/Products/OSA_system/OSAS_add.pysaddText2õs+ !,csNyI ti|ƒiƒ}  d} x| D ]} ||}q7WWn d|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!|ƒ*|i!| ƒ,|idƒ}-|idƒ}.|i!|ƒ/|i!|ƒ1|i!|ƒ3t|d dƒ} 4| i|i'ƒi(dƒƒ5| iƒ8tiii|d ƒ}9|idƒd };y<|idƒd }Wn=>dSnXAyTB|idƒ}Dt|ƒd j o'E|i*|d ƒ} F| i,ƒnWn GHnXJ|idƒ}K|i|d|ƒ}L|i!|ƒM|i!|ƒPt|d dƒ} Q| i|i'ƒi(dƒƒR| iƒUtid|ƒiƒGHWd|d|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=%ssDONE:N(/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.pysaddTextExternals|  & #   csVYZ|dd!}[|GH\y]tid|ƒ}Wn^_dSnX`dSdS(Nii s .*