Examples of CollectionImpl


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

    public void setPrimaryType(String s) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException {

        try {

            CollectionImpl collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
            collec.setProperty("jcr:primaryType", 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 void addMixin(String s) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException {

        try {

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

            if (collec.getPropertyValues("jcr:mixinTypes") == null) {

                List list = new ArrayList();
                list.add(s);
                collec.setProperty("jcr:mixinTypes", list);

            } else {

                collec.getPropertyValues("jcr:mixinTypes").add(s);

            }
            registrySession.getUserRegistry().put(nodePath, collec);

        } catch (RegistryException e) {
View Full Code Here

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

    }

    public void removeMixin(String s) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException {

        try {
            CollectionImpl collec = (CollectionImpl) registrySession.getUserRegistry().get(nodePath);
            collec.getPropertyValues("jcr:mixinTypes").remove(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

                sess = (RegistrySession) aa;

                if (sess.getWorkspaceName() != null) {
                    if (sess.getWorkspaceName().equals(s)) {

                        CollectionImpl collec = (CollectionImpl) sess.getUserRegistry().get(nodePath);
                        npath = collec.getPath();
                    }
                } else {

                    throw new NoSuchWorkspaceException();
                }
View Full Code Here

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

            if (!registrySession.getUserRegistry().resourceExists(nodePath)) {
                throw new InvalidItemStateException();
            }

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

            if (col != null) {

                if (nodePath.split("/").length == 2) {
                    parent = "/";

                } else {
                    parent = col.getParentPath();
                }
                par = new RegistryNode(parent, registrySession);
            }

        } catch (RegistryException e) {
View Full Code Here

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

        //  This piece of code was added as fix for the CARBON-9041 BUG, and proper code refactoring
        //  needs to happen in the RegistryResource.java
        //  TODO: This is a CARBON-9041 fix and remove with proper code refactoring.
        if (resource instanceof RegistryResource) {
            ((RegistryResource) resource).setUnderLineResource(new CollectionImpl());
        }
        super.doMkCol(request, response, resource);
    }
View Full Code Here

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

        String path = requestContext.getResourcePath().getPath();

        String confPath = path +
                RegistryConstants.PATH_SEPARATOR + RegistryConstants
                .SYNAPSE_CONF_COLLECTION_NAME;
        CollectionImpl confCollection = new CollectionImpl();
        confCollection.setPath(confPath);
        confCollection.setMediaType(RegistryConstants.SYNAPSE_CONF_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(confPath, confCollection);

        String seqPath = path + RegistryConstants.PATH_SEPARATOR +
                RegistryConstants.SYNAPSE_SEQUENCES_COLLECTION_NAME;
        CollectionImpl seqCollection = new CollectionImpl();
        seqCollection.setPath(seqPath);
        seqCollection.setMediaType(RegistryConstants.SYNAPSE_SEQUENCE_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(seqPath, seqCollection);

        String epPath = path + RegistryConstants.PATH_SEPARATOR +
                RegistryConstants.SYNAPSE_ENDPOINT_COLLECTION_NAME;
        CollectionImpl epCollection = new CollectionImpl();
        epCollection.setPath(epPath);
        epCollection.setMediaType(RegistryConstants.SYNAPSE_ENDPOINT_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(epPath, epCollection);

        String proxyServicesPath = path + RegistryConstants.PATH_SEPARATOR +
                RegistryConstants.SYNAPSE_PROXY_SERVICES_COLLECTION_NAME;
        CollectionImpl proxyCollection = new CollectionImpl();
        proxyCollection.setPath(proxyServicesPath);
        proxyCollection
                .setMediaType(RegistryConstants.SYNAPSE_PROXY_SERVICES_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(proxyServicesPath, proxyCollection);

        String tasksPath = path + RegistryConstants.PATH_SEPARATOR +
                RegistryConstants.SYNAPSE_TASKS_COLLECTION_NAME;
        CollectionImpl tasksCollection = new CollectionImpl();
        tasksCollection.setPath(tasksPath);
        tasksCollection.setMediaType(RegistryConstants.SYNAPSE_TASKS_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(tasksPath, tasksCollection);

        String entriesPath = path + RegistryConstants.PATH_SEPARATOR +
                RegistryConstants.SYNAPSE_ENTRIES_COLLECTION_NAME;
        CollectionImpl entryCollection = new CollectionImpl();
        entryCollection.setPath(entriesPath);
        entryCollection.setMediaType(RegistryConstants.SYNAPSE_ENTRIES_COLLECTION_MEDIA_TYPE);
        requestContext.getRegistry().put(entriesPath, entryCollection);
    }
View Full Code Here

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

            path = RegistryConstants.ROOT_PATH + collectionName;
        } else {
            path = parentPath + RegistryConstants.PATH_SEPARATOR + collectionName;
        }

        CollectionImpl collection = null;
        try {
            collection = (CollectionImpl) registry.newCollection();
        } catch (RegistryException e) {
            String msg = "Failed to create new collection instance for the collection " +
                    path + ". " + e.getMessage();
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }

        collection.setPath(path);
        if (!mediaType.equals(RegistryConstants.DEFAULT_MEDIA_TYPE)) {
            collection.setMediaType(mediaType);
        }
        collection.setDescription(description);

        try {
            registry.put(path, collection);
        } catch (RegistryException e) {
            String msg = "Failed to add collection " + path + ". " +
View Full Code Here

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

                String[] regVerPaths = ((RegistrySession) session).getUserRegistry().getVersions(s);
                latestVersionPath = regVerPaths[0]; //Here we assume that latest version path is given by the last element of tye version array

                if (((RegistrySession) session).getUserRegistry().get(s) instanceof CollectionImpl) {

                    CollectionImpl tempColl = ((CollectionImpl) ((RegistrySession) session).getUserRegistry().get(s));
                    tempColl.getPropertyValues("wso2.registry.jcr.versions").add(latestVersionPath);
                    ((RegistrySession) session).getUserRegistry().put(s, tempColl);
                }

                ((CollectionImpl) ((RegistrySession) session).getUserRegistry().get(s)).getPropertyValues("wso2.registry.jcr.versions");
            } catch (RegistryException e) {
View Full Code Here

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

                "/custom-queries";
    }

    public Node storeAsNode(String s) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException {
        RegistryNode node = new RegistryNode(s, session);
        CollectionImpl subCollection = null;

        try {
            subCollection = (CollectionImpl) session.getUserRegistry().newCollection();
            subCollection.setDescription("nt:query");
            session.getUserRegistry().put(s, subCollection);

        } catch (RegistryException e) {
            e.printStackTrace();
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.