Examples of CollectionImpl


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

        return setProperty(s, strings);
    }

    public Property setProperty(String s, String s1) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {

        CollectionImpl collc = null;

        try {
            if (s1 != null) {
                collc = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
                List lis = new ArrayList();
                lis.add(s1);
                collc.setProperty(s, lis);
                registrySession.getUserRegistry().put(nodePath, collc);

            } else {

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

            }

        } catch (RegistryException e) {
View Full Code Here

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

    }

    public NodeIterator getNodes() throws RepositoryException {

        HashSet nodes = new HashSet();
        CollectionImpl tempCollection = null;
        try {

            if (registrySession.getUserRegistry().get(nodePath) instanceof CollectionImpl) {
                tempCollection = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);

                String[] children = tempCollection.getChildren();

                for (int i = 0; i < children.length; i++) {

                    nodes.add(registrySession.getNode(children[i]));
View Full Code Here

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

        Set nodes = new HashSet();

        try {

            CollectionImpl coll = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
            String[] childpaths = coll.getChildren();

            for (int i = 0; i < childpaths.length; i++) {
                Node node = new RegistryNode(childpaths[i], registrySession);
                nodes.add(node);
            }
View Full Code Here

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

        Set<String> propNamesList = new HashSet<String>();
        Set<Property> properties = new HashSet<Property>();

        //
        CollectionImpl coll = null;
        try {
            if (registrySession.getUserRegistry().get(nodePath) instanceof CollectionImpl) {

                coll = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);

                String[] childPaths = coll.getChildren();

                for (int i = 0; i < childPaths.length; i++) {
                    Resource res = registrySession.getUserRegistry().get(childPaths[i]);

                    if ((res instanceof ResourceImpl) && (res.getProperty("registry.jcr.property.type") != null)) {
                        String[] temp = childPaths[i].split("/");
                        propNamesList.add(temp[temp.length - 1]);

                    }
                }

                Properties propyList = coll.getProperties();
                Enumeration en = propyList.propertyNames();
                while (en.hasMoreElements()) {
                    String pName = en.nextElement().toString();
                    if ((pName != null) && (!isImplicitProperty(pName))) {
                        propNamesList.add(pName);
View Full Code Here

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

        String propName = tempArr[tempArr.length - 1];

        try {

            if (registrySession.getUserRegistry().resourceExists(tempPath)) {
                CollectionImpl c = (CollectionImpl) registrySession.getUserRegistry().get(tempPath);

                if (c.getProperty(propName) != null) {
                    hasProperty = true;

                }

            } else if (registrySession.getUserRegistry().resourceExists(absPath)) {
View Full Code Here

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

    }

    public boolean hasNodes() throws RepositoryException {

        boolean hasNodes = true;
        CollectionImpl collec = null;
        try {

            if ((registrySession.getUserRegistry().resourceExists(nodePath)) && ((registrySession.getUserRegistry().get(nodePath) instanceof CollectionImpl))) {

                collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);

            }

            if (collec != null) {
                String[] children = collec.getChildren();

                if (children != null) {
                    if (children.length == 0) hasNodes = false;
                }
            }
View Full Code Here

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

                        Resource resourceImpl = ((RegistryResource) resource).getUnderLineResource();
                        boolean isCollection = resourceImpl instanceof Collection;
                        // 'resourceImpl == null' indicates it's a new non-collection resource created by the client
                        // @see:  org.wso2.carbon.registry.webdav.RegistryServlet.doMkCol()
                        if (null == resourceImpl) {
                            resourceImpl = isCollection ? new CollectionImpl() : new ResourceImpl();
                            //setting path and underline resource only for newly created resources
                            ((ResourceImpl) resourceImpl).setPath(resource.getResourcePath());
                            ((RegistryResource) resource).setUnderLineResource(resourceImpl);
                            //if (!isCollection) {
                            resourceCache.updateDavResourceMimeType((RegistryResource) resource);
View Full Code Here

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

    }

    public boolean hasProperties() throws RepositoryException {

        boolean hasProperties = true;
        CollectionImpl coll = null;
        try {
            coll = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);

        } catch (RegistryException e) {

            String msg = "failed to resolve the path of the given node or violation of repository syntax " + this;
            log.debug(msg);
            throw new RepositoryException(msg, e);

        }

        Properties propyList = coll.getProperties();
        Set<String> propNames = getCollectionProperties(propyList);

        if (propNames.size() == 0) {

            hasProperties = false;
View Full Code Here

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

    }

    public NodeType getPrimaryNodeType() throws RepositoryException {

        NodeType nt = null;
        CollectionImpl collec = null;
        String priType = null;
        try {
            if (registrySession.getUserRegistry().get(nodePath) instanceof CollectionImpl) {
                collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
                priType = collec.getProperty("jcr:primaryType");
            }

            Iterator it = registrySession.getRepository().getNodeTypeList().iterator();

            while (it.hasNext()) {
View Full Code Here

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

    public boolean isNodeType(String s) throws RepositoryException {
        boolean isNodeType = false;

        try {

            CollectionImpl collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);

            if ((collec.getPropertyValues("jcr:mixinTypes") != null) && (collec.getPropertyValues("jcr:mixinTypes").contains(s))) {

                isNodeType = true;

            } else if ((getPrimaryNodeType() != null) && (getPrimaryNodeType().getName().equals(s))) {
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.