private void parseOnlineElementsList( Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element digitalTransferOptionsElement = extractElementWithFilter(rootElement, "MD_DigitalTransferOptions", gmdNamespace); if (digitalTransferOptionsElement != null) { List onlineElementsList = digitalTransferOptionsElement.getChildren(); for (Object o : onlineElementsList) { Element onlineElement = (Element) o; String url = parseOnlineElement( onlineElement, "CI_OnlineResource", gmdNamespace, "linkage", gmdNamespace, "URL", gmdNamespace); String protocol = parseOnlineElement( onlineElement, "CI_OnlineResource", gmdNamespace, "protocol", gmdNamespace, "CharacterString", gcoNamespace); String name = parseOnlineElement( onlineElement, "CI_OnlineResource", gmdNamespace, "name", gmdNamespace, "CharacterString", gcoNamespace); String description = parseOnlineElement( onlineElement, "CI_OnlineResource", gmdNamespace, "description", gmdNamespace, "CharacterString", gcoNamespace); GPCatalogMetadataOnlineResource gpCatalogMetadataOnlineResource = new GPCatalogMetadataOnlineResource(); gpCatalogMetadataOnlineResource.setURL(url); gpCatalogMetadataOnlineResource.setProtocol(protocol); gpCatalogMetadataOnlineResource.setName(name); gpCatalogMetadataOnlineResource.setDescription(description); gpCatalogMetadataDTO.addOnlineResource(gpCatalogMetadataOnlineResource); } } }
private void parseKeywords(Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element keywordsElement = extractElementWithFilter(rootElement, "MD_Keywords", gmdNamespace); if (keywordsElement != null) { List keywordsList = keywordsElement.getChildren(); for (Object o : keywordsList) { Element keywordElement = (Element) o; String keyword = extractTextFromCharacterString(keywordElement); gpCatalogMetadataDTO.addKeywordValue(keyword); } } }
private void parseBoundingBox(Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element geographicBoundingBoxElement = extractElementWithFilter(rootElement, "EX_GeographicBoundingBox", gmdNamespace); if (geographicBoundingBoxElement != null) { GPBBox bbox = new GPBBox(); Element westBoundLongitudeElement = extractElement(geographicBoundingBoxElement, "westBoundLongitude", gmdNamespace); if (westBoundLongitudeElement != null) { bbox.setMinX( Double.parseDouble(westBoundLongitudeElement.getChildText("Decimal", gcoNamespace))); } Element eastBoundLongitudeElement = extractElement(geographicBoundingBoxElement, "eastBoundLongitude", gmdNamespace); if (eastBoundLongitudeElement != null) { bbox.setMaxX( Double.parseDouble(eastBoundLongitudeElement.getChildText("Decimal", gcoNamespace))); } Element southBoundLatitudeElement = extractElement(geographicBoundingBoxElement, "southBoundLatitude", gmdNamespace); if (southBoundLatitudeElement != null) { bbox.setMinY( Double.parseDouble(southBoundLatitudeElement.getChildText("Decimal", gcoNamespace))); } Element northBoundLatitudeElement = extractElement(geographicBoundingBoxElement, "northBoundLongitude", gmdNamespace); if (northBoundLatitudeElement != null) { bbox.setMaxY( Double.parseDouble(northBoundLatitudeElement.getChildText("Decimal", gcoNamespace))); } gpCatalogMetadataDTO.setBbox(bbox); } }
private void parseAbstract(Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element abstractElement = extractElementWithFilter(rootElement, "abstract", gmdNamespace); String abstractValue = extractTextFromCharacterString(abstractElement); gpCatalogMetadataDTO.setAbstractValue(abstractValue); }
private void parseTitle(Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element titleElement = extractElementWithFilter(rootElement, "title", gmdNamespace); String title = extractTextFromCharacterString(titleElement); gpCatalogMetadataDTO.setTitle(title); }
private void parseUUID(Element rootElement, GPCatalogMetadataDTO gpCatalogMetadataDTO) { Element uuidElement = extractElement(rootElement, "uuid"); if (uuidElement != null) { gpCatalogMetadataDTO.setUuid(uuidElement.getText()); } }