Package org.gatein.management.api.controller

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


      if (contentType == null)
      {
         contentType = ContentType.JSON; // default to JSON
      }

      ManagedRequest request = ManagedRequest.Factory.create(operationName, address, parameters, inputStream, contentType);
      request.setLocale(locale);
      return new HttpManagedRequestDelegate(request, httpMethod);
   }
View Full Code Here


        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

        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());
View Full Code Here

                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 {
View Full Code Here

        }
    }

    private TreeNode getSiteTypeNode(ManagementController controller, String siteType) throws Exception {
        try {
            ManagedRequest request = ManagedRequest.Factory.create(OperationNames.READ_RESOURCE,
                    PathAddress.pathAddress("mop", siteType + "sites"), ContentType.JSON);

            ManagedResponse response = controller.execute(request);
            if (!response.getOutcome().isSuccess()) {
                throw new Exception(response.getOutcome().getFailureDescription());
View Full Code Here

                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());
View Full Code Here

TOP

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

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.