Package org.structr.core.app

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


              AbstractFile fileOrFolder = null;

              if (entry.isDirectory()) {

                fileOrFolder = app.create(Folder.class, name);

              } else {

                fileOrFolder = ImageHelper.isImageType(name)
                  ? ImageHelper.createImage(securityContext, in, null, Image.class, name, false)
View Full Code Here


      try {

        PropertyMap nodeProperties = PropertyMap.inputTypeToJavaType(securityContext, properties);

        nodeToInsert = app.create(DOMNode.class, nodeProperties);
       
      } catch (FrameworkException fex) {

        logger.log(Level.WARNING, "Could not create node.", fex);
        getWebSocket().send(MessageBuilder.status().code(fex.getStatus()).message(fex.getMessage()).build(), true);
View Full Code Here

      if ((nodeToInsert != null) && (parentNode != null)) {

        try {

          PropertyMap relProperties = PropertyMap.inputTypeToJavaType(securityContext, relData);
          app.create(parentNode, nodeToInsert, DOMChildren.class, relProperties);
         
        } catch (FrameworkException t) {

          getWebSocket().send(MessageBuilder.status().code(400).message(t.getMessage()).build(), true);
View Full Code Here

          // Create new relationship to user and grant permissions to user or group
          Principal owner = (Principal)user;

          App app = StructrApp.getInstance(securityContext);
         
          app.create(owner, (NodeInterface)node, PrincipalOwnsNode.class);
         
          Security securityRel = app.create(owner, (NodeInterface)node, Security.class);
          securityRel.setAllowed(Permission.values());

          node.unlockReadOnlyPropertiesOnce();
View Full Code Here

          App app = StructrApp.getInstance(securityContext);
         
          app.create(owner, (NodeInterface)node, PrincipalOwnsNode.class);
         
          Security securityRel = app.create(owner, (NodeInterface)node, Security.class);
          securityRel.setAllowed(Permission.values());

          node.unlockReadOnlyPropertiesOnce();
          node.setProperty(AbstractNode.createdBy, user.getProperty(GraphObject.id));
        }
View Full Code Here

      }

    } else if (createIfNotExisting) {

      return app.create(type);
    }

    return null;
  }
}
View Full Code Here

        case 0:

          if (createIfNotExisting) {

            // create node and return it
            T newNode = app.create(type, attributes);
            if (newNode != null) {

              return newNode;
            }           
          }
View Full Code Here

      case 0 :
        if ((convertedSource != null) && createIfNotExisting) {

          // create node and return it
          T newNode = app.create(type);

          if (newNode != null) {
            newNode.setProperty(propertyKey, convertedSource);
            return newNode;
          }
View Full Code Here

        final Class<T> relatedType              = relationProperty.getTargetType();

        if (relatedType != null) {
         
          try {
            relatedNode = app.create(relatedType);
            relationProperty.addSingleElement(securityContext, localNode, relatedNode);

          } catch (FrameworkException fex) {

            fex.printStackTrace();
View Full Code Here

    // create new relationships
    for (S sourceNode : toBeCreated) {

      relation.ensureCardinality(securityContext, sourceNode, targetNode);
     
      app.create(sourceNode, targetNode, relation.getClass(), getNotionProperties(securityContext, relation.getClass(), sourceNode.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.