- ?cs&dklZdklZdklZdklZdkl Z dk l Z dk Z dk Z  dkZ  dkZ dkZ dZdeeefd YZyd Z~eed Zd eeefd YZndZsedZdS((sFolder(s SimpleItem(s Persistent(sImplicit(sPageTemplateFile(s PageTemplateNcsX d}x;|D]0}|i|ijo||i}nqW|SdS(Ns(srcsnodelistsnodesnodeTypes TEXT_NODEsdata(snodelistsnodesrc((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysgetText s   s ImageDigilibcstZdZdZdddddddgZeihd d <d d ||_?||_dS(N(sidsselfsfilenamestitlesmeta(sselfsidsfilenamesmeta((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys__init__;s   csABC|iSdS(sausgabe der metadatenN(sselfsmeta(sself((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysgetMetaAscsEFH|d|i}I|i}Jt|d}K|i|L|iMt i |dNt i d|i dS(supload an Image from an Requasts/swismssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &N(s path_names fileuploadsfilenamesreadsfiledatasopensfswritesclosesosschmodspopensselfsImageViewerPath(sselfs fileuploads path_namesfsfiledatasfilename((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys uploadImageEs cs?TUVd|id|id}Y|iii|SdS(sdownloadsDhttp://nausikaa2.rz-berlin.mpg.de/digitallibrary/servlet/Scaler/?fn=s/s&mo=rawfile,highresN(sselfsImageViewerPathsfilenamespathsREQUESTsRESPONSEsredirect(sselfspath((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysdownloadTscs{[\]tii|idd}hd|id|}id||iid<jt di |}k|SdS( s show thumbis.jpgs/mpiwg/online/s/s#sstringsProducts/ImageArchive/thumb.zptN( sosspathssplitextsselfsfilenames thumbnamesImageViewerPathsREQUESTsSESSIONsPageTemplateFiles__of__spt(sselfspts thumbnamespath((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysthumb[s  cs;mnsd|id|i}v|iii|SdS(s show images#http://localhost:8080/mpiwg/online/s/N(sselfsImageViewerPathsfilenamespathsREQUESTsRESPONSEsredirect(sselfspath((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys index_htmlms(s__name__s __module__s__doc__s meta_typesleiden_meta_fieldssFoldersmanage_optionssNones addMetaObjectsaddMetaObjectForms__init__sgetMetas uploadImagesdownloadsthumbs index_html(((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys ImageDigilibs %     cs,yz{tdi|}||SdS(s Nothing yets-Products/ImageArchive/AddImageDigilibForm.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysmanage_AddImageDigilibFormyscsx~t||i|}|i||t||i ||i |t j o|i dndS(sAdd ImageCollections manage_mainN(s ImageDigilibsids fileuploadsfilenamesmetasnewObjsselfs _setObjectsgetattrs uploadImagesImageStoragePathsRESPONSEsNonesredirect(sselfsids fileuploadsmetasRESPONSEsnewObj((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysmanage_AddImageDigilib~s sImageCollectionc stZdZdZdZddddddd gZd Zd Zd Ze i hd d<ddd6Z)Cd7Z*Hd8Z+Md9Z,Sd:Z-Zd;Z.dd<Z/RS(=sSammelordner fr BildersImageCollections leiden_metasimage_idsdatescountrysplacespeoples descriptions photographershttp://fm-web.mpiwg-berlin.mpg.de:8050/FMRes/FMPJS?-db=Wissenschaftlerportraits.fp5&-layID=69&-token=25&-max=1&-format=formvwcss.htm&-mode=browse&images::filename=%s&-findcs(tid|idSdS(s scale thumbssmssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &sRESCALING STARTEDN(sosspopensselfsImageViewerPath(sself((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys scaleThumbsscsC||_||_||_||_||_dS(N(sidsselfstitlesImageStoragePathsImageViewerPathsdefaultMetaString(sselfsidstitlesImageStoragePathsImageViewerPathsdefaultMetaString((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys__init__s     s Main ConfigslabelsImageCollection_configsactionsImports ImportFilessRecalculate MetadatasrecalculateMetasImport MetadatasimportMetaFormsRescale thumbss scaleThumbscs,tdi|}|SdS(simport metadatas$Products/ImageArchive/importMeta.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysimportMetaFormscs|i} tiii| }|i|} |i }xA| D]6}x:|iD],}t|i|di|i |tt| | ddd}|it| |nd} | |i d<yWt|| }|idi| } t|| }|ii i!|Wn nXqUWdSdS( simportisimage_idssleiden_meta_data_filesids ImageMetaDatasOKN("s fileuploadsreadsfiledatasxmlsdomsminidoms parseStringsgetElementsByTagNamestagsrowssselfsREQUESTsrequestsrowsleiden_meta_fieldssasgetTexts childNodessimage_idshasattrsImageCollectionsstrsnewObjs _setObjectsidsgetattrsaddIDsmanage_addProductsleiden_meta_adds objectCreatesobjspropertysheetssmetasmanage_editProperties(sselfs fileuploadstagsasobjsdomsaddIDsrequestsnewObjsimage_idsrowss objectCreatesfiledatasidsrow((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys importMetas0   *!  cs|i}|iidoC|id}y|i|}Wnd}nXn d}|t |djo dSn[|o*d|i dd||ddSn'd|i dd ||ddSd S( sshow nextimagesfilenameiiss next images ?filename=N( sselfs show_thumbssidssrequestsSESSIONshas_keysfilenamesindexsnrslensselectedsREQUEST(sselfsrequestsselectedsfilenamesnrsids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys nextImages   *cs|i}|iidoC|id}y|i|}Wnd}nXn d}|djo dSn[|o*d|i dd||ddSn'd|i dd ||ddSd S( sshow nextimagesfilenameiss previous images ?filename=N( sselfs show_thumbssidssrequestsSESSIONshas_keysfilenamesindexsnrsselectedsREQUEST(sselfsrequestsselectedsfilenamesnrsids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys prevImages   *cs|i|SdS(surl der metadatenN(sselfsdefaultMetaStringsfilename(sselfsfilename((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys meta_defaultscsVt||ott|||Sn |djod|SndS(NstitlesMissing Image:%s(shasattrsselfsidsgetattrsattr(sselfsidsattr((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysgetThumbAttributescs:t||o tt|||SndS(N(shasattrsselfsidsgetattrsattr(sselfsidsattr((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysgetThumbFunctionsc s  ti|}ti|i}tiii |}|i d}g}xN|D]C}t|i}|dj o|it|nqmW|i||iid<tdi|}|SdS(s Anzeige von ausgewaehlten thumbss imagenamess filenamess+Products/ImageArchive/overview_selected.zptN(surllibsunquotesurlsurlopensreadsxmldocsxmlsdomsminidoms parseStringsgetElementsByTagNamesimagessrcsimagesgetTexts childNodesstextsappendsstrssortsselfsREQUESTsSESSIONsPageTemplateFiles__of__spt( sselfsurlsptsdomstextsimagesxmldocsrcsimages((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysxmlinput s   cs "xo|iD"]a}#t||}$t|do6&|idjo'|i|i|_ nnqW(dSdS(srecalculate the metadatas meta_types ImageDigilibsOKN( sselfs__dict__sentryidsgetattrsentryshasattrs meta_types meta_defaultsgetIdsmeta(sselfsentrysentryid((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysrecalculateMetas 'cs,*+,tdi|}-|SdS(s Add an Images"Products/ImageArchive/addImage.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysaddImage*scs/03|o64y5|i|i}Wn67t}nXn 9t};t||i|d|<|i |i dd|iSdS(sAddsmetasURL1s/N( s use_defaultsselfs meta_defaults fileuploadsfilenamesmetasNonesmanage_AddImageDigilibsRESPONSEsredirectsREQUEST(sselfs fileuploadsmetas use_defaultsRESPONSE((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys addImage2/s  cs?@Ati|i}Bd}Dx|DD]}E|ddj oF|ii|oH|d|d}nPJ|d|d}K|i |}Lt |||}O|i ||nq.WStid|iT|idd S( s%Import the existing files of a foldersis.s
s already exists!s created!smssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &s manage_mainN(sosslistdirsselfsImageStoragePathsfilessretsfiles__dict__shas_keys meta_defaultsmetas ImageDigilibsnewObjs _setObjectspopensRESPONSEsredirect(sselfsRESPONSEsfilessmetasfilesretsnewObj((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys ImportFiles2?s  csVWXti|i}Yd}[x|D[]}\|ddj o]|ii|o_|d|d}nRa|d|d}bt ||}eyf|i ||Wn ghnXnq.Wlti d|im|idd S( s%Import the existing files of a foldersis.s
s already exists!s created!smssh nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/small 100 &s manage_mainN(sosslistdirsselfsImageStoragePathsfilessretsfiles__dict__shas_keys ImageDigilibsnewObjs _setObjectspopensRESPONSEsredirect(sselfsRESPONSEsfilessfilesretsnewObj((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys ImportFilesVs   csPopqt|d ord|_nttdi|}u|SdS(s Nothing yetsdefaultMetaStringss3Products/ImageArchive/ChangeImageCollectionForm.zptN(shasattrsselfsdefaultMetaStringsPageTemplateFiles__of__spt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysImageCollection_configos cs^wxy||_z||_{||_|||_~|tj o|idndS(sChanges manage_mainN(stitlesselfsImageStoragePathsImageViewerPathsdefaultMetaStringsRESPONSEsNonesredirect(sselfstitlesImageStoragePathsImageViewerPathsdefaultMetaStringsRESPONSE((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysChangeImageCollectionws    cs|iidSdS(Ns filenames(sselfsREQUESTsSESSION(sself((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysshow_selected_thumbsscsng}xD|iD]6}tt||do|i|nqW|i|SdS(Nsthumb(sidssselfs__dict__sentryshasattrsgetattrsappendssort(sselfsentrysids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys show_thumbss   csh|i}|o&d|idd|ddSn#d|idd|ddSdS(Ns first setss ?filename=(sselfs show_thumbssidssselectedsREQUEST(sselfsselectedsids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys firstSetss &cs|i}|i}|do#t||d|d}n d}|djo d}n|o&d|idd||dSn#d|idd||dSdS( Niis last sets ?filename=s" target="_top">last sets( sselfs show_thumbssidssgetColTimesRowscolRowsslensnrsselectedsREQUEST(sselfsselectedscolRowssnrsids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pyslastSetss#   &csV|i}|i}|do |iiido|iid}yS|i ||d|d}|t |jot |d}nWnd}nXn d}|t |djo dSnS|o&d|idd||dSn#d|idd ||dSnd S( sshow nextimageisfilenameiss next sets ?filename=N( sselfs show_thumbssidssgetColTimesRowscolRowssREQUESTsSESSIONshas_keysfilenamesindexsnrslensselected(sselfsselectedscolRowssidssnrsfilename((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysnextSetss$"   &csL|i}|i}|do|iiidos|iid}yC|i ||d|d}|djo d}nWnd}nXn d}|i |djo dSnS|o&d|idd||dSn#d|idd ||dSndSd S( sshow nextimageisfilenameiss previous setss ?filename=N( sselfs show_thumbssidssgetColTimesRowscolRowssREQUESTsSESSIONshas_keysfilenamesindexsnrsselected(sselfsselectedscolRowssidssnrsfilename((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysprevSetss&"   &&css|i}||iid<tt||d}t ||iid<t |dSdS(sAusgabe anzahlsidsisnumberN( sselfsshow_selected_thumbssidssREQUESTsSESSIONsintslensnumberOfColumnssnumbersrange(sselfsnumberOfColumnssnumbersids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysshow_thumbs_selected_rowss cs,tdi|}|SdS(sform for matrix settings+Products/ImageArchive/selectColTimesRow.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pyssetColTimesRowFormscs,tdi|}|SdS(sdones,Products/ImageArchive/changedColTimesRow.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pyssetDonescsZ|ii}|id||id||i|idddS(sset coltimes rowsImageViewerRowssImageViewerColssURL1s/setDoneN(sselfsREQUESTsRESPONSEs setCookiesrowsscolssredirect(sselfscolssrowssRESPONSE((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pyssetColTimesRows cs|i}|iido7yt|id}Wnt}nXn t} |iido- dG|idGH t|id}n  d}|G|GH||fSdS(NsImageViewerRowssImageViewerColssCOLSi(sselfsREQUESTscookiesshas_keysintsrowssNonescols(sselfsrowssREQUESTscols((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysgetColTimesRows    c s|i}|iiidoA|iid} y | }Wn|d}nXn|d}!dG|GH#|o7$|i |}%|||}&|||!}n (|}+||iid<,tt||d}.t|dSdS(sAusgabe anzahlsfilenameisNOR:sidsiN(sselfs show_thumbssidsAllsREQUESTsSESSIONshas_keysfilenamesstartIds numberOfRowssindexsstartPicsnumberOfColumnssendPicsidssintslensnumbersrange( sselfsnumberOfColumnss numberOfRowssstartIdsidsAllsnumbersstartPicsidssendPicsfilename((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysshow_thumbs_rowss$     csq012|iid}3t|}4|||jo5||d|||!Sn7||d|SdS(sAusgabe einer Liste der ReihesidsiN(sselfsREQUESTsSESSIONsidsslensmaxsrowsnumberOfColumns(sselfsrowsnumberOfColumnssmaxsids((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysshow_thumbs_columns0s cs,9:;tdi|}<|SdS(smain template collections'Products/ImageArchive/thumbselected.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysthumblistSelected_old9scs,>?@tdi|}A|SdS(smain template collections(Products/ImageArchive/thumbselected2.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysthumblistSelected>scs,CDEtdi|}F|SdS(smain template collections Products/ImageArchive/thumbs.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys thumblist_oldCscs,HIJtdi|}K|SdS(smain template collections Products/ImageArchive/thumb2.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys thumblistHscs,MNPtdi|}Q|SdS(s navigations-Products/ImageArchive/navigation_selected.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysnavig_selected_htmlMscs,STVtdi|}W|SdS(s navigations$Products/ImageArchive/navigation.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys navig_htmlSscsrZ[\|iido]|id}n _d}`||iid<atdi|}b|SdS(sshow only selectedsfilenamess,Products/ImageArchive/overview_selected2.zptN(sselfsREQUESTshas_keysfilensSESSIONsPageTemplateFiles__of__spt(sselfsfilenspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys selectionZs csrdef|iidog|id}n id}j||iid<ktdi|}l|SdS(smain template collectionsfilenamess"Products/ImageArchive/overview.zptN(sselfsREQUESTshas_keysfilensSESSIONsPageTemplateFiles__of__spt(sselfsfilenspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys index_htmlds (0s__name__s __module__s__doc__s meta_typesgenericMetaDataTypesleiden_meta_fieldssdefaultMetaStrings scaleThumbss__init__sFoldersmanage_optionssimportMetaForms importMetasNones nextImages prevImages meta_defaultsgetThumbAttributesgetThumbFunctionsxmlinputsrecalculateMetasaddImages addImage2s ImportFiles2s ImportFilessImageCollection_configsChangeImageCollectionsshow_selected_thumbss show_thumbss firstSetsslastSetssnextSetssprevSetssshow_thumbs_selected_rowsssetColTimesRowFormssetDonessetColTimesRowsgetColTimesRowsshow_thumbs_rowssshow_thumbs_columnssthumblistSelected_oldsthumblistSelecteds thumblist_olds thumblistsnavig_selected_htmls navig_htmls selections index_html(((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysImageCollectionsX     y  "                   cs,noptdi|}q|SdS(s Nothing yets0Products/ImageArchive/AddImageCollectionForm.zptN(sPageTemplateFiles__of__sselfspt(sselfspt((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysmanage_AddImageCollectionFormnscs\stut|||||}v|i||x|t j oy|i dndS(sAdd ImageCollections manage_mainN( sImageCollectionsidstitlesImageStoragePathsImageViewerPathsdefaultMetaStringsnewObjsselfs _setObjectsRESPONSEsNonesredirect(sselfsidstitlesImageStoragePathsImageViewerPathsdefaultMetaStringsRESPONSEsnewObj((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pysmanage_AddImageCollectionss (s OFS.FoldersFoldersOFS.SimpleItems SimpleItemsGlobalss Persistents AcquisitionsImplicits'Products.PageTemplates.PageTemplateFilesPageTemplateFiles#Products.PageTemplates.PageTemplates PageTemplatesresossos.pathsurllibsxml.dom.minidomsxmlsgetTexts ImageDigilibsmanage_AddImageDigilibFormsNonesmanage_AddImageDigilibsImageCollectionsmanage_AddImageCollectionFormsmanage_AddImageCollection(sxmls ImageDigilibsresImageCollections PersistentsgetTextsurllibs SimpleItemsmanage_AddImageCollectionFormsPageTemplateFilesmanage_AddImageCollectionsmanage_AddImageDigilibsFolders PageTemplatesossImplicitsmanage_AddImageDigilibForm((sX/Users/dwinter/install/CVSZOPE/Zope_old/lib/python/Products/ImageArchive/ImageArchive.pys?s$      b