Examples of AjaxAction


Examples of org.apache.jetspeed.ajax.AjaxAction

                throw new AJAXException("unknown action requested==>"
                        + a_sAction);
            }

            AjaxAction a_oAction = (AjaxAction) a_oActionObject;

            JetspeedRequestContext a_oJetspeedRequestContext = (JetspeedRequestContext) p_oRequestContext;

            // Process each parameter for this action
            while (a_oParamTok.hasMoreTokens())
            {
                String a_sName = a_oParamTok.nextToken(VALUE_TOKEN);
                // Strip of the leading ; if present
                if (a_sName.indexOf(';') >= 0)
                {
                    a_sName = a_sName.substring(1);
                }

                String a_sValue = a_oParamTok.nextToken();

                // Put the parameters on the request context
                a_oJetspeedRequestContext.setAttribute(a_sName, a_sValue);
            }

            // Invoke the action
            Map a_oResultMap = new HashMap();
            boolean a_bSuccess;

            try
            {
                a_bSuccess = a_oAction.runBatch(a_oJetspeedRequestContext,
                        a_oResultMap);
            } catch (Exception e)
            {
                // Move the reason into the return map
                p_oResultMap.put(REASON, a_oResultMap.get(REASON));
View Full Code Here

Examples of org.apache.jetspeed.ajax.AjaxAction

                throw new AJAXException("unknown action requested==>"
                        + a_sAction);
            }

            AjaxAction a_oAction = (AjaxAction) a_oActionObject;

            JetspeedRequestContext a_oJetspeedRequestContext = (JetspeedRequestContext) p_oRequestContext;

            // Process each parameter for this action
            while (a_oParamTok.hasMoreTokens())
            {
                String a_sName = a_oParamTok.nextToken(VALUE_TOKEN);
                // Strip of the leading ; if present
                if (a_sName.indexOf(';') >= 0)
                {
                    a_sName = a_sName.substring(1);
                }

                String a_sValue = a_oParamTok.nextToken();

                // Put the parameters on the request context
                a_oJetspeedRequestContext.setAttribute(a_sName, a_sValue);
            }

            // Invoke the action
            Map a_oResultMap = new HashMap();
            boolean a_bSuccess;

            try
            {
                a_bSuccess = a_oAction.runBatch(a_oJetspeedRequestContext,
                        a_oResultMap);
            } catch (Exception e)
            {
                // Move the reason into the return map
                p_oResultMap.put(REASON, a_oResultMap.get(REASON));
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        } else {
            model.put(this.exceptionMessageAttribute, ex.getClass());
        }
        // Create the response with the redirect action:
        AjaxResponse ajaxResponse = new AjaxResponseImpl();
        AjaxAction ajaxRedirect = new RedirectAction(new StringBuilder(request.getContextPath()).append(this.redirectUrl).toString(), model);
        ajaxResponse.addAction(ajaxRedirect);
        return ajaxResponse;
    }
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

    public InsertContentAfterActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new InsertContentAfterAction("testId", Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        assertXpathEvaluatesTo("testId", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        assertXpathEvaluatesTo("testId", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        assertXpathEvaluatesTo("testId1,testId2", "/insert-after/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithSelectorMatcher() throws Exception {
        ElementMatcher matcher = new SelectorMatcher(Arrays.asList("#testId1", "#testId2"));
        AjaxAction action = new InsertContentAfterAction(matcher, Arrays.asList(new Component[]{new TaggedText("Test Component 1", TaggedText.Tag.DIV), new TaggedText("Test Component 2", TaggedText.Tag.DIV)}));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component 1", "/insert-after/content/div[position()=1]", result);
        assertXpathEvaluatesTo("Test Component 2", "/insert-after/content/div[position()=2]", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

    public AppendContentActionTest(String testName) {
        super(testName);
    }
   
    public void testRender() throws Exception {
        AjaxAction action = new AppendContentAction("testId", new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithWildcardMatcher() throws Exception {
        ElementMatcher matcher = new WildcardMatcher("testId");
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("wildcard", "/append-as-children/context/matcher/@matchMode", result);
View Full Code Here

Examples of org.springmodules.xt.ajax.AjaxAction

        assertXpathEvaluatesTo("testId", "/append-as-children/context/matcher/@contextNodeID", result);
    }
   
    public void testRenderWithListMatcher() throws Exception {
        ElementMatcher matcher = new ListMatcher(Arrays.asList("testId1", "testId2"));
        AjaxAction action = new AppendContentAction(matcher, new SimpleText("Test Component"));
       
        String result = action.render();
       
        System.out.println(result);
       
        assertXpathEvaluatesTo("Test Component", "/append-as-children/content", result);
        assertXpathEvaluatesTo("plain", "/append-as-children/context/matcher/@matchMode", result);
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.