version 1.7, 2005/04/06 09:18:41
|
version 1.10, 2005/10/10 19:10:33
|
Line 12 import xml.dom.pulldom
|
Line 12 import xml.dom.pulldom
|
import OSAS_helpers |
import OSAS_helpers |
import zLOG |
import zLOG |
import string |
import string |
import xml.xpath |
try: |
|
from xml.xpath import Evaluate |
|
except: |
|
from Ft.Xml.XPath import Evaluate |
import xmlrpclib |
import xmlrpclib |
|
|
from types import * |
from types import * |
Line 107 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 181 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": |
print obj.meta_type |
|
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): |
Line 429 class OSAS_Metadata(Folder):
|
Line 438 class OSAS_Metadata(Folder):
|
xpathStr=MDF_xpathStart |
xpathStr=MDF_xpathStart |
|
|
|
|
xpathNodes=xml.xpath.Evaluate(xpathStr,actualNode) |
xpathNodes=Evaluate(xpathStr,actualNode) |
|
|
|
|
if len(xpathNodes)>0: |
if len(xpathNodes)>0: |
Line 500 class OSAS_Metadata(Folder):
|
Line 509 class OSAS_Metadata(Folder):
|
xpathStr=MDF_xpathStart |
xpathStr=MDF_xpathStart |
|
|
|
|
xpathNodes=xml.xpath.Evaluate(xpathStr,actualNode) |
xpathNodes=Evaluate(xpathStr,actualNode) |
|
|
|
|
|
|
Line 511 class OSAS_Metadata(Folder):
|
Line 520 class OSAS_Metadata(Folder):
|
else: |
else: |
#existiert nicht dann neue erzeugen |
#existiert nicht dann neue erzeugen |
|
|
if len(xml.xpath.Evaluate(MDF_xpathStart,dom))>0: |
if len(Evaluate(MDF_xpathStart,dom))>0: |
|
|
create=True |
create=True |
|
|