Package com.jada.content.data

Examples of com.jada.content.data.ContentApi$Result


    public ActionForward itemCompareList(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response)
        throws Throwable {
      ContentApi api = new ContentApi(request);
      Vector<ItemInfo> dataList = new Vector<ItemInfo>();
      Iterator<?> iterator = ContentLookupDispatchAction.getItemCompareList(request).iterator();
      while (iterator.hasNext()) {
        String itemId = (String) iterator.next();
        ItemInfo itemInfo = api.getItem(Format.getLong(itemId), false);
        dataList.add(itemInfo);
      }
     
      // merge with template and stream.
    TemplateEngine engine = TemplateEngine.getInstance();
View Full Code Here


      engine.setProperty("runtime.log.logsystem.log4j.logger", "loggername");

    initResourceLoader();
    dataApi = DataApi.getInstance();
    api = new ContentApi(siteDomain, siteProfile, siteCurrency);
    siteInfo = api.getSite();
  }
View Full Code Here

      }
    }
    engine = new VelocityEngine();
    initResourceLoader();
    dataApi = DataApi.getInstance();
    api = new ContentApi(request);
    siteInfo = api.getSite();
  }
View Full Code Here

          if (siteDomainParamBean.getCheckoutAllowsShippingQuote() != null && siteDomainParamBean.getCheckoutAllowsShippingQuote().equals(String.valueOf(Constants.VALUE_YES))) {
            form.setAllowShippingQuote(true);
          }
        }
     
      ContentApi contentApi = new ContentApi(request);
     
      Vector<ItemInfo> crossSellItems = new Vector<ItemInfo>();
      iterator = shoppingCart.getShoppingCartItems().iterator();
      while (iterator.hasNext()) {
        ShoppingCartItem shoppingCartItem = (ShoppingCartItem) iterator.next();
        Item item = shoppingCartItem.getItem();
        if (item.getItemTypeCd().equals(Constants.ITEM_TYPE_SKU)) {
          item = item.getItemSkuParent();
        }
        Iterator<?> itemsCrossSell = item.getItemsCrossSell().iterator();
        while (itemsCrossSell.hasNext()) {
          Item upSellItem = (Item) itemsCrossSell.next();
          if (isExist(crossSellItems, upSellItem)) {
            continue;
          }
          ItemInfo itemInfo = contentApi.formatItem(upSellItem);
            crossSellItems.add(itemInfo);
        }
      }
      form.setCrossSellItems(crossSellItems);
    }
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNotNull(result);
        assertTrue(result instanceof ServletRedirectResult);

        Mock invMock = new Mock(ActionInvocation.class);
        ActionInvocation inv = (ActionInvocation) invMock.proxy();
        ActionContext ctx = ActionContext.getContext();
        ctx.put(ServletActionContext.HTTP_REQUEST, request);
        StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
        ctx.put(ServletActionContext.HTTP_RESPONSE, response);
        invMock.expectAndReturn("getInvocationContext", ctx);
        invMock.expectAndReturn("getStack", ctx.getValueStack());
        result.execute(inv);
        assertEquals("http://www.google.com", response.getRedirectURL());
        //TODO: need to test location but there's noaccess to the property/method, unless we use reflection
    }
View Full Code Here

                request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);

                ActionContext savedContext = savedInvocation.getInvocationContext();
                savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request);
                savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response);
                Result result = savedInvocation.getResult();

                if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
                    synchronized (context) {
                        result.execute(savedInvocation);
                    }
                }

                // turn off execution of this invocations result
                invocation.getProxy().setExecuteResult(false);
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNotNull(result);
        assertTrue(result instanceof ServletRedirectResult);

        Mock invMock = new Mock(ActionInvocation.class);
        ActionInvocation inv = (ActionInvocation) invMock.proxy();
        ActionContext ctx = ActionContext.getContext();
        ctx.put(ServletActionContext.HTTP_REQUEST, request);
        StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
        ctx.put(ServletActionContext.HTTP_RESPONSE, response);
        invMock.expectAndReturn("getInvocationContext", ctx);
        invMock.expectAndReturn("getStack", ctx.getValueStack());
        result.execute(inv);
        assertEquals("http://www.google.com", response.getRedirectURL());
        //TODO: need to test location but there's noaccess to the property/method, unless we use reflection
    }
View Full Code Here

     */
    protected void after(ActionInvocation invocation,
                         ValidationAware validationAware)
        throws Exception
    {
        Result result = invocation.getResult();

        if (result != null
            && (result instanceof ServletRedirectResult ||
                result instanceof ServletActionRedirectResult))
        {
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNull(result);
    }
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNull(result);
    }
View Full Code Here

TOP

Related Classes of com.jada.content.data.ContentApi$Result

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.