Package org.wso2.carbon.registry.core

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


        ResourceIDImpl resourceID = resourceDAO.getResourceID(versionedPath.getPath());

        long snapshotID = versionedPath.getVersion();

        CollectionImpl collectionImpl =
                resourceVersionDAO.get(resourceID, snapshotID, start, pageLen);

        if (collectionImpl == null) {
            String msg = "Resource " + versionedPath.getPath() +
                    " does not have a version " + versionedPath.getVersion();
            log.error(msg);
            throw new RegistryException(msg);
        }

        collectionImpl.setDataAccessManager(dataAccessManager);
        collectionImpl.setUserName(CurrentSession.getUser());
        collectionImpl.setTenantId(CurrentSession.getTenantId());
        collectionImpl.setUserRealm(CurrentSession.getUserRealm());

        collectionImpl.setPath(versionedPath.getPath());
        collectionImpl.setSnapshotID(snapshotID);
        collectionImpl.setMatchingSnapshotID(snapshotID);
        return collectionImpl;
    }
View Full Code Here


                pathList.add(path);
            }
        }

        String[] paths = pathList.toArray(new String[pathList.size()]);
        return new CollectionImpl(paths);
    }
View Full Code Here

        }

        String[] commentPaths = ((JDBCCommentsDAO)commentsDAO).getResourcePathsOfComments(
                commentIDs.toArray(new Long[commentIDs.size()]), conn);

        return new CollectionImpl(commentPaths);
    }
View Full Code Here

        }

        String[] ratingPaths =
                ratingPathList.toArray(new String[ratingPathList.size()]);

        return new CollectionImpl(ratingPaths);
    }
View Full Code Here

            tagPathList.add(tagPath);
        }

        String[] tagPaths = tagPathList.toArray(new String[tagPathList.size()]);

        return new CollectionImpl(tagPaths);
    }
View Full Code Here

    }

    public Collection newCollection() throws RegistryException {
        beginDBQueryLog(2);
        try {
            CollectionImpl coll = new CollectionImpl();
            coll.setAuthorUserName(CurrentSession.getUser());
            return coll;
        } finally {
            endDBQueryLog(2);
        }
    }
View Full Code Here

            if (repository.resourceExists(path)) {
                resource = repository.get(path);
                resource.addProperty(RegistryConstants.REGISTRY_EXISTING_RESOURCE, "true");
            } else if (oldResource != null) {
                if (oldResource instanceof Collection) {
                    resource = new CollectionImpl();
                } else {
                    resource = new ResourceImpl();
                }
            } 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 + CurrentSession.getUser());
View Full Code Here

            if (repository.resourceExists(path)) {
                resource = repository.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

    public Resource get(RequestContext requestContext) throws RegistryException {

        ResourcePath resourcePath = requestContext.getResourcePath();

        Comment[] comments = requestContext.getRegistry().getComments(resourcePath.getPath());
        CollectionImpl resource = new CollectionImpl();
        resource.setDescription("Comments for '" + resourcePath.getPath() + "'");
        resource.setPath(resourcePath.getPath());
        resource.setContent(comments);

        requestContext.setProcessingComplete(true);
        return resource;

    }
View Full Code Here

        if (resourcePath.parameterExists("ratings") &&
                resourcePath.getParameterValue("ratings") == null) {
            ResourceImpl resourceImpl = resourceDAO.getResourceMetaData(resourcePath.getPath());
            String[] ratedUserNames = ratingsDAO.getRatedUserNames(resourceImpl);

            CollectionImpl resource = new CollectionImpl();
            resource.setPath(resourcePath.getCompletePath());
            List<String> ratingPaths = new ArrayList<String>();
            for (String ratedUserName : ratedUserNames) {
                String ratingPath = resourcePath.getPath() + RegistryConstants.URL_SEPARATOR +
                        "ratings:" + ratedUserName;
                ratingPaths.add(ratingPath);
            }

            String[] ratingsContent = ratingPaths.toArray(new String[ratingPaths.size()]);
            resource.setContent(ratingsContent);

            requestContext.setProcessingComplete(true);

            return resource;
        }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.CollectionImpl

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.