--- ECHO_content/ECHO_collection.py 2004/12/02 20:11:49 1.199
+++ ECHO_content/ECHO_collection.py 2005/01/21 17:32:09 1.205
@@ -74,7 +74,7 @@ regexpPage = re.compile(patternPage, re.
-def setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight,coordstrs="",viewClassification=""):
+def setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight,coordstrs=""):
"""Allegemeine Informationen zu einer ECHO Collection"""
@@ -151,8 +151,6 @@ class ECHO_layoutTemplate(ZopePageTempla
def __init__(self, id, text=None, content_type=None,EchoType=None):
self.id = str(id)
-
-
self.ZBindings_edit(self._default_bindings)
if text is None:
self._default_content_fn = os.path.join(package_home(globals()),
@@ -160,9 +158,6 @@ class ECHO_layoutTemplate(ZopePageTempla
text = open(self._default_content_fn).read()
self.pt_edit(text, content_type)
-
- """change form"""
-
def manage_addECHO_layoutTemplateForm(self):
"""Form for adding"""
@@ -263,7 +258,7 @@ class ECHO_resource(Folder,Persistent,EC
security=ClassSecurityInfo()
meta_type='ECHO_resource'
- viewClassificationList=viewClassificationListMaster
+# viewClassificationList=viewClassificationListMaster
getSubCols = ECHO_helpers.getSubCols
@@ -665,11 +660,11 @@ class ECHO_resource(Folder,Persistent,EC
"""template fuer content"""
return ECHO_basis.content_html(self,'resource')
- def getViewClassification(self):
- if hasattr(self,'viewClassification'):
- return self.viewClassification
- else:
- return ""
+# def getViewClassification(self):
+# if hasattr(self,'viewClassification'):
+# return self.viewClassification
+# else:
+# return ""
def getFullTextXML(self,noredirect=None):
"""getFullTextXML; gives the FullText as an XML Document, and if somthing goes wrong."""
@@ -823,7 +818,7 @@ class ECHO_resource(Folder,Persistent,EC
coordsnew=[]
self.coords=coordsnew
- self.viewClassification=""
+# self.viewClassification=""
@@ -1005,7 +1000,7 @@ class ECHO_resource(Folder,Persistent,EC
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
return writeMetadata(self.metalink,self.metaDataHash)
- def changeECHO_resource(self,metalink,link,title,label,description,contentType,responsible,weight,viewClassification="",coords=None,credits=None,RESPONSE=None):
+ def changeECHO_resource(self,metalink,link,title,label,description,contentType,responsible,weight,coords=None,credits=None,RESPONSE=None):
"""Aenderung der Properties"""
setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight)
@@ -1107,7 +1102,9 @@ class ECHO_resource(Folder,Persistent,EC
retdata={}
fields=[]
fieldlist=self.standardMD.fieldList
-
+
+ tags=self.findTagsFromMapping(self.contentType)
+ self.referencetypes=tags[2]
for referenceTypeF in self.referencetypes:
if referenceTypeF[1].title.lower() == referenceType.lower():
@@ -1429,7 +1426,7 @@ class ECHO_collection(Folder, Persistent
security=ClassSecurityInfo()
meta_type='ECHO_collection'
- viewClassificationList=viewClassificationListMaster
+# viewClassificationList=viewClassificationListMaster
displayTypes=displayTypes
path="/mpiwg/online/permanent/shipbuilding"
@@ -1741,11 +1738,11 @@ class ECHO_collection(Folder, Persistent
"""nothing"""
return retStr
- def getViewClassification(self):
- if hasattr(self,'viewClassification'):
- return self.viewClassification
- else:
- return ""
+# def getViewClassification(self):
+# if hasattr(self,'viewClassification'):
+# return self.viewClassification
+# else:
+# return ""
def createRessourcesFromXMLForm(self):
@@ -1797,29 +1794,32 @@ class ECHO_collection(Folder, Persistent
except:
return ""
- def getCollectionTreeXML(self):
+ def getCollectionTreeXML(self,pwstr=None):
"""Tree as XML"""
- def addPassWd(str):
+ def addPassWd(str,pwstr=None):
"""adds a user/passwd to an url"""
- txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str)
+ if pwstr:
+ txt2=re.sub(r"(http://)(.*?)","\g<1>%s@\g<2>"%pwstr,str)
+ else:
+ txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str)
return txt2
- def getCollection(object,depth=0):
+ def getCollection(object,depth=0,pwstr=None):
depth+=1
collections=""
for entry in object.__dict__.keys():
element=getattr(object,entry)
try:
if element.meta_type in ["ECHO_collection","ECHO_group"]:
- collections+=""
+ collections+=""
collections+=getCollection(element,depth)+"\n"
except:
"""nothing"""
return collections
ret=""""""
- return ret+""+getCollection(self)+""
+ return ret+""+getCollection(self,pwstr=pwstr)+""
def createAllJSAreas(self):
"""create area calls for JavaScript"""
@@ -1927,7 +1927,7 @@ class ECHO_collection(Folder, Persistent
security.declarePublic('changeECHO_collection')
- def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",viewClassification=None,location=None,isAlwaysClickable=None):
+ def changeECHO_collection(self,title,label,description,contentType,responsible,weight,secondaryLink,secondaryLinkTitle,credits=None,sortfield="weight",coords=None,RESPONSE=None,imageTag="",bgcolour="",location=None,isAlwaysClickable=None):
"""Aenderung der Properties"""
self.secondaryLink=secondaryLink
@@ -2030,10 +2030,10 @@ class ECHO_collection(Folder, Persistent
def getAllMapAreas(self):
"""Give list of coordinates"""
- subColTypes=['ECHO_collection','ECHO_resource']
+ mapColTypes=['ECHO_collection','ECHO_resource']
areas=[]
- for entrySearch in self.ZopeFind(self,obj_metatypes=subColTypes):
- object=entrySearch[1]
+ for entry in self.getSubCols(self,subColTypes=mapColTypes):
+ object=entry
areas.extend(object.getMapAreas())
return areas
@@ -2348,7 +2348,12 @@ class ECHO_root(Folder,Persistent,Implic
meta_type="ECHO_root"
- ###CDLI adds -> have to be removed
+ def getContentOverviewTemplate(self):
+ """produces overview template with macro"""
+ pt = zptObjectOrFile(self, 'content_overview_template')
+ return pt
+
+ ###Cdli adds -> have to be removed
def getTablet(self,item):
#print "getTablet"
try:
@@ -2361,6 +2366,11 @@ class ECHO_root(Folder,Persistent,Implic
###END CDLI add
+ def URLquote(self, text):
+ """urllib.quote fuer Michael"""
+ return urllib.quote(text)
+
+
def checkResource(self,id):
"""checks if a resource is in the tree, gives back none or list of resources"""
if hasattr(self,"_v_checkResource") and self._v_checkResource.has_key(id): #existiert ein cache und id ist bereits drin?