Package org.structr.core.app

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


    final App app = StructrApp.getInstance(securityContext);

    try {

      // create new content element
      org.structr.web.entity.dom.DocumentFragment fragment = app.create(org.structr.web.entity.dom.DocumentFragment.class);

      // create relationship from ownerDocument to new text element
      ((RelationProperty<DOMNode>) Page.elements).addSingleElement(securityContext, Page.this, fragment);
      // Page.elements.createRelationship(securityContext, Page.this, fragment);
View Full Code Here


      partialPath += PathHelper.PATH_SEP + part;
      folder = (Folder) FileHelper.getFileByAbsolutePath(securityContext, partialPath);

      if (folder == null) {

        folder = app.create(Folder.class, part);

      }

      if (parent != null) {
View Full Code Here

    final App backendApp = StructrApp.getInstance(SecurityContext.getInstance(user, AccessMode.Backend));

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

      final T result = backendApp.create(type, props);
      tx.success();

      return result;
    }
  }
View Full Code Here

      final String fqcn = entry.getValue();

      SchemaNode schemaNode = app.nodeQuery(SchemaNode.class).andName(type).getFirst();
      if (schemaNode == null) {

        schemaNode = app.create(SchemaNode.class, type);
      }

      schemaNode.setProperty(SchemaNode.extendsClass, fqcn);
      schemaNode.unlockReadOnlyPropertiesOnce();
      schemaNode.setProperty(SchemaNode.isBuiltinType, true);
View Full Code Here

      ResourceAccess grant = app.nodeQuery(ResourceAccess.class).and(ResourceAccess.signature, signature).getFirst();
      if (grant == null) {

        // create new grant
        grants.add(app.create(DynamicResourceAccess.class,
          new NodeAttribute(DynamicResourceAccess.signature, signature),
          new NodeAttribute(DynamicResourceAccess.flags, initialFlagsValue)
        ));

        // create additional grant for the _schema resource
View Full Code Here

          new NodeAttribute(DynamicResourceAccess.signature, signature),
          new NodeAttribute(DynamicResourceAccess.flags, initialFlagsValue)
        ));

        // create additional grant for the _schema resource
        grants.add(app.create(DynamicResourceAccess.class,
          new NodeAttribute(DynamicResourceAccess.signature, "_schema/" + signature),
          new NodeAttribute(DynamicResourceAccess.flags, initialFlagsValue)
        ));

        // create additional grant for the Ui view
View Full Code Here

          new NodeAttribute(DynamicResourceAccess.signature, "_schema/" + signature),
          new NodeAttribute(DynamicResourceAccess.flags, initialFlagsValue)
        ));

        // create additional grant for the Ui view
        grants.add(app.create(DynamicResourceAccess.class,
          new NodeAttribute(DynamicResourceAccess.signature, signature + "/_Ui"),
          new NodeAttribute(DynamicResourceAccess.flags, initialFlagsValue)
        ));
      }
View Full Code Here

    // delete this as the new rel will be the container afterwards
    app.delete(this);

    // create new relationship
    app.create(newStartNode, endNode, relationType, _props);
  }

  @Override
  public void setTargetNodeId(final String targetIdNode) throws FrameworkException {
View Full Code Here

    // delete this as the new rel will be the container afterwards
    app.delete(this);

    // create new relationship and store here
    app.create(startNode, newTargetNode, relationType, _props);
  }

  @Override
  public String getPropertyWithVariableReplacement(SecurityContext securityContext, ActionContext renderContext, PropertyKey<String> key) throws FrameworkException {
    return SchemaHelper.getPropertyWithVariableReplacement(securityContext, this, renderContext, key);
View Full Code Here

    // create new relationships
    for (T targetNode : toBeCreated) {

      relation.ensureCardinality(securityContext, sourceNode, targetNode);

      app.create(sourceNode, targetNode, relation.getClass(), getNotionProperties(securityContext, relation.getClass(), targetNode.getUuid()));
    }
  }

  @Override
  public Iterable<Relationship> getRawSource(final SecurityContext securityContext, final Node dbNode, final Predicate<GraphObject> predicate) {
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.