Search in sources :

Example 11 with SchemaRelationshipNode

use of org.structr.core.entity.SchemaRelationshipNode in project structr by structr.

the class SchemaHelper method reloadSchema.

public static boolean reloadSchema(final ErrorBuffer errorBuffer, final String initiatedBySessionId) {
    try {
        final App app = StructrApp.getInstance();
        final List<SchemaNode> existingSchemaNodes = app.nodeQuery(SchemaNode.class).getAsList();
        cleanUnusedDynamicGrants(existingSchemaNodes);
        for (final SchemaNode schemaNode : existingSchemaNodes) {
            createDynamicGrants(schemaNode.getResourceSignature());
        }
        for (final SchemaRelationshipNode schemaRelationship : StructrApp.getInstance().nodeQuery(SchemaRelationshipNode.class).getAsList()) {
            createDynamicGrants(schemaRelationship.getResourceSignature());
            createDynamicGrants(schemaRelationship.getInverseResourceSignature());
        }
    } catch (Throwable t) {
        logger.warn("", t);
    }
    return SchemaService.reloadSchema(errorBuffer, initiatedBySessionId);
}
Also used : App(org.structr.core.app.App) StructrApp(org.structr.core.app.StructrApp) AbstractSchemaNode(org.structr.core.entity.AbstractSchemaNode) SchemaNode(org.structr.core.entity.SchemaNode) SchemaRelationshipNode(org.structr.core.entity.SchemaRelationshipNode)

Aggregations

SchemaRelationshipNode (org.structr.core.entity.SchemaRelationshipNode)11 SchemaNode (org.structr.core.entity.SchemaNode)8 App (org.structr.core.app.App)7 StructrApp (org.structr.core.app.StructrApp)7 Tx (org.structr.core.graph.Tx)7 FrameworkException (org.structr.common.error.FrameworkException)6 LinkedHashSet (java.util.LinkedHashSet)3 LinkedList (java.util.LinkedList)3 NodeAttribute (org.structr.core.graph.NodeAttribute)3 PropertyKey (org.structr.core.property.PropertyKey)3 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Test (org.junit.Test)2 AbstractNode (org.structr.core.entity.AbstractNode)2 NodeInterface (org.structr.core.graph.NodeInterface)2 ConfigurationProvider (org.structr.schema.ConfigurationProvider)2 GraphQLList (graphql.schema.GraphQLList)1 GraphQLObjectType (graphql.schema.GraphQLObjectType)1 GraphQLType (graphql.schema.GraphQLType)1 FileInputStream (java.io.FileInputStream)1