version 1.307, 2009/05/06 07:53:46
|
version 1.311, 2011/11/03 11:05:25
|
Line 57 import Ft.Xml.XPath
|
Line 57 import Ft.Xml.XPath
|
import cStringIO |
import cStringIO |
|
|
import sys |
import sys |
|
import logging |
|
|
try: |
try: |
from psycopg import libpq |
from psycopg import libpq |
Line 701 class ECHO_collection(CatalogAware, Fold
|
Line 702 class ECHO_collection(CatalogAware, Fold
|
|
|
path="/mpiwg/online/permanent/shipbuilding" |
path="/mpiwg/online/permanent/shipbuilding" |
|
|
|
def getSection(self, crumbs=None): |
|
"""returns the current section name""" |
|
# use breadcrumbs if available |
|
if crumbs is not None and len(crumbs) > 0: |
|
return crumbs[0][2].getId() |
|
|
|
p = self |
|
|
|
sec = None |
|
# descend parents to the root (and remember the last id) |
|
while p is not None and p.meta_type != 'ECHO_root' and p.meta_type!='ECHO_main' and p.meta_type!='ECHO_nav': |
|
sec = p.getId() |
|
p = p.aq_parent |
|
|
|
return sec |
|
|
|
def getSubSection(self, crumbs=None): |
|
"""returns the current subsection name""" |
|
# use breadcrumbs if available |
|
if crumbs is not None and len(crumbs) > 1: |
|
return crumbs[1][2].getId() |
|
|
|
p = self |
|
sec = None |
|
subsec = None |
|
# descend parents to the root (and remember the last id) |
|
while p is not None and p.meta_type != 'ECHO_root' and p.meta_type!='ECHO_main' and p.meta_type!='ECHO_nav': |
|
subsec = sec |
|
sec = p.getId() |
|
p = p.aq_parent |
|
|
|
return subsec |
|
|
|
|
def exportImportObjects_html(self,RESPONSE): |
def exportImportObjects_html(self,RESPONSE): |
"""ImportObject""" |
"""ImportObject""" |
Line 1003 class ECHO_collection(CatalogAware, Fold
|
Line 1037 class ECHO_collection(CatalogAware, Fold
|
pass |
pass |
return ret |
return ret |
|
|
def importCollection(self,path=None,RESPONSE=None): |
def importCollection(self,path=None,viewerUrl=None,metaDataUrl=None,replacePathPermanent=None,replacePathExperimental=None,RESPONSE=None): |
"""liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" |
"""liest verzeichnisse aus dem pfad und legt sie dann als objekte in den ordner""" |
|
|
if path is None: |
if path is None: |
Line 1016 class ECHO_collection(CatalogAware, Fold
|
Line 1050 class ECHO_collection(CatalogAware, Fold
|
|
|
if fileName: |
if fileName: |
|
|
tempPath=re.sub("/mpiwg/online","",path) |
if (replacePathExperimental and replacePathExperimental!=''): |
link="http://echo.mpiwg-berlin.mpg.de/zogilib_book?fn="+tempPath+"/"+fileName+"/pageimg" |
path=re.sub(replacePathExperimental,"/mpiwg/online/experimental",path) |
|
|
|
if (replacePathPermanent and replacePathPermanent!=''): |
|
path=re.sub(replacePathPermanent,"/mpiwg/online/permanent",path) |
|
|
|
link=viewerUrl%(path+"/"+fileName+"/pageimg") |
|
|
metalink=self.path+"/"+fileName+"/index.meta" |
metalink=metaDataUrl+"/"+path+"/"+fileName+"/index.meta" |
try: |
try: |
|
|
#link="http://nausikaa2.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.x.cgi?dir="+fileName+"&step=thumb" |
#link="http://nausikaa2.mpiwg-berlin.mpg.de/cgi-bin/toc/toc.x.cgi?dir="+fileName+"&step=thumb" |
|
|
newObj=ECHO_resource(fileName,link,metalink,fileName,fileName,fileName,'generated','book','','','','','','') |
newObj=ECHO_resource(fileName,link,metalink,fileName,fileName,fileName,'','book','','','','','','') |
self._setObject(fileName,newObj) |
self._setObject(fileName,newObj) |
|
|
genObj=getattr(self,fileName) |
genObj=getattr(self,fileName) |
Line 1467 class ECHO_collection(CatalogAware, Fold
|
Line 1506 class ECHO_collection(CatalogAware, Fold
|
|
|
def showOverview(self): |
def showOverview(self): |
"""overview""" |
"""overview""" |
|
# ECHO_overview.html template for this instance |
if 'ECHO_overview.html' in self.__dict__.keys(): |
if 'ECHO_overview.html' in self.__dict__.keys(): |
return getattr(self,'ECHO_overview.html')() |
return getattr(self,'ECHO_overview.html')() |
|
|
|
# ECHO_overview_main template in path |
|
if hasattr(self, 'ECHO_overview_main'): |
|
return getattr(self, 'ECHO_overview_main')() |
|
|
|
# template from product |
pt=zptFile(self, 'zpt/ECHO_content_overview.zpt') |
pt=zptFile(self, 'zpt/ECHO_content_overview.zpt') |
return pt() |
return pt() |
|
|
Line 1815 class ECHO_userFolder(UserFolder):
|
Line 1861 class ECHO_userFolder(UserFolder):
|
return 1 |
return 1 |
return 0 |
return 0 |
|
|
Globals.default__class_init__(ECHO_userFolder) |
# ROC: problem with 2.12 |
|
#Globals.default__class_init__(ECHO_userFolder) |
|
|
|
|
|
|
Line 1890 class ECHO_root(Folder,Persistent,Implic
|
Line 1937 class ECHO_root(Folder,Persistent,Implic
|
) |
) |
|
|
|
|
|
|
|
|
def getECHORootURL(self): |
def getECHORootURL(self): |
return self.absolute_url() |
return self.absolute_url() |
|
|