Examples of nodeQuery()


Examples of org.structr.core.app.App.nodeQuery()

    }

    // Find root folder
    final App app = StructrApp.getInstance(securityContext);
    Folder folder = null;
    for (final Folder possibleRootFolder : app.nodeQuery(Folder.class).andName(parts[0])) {

      if (possibleRootFolder.getProperty(Folder.parent) == null) {
        folder = possibleRootFolder;
        break;
      }
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

        // Switch user context to user1
        final App user1App = StructrApp.getInstance(SecurityContext.getInstance(user1, AccessMode.Backend));

        // Check if user1 can see t1
        assertEquals(t1, user1App.nodeQuery(type, false).getFirst());
      }
     
      try (final Tx tx = app.tx()) {

        // As superuser, make another user the owner
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

       
        // Switch user context to user2
        final App user2App = StructrApp.getInstance(SecurityContext.getInstance(user2, AccessMode.Backend));

        // Check if user2 can see t1
        assertEquals(t1, user2App.nodeQuery(type, false).getFirst());

        // Check if user2 is owner of t1
        assertEquals(user2, t1.getProperty(AbstractNode.owner));
      }
     
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

        // transform search values using input convert of notion property
        final Object transformedValue          = inputConverter != null ? inputConverter.convert(searchValue) : searchValue;

        if (exactMatch) {

          Result<AbstractNode> result = app.nodeQuery(entityProperty.relatedType()).and(key, transformedValue).getResult();

          for (AbstractNode node : result.getResults()) {

            switch (occur) {
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

            }
          }

        } else {

          Result<AbstractNode> result = app.nodeQuery(entityProperty.relatedType(), false).and(key, transformedValue, false).getResult();

          // loose search behaves differently, all results must be combined
          for (AbstractNode node : result.getResults()) {

            intersectionResult.addAll(entityProperty.getRelatedNodesReverse(securityContext, node, declaringClass, predicate));
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

      } else if (source instanceof GraphObject) {
       
        GraphObject obj = (GraphObject)source;
        if (propertyKey != null) {
         
          results = (Result<T>) app.nodeQuery(NodeInterface.class).and(propertyKey, obj.getProperty(propertyKey)).getResult();
         
         
        } else {
         
          // fetch property key for "id", may be different for AbstractNode and AbstractRelationship!
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

          attributesComplete &= attributes.containsKey(key);
        }
       
        if (attributesComplete) {
         
          result = app.nodeQuery(type).and(attributes).getResult();
         
        }
      }

      // just check for existance
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

      if (convertedSource instanceof JsonInput) {

        Object value = ((JsonInput)convertedSource).getAttributes().get(propertyKey.jsonName());
        if (value != null) {
         
          result = app.nodeQuery(type).and(propertyKey, value.toString()).getResult();
        }

      } else if (convertedSource instanceof GraphObject) {
       
        GraphObject obj = (GraphObject)convertedSource;
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

      } else if (convertedSource instanceof GraphObject) {
       
        GraphObject obj = (GraphObject)convertedSource;
        if (propertyKey != null) {
         
          result = app.nodeQuery(type).and(propertyKey, obj.getProperty(propertyKey)).getResult();
         
        } else {
         
          // fetch property key for "id", may be different for AbstractNode and AbstractRelationship!
          PropertyKey<String> idProperty = StructrApp.getConfiguration().getPropertyKeyForDatabaseName(obj.getClass(), GraphObject.id.dbName());
View Full Code Here

Examples of org.structr.core.app.App.nodeQuery()

          result = new Result(app.get(obj.getProperty(idProperty)), false);
        }
       
      } else {

        result = app.nodeQuery(type).and(propertyKey, convertedSource).getResult();

      }
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.