Package org.structr.core.entity

Examples of org.structr.core.entity.AbstractNode


        // Try to create node without parameters => should fail
        app.create(TestOne.class);
        fail("Should have raised an org.neo4j.graphdb.NotInTransactionException");
      } catch (org.neo4j.graphdb.NotInTransactionException e) {}

      AbstractNode node = null;

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

        node = app.create(TestOne.class);
        tx.success();
View Full Code Here


  private AbstractRelationship cascadeRel(final Class type1, final Class type2, final int cascadeDeleteFlag) throws FrameworkException {

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

      AbstractNode start       = createTestNode(type1);
      AbstractNode end         = createTestNode(type2);
      AbstractRelationship rel = createTestRelationship(start, end, NodeHasLocation.class);

      rel.setProperty(AbstractRelationship.cascadeDelete, cascadeDeleteFlag);

      tx.success();
View Full Code Here

    final SecurityContext securityContext = getWebSocket().getSecurityContext();

    // Node to clone
    String nodeId = webSocketData.getId();
    final AbstractNode nodeToClone = getNode(nodeId);
    final Map<String, Object> nodeData = webSocketData.getNodeData();
    final String newName;

    if (nodeData.containsKey(AbstractNode.name.dbName())) {
View Full Code Here

    return webSocket;
  }

  public Page getPage(final String id) {

    AbstractNode node = getNode(id);

    if (node != null && node instanceof Page) {

      return (Page) node;
    }
View Full Code Here

    return null;
  }

  public DOMNode getDOMNode(final String id) {

    AbstractNode node = getNode(id);

    if (node != null && node instanceof DOMNode) {

      return (DOMNode) node;
    }
View Full Code Here

    return null;
  }

  public Widget getWidget(final String id) {

    AbstractNode node = getNode(id);

    if (node != null && node instanceof Widget) {

      return (Widget) node;
    }
View Full Code Here

    final SecurityContext securityContext = getWebSocket().getSecurityContext();
    final App app = StructrApp.getInstance(securityContext);

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

      final AbstractNode node = (AbstractNode)app.get(id);

      tx.success();

      return node;
View Full Code Here

  }

  @Override
  public void processMessage(final WebSocketMessage webSocketData) {

    AbstractNode node = getNode(webSocketData.getId());
    String key = (String) webSocketData.getNodeData().get("key");

    if (node != null) {

      PropertyKey propertyKey = StructrApp.getConfiguration().getPropertyKeyForJSONName(node.getClass(), key);
      PropertyConverter converter = propertyKey.inputConverter(getWebSocket().getSecurityContext());

      Object value = node.getProperty(propertyKey);
      if (converter != null) {

        try {
          value = converter.revert(value);
View Full Code Here

      final PropertyKey key = AbstractNode.name;
      final String name     = "89w3hkl sdfghsdkljth";

      props.put(key, name);

      final AbstractNode node = createTestNode(TestOne.class, props);
     
      Result result = null;

      try (final Tx tx = app.tx()) {
       
        result = app.nodeQuery(TestOne.class).andName(name).includeDeletedAndHidden().getResult();

        assertTrue(result.size() == 1);
        assertTrue(result.get(0).equals(node));
      }

      // Change name attribute and search again
      final String name2 = "klppptzoehi gösoiu tzüw0e9hg";

      try (final Tx tx = app.tx()) {
       
        node.setProperty(key, name2);
        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
View Full Code Here

      Date date         = new Date();
      Class type        = TestOne.class;

      props.put(key, date);

      AbstractNode node = createTestNode(type, props);

      try (final Tx tx = app.tx()) {
       
        Result result = app.nodeQuery(type).and(key, date).includeDeletedAndHidden().getResult();
View Full Code Here

TOP

Related Classes of org.structr.core.entity.AbstractNode

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.