Package org.jboss.seam.navigation

Examples of org.jboss.seam.navigation.Pages


    * for the debug page.
    */
   @Test(enabled = true)
   public void testSwitchEnabledFlag()
   {
      Pages pages = Pages.instance();
     
      assert pages.getPage("/action-test01a.xhtml").isSwitchEnabled();
      assert !pages.getPage("/debug.xhtml").isSwitchEnabled();
   }
View Full Code Here


    * it does not.
    */
   @Test(enabled = true)
   public void testHasDescription()
   {
      Pages pages = Pages.instance();
     
      assert pages.hasDescription("/action-test01b.xhtml");
      assert pages.hasDescription("/action-test01a.xhtml");
      assert !pages.hasDescription("/action-test02.xhtml");
   }
View Full Code Here

    * the wild-card description.
    */
   @Test(enabled = true)
   public void testGetAndResolveDescription()
   {
      Pages pages = Pages.instance();
      String fineDescription = "fine-description";
      Contexts.getEventContext().set("fineDescription", fineDescription);
     
      assert "coarse-description".equals(pages.getDescription("/action-test01a.xhtml")) :
         "Expecting the wild-card description to be returned as no description was provided for the view-id";
      assert fineDescription.equals(pages.renderDescription("/action-test01b.xhtml")) :
         "Expecting the description for the view-id to be returned";
   }
View Full Code Here

            {
               warRootDeploymentStrategy.scan();
               if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
               {
                  log.info("redeploying page descriptors...");
                  Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
                  if (pages != null) {
                     // application context is needed for creating expressions
                     Lifecycle.setupApplication();
                     pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
                     Lifecycle.cleanupApplication();
                  }
                  ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
                  init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
                  log.info("done redeploying page descriptors");
View Full Code Here

                  Pageflow.instance().getPage() : null;
     
      if (page==null)
      {
         //handle stuff defined in pages.xml
         Pages pages = Pages.instance();
         if (pages!=null) //for tests
         {
            String viewId = Pages.getViewId(facesContext);
            org.jboss.seam.navigation.Page pageEntry = pages.getPage(viewId);
            if ( pageEntry.isSwitchEnabled() )
            {
               conversation.setViewId(viewId);
            }
            if ( pageEntry.hasDescription() )
            {
               conversation.setDescription( pageEntry.renderDescription() );
            }
            else if(pages.hasDescription(viewId))
            {
               conversation.setDescription( pages.renderDescription(viewId) )
            }
            conversation.setTimeout( pages.getTimeout(viewId) );
            conversation.setConcurrentRequestTimeout( pages.getConcurrentRequestTimeout(viewId) );
         }
      }
      else
      {
         //use stuff from the pageflow definition
View Full Code Here

                  log.info("done redeploying");
               }
              
               WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot);
               warRootDeploymentStrategy.scan();
               Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
               if (pages!= null) {
                   pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
               }
           
               ServletLifecycle.getServletContext().removeAttribute( Seam.getComponentName(Exceptions.class) );                
            }
         }
View Full Code Here

         {
            warRootDeploymentStrategy.scan();
            if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
            {
               log.debug("redeploying page descriptors...");
               Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
               if (pages != null) {
                  // application context is needed for creating expressions
                  Lifecycle.setupApplication();
                  pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
                  Lifecycle.cleanupApplication();
               }
               ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
               init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
               log.debug ("done redeploying page descriptors");
View Full Code Here

   
   
    private List<Pattern> getAllPatterns() {
        List<Pattern> allPatterns = new ArrayList<Pattern>();
       
        Pages pages = (Pages) getServletContext().getAttribute(Seam.getComponentName(Pages.class));
        if (pages != null) {
            Collection<String> ids = pages.getKnownViewIds();

            for (String id: ids) {
                 Page page = pages.getPage(id);
                 allPatterns.addAll(page.getRewritePatterns());
            }
        } else {
            log.warn("Pages is null for incoming request!");
        }
View Full Code Here

         {
            warRootDeploymentStrategy.scan();
            if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
            {
               log.debug("redeploying page descriptors...");
               Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
               if (pages != null) {
                  // application context is needed for creating expressions
                  Lifecycle.setupApplication();
                  pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
                  Lifecycle.cleanupApplication();
               }
               ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
               init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
               log.debug ("done redeploying page descriptors");
View Full Code Here

                  Pageflow.instance().getPage() : null;
     
      if (page==null)
      {
         //handle stuff defined in pages.xml
         Pages pages = Pages.instance();
         if (pages!=null) //for tests
         {
            String viewId = Pages.getViewId(facesContext);
            org.jboss.seam.navigation.Page pageEntry = pages.getPage(viewId);
            if ( pageEntry.isSwitchEnabled() )
            {
               conversation.setViewId(viewId);
            }
            if ( pageEntry.hasDescription() )
            {
               conversation.setDescription( pageEntry.renderDescription() );
            }
            else if(pages.hasDescription(viewId))
            {
               conversation.setDescription( pages.renderDescription(viewId) )
            }
            conversation.setTimeout( pages.getTimeout(viewId) );
            conversation.setConcurrentRequestTimeout( pages.getConcurrentRequestTimeout(viewId) );
         }
      }
      else
      {
         //use stuff from the pageflow definition
View Full Code Here

TOP

Related Classes of org.jboss.seam.navigation.Pages

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.