Package org.gatein.management.api.controller

Examples of org.gatein.management.api.controller.ManagementController


        response.reset();
        response.setContentType("application/zip");
        response.setProperty("Content-disposition", "attachment; filename=\"" + filename + "\"");

        ManagementController controller = (ManagementController) PortalContainer.getComponent(ManagementController.class);
        PathAddress address = PathAddress.pathAddress("mop", type + "sites", name);

        ManagedRequest request = ManagedRequest.Factory.create(OperationNames.EXPORT_RESOURCE, address, ContentType.ZIP);
        ManagedResponse expResponse = controller.execute(request);
        if (expResponse.getOutcome().isSuccess()) {
            expResponse.writeResult(out, true);
        } else {
            throw new Exception(expResponse.getOutcome().getFailureDescription());
        }
View Full Code Here


    }

    public void importSite(FileUploadEvent event) throws Exception {
        UploadedFile item = event.getUploadedFile();

        ManagementController controller = (ManagementController) PortalContainer.getComponent(ManagementController.class);
        Map<String, List<String>> attributes = new HashMap<String, List<String>>(1);
        attributes.put("importMode", Collections.singletonList(importMode));
        ManagedRequest request = ManagedRequest.Factory.create(OperationNames.IMPORT_RESOURCE,
                PathAddress.pathAddress("mop"), attributes, item.getInputStream(), ContentType.ZIP);
        try {
            ManagedResponse response = controller.execute(request);
            if (!response.getOutcome().isSuccess()) {
                addMessage(item.getName());
                log.error(response.getOutcome().getFailureDescription());
            }
        } catch (Exception e) {
View Full Code Here

        final OutputStream os = response.getOutputStream();
        try {
            doInRequest(portalContainerName, new ContainerCallback<Void>() {

                public Void doInContainer(ExoContainer container) throws Exception {
                    ManagementController controller = getComponent(container, ManagementController.class);
                    PathAddress address = PathAddress.pathAddress("mop", type + "sites", name);

                    ManagedRequest request = ManagedRequest.Factory.create(OperationNames.EXPORT_RESOURCE, address,
                            ContentType.ZIP);
                    ManagedResponse response = controller.execute(request);
                    if (response.getOutcome().isSuccess()) {
                        response.writeResult(os);
                    } else {
                        throw new Exception(response.getOutcome().getFailureDescription());
                    }
View Full Code Here

     */
    public List<TreeNode> getRootNodes(String containerName) throws Exception {
        try {
            return doInRequest(containerName, new ContainerCallback<List<TreeNode>>() {
                public List<TreeNode> doInContainer(ExoContainer container) throws Exception {
                    ManagementController controller = getComponent(container, ManagementController.class);
                    List<TreeNode> nodes = new ArrayList<TreeNode>();
                    nodes.add(getSiteTypeNode(controller, "portal"));
                    nodes.add(getSiteTypeNode(controller, "group"));

                    return nodes;
View Full Code Here

        doInRequest(containerName, new ContainerCallback<Void>() {

            @Override
            public Void doInContainer(ExoContainer container) throws Exception {
                ManagementController controller = getComponent(container, ManagementController.class);

                Map<String, List<String>> attributes = new HashMap<String, List<String>>(1);
                attributes.put("importMode", Collections.singletonList(importMode));

                ManagedRequest request = ManagedRequest.Factory.create(OperationNames.IMPORT_RESOURCE,
                        PathAddress.pathAddress("mop"), attributes, in, ContentType.ZIP);

                ManagedResponse response = controller.execute(request);
                if (!response.getOutcome().isSuccess()) {
                    throw new Exception(response.getOutcome().getFailureDescription());
                }

                return null;
View Full Code Here

TOP

Related Classes of org.gatein.management.api.controller.ManagementController

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.