Package org.structr.core

Examples of org.structr.core.Ownership


        }

        // special keyword "owner"
        if (entity instanceof NodeInterface && "owner".equals(part)) {

          Ownership rel = ((NodeInterface) entity).getIncomingRelationship(PrincipalOwnsNode.class);
          if (rel != null) {

            _data = rel.getSourceNode();

            if (parts.length == 1) {
              return _data;
            }
          }
View Full Code Here


     
      t1.setProperty(AbstractNode.owner, user1);
      t1.setProperty(AbstractNode.owner, group1);
      assertEquals(group1, t1.getProperty(AbstractNode.owner));
     
      Ownership ownerRel = t1.getIncomingRelationship(PrincipalOwnsNode.class);
      assertNotNull(ownerRel);

      // Do additional low-level check here to ensure cardinality!
      List<Relationship> incomingRels = Iterables.toList(t1.getNode().getRelationships(Direction.INCOMING, new PrincipalOwnsNode()));
      assertEquals(1, incomingRels.size());
View Full Code Here

        }

        // special keyword "owner"
        if (entity instanceof NodeInterface && "owner".equals(part)) {

          Ownership rel = ((NodeInterface)entity).getIncomingRelationship(PrincipalOwnsNode.class);
          if (rel != null) {

            _data = rel.getSourceNode();

            if (parts.length == 1) {
              return _data;
            }
          }
View Full Code Here

  @Override
  public Principal getOwnerNode() {

    if (cachedOwnerNode == null) {

      final Ownership ownership = getIncomingRelationshipAsSuperUser(PrincipalOwnsNode.class);
      if (ownership != null) {

        Principal principal = ownership.getSourceNode();
        cachedOwnerNode = (Principal) principal;
      }
    }

    return cachedOwnerNode;
View Full Code Here

TOP

Related Classes of org.structr.core.Ownership

Copyright © 2018 www.massapicom. 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.