Package org.gatein.management.api

Examples of org.gatein.management.api.PathAddress


                org.exoplatform.portal.config.model.Page.PageSet.class, ContentType.XML));

        String pageName = operationContext.getAddress().resolvePathTemplate("page-name");
        for (Page page : pagesList) {
            if (pageName == null) {
                PathAddress pageAddress = operationContext.getAddress().append(page.getName());
                // We need to look up the subresource because this sets the path template resolver to be used by the filter.
                operationContext.getManagedResource().getSubResource(pageAddress);

                PathTemplateFilter filter;
                try {
                    filter = PathTemplateFilter.parse(operationContext.getAttributes().getValues("filter"));
                } catch (ParseException e) {
                    throw new OperationException(operationContext.getOperationName(), "Could not parse filter attributes.", e);
                }

                if (pageAddress.accepts(filter)) {
                    pageExportTask.addPageName(page.getName());
                }
            } else if (pageName.equals(page.getName())) {
                pageExportTask.addPageName(page.getName());
            }
View Full Code Here


            {
               pai = new PathAddressIterator(iterator.currentAddress().copy());
               AbstractManagedResource subResource = resource.getSubResource(pai);
               if (subResource != null)
               {
                  PathAddress address = pai.originalAddress();
                  for (PathTemplateResolver resolver : address.getPathTemplateResolvers())
                  {
                     iterator.originalAddress().addPathTemplateResolver(resolver);
                  }
                  while(iterator.hasNext()) iterator.next();
                  return subResource;
View Full Code Here

      {
         managementService.reloadExtensions();
         rootResource = managementService.getManagedResource(PathAddress.empty());
      }

      PathAddress address = request.getAddress();
      String operationName = request.getOperationName();

      boolean debug = log.isDebugEnabled();
      if (debug)
      {
         log.debug("Executing request for operation " + operationName + " at address " + address);
      }
     
      ManagedResource root = getRootResource();
      if (root.getSubResource(address) == null)
      {
         throw new ResourceNotFoundException("Could not locate managed resource for address '" + address + "'");
      }

      OperationHandler operationHandler = root.getOperationHandler(address, operationName);
      if (operationHandler != null)
      {
         // Obtain binding provider given managed component.
         String componentName = (address.size() >= 1) ? address.get(0) : null;
         BindingProvider bindingProvider = managementService.getBindingProvider(componentName);

         // Execute operation for given registered operation handler
         BasicResultHandler resultHandler = new BasicResultHandler();
         operationHandler.execute(new OperationContextImpl(request, root, runtimeContext, bindingProvider), resultHandler);
View Full Code Here

   {
      BindingProvider bindingProvider = operationContext.getBindingProvider();
      Marshaller<PageNavigation> marshaller = bindingProvider.getMarshaller(PageNavigation.class, ContentType.XML);

      final ManagedResource resource = operationContext.getManagedResource();
      final PathAddress address = operationContext.getAddress();
      final String operationName = operationContext.getOperationName();

      StepResultHandler<PageNavigation> stepResultHandler = new StepResultHandler<PageNavigation>(address)
      {
         @Override
         public void failed(String failureDescription)
         {
            if (address.equals(getCurrentAddress()))
            {
               throw new OperationException(operationName, "Navigation export failed. Reason: " + failureDescription);
            }
            else
            {
View Full Code Here

            throw new RuntimeException("Was expecting " + ReadResourceModel.class + " to be returned for operation " + OperationNames.READ_RESOURCE + " at address " + address);
         }

         for (String child : ((ReadResourceModel) model).getChildren())
         {
            final PathAddress childAddress = address.append(child);
            OperationContext childContext = new OperationContextDelegate(operationContext)
            {
               @Override
               public PathAddress getAddress()
               {
View Full Code Here

{
   @Override
   public final void execute(OperationContext operationContext, ResultHandler resultHandler) throws ResourceNotFoundException, OperationException
   {
      String operationName = operationContext.getOperationName();
      PathAddress address = operationContext.getAddress();

      String siteType = address.resolvePathTemplate("site-type");
      if (siteType == null) throw new OperationException(operationName, "Site type was not specified.");

      ObjectType<Site> objectType = Utils.getObjectType(Utils.getSiteType(siteType));
      if (objectType == null)
      {
View Full Code Here

{
   @Override
   protected final void execute(OperationContext operationContext, ResultHandler resultHandler, Workspace workspace, ObjectType<Site> siteType) throws ResourceNotFoundException, OperationException
   {
      String operationName = operationContext.getOperationName();
      PathAddress address = operationContext.getAddress();

      String siteName = address.resolvePathTemplate("site-name");
      if (siteName == null) throw new OperationException(operationName, "No site name specified.");

      SiteKey siteKey = getSiteKey(siteType, siteName);

      Site site = workspace.getSite(siteType, siteKey.getName());
View Full Code Here

      String pageName = operationContext.getAddress().resolvePathTemplate("page-name");
      for (Page page : pagesList)
      {
         if (pageName == null)
         {
            PathAddress pageAddress = operationContext.getAddress().append(page.getName());
            // We need to look up the subresource because this sets the path template resolver to be used by the filter.
            operationContext.getManagedResource().getSubResource(pageAddress);

            PathTemplateFilter filter;
            try
            {
               filter = PathTemplateFilter.parse(operationContext.getAttributes().getValues("filter"));
            }
            catch (ParseException e)
            {
               throw new OperationException(operationContext.getOperationName(), "Could not parse filter attributes.", e);
            }

            if (pageAddress.accepts(filter))
            {
               pageExportTask.addPageName(page.getName());
            }
         }
         else if (pageName.equals(page.getName()))
View Full Code Here

            {
               pai = new PathAddressIterator(iterator.currentAddress().copy());
               AbstractManagedResource subResource = resource.getSubResource(pai);
               if (subResource != null)
               {
                  PathAddress address = pai.originalAddress();
                  for (PathTemplateResolver resolver : address.getPathTemplateResolvers())
                  {
                     iterator.originalAddress().addPathTemplateResolver(resolver);
                  }
                  while(iterator.hasNext()) iterator.next();
                  return subResource;
View Full Code Here

      return methods;
   }

   static AbstractManagedResource registerOrGetResource(AbstractManagedResource resource, Managed managed)
   {
      PathAddress address = PathAddress.pathAddress(managed.value());
      for (Iterator<String> iterator = address.iterator(); iterator.hasNext();)
      {
         String path = iterator.next();
         String description = "";
         if (iterator.hasNext())
         {
View Full Code Here

TOP

Related Classes of org.gatein.management.api.PathAddress

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.