Package org.gatein.management.api.exceptions

Examples of org.gatein.management.api.exceptions.ResourceNotFoundException


    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site)
            throws ResourceNotFoundException, OperationException {
        Page pages = site.getRootPage().getChild("pages");
        if (pages == null || pages.getChildren().isEmpty())
            throw new ResourceNotFoundException("No pages found for site " + getSiteKey(site));

        execute(operationContext, resultHandler, pages);
    }
View Full Code Here


                pageExportTask.addPageName(page.getName());
            }
        }

        if (pageExportTask.getPageNames().isEmpty() && pageName != null) {
            throw new ResourceNotFoundException("No page found for " + new PageKey(siteKey, pageName));
        } else if (pageExportTask.getPageNames().isEmpty()) {
            resultHandler.completed(new ExportResourceModel(Collections.<ExportTask> emptyList()));
        } else {
            tasks.add(pageExportTask);
            resultHandler.completed(new ExportResourceModel(tasks));
View Full Code Here

        } else {
            PageKey key = new PageKey(siteKey, pageName);
            try {
                Page page = PageUtils.getPage(dataStorage, pageService, key);
                if (page == null) {
                    throw new ResourceNotFoundException("No page found for " + key);
                } else {
                    resultHandler.completed(page);
                }
            } catch (ResourceNotFoundException e) {
                throw e;
View Full Code Here

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

{
   @Override
   protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site) throws ResourceNotFoundException, OperationException
   {
      Navigation navigation = site.getRootNavigation().getChild("default");
      if (navigation == null) throw new ResourceNotFoundException("Navigation does not exist for site " + getSiteKey(site));
     
      execute(operationContext, resultHandler, navigation);
   }
View Full Code Here

      if (siteType == null) throw new OperationException(operationName, "Site type was not specified.");

      ObjectType<Site> objectType = Utils.getObjectType(Utils.getSiteType(siteType));
      if (objectType == null)
      {
         throw new ResourceNotFoundException("No site type found for " + siteType);
      }

      POMSessionManager mgr = operationContext.getRuntimeContext().getRuntimeComponent(POMSessionManager.class);
      POMSession session = mgr.getSession();
      if (session == null) throw new OperationException(operationName, "MOP session was null");
View Full Code Here

      Set<String> children = new LinkedHashSet<String>();

      NodeContext<NodeContext<?>> node = NavigationUtils.loadNode(navigationService, navigation, navUri);
      if (node == null)
      {
         throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri +"'");
      }

      for (NodeContext child : node.getNodes())
      {
         children.add(child.getName());
View Full Code Here

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

      SiteKey siteKey = getSiteKey(siteType, siteName);

      Site site = workspace.getSite(siteType, siteKey.getName());
      if (site == null) throw new ResourceNotFoundException("No site found for site " + siteKey);

      execute(operationContext, resultHandler, site);
   }
View Full Code Here

      DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(DescriptionService.class);
      NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);

      PageNavigation pageNavigation = NavigationUtils.loadPageNavigation(new NavigationKey(siteKey, navUri), navigationService, descriptionService);
      if (pageNavigation == null) throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri +"'");

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

         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

TOP

Related Classes of org.gatein.management.api.exceptions.ResourceNotFoundException

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.