use of com.evolveum.midpoint.prism.xml.GlobalDynamicNamespacePrefixMapper in project midpoint by Evolveum.
the class PrismInternalTestUtil method constructPrismContext.
public static PrismContextImpl constructPrismContext(File extraSchema) throws SchemaException, FileNotFoundException {
SchemaRegistryImpl schemaRegistry = new SchemaRegistryImpl();
schemaRegistry.setCatalogResourceName(TEST_CATALOG_RESOURCE_NAME);
DynamicNamespacePrefixMapper prefixMapper = new GlobalDynamicNamespacePrefixMapper();
// Set default namespace?
schemaRegistry.setNamespacePrefixMapper(prefixMapper);
schemaRegistry.registerPrismDefaultSchemaResource("xml/ns/test/foo-1.xsd", "foo", ObjectFactory.class.getPackage());
schemaRegistry.registerPrismSchemaResource("xml/ns/test/foo-types-1.xsd", "foot", null);
schemaRegistry.registerPrismSchemaResource("xml/ns/public/types-3.xsd", "t", com.evolveum.prism.xml.ns._public.types_3.ObjectFactory.class.getPackage());
schemaRegistry.registerPrismSchemaResource("xml/ns/public/query-3.xsd", "q", com.evolveum.prism.xml.ns._public.query_3.ObjectFactory.class.getPackage());
schemaRegistry.registerPrismSchemasFromDirectory(SCHEMA_DIR);
if (extraSchema != null) {
schemaRegistry.registerPrismSchemaFile(extraSchema);
}
prefixMapper.registerPrefix(XMLConstants.W3C_XML_SCHEMA_NS_URI, DOMUtil.NS_W3C_XML_SCHEMA_PREFIX, false);
prefixMapper.registerPrefix(PrismConstants.NS_ANNOTATION, PrismConstants.PREFIX_NS_ANNOTATION, false);
prefixMapper.registerPrefix(PrismInternalTestUtil.NS_WEAPONS, PrismInternalTestUtil.NS_WEAPONS_PREFIX, false);
return PrismContextImpl.create(schemaRegistry);
}
use of com.evolveum.midpoint.prism.xml.GlobalDynamicNamespacePrefixMapper in project midpoint by Evolveum.
the class SchemaDocMojo method createSchemaRegistry.
@NotNull
private SchemaRegistryImpl createSchemaRegistry() throws SchemaException {
SchemaRegistryImpl schemaRegistry = new SchemaRegistryImpl();
schemaRegistry.setNamespacePrefixMapper(new GlobalDynamicNamespacePrefixMapper());
return schemaRegistry;
}
use of com.evolveum.midpoint.prism.xml.GlobalDynamicNamespacePrefixMapper in project midpoint by Evolveum.
the class MidPointPrismContextFactory method createSchemaRegistry.
@NotNull
private SchemaRegistryImpl createSchemaRegistry() throws SchemaException, FileNotFoundException {
SchemaRegistryImpl schemaRegistry = new SchemaRegistryImpl();
schemaRegistry.setDefaultNamespace(SchemaConstantsGenerated.NS_COMMON);
schemaRegistry.setNamespacePrefixMapper(new GlobalDynamicNamespacePrefixMapper());
registerBuiltinSchemas(schemaRegistry);
registerExtensionSchemas(schemaRegistry);
return schemaRegistry;
}
Aggregations