Examples of CollectionImpl


Examples of org.wso2.carbon.registry.core.CollectionImpl

        }

        ResourceImpl resourceImpl;
        byte[] contentBytes = new byte[0];
        if (isCollection) {
            resourceImpl = new CollectionImpl();
        } else {
            resourceImpl = new ResourceImpl();
        }

        List<CommentDO> commentDOList = new ArrayList<CommentDO>();
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

            child.serialize(xmlWriter);
        }

        // getting children and applying dump recursively
        if (resource instanceof CollectionImpl) {
            CollectionImpl collection = (CollectionImpl) resource;
            resourceDAO.fillChildren(collection, 0, -1);
            String childPaths[] = collection.getChildren();

            xmlWriter.writeStartElement(DumpConstants.CHILDREN);
            OMText emptyText = factory.createOMText("");
            emptyText.serialize(xmlWriter);
            xmlWriter.flush();
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

            if (files.length > 0) {
                for (File childFile : files) {
                    processImport(childFile, resourcePath, registry);
                }
            } else {
                CollectionImpl resource = new CollectionImpl();
                resource.setPath(resourcePath);
                registry.put(resourcePath, resource);
            }
        } else {
            ResourceImpl resource = new ResourceImpl();
            resource.setContent(new FileInputStream(file));
            resource.setPath(resourcePath);
            registry.put(resourcePath, resource);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        Resource resource;
        if (registry.resourceExists(path)) {
            resource = registry.get(path);
            resource.addProperty(RegistryConstants.REGISTRY_EXISTING_RESOURCE, "true");
        } else {
            resource = new CollectionImpl();
        }
        resource.addProperty(RegistryConstants.REGISTRY_NON_RECURSIVE, "true");
        resource.addProperty(RegistryConstants.REGISTRY_LINK_RESTORATION,
                path + RegistryConstants.URL_SEPARATOR + target +
                        RegistryConstants.URL_SEPARATOR + targetSubPath +
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        //assertTrue("/d15/d14/r1 is not tagged with the tag \"tag1\"", artifactFound);
        assertTrue("tag 'tag1' is not associated with the artifact /d15/d14/r1", tagFound);
    }

    public void testRemoveCollectionTagging() throws Exception {
        CollectionImpl r1 = new CollectionImpl();
        r1.setAuthorUserName("Author q1 remove");
        registry.put("/d15/d14/d13/d12", r1);

        registry.applyTag("/d15/d14/d13", "tag1");
        registry.applyTag("/d15/d14/d13", "tag2");
        registry.applyTag("/d15/d14/d13", "tag3");
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

    }

    public Item getItem(String s) throws PathNotFoundException, RepositoryException {

        Item anItem = null;
        CollectionImpl collection = null;
        String[] tempArr = null;
        String tempPath = s; // example:tempP="/abc/post/test";

        if ((tempPath != null) && (tempPath.contains("["))) {

            tempPath = tempPath.substring(1, tempPath.length() - 1);

        }

        if ((tempPath != null) && (tempPath.contains("/"))) {

            tempArr = tempPath.split("/");

            if (tempArr.length == 2) {
                tempPath = "/";
            } else {

                tempPath = tempPath.substring(0, (tempPath.length()) -
                        (tempArr[tempArr.length - 1].length()) - 1); //parent path
            }

            try {

                if (userRegistry.resourceExists(s)) {

                    if (userRegistry.get(s) instanceof CollectionImpl) {
                        anItem = new RegistryNode(s, this);

                    } else {

                        if (userRegistry.resourceExists(tempPath)) {
                            anItem = new RegistryNode(tempPath, this).getProperty(tempArr[tempArr.length - 1]);

                        }

                    }
                } else {

                    if ((userRegistry.resourceExists(tempPath))) {  // tempPath  is the parent path

                        CollectionImpl parentCol = (CollectionImpl) userRegistry.get(tempPath);   //need to know the int values to be passed

                        if ((parentCol != null) && (parentCol.getProperty(tempArr[tempArr.length - 1]) != null)) {

                            anItem = new RegistryProperty(parentCol, this, tempArr[tempArr.length - 1]);
                            ((RegistryProperty) anItem).setValue(parentCol.getProperty(tempArr[tempArr.length - 1]));

                        }
                    }

                }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        if ((!nodePath.equals("/")) && (((RegistryNode) this.getParent()).getNodetype() != null)) {
            ntName = ((RegistryNode) this.getParent()).getNodetype().getName();
        }

        CollectionImpl subCollection = null;

        try {
            subCollection = (CollectionImpl) registrySession.getUserRegistry().newCollection();
            subCollection.setDescription(ntName);
            subCollection.setProperty("jcr:uuid", absPath)//Here we use node's path as its identifier
            subCollection.setProperty("wso2.registry.jcr.versions", versionList);
            registrySession.getUserRegistry().put(absPath, subCollection);

        } catch (RegistryException e) {
            String msg = "failed to resolve the path of the given node " + this;
            log.debug(msg);
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        RegistryNode subNode = new RegistryNode(absPath, registrySession);

        ntName = s1;

        CollectionImpl subCollection = null;

        try {

            subCollection = (CollectionImpl) registrySession.getUserRegistry().newCollection();
            subCollection.setDescription(ntName);
            subCollection.setProperty("jcr:uuid", absPath)//Here we use node's path as its identifier
            subCollection.setProperty("wso2.registry.jcr.versions", versionList);

            if (ntName.equals("mix:simpleVersionable")) {

                subCollection.setProperty("jcr:checkedOut", "true");
                subCollection.setProperty("jcr:isCheckedOut", "true");
            }

            if (ntName.startsWith("mix")) {

                addMixin(s1);
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        } else if (value == null) {

            try {

                CollectionImpl collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
                collec.removeProperty(s);
                registrySession.getUserRegistry().put(nodePath, collec);

            } catch (RegistryException e) {
                String msg = "failed to resolve the path of the given node or violation of repository syntax " + this;
                log.debug(msg);
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

    }

    public Property setProperty(String s, String[] strings) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {

        List<String> properties = new ArrayList<String>();
        CollectionImpl coll = null;
        try {
            if (strings != null) {
                for (String val : strings) {

                    if (val != null) {

                        properties.add(val);
                    }

                }

                coll = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
                coll.setProperty(s, properties);
                registrySession.getUserRegistry().put(nodePath, coll);
            } else {

                coll = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
                coll.removeProperty(s);
                registrySession.getUserRegistry().put(nodePath, coll);


            }
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.