Пример #1
0
 /**
  * {@inheritDoc}
  *
  * @throws Exception sometimes things just don't work out
  */
 public String renderAsync() throws Exception {
   WebContext ctx = WebContextFactory.get();
   HttpServletRequest req = ctx.getHttpServletRequest();
   RequestContext rhnCtx = new RequestContext(req);
   User user = rhnCtx.getCurrentUser();
   PageControl pc = new PageControl();
   pc.setStart(1);
   pc.setPageSize(PAGE_SIZE);
   render(user, pc, req);
   HttpServletResponse resp = ctx.getHttpServletResponse();
   return RendererHelper.renderRequest(getPageUrl(), req, resp);
 }
  /**
   * Renders Action Chain entries from an Action Chain having a certain sort order number.
   *
   * @param actionChainId Action Chain identifier
   * @param sortOrder sort order number
   * @return a response string
   * @throws ServletException if something goes wrong
   * @throws IOException if something goes wrong
   */
  public String renderAsync(Long actionChainId, Integer sortOrder)
      throws ServletException, IOException {
    WebContext webContext = WebContextFactory.get();
    HttpServletRequest request = webContext.getHttpServletRequest();
    User u = new RequestContext(request).getCurrentUser();

    ActionChain actionChain = ActionChainFactory.getActionChain(u, actionChainId);
    request.setAttribute("sortOrder", sortOrder);
    request.setAttribute(
        "entries", ActionChainFactory.getActionChainEntries(actionChain, sortOrder));

    HttpServletResponse response = webContext.getHttpServletResponse();
    return RendererHelper.renderRequest(
        "/WEB-INF/pages/common/fragments/schedule/actionchainentries.jsp", request, response);
  }