version 1.9, 2005/10/10 18:11:10
|
version 1.11, 2005/10/11 13:14:23
|
Line 110 class OSAS_MetadataMapping(SimpleItem):
|
Line 110 class OSAS_MetadataMapping(SimpleItem):
|
if RESPONSE is not None: |
if RESPONSE is not None: |
RESPONSE.redirect('manage_main') |
RESPONSE.redirect('manage_main') |
|
|
|
manage_workspace=changeMetadataMappingForm |
|
|
def manage_addMetadataMappingForm(self): |
def manage_addMetadataMappingForm(self): |
"""interface for adding the OSAS_root""" |
"""interface for adding the OSAS_root""" |
Line 184 class OSAS_Metadata(Folder):
|
Line 184 class OSAS_Metadata(Folder):
|
def generateMappingList(self): |
def generateMappingList(self): |
"""Erzeuge Mapping""" |
"""Erzeuge Mapping""" |
mapping={} |
mapping={} |
|
|
for dict in self.__dict__: |
for dict in self.__dict__: |
#print dict |
#print dict |
obj=getattr(self,dict) |
obj=getattr(self,dict) |
if hasattr(obj,'meta_type'): |
if hasattr(obj,'meta_type'): |
if obj.meta_type=="OSAS_MetadataMapping": |
if obj.meta_type=="OSAS_MetadataMapping__neu": |
mapping[obj.getId()]=obj.generateMappingHash() |
mapping[obj.getId()]=obj.generateMappingHash() |
|
|
return mapping |
return mapping |
|
|
def generateMappingForType(self,type,clean="yes"): |
def generateMappingForType(self,type,clean="yes"): |
"""erzeuge spezifisches Mapping""" |
"""erzeuge spezifisches Mapping""" |
|
|
hash=self.generateMappingList() |
hash=self.generateMappingList() |
if hash.has_key(type): |
|
|
for key in hash.keys(): |
|
if (key.lower() == type.lower()): |
if clean=="yes": |
if clean=="yes": |
temp={} |
temp={} |
for x in hash[type].keys(): |
for x in hash[key].keys(): |
if not hash[type][x]=="": |
if not hash[key][x]=="": |
temp[x]=hash[type][x] |
temp[x]=hash[key][x] |
return temp |
return temp |
else: |
else: |
return hash[type] |
|
|
|
else: |
return hash[key] |
|
|
return {} |
return {} |
|
|
def getFieldList(self): |
def getFieldList(self): |