Package org.wso2.carbon.registry.resource.ui.clients

Examples of org.wso2.carbon.registry.resource.ui.clients.ResourceServiceClient


        String description = request.getParameter("description");
        description = description.replaceAll("<br>", "\n");
        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        ResourceServiceClient client =
                new ResourceServiceClient(cookie, config, request.getSession());
        client.setDescription(resourcePath, description);

        return description;
    }
View Full Code Here


         String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.delete(pathToDelete);
        } catch (Exception e) {
            String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
            log.error(msg, e);
            throw new UIException(e);
        }
View Full Code Here

        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.addRolePermission(
                    pathToAuthorize, roleToAuthorize, actionToAuthorize, permissionType);
        } catch (Exception e) {
            String msg = "Failed to add new role permission. " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here

        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.addTextResource(parentPath, fileName, mediaType, description, content);
        } catch (Exception e) {
            // having additional details will make the error message long
            String msg = e.getMessage();
            log.error(e);
            // if we skip msg and put just e, error message contain the axis2 fault story
View Full Code Here

        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.addSymbolicLink(parentPath, name, targetPath);
        } catch (Exception e) {
            String msg = "Failed to add symbolic link "+ name + "to the parent collection "
                    + parentPath + ". " + e.getMessage();
            log.error(msg, e);
            throw new UIException(e);
View Full Code Here

        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.changeRolePermissions(resourcePath, permissionInput);

        } catch (Exception e) {
            String msg = "Failed to change role permissions. " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
View Full Code Here

        String cookie = (String) request.
                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.createVersion(resourcePath);
        } catch (Exception e) {
            String msg = "Failed to create version of the resource " + resourcePath + ". " + e.getMessage();
            log.error(msg, e);
            throw new UIException(msg, e);
        }
View Full Code Here

                log.debug("Unable to determine chroot. Symbolic Link cannot be created");
            }
            if (symlinkLocation != null) {
                symlinkLocation = chroot + symlinkLocation;
            }
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            if (JavaUtils.isTrueExplicitly(isAsync)) {
                client.importResource(parentPath, resourceName, mediaType, description, fetchURL, symlinkLocation, true);
            } else {
                client.importResource(parentPath, resourceName, mediaType, description, fetchURL, symlinkLocation, false);
            }
        } catch (Exception e) {
            // having additional details will make the error message long
            String msg = e.getMessage();
            log.error(msg, e);
View Full Code Here

    public static String getGreatestChildVersion(ServletConfig config, HttpSession session,
                                                 String path) throws Exception {
        String[] nodes =
                Utils.getSortedChildNodes(
                        new ResourceServiceClient(config, session).getCollectionContent(
                                path));
        String last = "";
        for (String node : nodes) {
            String name = RegistryUtils.getResourceName(node);
            try {
View Full Code Here

    public static int[] getAdjacentVersions(ServletConfig config, HttpSession session,
                                                 String path, int current) throws Exception {
        String[] nodes =
                Utils.getSortedChildNodes(
                        new ResourceServiceClient(config, session).getCollectionContent(path));
        int[] versions = new int[2];
        versions[0] = -1;
        versions[1] = -1;
        int previous = -1;
        for (String node : nodes) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.resource.ui.clients.ResourceServiceClient

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.