/** * Parses the gml schema referenced by <code>location</code> into a {@link SchemaIndex} * * @param nameSpace * the location namespace * @param location * the physical location of the root xsd schema that comprises the application schema * to parse. * @throws IOException * if any non recoverable problem occurs while parsing the application schema * pointed out by <code>location</code> or one of its dependencies. */ public SchemaIndex parse(String nameSpace, String schemaLocation) throws IOException { AppSchemaConfiguration configuration = new AppSchemaConfiguration(nameSpace, schemaLocation, resolver); configuration.addDependency(findGmlConfiguration(configuration)); return parse(configuration); }
/** * Load schema * * @param location * schema location path that can be found through getClass().getResource() * @return */ private SchemaIndex loadSchema(final String location) throws IOException { EmfAppSchemaReader reader = EmfAppSchemaReader.newInstance(); final URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml"); reader.setResolver(catalogLocation); return reader.parse(new URL(location)); }
public static EmfAppSchemaReader newInstance() { return new EmfAppSchemaReader(); }
/** * Parses the gml schema referenced by <code>location</code> into a {@link SchemaIndex} * * @param location * the physical location of the root xsd schema that comprises the application schema * to parse. * @throws IOException * if any non recoverable problem occurs while parsing the application schema * pointed out by <code>location</code> or one of its dependencies. */ public SchemaIndex parse(final URL location) throws IOException { final String nameSpace = findSchemaNamespace(location); final String schemaLocation = location.toExternalForm(); return parse(nameSpace, schemaLocation); }
schemaParser = EmfAppSchemaReader.newInstance(); schemaParser.setResolver(buildResolver()); + schemaUrl.toExternalForm()); nameSpace = schemaParser.findSchemaNamespace(schemaUrl); schemaLocation = schemaUrl.toExternalForm(); schemaURIs.put(nameSpace, schemaLocation); SchemaIndex schemaIndex = schemaParser.parse(nameSpace, schemaLocation);
/** * Load schema * * @param location * schema location path that can be found through getClass().getResource() * @return */ private SchemaIndex loadSchema(final String location) throws IOException { final URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml"); reader.setResolver(catalogLocation); return reader.parse(new URL(location)); }
@Test public void testSimpleAttributeFromComplexDeclaration() throws Exception { String res = "/test-data/complexFeature.xsd"; URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfAppSchemaReader.newInstance().parse(resource); FeatureTypeRegistry registry = new FeatureTypeRegistry(); try { registry.addSchemas(schemaIndex); Name tcl = Types.typeName(NS_URI, "TypedCategoryListType"); AttributeType typedCategoryListType = registry.getAttributeType(tcl); Assert.assertNotNull(typedCategoryListType); Assert.assertTrue(typedCategoryListType instanceof ComplexType); AttributeType superType = typedCategoryListType.getSuper(); Assert.assertNotNull(superType); Name superName = superType.getName(); Assert.assertEquals(XS.STRING.getNamespaceURI(), superName.getNamespaceURI()); Assert.assertEquals(XS.STRING.getLocalPart(), superName.getLocalPart()); Assert.assertNotNull(typedCategoryListType.getUserData().get(XSDTypeDefinition.class)); } finally { registry.disposeSchemaIndexes(); } }
/** * DOCUMENT ME! * * @throws Exception * DOCUMENT ME! */ @Before public void setUp() throws Exception { reader = EmfAppSchemaReader.newInstance(); // Logging.GEOTOOLS.forceMonolineConsoleOutput(Level.FINEST); }
/** * Test we can find that GeoSciML 2.0 depends on GML 3.1. */ @Test public void findGml31Configuration() { AppSchemaConfiguration configuration = new AppSchemaConfiguration( "urn:cgi:xmlns:CGI:GeoSciML:2.0", "http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd", new AppSchemaResolver()); Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration); Assert.assertNotNull(gmlConfiguration); Assert.assertEquals(new GMLConfiguration(), gmlConfiguration); }
/** * * @param location * schema location path discoverable through getClass().getResource() */ private SchemaIndex loadSchema(String location) throws IOException { // load needed GML types directly from the gml schemas URL schemaLocation = getClass().getResource(location); assertNotNull(location, schemaLocation); return reader.parse(schemaLocation); }
/** * * @param location * schema location path discoverable through getClass().getResource() * @return */ private SchemaIndex loadSchema(String location) throws IOException { URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml"); reader.setResolver(catalogLocation); return reader.parse(new URL(location)); }
URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfAppSchemaReader.newInstance().parse(resource);
/** * Set up the reader * * @throws Exception * If any exception occurs */ @BeforeClass public static void oneTimeSetUp() throws Exception { reader = EmfAppSchemaReader.newInstance(); }
/** * Test we can find that GeoSciML 3.0rc1 depends on GML 3.2. */ @Test public void findGml32Configuration() { AppSchemaConfiguration configuration = new AppSchemaConfiguration( "urn:cgi:xmlns:CGI:GeoSciML-Core:3.0.0", "https://www.seegrid.csiro.au/subversion/GeoSciML/branches/3.0.0_rc1_gml3.2/geosciml-core/3.0.0/xsd/geosciml-core.xsd", new AppSchemaResolver()); Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration); Assert.assertNotNull(gmlConfiguration); Assert.assertEquals(new org.geotools.gml3.v3_2.GMLConfiguration(), gmlConfiguration); }
/** * DOCUMENT ME! * * @param location * schema location path discoverable through getClass().getResource() * @return * * @throws IOException * DOCUMENT ME! */ private SchemaIndex loadSchema(URL location) throws IOException { URL catalogLocation = getClass().getResource(schemaBase + "observations.oasis.xml"); reader.setResolver(catalogLocation); return reader.parse(location); }
String res = "/test-data/complexFeature.xsd"; URL resource = getClass().getResource(res); SchemaIndex schemaIndex = EmfAppSchemaReader.newInstance().parse(resource);
@BeforeClass public static void oneTimeSetUp() throws IOException { final Map<String, Serializable> dsParams = new HashMap<String, Serializable>(); final URL url = GeoSciMLTest.class.getResource(schemaBase + "mappedPolygons.xml"); dsParams.put("dbtype", "app-schema"); dsParams.put("url", url.toExternalForm()); mappingDataStore = DataAccessFinder.getDataStore(dsParams); reader = EmfAppSchemaReader.newInstance(); // Logging.GEOTOOLS.forceMonolineConsoleOutput(Level.FINEST); }
@BeforeClass public static void oneTimeSetUp() throws IOException { System.out.println("beforeclass"); final Map dsParams = new HashMap(); final URL url = BoreholeTest.class.getResource(schemaBase + "BoreholeTest_properties.xml"); dsParams.put("dbtype", "app-schema"); dsParams.put("url", url.toExternalForm()); mappingDataStore = DataAccessFinder.getDataStore(dsParams); assertNotNull(mappingDataStore); reader = EmfAppSchemaReader.newInstance(); }