Package org.wso2.carbon.registry.core.utils

Examples of org.wso2.carbon.registry.core.utils.VersionedPath


   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        long snapshotID =
                resourceVersionDAO.createSnapshot(pathId, resourceName, versionsInputStream);
        // Associations can be created only once we have created the snapshot, since we need to know
        // the snapshotID.
        if (snapshotID != -1) {
            VersionedPath versionedPath = new VersionedPath();
            versionedPath.setVersion(snapshotID);
            versionedPath.setPath(resourceImpl.getPath());
            associationDAO.copyAssociations(resourceImpl.getPath(), versionedPath.toString());
        }
    }
View Full Code Here

     *
     * @throws RegistryException if the operation failed.
     */
    public void restoreVersion(ResourcePath resourcePath) throws RegistryException {

        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
        if (versionedPath.getVersion() == -1) {
            String msg = "Failed to restore resource. " +
                    versionedPath + " is not a valid version path.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        String versionedResourcePath = versionedPath.getPath();
        long snapshotID = versionedPath.getVersion();


        ResourceIDImpl resourceID = resourceDAO.getResourceID(versionedResourcePath);
        if (!AuthorizationUtils.authorize(versionedResourcePath, ActionConstants.PUT)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
View Full Code Here

            return (mediaType != null && (invert != this.mediaType.equals(mediaType)));
        }

        Resource resource = requestContext.getResource();
        if (resource == null) {
            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                resource = requestContext.getRepository().
                        get(requestContext.getResourcePath().getPath());
                requestContext.setResource(resource);
            }
        }
View Full Code Here

                parentPath = RegistryUtils.
                        getParentPath(requestContext.getResourcePath().getPath());
                requestContext.setParentPath(parentPath);
            }

            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                Resource parentResource = requestContext.getRepository().get(parentPath);
                if (parentResource != null) {
                    if (parentResource instanceof Collection) {
                        parentCollection = (Collection) parentResource;
                        requestContext.setParentCollection(parentCollection);
View Full Code Here

                parentPath = RegistryUtils.
                        getParentPath(requestContext.getResourcePath().getPath());
                requestContext.setParentPath(parentPath);
            }

            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                parentCollection = (Collection) requestContext.getRepository().get(parentPath);
                requestContext.setParentCollection(parentCollection);
            }
        }
View Full Code Here

        }

        commentsDAO.copyComments(oldResource, newResource);
        tagsDAO.copyTags(oldResource, newResource);
        ratingsDAO.copyRatings(oldResource, newResource);
        VersionedPath versionedPath = new VersionedPath();
        versionedPath.setVersion(snapshotID);
        versionedPath.setPath(oldResource.getPath());
        associationDAO.removeAllAssociations(newResource.getPath());
        associationDAO.copyAssociations(versionedPath.toString(), newResource.getPath());

        // finally return the resource path
        return resourcePath;
    }
View Full Code Here

                if (resource == null) {
                    resource = context.getResource();
                }

                if (resource == null) {
                    VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
                    if (versionedPath.getVersion() == -1) {
                        resource = repository.get(resourcePath.getPath());
                    } else {
                        resource = versionRepository.get(versionedPath);
                    }
                }
View Full Code Here

            beginTransaction();

            ResourcePath resourcePath = new ResourcePath(path);
            Resource resource;

            VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
            if (versionedPath.getVersion() == -1) {
                resource = repository.getMetaData(resourcePath.getPath());
            } else {
                resource = versionRepository.getMetaData(versionedPath);
            }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.utils.VersionedPath

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.