867572666f0df0188612bd5199186553bd670e30 | 436d3421e4242ab391ef48b4c453bcaed62e7490 | ||
---|---|---|---|
44 | 44 | ||
45 | //TODO implement outputConfig.toXML | 45 | //TODO implement outputConfig.toXML |
46 | def toXML : xml.Node = { | 46 | def toXML : xml.Node = { |
47 | <intergrationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 47 | <integrationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
48 | xsi:schemaLocation="http://www4.wiwiss.fu-berlin.de/ldif/ ../../xsd/IntegrationJob.xsd" | 48 | xsi:schemaLocation="http://www4.wiwiss.fu-berlin.de/ldif/ ../../xsd/IntegrationJob.xsd" |
49 | xmlns="http://www4.wiwiss.fu-berlin.de/ldif/"> | 49 | xmlns="http://www4.wiwiss.fu-berlin.de/ldif/"> |
50 | {if (isAnySourceDefined){ | 50 | {if (isAnySourceDefined){ |
... | ... | ||
57 | {if (isSieveSpecDefined) <sieve>{sieveSpecDir}</sieve>} | 57 | {if (isSieveSpecDefined) <sieve>{sieveSpecDir}</sieve>} |
58 | {if (isAnyOutputDefined){ | 58 | {if (isAnyOutputDefined){ |
59 | <outputs> | 59 | <outputs> |
60 | {for (output <- outputs.outputs) yield { <output>{output.toString()}</output> } } | 60 | {for (output <- outputs.outputs) yield { <output><file>todo</file></output> } } |
61 | </outputs>} | 61 | </outputs>} |
62 | } | 62 | } |
63 | {if (isAnyPropertyDefined) <properties>{properties.getProperty("propertiesFile")}</properties>} | 63 | {if (isAnyPropertyDefined) <properties>{properties.getProperty("propertiesFile")}</properties>} |
64 | <runSchedule>{runSchedule}</runSchedule> | 64 | <runSchedule>{runSchedule}</runSchedule> |
65 | </intergrationJob>} | 65 | </integrationJob>} |
66 | } | 66 | } |
67 | 67 | ||
68 | object IntegrationConfig { | 68 | object IntegrationConfig { |
... | ... | ||
77 | 77 | ||
78 | def load = new ValidatingXMLReader(fromFile, schemaLocation) | 78 | def load = new ValidatingXMLReader(fromFile, schemaLocation) |
79 | 79 | ||
80 | def fromFile(configFile : File) : IntegrationConfig = { | 80 | def fromFile(file : File) : IntegrationConfig = |
81 | baseDir = configFile.getParent | 81 | fromXML(XML.loadFile(file), file.getParent) |
82 | xml = XML.loadFile(configFile) | 82 | |
83 | def fromString(xmlString : String, dir : String) = | ||
84 | fromXML(XML.loadString(xmlString), dir) | ||
85 | |||
86 | def fromXML(node : Node, dir : String) : IntegrationConfig = { | ||
87 | xml = node | ||
88 | baseDir = dir | ||
83 | 89 | ||
84 | // Read in properties | 90 | // Read in properties |
85 | val propertiesFile = getFile("properties", baseDir) | 91 | val propertiesFile = getFile("properties", baseDir) |