Package org.wso2.carbon.registry.core

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


                tags[i] = tag;
            }
           
            tagBean.setTags(tags);

            ResourcePath resourcePath = new ResourcePath(path);
            tagBean.setPathWithVersion(resourcePath.getPathWithVersion());
            tagBean.setVersionView(!resourcePath.isCurrentVersion());
            List mountPoints = resource.getPropertyValues("registry.mountpoint");
            List targetPoints = resource.getPropertyValues("registry.targetpoint");
//            List paths = resource.getPropertyValues("registry.path");
            List actualPaths = resource.getPropertyValues("registry.actualpath");
            String user = resource.getProperty("registry.user");
View Full Code Here


public class EventTypeBeanPopulator {

    public static EventTypeBean populate(UserRegistry userRegistry, String path) {
        EventTypeBean eventTypeBean = new EventTypeBean();
        ResourcePath resourcePath = new ResourcePath(path);
        try {
            if (Utils.getRegistryEventingService() == null || Utils.getRegistryEventingService().getEventTypes() == null) {
                throw new IllegalStateException("No Event Types defined");
            }
            else {
View Full Code Here

        if (!responseSent) {
            String redirectURL = request.getParameter("redirectURL");
            if (redirectURL != null) {
                RegistryUtils.redirect(response, redirectURL);
            } else {
                ResourcePath resourcePath = new ResourcePath(path);
                RegistryUtils.redirect(
                        response, "/wso2registry/web" + resourcePath.getPathWithVersion());
            }
        }
    }
View Full Code Here

            // Source and target of associations may or may not be resources in the registry. If they
            // don't refer to a resource, they can contain any string value. But if they refer to
            // resources, values should be proper resource paths.

            ResourcePath processedPath = new ResourcePath(resourcePath);
            if (repository.resourceExists(processedPath.getPath())) {
                resourcePath = processedPath.getPathWithVersion();
            }

            context.setResourcePath(new ResourcePath(resourcePath));

            Association[] associations =
                    registryContext.getHandlerManager().getAllAssociations(context);
            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {
View Full Code Here

            // Source and target of associations may or may not be resources in the registry. If they
            // don't refer to a resource, they can contain any string value. But if they refer to
            // resources, values should be proper resource paths.

            ResourcePath processedPath = new ResourcePath(resourcePath);
            if (repository.resourceExists(processedPath.getPath())) {
                resourcePath = processedPath.getPathWithVersion();
            }

            context.setResourcePath(new ResourcePath(resourcePath));
            context.setAssociationType(associationType);

            Association[] associations =
                    registryContext.getHandlerManager().getAssociations(context);
            if (!context.isSimulation()) {
View Full Code Here

        try {

            // start the transaction
            beginTransaction();

            ResourcePath processedPath = new ResourcePath(resourcePath);

            context.setResourcePath(processedPath);
            context.setTag(tag);
            context.setOldTags(getTags(processedPath.getPath()));

            registryContext.getHandlerManager().applyTag(context);
            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {

                    if (!processedPath.isCurrentVersion()) {
                        String msg = "Failed to apply tag to the resource " + processedPath +
                                ". Given path refers to an archived version of the resource.";
                        log.error(msg);
                        throw new RegistryException(msg);
                    }

                    resourcePath = processedPath.getPath();

                    // break the comma separated words into multiple tags
                    String[] tags = tag.split(",");

                    ResourceImpl resource = tagsDAO.getResourceWithMinimumData(resourcePath);
View Full Code Here

        RequestContext context = new RequestContext(this, repository, versionRepository);
        try {
            // start the transaction
            beginTransaction();

            context.setResourcePath(new ResourcePath(path));

            Tag[] output = registryContext.getHandlerManager().getTags(context);
            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {

                    path = RegistryUtils.prepareGeneralPath(path);

                    ResourcePath resourcePath = new ResourcePath(path);
                    VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
                    ResourceImpl resourceImpl;
                    if (versionedPath.getVersion() == -1) {
                        resourceImpl = tagsDAO.getResourceWithMinimumData(resourcePath.getPath());
                    } else {
                        resourceImpl = (ResourceImpl) versionRepository.getMetaData(versionedPath);
                    }

                    if (resourceImpl == null) {
View Full Code Here

        RequestContext context = new RequestContext(this, repository, versionRepository);
        try {
            // start the transaction
            beginTransaction();

            ResourcePath processedPath = new ResourcePath(path);

            context.setResourcePath(processedPath);
            context.setTag(tag);
            context.setOldTags(getTags(processedPath.getPath()));

            registryContext.getHandlerManager().removeTag(context);
            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {

                    if (!processedPath.isCurrentVersion()) {
                        String msg = "Failed to remove tag from the resource " + processedPath +
                                ". Given path refers to an archived version of the resource.";
                        log.error(msg);
                        throw new RegistryException(msg);
                    }

                    path = processedPath.getPath();
                    path = RegistryUtils.prepareGeneralPath(path);

                    String user = CurrentSession.getUser();
                    UserRealm userRealm = CurrentSession.getUserRealm();
View Full Code Here

        RequestContext context = new RequestContext(this, repository, versionRepository);
        try {
            // start the transaction
            beginTransaction();

            ResourcePath processedPath = new ResourcePath(resourcePath);

            context.setResourcePath(processedPath);
            context.setComment(comment);
            context.setOldComments(getComments(processedPath.getPath()));
            String output = registryContext.getHandlerManager().addComment(context);
            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {

                    if (!processedPath.isCurrentVersion()) {
                        String msg = "Failed to add comment to the resource " + processedPath +
                                ". Given path refers to an archived version of the resource.";
                        log.error(msg);
                        throw new RegistryException(msg);
                    }

                    resourcePath = processedPath.getPath();

                    String userName = CurrentSession.getUser();

                    if (!AuthorizationUtils.authorize(resourcePath, ActionConstants.GET)) {
                        String msg =
View Full Code Here

        RequestContext context = new RequestContext(this, repository, versionRepository);
        try {
            // start the transaction
            beginTransaction();

            ResourcePath processedPath = new ResourcePath(commentPath);

            Comment comment = new Comment();
            comment.setCommentPath(commentPath);
            comment.setText(text);
View Full Code Here

TOP

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

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.