Diff for /ECHO_content/ECHO_collection.py between versions 1.200 and 1.209

version 1.200, 2004/12/06 17:48:39 version 1.209, 2005/02/07 18:29:07
Line 74  regexpPage = re.compile(patternPage, re. Line 74  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"""          """Allegemeine Informationen zu einer ECHO Collection"""
   
Line 151  class ECHO_layoutTemplate(ZopePageTempla Line 151  class ECHO_layoutTemplate(ZopePageTempla
     def __init__(self, id, text=None, content_type=None,EchoType=None):      def __init__(self, id, text=None, content_type=None,EchoType=None):
         self.id = str(id)          self.id = str(id)
   
   
   
         self.ZBindings_edit(self._default_bindings)          self.ZBindings_edit(self._default_bindings)
         if text is None:          if text is None:
             self._default_content_fn = os.path.join(package_home(globals()),              self._default_content_fn = os.path.join(package_home(globals()),
Line 161  class ECHO_layoutTemplate(ZopePageTempla Line 159  class ECHO_layoutTemplate(ZopePageTempla
         self.pt_edit(text, content_type)          self.pt_edit(text, content_type)
   
           
         """change form"""  
   
   
 def manage_addECHO_layoutTemplateForm(self):  def manage_addECHO_layoutTemplateForm(self):
     """Form for adding"""      """Form for adding"""
     pt=zptFile(self, 'zpt/AddECHO_layoutTemplate.zpt')      pt=zptFile(self, 'zpt/AddECHO_layoutTemplate.zpt')
Line 263  class ECHO_resource(Folder,Persistent,EC Line 258  class ECHO_resource(Folder,Persistent,EC
     security=ClassSecurityInfo()      security=ClassSecurityInfo()
     meta_type='ECHO_resource'      meta_type='ECHO_resource'
   
     viewClassificationList=viewClassificationListMaster  #    viewClassificationList=viewClassificationListMaster
   
     getSubCols = ECHO_helpers.getSubCols      getSubCols = ECHO_helpers.getSubCols
   
Line 665  class ECHO_resource(Folder,Persistent,EC Line 660  class ECHO_resource(Folder,Persistent,EC
         """template fuer content"""          """template fuer content"""
         return ECHO_basis.content_html(self,'resource')          return ECHO_basis.content_html(self,'resource')
           
     def getViewClassification(self):  #    def getViewClassification(self):
         if hasattr(self,'viewClassification'):  #        if hasattr(self,'viewClassification'):
             return self.viewClassification  #            return self.viewClassification
         else:  #        else:
             return ""  #            return ""
   
     def getFullTextXML(self,noredirect=None):      def getFullTextXML(self,noredirect=None):
         """getFullTextXML; gives the FullText as an XML Document, and <error></error> if somthing goes wrong."""          """getFullTextXML; gives the FullText as an XML Document, and <error></error> if somthing goes wrong."""
Line 823  class ECHO_resource(Folder,Persistent,EC Line 818  class ECHO_resource(Folder,Persistent,EC
             coordsnew=[]              coordsnew=[]
                   
         self.coords=coordsnew          self.coords=coordsnew
     self.viewClassification=""  #   self.viewClassification=""
   
   
   
Line 973  class ECHO_resource(Folder,Persistent,EC Line 968  class ECHO_resource(Folder,Persistent,EC
   
   
     def getMDValue(self,fieldName,empty=None):      def getMDValue(self,fieldName,empty=None):
         if empty:          if not empty:
             return self.metaDataHash.get(fieldName,'!!NOT USED HERE in Type: %s'%self.contentType)              return self.metaDataHash.get(fieldName,'!!NOT USED HERE in Type: %s'%self.contentType)
                   
         else:          else:
Line 1005  class ECHO_resource(Folder,Persistent,EC Line 1000  class ECHO_resource(Folder,Persistent,EC
         self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')          self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
         return writeMetadata(self.metalink,self.metaDataHash)          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"""          """Aenderung der Properties"""
                   
         setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight)          setECHO_collectionInformation(self,title,label,description,contentType,responsible,credits,weight)
Line 1070  class ECHO_resource(Folder,Persistent,EC Line 1065  class ECHO_resource(Folder,Persistent,EC
             if ret == "":              if ret == "":
                 return None                  return None
             else:              else:
               
                 return ret                  return ret
         except:          except:
             return None              return None
Line 1108  class ECHO_resource(Folder,Persistent,EC Line 1104  class ECHO_resource(Folder,Persistent,EC
     fields=[]      fields=[]
         fieldlist=self.standardMD.fieldList          fieldlist=self.standardMD.fieldList
                   
           tags=self.findTagsFromMapping(self.contentType)
       self.referencetypes=tags[2]
     for referenceTypeF in self.referencetypes:      for referenceTypeF in self.referencetypes:
   
         if referenceTypeF[1].title.lower() == referenceType.lower():          if referenceTypeF[1].title.lower() == referenceType.lower():
Line 1307  def manage_addECHO_resourceForm(self): Line 1305  def manage_addECHO_resourceForm(self):
   
   
   
 def manage_addECHO_resource(self,id,title,label,description,responsible,link,metalink,weight,copyrightType=None,resourceID=None,contentType=None,renderingType=None,credits=None,coords=None,RESPONSE=None):  def manage_addECHO_resource(self,id,title,label,description="",responsible="",link="",metalink="",weight="",copyrightType=None,resourceID=None,contentType=None,renderingType=None,credits=None,coords=None,RESPONSE=None):
     """addaresource"""      """addaresource"""
   
     newObj=ECHO_resource(id,link,metalink,resourceID,title,label,description,contentType,renderingType,copyrightType,responsible,credits,weight,coords)      newObj=ECHO_resource(id,link,metalink,resourceID,title,label,description,contentType,renderingType,copyrightType,responsible,credits,weight,coords)
Line 1429  class ECHO_collection(Folder, Persistent Line 1427  class ECHO_collection(Folder, Persistent
   
     security=ClassSecurityInfo()      security=ClassSecurityInfo()
     meta_type='ECHO_collection'      meta_type='ECHO_collection'
     viewClassificationList=viewClassificationListMaster  #    viewClassificationList=viewClassificationListMaster
     displayTypes=displayTypes      displayTypes=displayTypes
   
     path="/mpiwg/online/permanent/shipbuilding"      path="/mpiwg/online/permanent/shipbuilding"
Line 1741  class ECHO_collection(Folder, Persistent Line 1739  class ECHO_collection(Folder, Persistent
          """nothing"""           """nothing"""
      return retStr       return retStr
     
     def getViewClassification(self):  #    def getViewClassification(self):
         if hasattr(self,'viewClassification'):  #        if hasattr(self,'viewClassification'):
             return self.viewClassification  #            return self.viewClassification
         else:  #        else:
             return ""  #            return ""
   
           
     def createRessourcesFromXMLForm(self):      def createRessourcesFromXMLForm(self):
Line 1797  class ECHO_collection(Folder, Persistent Line 1795  class ECHO_collection(Folder, Persistent
         except:          except:
             return ""              return ""
                   
     def getCollectionTreeXML(self):      def getCollectionTreeXML(self,pwstr=None):
         """Tree as XML"""          """Tree as XML"""
   
     def addPassWd(str):      def addPassWd(str,pwstr=None):
         """adds a user/passwd to an url"""          """adds a user/passwd to an url"""
           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)          txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str)
         return txt2          return txt2
   
         def getCollection(object,depth=0):          def getCollection(object,depth=0,pwstr=None):
             depth+=1              depth+=1
             collections=""              collections=""
             for entry in object.__dict__.keys():              for entry in object.__dict__.keys():
                 element=getattr(object,entry)                  element=getattr(object,entry)
                 try:                  try:
                     if element.meta_type in ["ECHO_collection","ECHO_group"]:                      if element.meta_type in ["ECHO_collection","ECHO_group"]:
                         collections+="<element name=\""+urllib.quote(element.title)+"\" url=\""+addPassWd(element.absolute_url())+"\">"                          collections+="<element name=\""+urllib.quote(element.title)+"\" url=\""+addPassWd(element.absolute_url(),pwstr=pwstr)+"\">"
                         collections+=getCollection(element,depth)+"</element>\n"                          collections+=getCollection(element,depth)+"</element>\n"
                 except:                  except:
                     """nothing"""                      """nothing"""
             return collections              return collections
                   
     ret="""<?xml version="1.0" encoding="utf-8" ?>"""      ret="""<?xml version="1.0" encoding="utf-8" ?>"""
         return ret+"<collection>"+getCollection(self)+"</collection>"          return ret+"<collection>"+getCollection(self,pwstr=pwstr)+"</collection>"
           
     def createAllJSAreas(self):      def createAllJSAreas(self):
         """create area calls for JavaScript"""          """create area calls for JavaScript"""
Line 1927  class ECHO_collection(Folder, Persistent Line 1928  class ECHO_collection(Folder, Persistent
   
                   
     security.declarePublic('changeECHO_collection')           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"""          """Aenderung der Properties"""
   
         self.secondaryLink=secondaryLink          self.secondaryLink=secondaryLink
Line 1979  class ECHO_collection(Folder, Persistent Line 1980  class ECHO_collection(Folder, Persistent
         elif hasattr(self,'collection_index_template'):          elif hasattr(self,'collection_index_template'):
             ret=self.collection_index_template()                  ret=self.collection_index_template()    
         elif hasattr(self,'main_index_template'):          elif hasattr(self,'main_index_template'):
             ret=self.main_index_template()      
               ret=self.main_index_template.__of__(self)(self.main_template)
         else:          else:
         pt=zptFile(self, 'zpt/ECHO_main_index_template_standard.zpt')          pt=zptFile(self, 'zpt/ECHO_main_index_template_standard.zpt')
         pt.content_type="text/html"          pt.content_type="text/html"
Line 2030  class ECHO_collection(Folder, Persistent Line 2032  class ECHO_collection(Folder, Persistent
   
     def getAllMapAreas(self):      def getAllMapAreas(self):
         """Give list of coordinates"""          """Give list of coordinates"""
         subColTypes=['ECHO_collection','ECHO_resource']          mapColTypes=['ECHO_collection','ECHO_resource']
         areas=[]          areas=[]
         for entrySearch in self.ZopeFind(self,obj_metatypes=subColTypes):          for entry in self.getSubCols(self,subColTypes=mapColTypes):
             object=entrySearch[1]              object=entry
         areas.extend(object.getMapAreas())          areas.extend(object.getMapAreas())
         return areas          return areas
           
Line 2059  def manage_addECHO_collectionForm(self): Line 2061  def manage_addECHO_collectionForm(self):
         return pt()          return pt()
   
   
 def manage_addECHO_collection(self,id,title,label,description,contentType,responsible,weight,sortfield,coords="",secondaryLinkTitle="",secondaryLink="",credits=None,RESPONSE=None,imageTag="",bgcolour=""):  def manage_addECHO_collection(self,id,title,label,description="",contentType="",responsible="",weight=0,sortfield="weight",coords="",secondaryLinkTitle="",secondaryLink="",credits=None,RESPONSE=None,imageTag="",bgcolour=""):
     """add a echo collection"""      """add a echo collection"""
           
   
Line 2348  class ECHO_root(Folder,Persistent,Implic Line 2350  class ECHO_root(Folder,Persistent,Implic
           
     meta_type="ECHO_root"      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):      def getTablet(self,item):
         #print "getTablet"          #print "getTablet"
     try:      try:
Line 2368  class ECHO_root(Folder,Persistent,Implic Line 2375  class ECHO_root(Folder,Persistent,Implic
   
     def checkResource(self,id):      def checkResource(self,id):
         """checks if a resource is in the tree, gives back none or list of resources"""          """checks if a resource is in the tree, gives back none or list of resources"""
           if not id:
           id=""
           splitted=id.split("/")
           id=splitted[len(splitted)-1]
         if hasattr(self,"_v_checkResource") and self._v_checkResource.has_key(id): #existiert ein cache und id ist bereits drin?          if hasattr(self,"_v_checkResource") and self._v_checkResource.has_key(id): #existiert ein cache und id ist bereits drin?
                 return self._v_checkResource[id]                  return self._v_checkResource[id]
   

Removed from v.1.200  
changed lines
  Added in v.1.209


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>