m .Ec@shdZdkZdkZdkZdklZdklZdklZdk l Z dk Z dk Z dk ZdkZdkZdk lZdklZdklZd klZd klZd klZd k lZd klZdklZdk l!Z!dk"l#Z#dk$l%Z&l'Z'dk(l)Z)dk*Z*dk+Z+dk,Z,dk-l-Z-dk.l/Z/dk+l0Z0edZ1de i2e,i3e*i*ei4i4e-fdYZ5ee5de i6fdYZ7dZ8dfdYZ9dZ:dZ;dZ<d d!d"Z=d#Z>d d!d$Z?d%Z@d&ZAd'ZBd(ZCe:d d)ZDdS(*sRApplication support $Id: Application.py 71171 2006-11-18 10:13:25Z andreasjung $ N(s getLogger(sescape(sStringIO(swarn(sInitializeClass(sClassSecurityInfo(s UserFolder(saq_base(sApplicationManager(sgetConfiguration(s doInstall(sProductContext(sDateTime(sHelpSys(s NullResource(sRedirects Forbidden(s implements(s FindSupport(s IApplication(sMisc_t ApplicationcBstZdZeeeZdZd&ZdZ dZ dZ e dZ e iZe i Z d'ZeZd ZeZd ZdZdZdZdZdZeZZedZdZeZei ddZ!dZ"dZ#eZ$e!Z%ddZ&dZ'dZ(dZ)dZ*ei+dddZ,ei+d d!Z-ei+d"d#Z.ei+d$d%Z/RS((sTop-level system objecttZopetManagert AnonymoustOwnertGETiitHelpSyst Control_Paneltbrowser_id_managert temp_foldert index_htmlcCs\t}||_|id|t}|i|id|ti i ddS(Nt acl_usersRsCreated Zope Application( t UserFoldertuftselft__allow_groups__t _setObjecttApplicationManagertcplt_initt transactiontgettnote(RRR ((t./data/zmath/zope/lib/python/OFS/Application.pyt__init__Xs    cCs(y|iddSWn|iSnXdS(Nt SCRIPT_NAMEi(RtREQUESTttitle(R((RtiddscCs|iS(N(RR(R((Rt title_and_idhscCs|iS(N(RR(R((Rt title_or_idkscCst|dS(N(tInitializeClassR(R((Rt__class_init__nscCs:|iddjo t|ntd||fdS(s3Utility function to allow user-controlled redirectss//is%s/%sN(t destinationtfindtRedirectExceptiontURL1(RR!R$((RtPrincipiaRedirectqs cCsyt||SWntj onXy ||SWntj onX|idd}|djot|||i |Sny|i i d||fWntj ot|nXdS(NtREQUEST_METHODRtPOSTs%s %s(RR'( tgetattrRtnametAttributeErrortKeyErrorRRtmethodt NullResourcet__of__tRESPONSEt notFoundError(RRR)R,((Rt__bobo_traverse__ys  cGs tt|S(s,Utility function to return current date/timeN(tapplytDateTimetargs(RR4((Rt PrincipiaTimestZopeAttributionButtoncCsdt|iidS(soReturns an HTML fragment that displays the 'powered by zope' button along with a link to the Zope site.sPowered by ZopeiN(tescapeRRtBASE1(R((RR6scCs|i||tddS(sDelete a resource object.s This resource cannot be deleted.N(Rt dav__initRR/t Forbidden(RRR/((RtDELETEscCs|i||tddS(s"Move a resource to a new location.sThis resource cannot be moved.N(RR9RR/R:(RRR/((RtMOVEscCsB|odSny|idSWnttfj o dSnXdS(s=The absolute URL of the root object is BASE1 or "/". tR8t/N(trelativeRRR*R+(RR?((Rt absolute_urlscCs:y|idpdSWnttfj o dSnXdS(sFThe absolute URL path of the root object is BASEPATH1 or "/". t BASEPATH1R>N(RRR*R+(R((Rtabsolute_url_paths cCsdS(s:The virtual URL path of the root object is empty. R=N((R((Rtvirtual_url_pathscCs|S(N(R(R((RtgetPhysicalRootscCsdS(s%Get the physical path of the object. Returns a path (an immutable sequence of strings) that can be used to access this object again later, for example in a copy/paste operation. getPhysicalRoot() and getPhysicalPath() are designed to operate together. R=N(R=((R((RtgetPhysicalPathstfixupZClassDependenciescCs@|i} d}|o*dkl}|| idWq|o!t@iAd|dtBiCnt;i<|oqqXndS(NRxis __init__.pys __init__.pycs __init__.pyos Products.%sRRRs__init__.py of %s has a long deprecated '__ac_permissions__' attribute. '__ac_permissions__' will be ignored by install_product in Zope 2.11. Please use registerClass instead.RiRs__init__.py of %s has a long deprecated 'meta_types' attribute. 'meta_types' will be ignored by install_product in Zope 2.11. Please use registerClass instead.tactionR!R\tGlobalt visibilityRMs __init__.py of %s has a long deprecated 'methods' attribute. 'methods' support might be removed in Zope 2.11 or a later feature release. Please use the 'legacy' argument of registerClass instead if the methods are constructors. Or refactor the product using adapters.it __roles__sInstalled product sCouldn't install %sRN(s__doc__(sManager(ERRRR RRR RRRRRt__traceback_info__RR\tpgetattrRt isinstanceRtMisc_RRRRtinitializeProductRt productObjecttProductContexttcontextRet initmethodt permissionstnew_permissionsRmRwtDeprecationWarningR RR!R"tdefaultR)RRWRRRRRRR^R,RfRtsetattrRR]RRRRRRRRhRqRnRNR(RRRRRRRRR1RR"RR/RR\R!RR,R'R0RR R)R3R,R RRR.((RRs                  %    &   c Cst|ddodSndkl}tiitit d}d}xgti |D]V}tii|\}}|djoYti||}|}t||oq_n|idid|dt|in|djo\|||d |}t||oq_n|id id|d ddt|ind|djoSt||oq_n|idid|d ddttii||nq_d}q_W|o*d|_tiidtindS(Nt!_standard_objects_have_been_addedi(sPageTemplateFiletstandards.dtmltOFSPRtfiles.pts.zptRwt PageTemplatesRR=ttexts.icos.gifs.pngisInstalled standard objects(s.pts.zpt(s.icos.gifs.png( R(Rt'Products.PageTemplates.PageTemplateFiletPageTemplateFileRRRRt package_homeR tstd_dirtwroteRtfntsplitextRdtexttDTMLFileRbRftmanage_addProducttmanage_addDTMLMethodtopentrawtmanage_addPageTemplatetfilenametmanage_addImageR5RRRR(RR>RBRbR<RdR@R?((RR`s: ! * 0 <  c Cst}g}tiidtixhtiD]]}t i |}|i ||jo1t|t|||||ddddPq6q6Wtit|t_ttidS(NsPrior to product reinstallRiRi(RRRRRRRRYRRRRRRRtremoveProductMetaTypesRRRRR(RRRRRR((Rtreinstall_products       cCs\xUtiD]J}ti|}|i||jot||ddddPq q WdS(NRiRi( RYRRRRRRRR(RRR((Rtreimport_products    cCstti}g}d}x>|D]6}|idd|jo d}q|i|qW|ot |t_ndS(s8Unregisters the meta types registered by a product. iR\iN( RYRtnew_mtstchangedRRRetpidRR(RPRORRRN((RRKs  cCs| o!t||ot||Snt|do.|i}t||ot||Sqgn|tj o|Snt|dS(NR(RRfR\R)R(R3RR*(R\R)R3R((RR(s  (ERxRRnRtloggingt getLoggertcgiR7RtwarningsRmRRYt App.ProductRtApp.ProductRegistryRRt AccessControlR{tAccessControl.UserR t AcquisitionRctApp.ApplicationManagerRt App.configRRtApp.ProductContextR-R3tHelpSys.HelpSysRtwebdav.NullResourceR-t zExceptionsRR#R:tzope.interfaceRyRRtZDOMt FindSupportt interfacesRzR*RhtApplicationDefaultPermissionstRoottProductRegistryRt PersistentRRRRRRRRRRRLRMRKR((/RRhRKR-RR3RRR7RRRRRR-R RLRRaRRRcRRbR{RMRR(RmR#RYRRRyRnR*RRRRRRRRRzRRR:((Rt?sX    $                    1  +   *  )