Examples of ResourceServiceClient


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

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

        try {
            ResourceServiceClient client =
                    new ResourceServiceClient(cookie, config, request.getSession());
            client.renameResource(parentPath, oldResourcePath, newName);
           
        } catch (Exception e) {
            String msg = "Failed to rename resource " + oldResourcePath +
                    " to the name " + newName + ". " + e.getMessage();
            log.error(msg, e);
View Full Code Here

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

    public static void getContent(HttpServletRequest request, HttpServletResponse response, ServletConfig config)
            throws Exception {

        try {
            ResourceServiceClient client = new ResourceServiceClient(config, request.getSession());
            String path = request.getParameter("path");
            if (path == null) {
                String msg = "Could not get the resource content. Path is not specified.";
                log.error(msg);
                response.setStatus(400);
                return;
            }

            ContentDownloadBean bean = client.getContentDownloadBean(path);

            InputStream contentStream = null;
            if (bean.getContent() != null) {
                contentStream = bean.getContent().getInputStream();
            } else {
View Full Code Here

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

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

         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

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

        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

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

        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

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

        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

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

        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

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

        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

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

                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
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.