Package org.structr.core.graph

Examples of org.structr.core.graph.NodeInterface


          final String userName = (String) parameters[0];

          for (final Node n : index.get(AbstractNode.name.dbName(), userName)) {

            final NodeInterface s = nodeFactory.instantiate(n);

            if (s.getType().equals(Principal.class.getSimpleName())) {

              return s;

            }
View Full Code Here


    if(currentObject instanceof AbstractRelationship) {
     
      AbstractRelationship rel = (AbstractRelationship)currentObject;
      if(rel != null) {
       
        NodeInterface startNode = rel.getSourceNode();
        if(startNode != null) {
         
          return startNode.getType();
        }
      }
    }
   
    return null;
View Full Code Here

    if (currentObject instanceof AbstractRelationship) {
     
      AbstractRelationship rel = (AbstractRelationship) currentObject;
      if (rel != null) {
       
        NodeInterface endNode = rel.getTargetNode();
        if (endNode != null) {
         
          return endNode.getType();
        }
      }
    }
   
    return null;
View Full Code Here

  @Override
  public List<T> getProperty(SecurityContext securityContext, GraphObject currentObject, boolean applyConverter, final org.neo4j.helpers.Predicate<GraphObject> predicate) {
   
    if(currentObject != null && currentObject instanceof AbstractNode) {
     
      NodeInterface sourceNode  = (NodeInterface)currentObject;
      List<NodeInterface> nodes = new LinkedList<>();

      // 1. step: add all nodes
      for(Property property : aggregation.getAggregationProperties()) {
       
        Object obj = sourceNode.getProperty(property);
        if (obj != null && obj instanceof Collection) {
       
          nodes.addAll((Collection)obj);
        }
      }
View Full Code Here

  //~--- 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

  }

  @Override
  public Object revert(Object source) {

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

      return relatedNode.getProperty(targetKey);
    }

    return null;
  }
View Full Code Here

    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

  @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

   
    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

  @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

TOP

Related Classes of org.structr.core.graph.NodeInterface

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.