Search in sources :

Example 1 with AxiomEnabledSchemaRegistry

use of com.evolveum.midpoint.prism.impl.schema.axiom.AxiomEnabledSchemaRegistry in project midpoint by Evolveum.

the class MidPointPrismContextFactory method createSchemaRegistry.

@NotNull
private SchemaRegistryImpl createSchemaRegistry() throws SchemaException, IOException {
    SchemaRegistryImpl schemaRegistry = new AxiomEnabledSchemaRegistry();
    schemaRegistry.setDefaultNamespace(SchemaConstantsGenerated.NS_COMMON);
    schemaRegistry.setNamespacePrefixMapper(new GlobalDynamicNamespacePrefixMapper());
    registerBuiltinSchemas(schemaRegistry);
    registerExtensionSchemas(schemaRegistry);
    registerAxiomSchemas(schemaRegistry);
    schemaRegistry.setValueMetadataTypeName(ValueMetadataType.COMPLEX_TYPE);
    return schemaRegistry;
}
Also used : SchemaRegistryImpl(com.evolveum.midpoint.prism.impl.schema.SchemaRegistryImpl) AxiomEnabledSchemaRegistry(com.evolveum.midpoint.prism.impl.schema.axiom.AxiomEnabledSchemaRegistry) GlobalDynamicNamespacePrefixMapper(com.evolveum.midpoint.prism.impl.xml.GlobalDynamicNamespacePrefixMapper) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AxiomEnabledSchemaRegistry

use of com.evolveum.midpoint.prism.impl.schema.axiom.AxiomEnabledSchemaRegistry in project midpoint by Evolveum.

the class MidPointPrismContextFactory method registerAxiomSchemas.

private void registerAxiomSchemas(SchemaRegistryImpl schemaRegistry) {
    if (schemaRegistry instanceof AxiomEnabledSchemaRegistry) {
        AxiomEnabledSchemaRegistry axiomRegistry = (AxiomEnabledSchemaRegistry) schemaRegistry;
        AxiomModelStatementSource commonMetadata;
        try {
            commonMetadata = AxiomModelStatementSource.fromResource("xml/ns/public/common/common-metadata-3.axiom");
        } catch (AxiomSyntaxException | IOException e) {
            throw new RuntimeException(e);
        }
        axiomRegistry.addAxiomSource(commonMetadata);
    }
}
Also used : AxiomModelStatementSource(com.evolveum.axiom.lang.antlr.AxiomModelStatementSource) AxiomSyntaxException(com.evolveum.axiom.lang.spi.AxiomSyntaxException) IOException(java.io.IOException) AxiomEnabledSchemaRegistry(com.evolveum.midpoint.prism.impl.schema.axiom.AxiomEnabledSchemaRegistry)

Aggregations

AxiomEnabledSchemaRegistry (com.evolveum.midpoint.prism.impl.schema.axiom.AxiomEnabledSchemaRegistry)2 AxiomModelStatementSource (com.evolveum.axiom.lang.antlr.AxiomModelStatementSource)1 AxiomSyntaxException (com.evolveum.axiom.lang.spi.AxiomSyntaxException)1 SchemaRegistryImpl (com.evolveum.midpoint.prism.impl.schema.SchemaRegistryImpl)1 GlobalDynamicNamespacePrefixMapper (com.evolveum.midpoint.prism.impl.xml.GlobalDynamicNamespacePrefixMapper)1 IOException (java.io.IOException)1 NotNull (org.jetbrains.annotations.NotNull)1