throw new MetaDataException(e);
}
}
protected void loadLegacyMetaData(Document xml) throws MetaDataException {
NamespaceHelper helper = new NamespaceHelper(PageEnvelope.NAMESPACE, "", xml);
Element metaElement = helper.getFirstChild(xml.getDocumentElement(), "meta");
Element internalElement = helper.getFirstChild(metaElement, "internal");
Element[] internalElements = helper.getChildren(internalElement);
for (int i = 0; i < internalElements.length; i++) {
String value = DocumentHelper.getSimpleElementText(internalElements[i]);
String key = internalElements[i].getLocalName();
if (key.equals("workflowVersion")) {
List values = getValueList("http://apache.org/lenya/metadata/workflow/1.0", key);
values.add(value);
} else {
List values = getValueList("http://apache.org/lenya/metadata/document/1.0", key);
values.add(value);
}
}
NamespaceHelper dcHelper = new NamespaceHelper(DublinCore.DC_NAMESPACE, "", xml);
Element dcElement = helper.getFirstChild(metaElement, "dc");
if (dcElement != null) {
MetaDataRegistry registry = null;
try {
registry = (MetaDataRegistry) this.manager.lookup(MetaDataRegistry.ROLE);
ElementSet dcElementSet = registry.getElementSet(DublinCore.DC_NAMESPACE);
ElementSet dcTermSet = registry.getElementSet(DublinCore.DCTERMS_NAMESPACE);
Element[] dcElements = dcHelper.getChildren(dcElement);
for (int i = 0; i < dcElements.length; i++) {
String value = DocumentHelper.getSimpleElementText(dcElements[i]);
String key = dcElements[i].getLocalName();