Package org.structr.core.property

Examples of org.structr.core.property.PropertyMap


        message.setId(relationship.getUuid());
        message.getModifiedProperties().addAll(modificationEvent.getModifiedProperties().keySet());
        message.getRemovedProperties().addAll(modificationEvent.getRemovedProperties().keySet());
        message.setNodeData(modificationEvent.getData(securityContext));

        final PropertyMap relProperties = relationship.getProperties();
        final NodeInterface startNode = relationship.getSourceNode();
        final NodeInterface endNode = relationship.getTargetNode();

        relProperties.put(new StringProperty("startNodeId"), startNode.getUuid());
        relProperties.put(new StringProperty("endNodeId"), endNode.getUuid());

        final Map<String, Object> properties = PropertyMap.javaTypeToInputType(securityContext, relationship.getClass(), relProperties);

        message.setRelData(properties);
View Full Code Here


    if (results != null && !results.isEmpty()) {

      final Class type = results.get(0).getClass();

      PropertyMap properties = PropertyMap.inputTypeToJavaType(securityContext, type, propertySet);

      for (final GraphObject obj : results) {

        for (final Entry<PropertyKey, Object> attr : properties.entrySet()) {

          obj.setProperty(attr.getKey(), attr.getValue());

        }
View Full Code Here

      if (template != null) {

        final NodeInterface sourceNode        = identifyStartNode(template, propertySet);
        final NodeInterface targetNode        = identifyEndNode(template, propertySet);
        final PropertyMap properties          = PropertyMap.inputTypeToJavaType(securityContext, entityClass, propertySet);
        RelationshipInterface newRelationship = null;

        if (sourceNode == null) {
          errorBuffer.add(entityClass.getSimpleName(), new EmptyPropertyToken(template.getSourceIdProperty()));
        }
View Full Code Here

  public NodeInterface createNode(final Map<String, Object> propertySet) throws FrameworkException {

    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

      logger.log(Level.SEVERE, "Unknown entity type {0}", typeName);
      return null;
    }

    final PropertyMap properties             = PropertyMap.databaseTypeToJavaType(securityContext, nodeType, receivedNodeData.getProperties());
    final String uuid                        = receivedNodeData.getSourceNodeId();
    NodeInterface newOrExistingNode          = null;

    final NodeInterface existingCandidate = app.nodeQuery().and(GraphObject.id, uuid).includeDeletedAndHidden().getFirst();
    if (existingCandidate != null && existingCandidate instanceof NodeInterface) {
View Full Code Here

      final Class relType                   = config.getRelationshipEntityClass(typeName);

      if (targetStartNode != null && targetEndNode != null) {

        final RelationshipInterface existingCandidate = app.relationshipQuery().and(GraphObject.id, uuid).includeDeletedAndHidden().getFirst();
        final PropertyMap properties = PropertyMap.databaseTypeToJavaType(securityContext, relType, receivedRelationshipData.getProperties());

        if (existingCandidate != null) {

          // merge properties?
          ((Syncable) existingCandidate).updateFromPropertyMap(properties);
View Full Code Here

   * @throws IOException
   */
  public static Image createImage(final SecurityContext securityContext, final byte[] imageData, final String contentType, final Class<? extends Image> imageType, final String name, final boolean markAsThumbnail)
    throws FrameworkException, IOException {

    PropertyMap props                          = new PropertyMap();

    props.put(AbstractNode.type, imageType == null ? Image.class.getSimpleName() : imageType.getSimpleName());
    props.put(Image.isThumbnail, markAsThumbnail);
    props.put(AbstractNode.name, name);

    Image newImage = StructrApp.getInstance(securityContext).create(imageType, props);

    if (imageData != null && imageData.length > 0) {

View Full Code Here

   * @throws FrameworkException
   */
  public static Page createNewPage(SecurityContext securityContext, String name) throws FrameworkException {

    final App app = StructrApp.getInstance(securityContext);
    final PropertyMap properties = new PropertyMap();

    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);
  }
View Full Code Here

   * @throws IOException
   */
  public static <T extends org.structr.dynamic.File> T createFile(final SecurityContext securityContext, final byte[] fileData, final String contentType, final Class<T> t, final String name)
    throws FrameworkException, IOException {

    PropertyMap props = new PropertyMap();

    props.put(AbstractNode.name, name);

    T newFile = (T) StructrApp.getInstance(securityContext).create(t, props);

    setFileData(newFile, fileData, contentType);

View Full Code Here

    try {

      List<TestUser> users = createTestNodes(TestUser.class, 1);
      TestUser user = (TestUser) users.get(0);

      PropertyMap props = new PropertyMap();
      props.put(AbstractNode.visibleToPublicUsers, true);

      // Create two nodes with user context, one of them is visible to public users
      Class type = TestOne.class;
      TestOne t1 = createTestNode(TestOne.class, props, user);
      TestOne t2 = createTestNode(TestOne.class, user);
View Full Code Here

TOP

Related Classes of org.structr.core.property.PropertyMap

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.