version 1.255, 2005/11/25 18:46:40
|
version 1.256, 2005/11/29 13:48:44
|
Line 83 def setECHO_collectionInformation(self,t
|
Line 83 def setECHO_collectionInformation(self,t
|
self.credits=toList(credits) |
self.credits=toList(credits) |
self.weight=weight |
self.weight=weight |
|
|
|
class ECHO_partner(Image,Persistent,ECHO_basis): |
|
"""ECHO Partner""" |
|
|
|
meta_type="ECHO_partner" |
|
|
|
def __init__(self, id, title,url, file, copyrightType, person, email, country, color, content_type='', precondition=''): |
|
self.__name__=id |
|
self.title=title |
|
self.url=url |
|
self.person=person |
|
self.email=email |
|
self.country=country |
|
self.color=color |
|
self.precondition=precondition |
|
self.copyrightType=copyrightType |
|
data, size = self._read_data(file) |
|
content_type=self._get_content_type(file, data, id, content_type) |
|
self.update_data(data, content_type, size) |
|
|
|
manage_options = Image.manage_options+( |
|
{'label':'Partner Information','action':'ECHO_partner_config'}, |
|
) |
|
|
|
|
|
def changeECHO_partner(self,url,copyrightType,person, email, country, color, RESPONSE=None): |
|
"""Change main information""" |
|
self.url=url |
|
self.person=person |
|
self.email=email |
|
self.country=country |
|
self.color=color |
|
self.copyrightType=copyrightType |
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
|
|
|
def ECHO_partner_config(self): |
|
"""Main configuration""" |
|
if not hasattr(self,'url'): |
|
self.url="" |
|
pt=zptFile(self, 'zpt/ChangeECHO_partner.zpt') |
|
return pt() |
|
|
|
|
|
manage_addECHO_partnerForm=DTMLFile('dtml/ECHO_partnerAdd',globals(), |
|
Kind='ECHO_partner',kind='ECHO_partner') |
|
|
|
|
|
|
|
def manage_addECHO_partner(self, id, url, person, email, country, color, file=None, copyrightType='', title='', precondition='', content_type='', |
|
REQUEST=None): |
|
""" |
|
Add a new ECHO_partner object. |
|
|
|
Creates a new ECHO_partner object 'id' with the contents of 'file'. |
|
Based on Image.manage_addImage |
|
""" |
|
|
|
id=str(id) |
|
title=str(title) |
|
content_type=str(content_type) |
|
precondition=str(precondition) |
|
|
|
id, title = OFS.Image.cookId(id, title, file) |
|
|
|
self=self.this() |
|
|
|
# First, we create the image without data: |
|
self._setObject(id, ECHO_partner(id,title,url,'',copyrightType, person, email, country, color, content_type, precondition)) |
|
|
|
# Now we "upload" the data. By doing this in two steps, we |
|
# can use a database trick to make the upload more efficient. |
|
if file: |
|
self._getOb(id).manage_upload(file) |
|
if content_type: |
|
self._getOb(id).content_type=content_type |
|
|
|
if REQUEST is not None: |
|
try: url=self.DestinationURL() |
|
except: url=REQUEST['URL1'] |
|
REQUEST.RESPONSE.redirect('%s/manage_main' % url) |
|
return id |
|
|
class ECHO_locale(ZopePageTemplate): |
class ECHO_locale(ZopePageTemplate): |
"""localisierung""" |
"""localisierung""" |
|
|
Line 1625 def manage_addECHO_link(self,id,title,la
|
Line 1709 def manage_addECHO_link(self,id,title,la
|
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
|
class ECHO_collection(Folder, Persistent, Implicit, Cacheable,ECHO_basis): |
class ECHO_collection(CatalogAware, Folder, Persistent, Implicit, Cacheable,ECHO_basis): |
"""ECHO Collection""" |
"""ECHO Collection""" |
|
|
security=ClassSecurityInfo() |
security=ClassSecurityInfo() |
meta_type='ECHO_collection' |
meta_type='ECHO_collection' |
|
default_catalog='resourceCatalog' |
|
|
# viewClassificationList=viewClassificationListMaster |
# viewClassificationList=viewClassificationListMaster |
displayTypes=displayTypes |
displayTypes=displayTypes |
|
|
path="/mpiwg/online/permanent/shipbuilding" |
path="/mpiwg/online/permanent/shipbuilding" |
|
|
|
def getMDValueSimpleSearchField(self): |
|
"""returns value for simple search""" |
|
return " ".join([self.title,self.description]) |
|
|
def getTitleAndLabel(self): |
def getTitleAndLabel(self): |
"""gibt title und label zurueck""" |
"""gibt title und label zurueck""" |
return (getattr(self,'title',''),getattr(self,'label','')) |
return (getattr(self,'title',''),getattr(self,'label','')) |
Line 2115 class ECHO_collection(Folder, Persistent
|
Line 2205 class ECHO_collection(Folder, Persistent
|
areas = self.getAllMapAreas() |
areas = self.getAllMapAreas() |
return self.createJSAreas(areas) |
return self.createJSAreas(areas) |
|
|
|
|
|
emptyPartner=ECHO_partner("", "","", "", "", "", "", "", "") |
|
|
security.declarePublic('getCreditObject') |
security.declarePublic('getCreditObject') |
def getCreditObject(self,name): |
def getCreditObject(self,name): |
"""credit id to credititem""" |
"""credit id to credititem""" |
try: |
try: |
return getattr(self.partners,name) |
return getattr(self.partners,name) |
except: |
except: |
return "" |
|
|
return self.emptyPartner |
|
|
|
|
security.declarePublic('ECHO_generateNavBar') |
security.declarePublic('ECHO_generateNavBar') |
def ECHO_generateNavBar(self): |
def ECHO_generateNavBar(self): |
Line 2685 class ECHO_root(Folder,Persistent,Implic
|
Line 2780 class ECHO_root(Folder,Persistent,Implic
|
|
|
for resource in resources: |
for resource in resources: |
resource[1].reindex() |
resource[1].reindex() |
print "<p> done %s </p>\n" |
#print "<p> done %s </p>\n" |
if RESPONSE: |
if RESPONSE: |
RESPONSE.write("<p> done %s </p>\n"%resource[0]) |
RESPONSE.write("<p> done %s </p>\n"%resource[0]) |
|
|
Line 3509 def manage_addECHO_copyrightType(self,id
|
Line 3604 def manage_addECHO_copyrightType(self,id
|
|
|
|
|
|
|
class ECHO_partner(Image,Persistent,ECHO_basis): |
|
"""ECHO Partner""" |
|
|
|
meta_type="ECHO_partner" |
|
|
|
def __init__(self, id, title,url, file, copyrightType, person, email, country, color, content_type='', precondition=''): |
|
self.__name__=id |
|
self.title=title |
|
self.url=url |
|
self.person=person |
|
self.email=email |
|
self.country=country |
|
self.color=color |
|
self.precondition=precondition |
|
self.copyrightType=copyrightType |
|
data, size = self._read_data(file) |
|
content_type=self._get_content_type(file, data, id, content_type) |
|
self.update_data(data, content_type, size) |
|
|
|
manage_options = Image.manage_options+( |
|
{'label':'Partner Information','action':'ECHO_partner_config'}, |
|
) |
|
|
|
|
|
def changeECHO_partner(self,url,copyrightType,person, email, country, color, RESPONSE=None): |
|
"""Change main information""" |
|
self.url=url |
|
self.person=person |
|
self.email=email |
|
self.country=country |
|
self.color=color |
|
self.copyrightType=copyrightType |
|
if RESPONSE is not None: |
|
RESPONSE.redirect('manage_main') |
|
|
|
|
|
|
|
def ECHO_partner_config(self): |
|
"""Main configuration""" |
|
if not hasattr(self,'url'): |
|
self.url="" |
|
pt=zptFile(self, 'zpt/ChangeECHO_partner.zpt') |
|
return pt() |
|
|
|
|
|
manage_addECHO_partnerForm=DTMLFile('dtml/ECHO_partnerAdd',globals(), |
|
Kind='ECHO_partner',kind='ECHO_partner') |
|
|
|
|
|
|
|
def manage_addECHO_partner(self, id, url, person, email, country, color, file=None, copyrightType='', title='', precondition='', content_type='', |
|
REQUEST=None): |
|
""" |
|
Add a new ECHO_partner object. |
|
|
|
Creates a new ECHO_partner object 'id' with the contents of 'file'. |
|
Based on Image.manage_addImage |
|
""" |
|
|
|
id=str(id) |
|
title=str(title) |
|
content_type=str(content_type) |
|
precondition=str(precondition) |
|
|
|
id, title = OFS.Image.cookId(id, title, file) |
|
|
|
self=self.this() |
|
|
|
# First, we create the image without data: |
|
self._setObject(id, ECHO_partner(id,title,url,'',copyrightType, person, email, country, color, content_type, precondition)) |
|
|
|
# Now we "upload" the data. By doing this in two steps, we |
|
# can use a database trick to make the upload more efficient. |
|
if file: |
|
self._getOb(id).manage_upload(file) |
|
if content_type: |
|
self._getOb(id).content_type=content_type |
|
|
|
if REQUEST is not None: |
|
try: url=self.DestinationURL() |
|
except: url=REQUEST['URL1'] |
|
REQUEST.RESPONSE.redirect('%s/manage_main' % url) |
|
return id |
|
|
|
class ECHO_linkList(ZopePageTemplate,ECHO_basis): |
class ECHO_linkList(ZopePageTemplate,ECHO_basis): |
"""LinkList Objekt""" |
"""LinkList Objekt""" |