Package org.gatein.management.api.operation.model

Examples of org.gatein.management.api.operation.model.ReadResourceModel


      Set<String> children = new LinkedHashSet<String>(3);
      children.add("portalsites");
      children.add("groupsites");
      children.add("usersites");

      resultHandler.completed(new ReadResourceModel("Available site types.", children));
   }
View Full Code Here


               }
            }
         }
      }

      resultHandler.completed(new ReadResourceModel("Available artifacts for site " + getSiteKey(site), children));
   }
View Full Code Here

      for (NodeContext child : node.getNodes())
      {
         children.add(child.getName());
      }

      ReadResourceModel model = new ReadResourceModel("Navigation nodes available at this resource.", children);
      resultHandler.completed(model);
   }
View Full Code Here

         else if (pageOrNav)
         {
            children.add(site.getName());
         }
      }
      resultHandler.completed(new ReadResourceModel("Available sites for site type '" + getSiteType(siteType).getName() + "'", children));
   }
View Full Code Here

public class SiteLayoutReadResource extends AbstractSiteOperationHandler
{
   @Override
   protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site) throws ResourceNotFoundException, OperationException
   {
      ReadResourceModel readResource = new ReadResourceModel(
         "The site layout for site " + site.getName(), Collections.<String>emptySet());

      resultHandler.completed(readResource);
   }
View Full Code Here

         for (Page page : pageList)
         {
            children.add(page.getName());
         }

         resultHandler.completed(new ReadResourceModel("List of all available pages for site '" + rootPage.getSite().getName() +"'", children));
      }
      else
      {
         DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
         PageKey pageKey = new PageKey(getSiteKey(rootPage.getSite()), pageName);

         if (PageUtils.getPage(dataStorage, pageKey, operationContext.getOperationName()) == null)
         {
            throw new ResourceNotFoundException("No page found for " + pageKey);
         }

         resultHandler.completed(new ReadResourceModel("List of child pages for page '" + pageName +"'", Collections.<String>emptySet()));
      }
   }
View Full Code Here

            Object result = resultHandler.getResult();

            // Set descriptions based on the ManagedResource so 'dynamic' extensions don't have to.
            if (result instanceof ReadResourceModel)
            {
               ReadResourceModel readResource = (ReadResourceModel) result;
               if (!readResource.isChildDescriptionsSet())
               {
                  populateChildDescriptions(root, address, readResource);
               }

               if (readResource.getOperations().isEmpty())
               {
                  Map<String, ManagedDescription> descriptions = root.getOperationDescriptions(address);
                  for (Map.Entry<String, ManagedDescription> desc : descriptions.entrySet())
                  {
                     readResource.addOperation(new NamedDescription(desc.getKey(), desc.getValue().getDescription()));
                  }
               }
            }

            return new SuccessfulResponse<Object>(bindingProvider, result, request.getContentType());
View Full Code Here

      {
         ManagedResource resource = operationContext.getManagedResource();
         PathAddress address = operationContext.getAddress();

         Set<String> children = resource.getSubResourceNames(address);
         ReadResourceModel readResourceModel = new ReadResourceModel("Available operations and children (sub-resources).", children);

         // Set children descriptions
         for (String child : children)
         {
            ManagedDescription desc = resource.getResourceDescription(address.append(child));
            readResourceModel.setChildDescription(child, desc.getDescription());
         }

         // Set operation descriptions
         Map<String, ManagedDescription> descriptions = resource.getOperationDescriptions(address);
         for (Map.Entry<String, ManagedDescription> desc : descriptions.entrySet())
         {
            readResourceModel.addOperation(new NamedDescription(desc.getKey(), desc.getValue().getDescription()));
         }

         return readResourceModel;
      }
View Full Code Here

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

            ReadResourceModel result = (ReadResourceModel) response.getResult();
            List<TreeNode> children = new ArrayList<TreeNode>(result.getChildren().size());
            for (String siteName : result.getChildren()) {
                TreeNode siteNode = new TreeNode(siteName);
                siteNode.setExportable(true);
                siteNode.setType(siteType);
                siteNode.setSiteName(siteName);
                children.add(siteNode);
View Full Code Here

TOP

Related Classes of org.gatein.management.api.operation.model.ReadResourceModel

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.