Package org.apache.sling.ide.transport

Examples of org.apache.sling.ide.transport.ResourceProxy.addProperty()


    }

    private ResourceProxy newResourceWithProperties(Map<String, Object> properties) {
        ResourceProxy resource = new ResourceProxy("/");
        for (Map.Entry<String, Object> entry : properties.entrySet()) {
            resource.addProperty(entry.getKey(), entry.getValue());
        }
        return resource;
    }

    @Test
View Full Code Here


            path = parent.getPath() + "/" + name;
        }

        ResourceProxy resourceProxy = new ResourceProxy(path);
        // set defaults
        resourceProxy.addProperty("jcr:nodeTypeName", name);
        resourceProxy.addProperty("jcr:primaryType", "nt:nodeType");
        resourceProxy.addProperty("jcr:isMixin", false);
        resourceProxy.addProperty("jcr:mixinTypes", new String[] {});
        return new NodeTypeResourceBuilder(resourceProxy);
    }
View Full Code Here

        }

        ResourceProxy resourceProxy = new ResourceProxy(path);
        // set defaults
        resourceProxy.addProperty("jcr:nodeTypeName", name);
        resourceProxy.addProperty("jcr:primaryType", "nt:nodeType");
        resourceProxy.addProperty("jcr:isMixin", false);
        resourceProxy.addProperty("jcr:mixinTypes", new String[] {});
        return new NodeTypeResourceBuilder(resourceProxy);
    }
View Full Code Here

        ResourceProxy resourceProxy = new ResourceProxy(path);
        // set defaults
        resourceProxy.addProperty("jcr:nodeTypeName", name);
        resourceProxy.addProperty("jcr:primaryType", "nt:nodeType");
        resourceProxy.addProperty("jcr:isMixin", false);
        resourceProxy.addProperty("jcr:mixinTypes", new String[] {});
        return new NodeTypeResourceBuilder(resourceProxy);
    }

    private ResourceProxy resource;
View Full Code Here

        ResourceProxy resourceProxy = new ResourceProxy(path);
        // set defaults
        resourceProxy.addProperty("jcr:nodeTypeName", name);
        resourceProxy.addProperty("jcr:primaryType", "nt:nodeType");
        resourceProxy.addProperty("jcr:isMixin", false);
        resourceProxy.addProperty("jcr:mixinTypes", new String[] {});
        return new NodeTypeResourceBuilder(resourceProxy);
    }

    private ResourceProxy resource;
View Full Code Here

            ResourceProxy resource = new ResourceProxy(path);

            JSONObject json = new JSONObject(get.getResponseBodyAsString());
            String primaryType = json.optString(Repository.JCR_PRIMARY_TYPE);
            if (primaryType != null) { // TODO - needed?
                resource.addProperty(Repository.JCR_PRIMARY_TYPE, primaryType);
            }

            // TODO - populate all properties

            for (Iterator<?> keyIterator = json.keys(); keyIterator.hasNext();) {
View Full Code Here

                String key = (String) keyIterator.next();
                JSONObject value = json.optJSONObject(key);
                if (value != null) {
                    ResourceProxy child = new ResourceProxy(PathUtil.join(path, key));
                    child.addProperty(Repository.JCR_PRIMARY_TYPE, value.optString(Repository.JCR_PRIMARY_TYPE));
                    resource.addChild(child);
                }
            }
       
            return AbstractResult.success(resource);
View Full Code Here

            JSONArray names = result.names();
            for (int i = 0; i < names.length(); i++) {
                String name = names.getString(i);
                Object object = result.get(name);
                if (object instanceof String) {
                    resource.addProperty(name, object);
                } else {
                    System.out.println("Property '" + name + "' of type '" + object.getClass().getName()
                            + " is not handled");
                }
            }
View Full Code Here

            Property property = properties.nextProperty();
            String propertyName = property.getName();
            Object propertyValue = ConversionUtils.getPropertyValue(property);
   
            if (propertyValue != null) {
                resource.addProperty(propertyName, propertyValue);
            }
        }
   
        return resource;
   
View Full Code Here

            session.save();

            ResourceProxy resource = newResource("/content", NodeType.NT_UNSTRUCTURED);
            if (newPropertyValues != null) {
                resource.addProperty(PROP_NAME, newPropertyValues);
            }

            AddOrUpdateNodeCommand cmd = new AddOrUpdateNodeCommand(repo, credentials, null, resource, logger);
            cmd.execute().get();
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.