Examples of NodeInterface


Examples of org.structr.core.graph.NodeInterface

          String type = entityClass.getSimpleName();

          logger.log(Level.INFO, "Creating relationship of type {0}", type);

          List<GenericNode> nodes        = createTestNodes(GenericNode.class, 2);
          final NodeInterface startNode  = nodes.get(0);
          final NodeInterface endNode    = nodes.get(1);
          final RelationshipType relType = RelType.IS_AT;
          NodeHasLocation rel       = app.create(startNode, endNode, NodeHasLocation.class);

          assertTrue(rel != null);
          assertTrue(rel.getType().equals(relType.name()));
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

      final PropertyMap props = new PropertyMap();
      final String type       = "UnknownTestType";
      final String name       = "GenericNode-name";
     
      NodeInterface node      = null;

      props.put(AbstractNode.type, type);
      props.put(AbstractNode.name, name);

      try (final Tx tx = app.tx()) {
       
        node = app.create(GenericNode.class, props);
        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
        // Check defaults
        assertEquals(GenericNode.class.getSimpleName(), node.getProperty(AbstractNode.type));
        assertTrue(node.getProperty(AbstractNode.name).equals(name));
        assertTrue(!node.getProperty(AbstractNode.hidden));
        assertTrue(!node.getProperty(AbstractNode.deleted));
        assertTrue(!node.getProperty(AbstractNode.visibleToAuthenticatedUsers));
        assertTrue(!node.getProperty(AbstractNode.visibleToPublicUsers));
      }

      final String name2 = "GenericNode-name-äöüß";

      try (final Tx tx = app.tx()) {
       
        // Modify values
        node.setProperty(AbstractNode.name, name2);
        node.setProperty(AbstractNode.hidden, true);
        node.setProperty(AbstractNode.deleted, true);
        node.setProperty(AbstractNode.visibleToAuthenticatedUsers, true);
        node.setProperty(AbstractNode.visibleToPublicUsers, true);

        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
        assertTrue(node.getProperty(AbstractNode.name).equals(name2));
        assertTrue(node.getProperty(AbstractNode.hidden));
        assertTrue(node.getProperty(AbstractNode.deleted));
        assertTrue(node.getProperty(AbstractNode.visibleToAuthenticatedUsers));
        assertTrue(node.getProperty(AbstractNode.visibleToPublicUsers));
      }

    } catch (FrameworkException ex) {

      logger.log(Level.SEVERE, ex.toString());
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

   
    if (obj instanceof RelationshipInterface) {
   
      try {
        final Relationship relationship = ((RelationshipInterface)obj).getRelationship();
        final NodeInterface endNode     = new NodeFactory<>(securityContext).instantiate(relationship.getEndNode());

        if (endNode != null) {
         
          return endNode.getUuid();
        }
       
      } catch (Throwable t) {
       
        t.printStackTrace();
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  public PropertyMap getGroupedProperties(SecurityContext securityContext, GraphObject source) {

    if(source instanceof AbstractRelationship) {

      RelationshipInterface rel = (RelationshipInterface)source;
      NodeInterface startNode   = rel.getSourceNode();

      return super.getGroupedProperties(securityContext, startNode);
    }

    return null;
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

      return;
    }

    final App app = StructrApp.getInstance(securityContext);

    final NodeInterface newStartNode = (NodeInterface)app.get(startNodeId);
    final NodeInterface endNode      = getTargetNode();
    final Class relationType         = getClass();
    final PropertyMap _props         = getProperties();
    final String type                = this.getClass().getSimpleName();

    if (newStartNode == null) {
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

      return;
    }

    final App app = StructrApp.getInstance(securityContext);

    final NodeInterface newTargetNode = (NodeInterface)app.get(targetIdNode);
    final NodeInterface startNode     = getSourceNode();
    final Class relationType          = getClass();
    final PropertyMap _props          = getProperties();
    final String type                 = this.getClass().getSimpleName();

    if (newTargetNode == null) {
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

  }

  protected <T extends Relation> List<T> createTestRelationships(final Class<T> relType, final int number) throws FrameworkException {

    List<GenericNode> nodes = createTestNodes(GenericNode.class, 2);
    final NodeInterface startNode = nodes.get(0);
    final NodeInterface endNode = nodes.get(1);

    try (final Tx tx = app.tx()) {

      List<T> rels = new LinkedList<>();
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

public class RenderContextTest extends StructrUiTest {

  public void testVariableReplacementInDynamicTypes() {

    SchemaNode itemNode  = null;
    NodeInterface parent = null;
    NodeInterface child1 = null;
    NodeInterface child2 = null;

    try (final Tx tx = app.tx()) {

      itemNode = app.create(SchemaNode.class, new NodeAttribute(SchemaNode.name, "Item"));
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

    try {

      final PropertyMap properties  = PropertyMap.inputTypeToJavaType(securityContext, nodeData);
      Class type      = SchemaHelper.getEntityClassForRawType(properties.get(AbstractNode.type));
      final NodeInterface newNode  = app.create(type, properties);

      // check for File node and store in WebSocket to receive chunks
      if (newNode instanceof FileBase) {

        Long size    = (Long) webSocketData.getNodeData().get("size");
View Full Code Here

Examples of org.structr.core.graph.NodeInterface

    final Object value = serverConnection.getValue(key + "Nodes");
    if (value instanceof List) {

      final List<NodeInterface> nodes = (List<NodeInterface>)value;
      final NodeInterface node        = nodes.get(nodeIndex);
      final File file                 = (File)node;

      serverConnection.send(new FileNodeDataContainer(file));
    }
  }
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.