Package org.structr.core.app

Examples of org.structr.core.app.App.create()


    final List<T> nodes = new LinkedList<>();

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

      for (int i = 0; i < number; i++) {
        nodes.add(app.create(type));
      }

      tx.success();
    }
View Full Code Here


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

      for (int i = 0; i < number; i++) {

        rels.add((T)app.create(startNode, endNode, relType));
      }

      tx.success();
    }
View Full Code Here

    final List<T> nodes = new LinkedList<>();

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

      for (int i = 0; i < number; i++) {
        nodes.add(app.create(type));
      }

      tx.success();
    }
View Full Code Here

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

      for (int i = 0; i < number; i++) {

        rels.add((T)app.create(startNode, endNode, relType));
      }

      tx.success();
    }
View Full Code Here

        if (errorBuffer.hasError()) {
          throw new FrameworkException(422, errorBuffer);
        }

        newRelationship = app.create(sourceNode, targetNode, entityClass, properties);

        RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_CREATED);
        if (newRelationship != null) {

          result.addHeader("Location", buildLocationHeader(newRelationship));
View Full Code Here

    if (entityClass != null) {

      final App app                = StructrApp.getInstance(securityContext);
      final PropertyMap properties = PropertyMap.inputTypeToJavaType(securityContext, entityClass, propertySet);

      return app.create(entityClass, properties);
    }

    throw new NotFoundException();
  }
View Full Code Here

    final App localAppCtx   = StructrApp.getInstance(securityContext);
    Page page               = null;

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

      page   = localAppCtx.create(Page.class, new NodeAttribute<>(Page.name, name));

      if (importer.parse()) {

        importer.createChildNodesWithHtml(page, page);
      }
View Full Code Here

        }

        if (thumbnail != null && data != null) {

          // Create a thumbnail relationship
          Thumbnails thumbnailRelationship = app.create(originalImage, thumbnail, Thumbnails.class);

          // Thumbnails always have to be removed along with origin image
          thumbnailRelationship.setProperty(AbstractRelationship.cascadeDelete, Relation.SOURCE_TO_TARGET);

          // Add to cache list
View Full Code Here

    properties.put(AbstractNode.name, name != null ? name : "page");
    properties.put(AbstractNode.type, Page.class.getSimpleName());
    properties.put(Page.contentType, "text/html");

    return app.create(Page.class, properties);
  }

  @Override
  protected void checkHierarchy(Node otherNode) throws DOMException {
View Full Code Here

    DOMElement element;
    try {
      final Class entityClass = SchemaHelper.getEntityClassForRawType(elementType);
      if (entityClass != null) {

        element = (DOMElement) app.create(entityClass, new NodeAttribute(DOMElement.tag, tag));
        element.doAdopt(_page);

        return element;
      }
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.