Examples of UrlAction


Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

      assertEquals("0", mapping.getId());
      assertEquals("/project/#{viewProjectBean.projectId}/", mapping.getPattern());
      assertEquals("#{viewProjectBean.getPrettyTarget}", mapping.getViewId());

      List<UrlAction> actions = mapping.getActions();
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.load}")));
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.authorize}")));
   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

   static Object[] valuesArray;

   @BeforeClass
   public static void setUpBeforeClass() throws Exception
   {
      mapping.addAction(new UrlAction("#{bean.action}"));
      mapping.setId("testMapping");
      mapping.setPattern("/test/#{bean.param1}/mapping/#{bean.param2}");
      mapping.addQueryParam(new QueryParameter("key1", "#{bean.qp1}"));
      mapping.addQueryParam(new QueryParameter("key2", "#{bean.qp2}"));
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

                        + "' referenced at method '" + actionSpec.getMethod().getName() + "' in class '"
                        + actionSpec.getMethod().getDeclaringClass().getName() + "'.");
            }

            // build UrlMapping
            UrlAction urlAction = new UrlAction();
            urlAction.setPhaseId(actionSpec.getPhaseId());
            urlAction.setOnPostback(actionSpec.isOnPostback());
            urlAction.setInheritable(actionSpec.isInheritable());

            // try to get bean name
            Class<?> clazz = actionSpec.getMethod().getDeclaringClass();

            // build expression
            PrettyExpression expression = buildPrettyExpression(clazz, actionSpec.getMethod().getName());
            urlAction.setAction(expression);

            // trace
            if (log.isTraceEnabled())
            {
               log.trace("Adding action expression '" + urlAction.getAction() + "' to mapping: " + mapping.getId());
            }

            // register this action
            mapping.addAction(urlAction);
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

      return result;
   }

   private UrlAction copy(UrlAction urlAction)
   {
      UrlAction result = new UrlAction();
      result.setAction(urlAction.getAction());
      result.setOnPostback(urlAction.onPostback());
      result.setPhaseId(urlAction.getPhaseId());
      result.setInheritable(urlAction.isInheritable());
      return result;
   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(1, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate action
      UrlAction action = mapping.getActions().get(0);
      assertEquals(PhaseId.RESTORE_VIEW, action.getPhaseId());

      // validate PrettyExpression
      assertNotNull(action.getAction());
      assertEquals(LazyExpression.class, action.getAction().getClass());
      LazyExpression actionExpression = (LazyExpression) action.getAction();
      assertEquals(ClassWithSingleLazyExpressionAction.class, actionExpression.getBeanClass());
      assertEquals("actionMethod", actionExpression.getComponent());

   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(1, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate action
      UrlAction action = mapping.getActions().get(0);
      assertEquals(PhaseId.RESTORE_VIEW, action.getPhaseId());

      // validate PrettyExpression
      assertNotNull(action.getAction());
      assertEquals(ConstantExpression.class, action.getAction().getClass());
      assertEquals("#{someBean.actionMethod}", action.getAction().getELExpression());

   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(2, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate first action
      UrlAction firstAction = mapping.getActions().get(0);
      assertEquals(PhaseId.RENDER_RESPONSE, firstAction.getPhaseId());
      assertNotNull(firstAction.getAction());
      assertEquals(LazyExpression.class, firstAction.getAction().getClass());
      LazyExpression firstActionExpression = (LazyExpression) firstAction.getAction();
      assertEquals(ClassWithMultipleActions.class, firstActionExpression.getBeanClass());
      assertEquals("actionMethod", firstActionExpression.getComponent());

      // validate second action
      UrlAction secondAction = mapping.getActions().get(1);
      assertEquals(PhaseId.INVOKE_APPLICATION, secondAction.getPhaseId());
      assertNotNull(secondAction.getAction());
      assertEquals(LazyExpression.class, secondAction.getAction().getClass());
      LazyExpression secondActionExpression = (LazyExpression) secondAction.getAction();
      assertEquals(ClassWithMultipleActions.class, secondActionExpression.getBeanClass());
      assertEquals("actionMethod", secondActionExpression.getComponent());

   }
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction

                     + "' referenced at method '" + actionSpec.getMethod().getName() + "' in class '"
                     + actionSpec.getMethod().getDeclaringClass().getName() + "'.");
            }

            // build UrlMapping
            UrlAction urlAction = new UrlAction();
            urlAction.setPhaseId(actionSpec.getPhaseId());
            urlAction.setOnPostback(actionSpec.isOnPostback());

            // try to get bean name
            Class clazz = actionSpec.getMethod().getDeclaringClass();

            // build expression
            PrettyExpression expression = buildPrettyExpression(clazz, actionSpec.getMethod().getName());
            urlAction.setAction(expression);

            // trace
            if (log.isTraceEnabled())
            {
               log.trace("Adding action expression '" + urlAction.getAction() + "' to mapping: " + mapping.getId());
            }

            // register this action
            mapping.addAction(urlAction);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.