use of io.atlasmap.v2.Document in project aws-doc-sdk-examples by awsdocs.
the class DynamoDBService method injectETLData.
public void injectETLData(String myDom) throws JDOMException, IOException {
SAXBuilder builder = new SAXBuilder();
Document jdomDocument = builder.build(new InputSource(new StringReader(myDom)));
org.jdom2.Element root = ((org.jdom2.Document) jdomDocument).getRootElement();
PopData pop = new PopData();
List<org.jdom2.Element> items = root.getChildren("Item");
for (org.jdom2.Element element : items) {
pop.setName(element.getChildText("Name"));
pop.setCode(element.getChildText("Code"));
pop.set2010(element.getChildText("Date2010"));
pop.set2011(element.getChildText("Date2011"));
pop.set2012(element.getChildText("Date2012"));
pop.set2013(element.getChildText("Date2013"));
pop.set2014(element.getChildText("Date2014"));
pop.set2015(element.getChildText("Date2015"));
pop.set2016(element.getChildText("Date2016"));
pop.set2017(element.getChildText("Date2017"));
pop.set2018(element.getChildText("Date2018"));
pop.set2019(element.getChildText("Date2019"));
setItem(pop);
}
}
use of io.atlasmap.v2.Document in project jena by apache.
the class GMLReader method extract.
public static GMLReader extract(String gmlText) throws JDOMException, IOException {
if (gmlText.isEmpty()) {
gmlText = EMPTY_GML_TEXT;
}
SAXBuilder jdomBuilder = newSAXBuilder();
InputStream stream = new ByteArrayInputStream(gmlText.getBytes(StandardCharsets.UTF_8));
Document xmlDoc = jdomBuilder.build(stream);
Element gmlElement = xmlDoc.getRootElement();
return new GMLReader(gmlElement);
}
use of io.atlasmap.v2.Document in project gocd by gocd.
the class GoConfigMigration method getCurrentSchemaVersion.
private int getCurrentSchemaVersion(String content) {
try {
SAXBuilder builder = new SAXBuilder();
Document document = builder.build(new ByteArrayInputStream(content.getBytes()));
Element root = document.getRootElement();
String currentVersion = root.getAttributeValue(schemaVersion) == null ? "0" : root.getAttributeValue(schemaVersion);
return Integer.parseInt(currentVersion);
} catch (Exception e) {
throw bomb(e);
}
}
use of io.atlasmap.v2.Document in project gocd by gocd.
the class GoConfigMigrationIntegrationTest method shouldRemoveAllLuauConfigurationFromConfig.
@Test
public void shouldRemoveAllLuauConfigurationFromConfig() throws Exception {
String configString = "<cruise schemaVersion='66'>" + "<server siteUrl='https://hostname'>" + "<security>" + " <luau url='https://luau.url.com' clientKey='0d010cf97ec505ee3788a9b5b8cf71d482c394ae88d32f0333' authState='authorized' />" + " <ldap uri='ldap' managerDn='managerDn' encryptedManagerPassword='+XhtUNvVAxJdHGF4qQGnWw==' searchFilter='(sAMAccountName={0})'>" + " <bases>" + " <base value='ou=Enterprise,ou=Principal,dc=corporate,dc=thoughtworks,dc=com' />" + " </bases>" + " </ldap>" + " <roles>" + " <role name='luau-role'><groups><luauGroup>luau-group</luauGroup></groups></role>" + " <role name='ldap-role'><users><user>some-user</user></users></role>" + "</roles>" + "</security>" + "</server>" + "</cruise>";
String migratedContent = migrateXmlString(configString, 66);
Document document = new SAXBuilder().build(new StringReader(migratedContent));
assertThat(document.getDescendants(new ElementFilter("luau")).hasNext()).isFalse();
assertThat(document.getDescendants(new ElementFilter("groups")).hasNext()).isFalse();
}
use of io.atlasmap.v2.Document in project mycore by MyCoRe-Org.
the class MCRFileNodeServlet method sendDirectory.
/**
* Sends the contents of an MCRDirectory as XML data to the client
* @throws SAXException
* @throws TransformerException
*/
private MCRContent sendDirectory(HttpServletRequest request, HttpServletResponse response, MCRPath mcrPath) throws IOException, TransformerException, SAXException {
Document directoryXML = MCRPathXML.getDirectoryXML(mcrPath);
MCRJDOMContent source = new MCRJDOMContent(directoryXML);
source.setLastModified(Files.getLastModifiedTime(mcrPath).toMillis());
String fileName = mcrPath.getNameCount() == 0 ? mcrPath.getOwner() : mcrPath.getFileName().toString();
source.setName(fileName);
return getLayoutService().getTransformedContent(request, response, source);
}
Aggregations