Examples of NodeInterface


Examples of org.structr.core.graph.NodeInterface

  //~--- methods --------------------------------------------------------

  @Override
  public Object convert(Object source) {

    NodeInterface relatedNode = getRelatedNode(true);
    if (relatedNode != null) {

      try {
       
        relatedNode.setProperty(targetKey, source);
       
      } catch (FrameworkException fex) {

        logger.log(Level.WARNING, "Unable to set remote node property {0}", targetKey);
      }
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  }

  @Override
  public Object revert(Object source) {

    NodeInterface relatedNode = getRelatedNode(false);
    if (relatedNode != null) {

      return relatedNode.getProperty(targetKey);
    }

    return null;
  }
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

    T relatedNode = null;

    if ((currentObject != null) && (currentObject instanceof NodeInterface)) {

      NodeInterface localNode = (NodeInterface) currentObject;
      relatedNode = localNode.getProperty(sourceKey);
     
      if (relatedNode == null && add && sourceKey instanceof RelationProperty) {

        final RelationProperty relationProperty = (RelationProperty)sourceKey;
        final App app                           = StructrApp.getInstance();
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  @Override
  public boolean accept(final Relationship item) {

    try {
      final NodeInterface otherNode = nodeFactory.instantiate(item.getOtherNode(thisNode));

      // check predicate if exists
      if (otherNode != null && (nodePredicate == null || nodePredicate.accept(otherNode))) {

        final Class otherNodeType = otherNode.getClass();

        return desiredType.isAssignableFrom(otherNodeType);
      }

    } catch (FrameworkException fex) {
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

   
    if (obj instanceof RelationshipInterface) {
   
      try {
        final Relationship relationship = ((RelationshipInterface)obj).getRelationship();
        final NodeInterface startNode   = new NodeFactory<>(securityContext).instantiate(relationship.getStartNode());
       
        if (startNode != null) {
         
          return startNode.getUuid();
        }
       
      } catch (Throwable t) {
       
        t.printStackTrace();
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  @Override
  public boolean accept(final Relation rel) {

    try {
      final NodeInterface otherNode = nodeFactory.instantiate(rel.getRelationship().getOtherNode(thisNode));
      final Class otherNodeType     = otherNode.getClass();

      return desiredType.isAssignableFrom(otherNodeType) || otherNodeType.isAssignableFrom(desiredType);

    } catch (FrameworkException fex) {
      fex.printStackTrace();
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

    boolean allLocatablesAreValid = false;

    for(RelationshipInterface rel : this.getRelationships(NodeHasLocation.class)) {

      NodeInterface otherNode = rel.getOtherNode(this);
      if(otherNode != null && otherNode instanceof Locatable) {

        // notify other node of location change
        allLocatablesAreValid |= !((Locatable)otherNode).locationChanged();
      }
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

          // do migration of our own ID properties (and only our own!)
          if (node.hasProperty("uuid") && node.getProperty("uuid") instanceof String && !node.hasProperty("id")) {

            try {
              final NodeInterface nodeInterface = nodeFactory.instantiate(node);
              final String uuid = nodeInterface.getProperty(uuidProperty);

              if (uuid != null) {

                nodeInterface.setProperty(GraphObject.id, uuid);
                nodeInterface.removeProperty(uuidProperty);
                actualNodeCount++;
                hasChanges = true;
              }

            } catch (Throwable t) {
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  public PropertyMap getGroupedProperties(SecurityContext securityContext, GraphObject source) {

    if(source instanceof RelationshipInterface) {

      RelationshipInterface rel = (RelationshipInterface)source;
      NodeInterface end         = rel.getTargetNode();

      return super.getGroupedProperties(securityContext, end);
    }

    return null;
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.