Package com.liferay.portlet

Examples of com.liferay.portlet.ActionResponseImpl


  private void _addWorkflowComment(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String comment = req.getParameter ("comment");
    WorkflowComment taskComment = new WorkflowComment ();
    taskComment.setComment(comment);
    taskComment.setCreationDate(new Date());
    taskComment.setPostedBy(user.getUserId());
View Full Code Here


  private void _addFileToWorkflow(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String fileToAttachInode = req.getParameter ("file_inode");
    String title = null;
    try{
      title = APILocator.getContentletAPI().find(fileToAttachInode, user, false).getTitle();
     
View Full Code Here

  private void _removeFileToWorkflow(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String fileToAttachInode = req.getParameter ("file_inode");
    String title = null;
    try{
      title = APILocator.getContentletAPI().find(fileToAttachInode, user, false).getTitle();
     
View Full Code Here

        boolean filterLocked = Boolean.parseBoolean( req.getParameter("filterLocked"));
        String categories = req.getParameter("expCategoriesValues");
        String fields = req.getParameter("expFieldsValues");
        String structureInode = req.getParameter("expStructureInode");

        ActionResponseImpl resImpl = (ActionResponseImpl) res;
        HttpServletResponse response = resImpl.getHttpServletResponse();

        downloadToExcel(response, user,searchContentlets(req,res,config,form,user,"Excel"), structureInode);

      } catch (Exception ae) {
        _handleException(ae, req);
View Full Code Here

    //WebAsset webAsset = (WebAsset) req.getAttribute(webKeyEdit);
    com.dotmarketing.portlets.contentlet.model.Contentlet webAsset = (com.dotmarketing.portlets.contentlet.model.Contentlet)req.getAttribute(webKeyEdit);

    ContentletAPI conAPI;
    conAPI = APILocator.getContentletAPI();
    ActionResponseImpl resImpl = (ActionResponseImpl) res;
    // calls the Contentlet API delete the container version
    try{
      //conAPI.delete(webAsset, user, false, false);
      conAPI.deleteVersion(webAsset,user,false);


    }catch(Exception e){
      resImpl.getHttpServletResponse().getWriter().println("FAILURE:" + LanguageUtil.get(user, "message.contentlet.delete.live_or_working"));
    }
  }
View Full Code Here

      try {
        String trending = req.getParameter("trending");
        String viewType =  req.getParameter("viewType");
        String hostId =  req.getParameter("hostId");
        User user = _getUser(req);
        ActionResponseImpl resImpl = (ActionResponseImpl) res;
        HttpServletResponse response = resImpl.getHttpServletResponse();     
        downloadToExcel(response, user, trending, viewType, hostId);
      } catch (Exception e) {
        Logger.warn(this, e.toString(), e);
        req.setAttribute(PageContext.EXCEPTION, e);
        req.setAttribute("javax.servlet.error.status_code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
View Full Code Here

  }

  // /// ************** ALL METHODS HERE *************************** ////////
  private void _downloadCSVTemplate(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form) throws Exception {

    ActionResponseImpl resImpl = (ActionResponseImpl)res;
    HttpServletResponse httpRes = resImpl.getHttpServletResponse();

    httpRes.setContentType("application/octet-stream");
    httpRes.setHeader("Content-Disposition", "attachment; filename=\"CSV_Template.csv\"");

    ServletOutputStream out = httpRes.getOutputStream();
View Full Code Here

       ActionMapping mapping, ActionForm form, PortletConfig config,
       ActionRequest req, ActionResponse res)
     throws Exception {

    //wraps request to get session object
    ActionResponseImpl resImpl = (ActionResponseImpl)res;
    HttpServletResponse httpRes = resImpl.getHttpServletResponse();

    String cmd = (req.getParameter(Constants.CMD)!=null) ? req.getParameter(Constants.CMD) : Constants.VIEW;

    Logger.debug(this, "ViewReportAction :: cmd=" + cmd);
View Full Code Here

       ActionMapping mapping, ActionForm form, PortletConfig config,
       ActionRequest req, ActionResponse res)
     throws Exception {

    //wraps request to get session object
    ActionResponseImpl resImpl = (ActionResponseImpl)res;
    HttpServletResponse httpRes = resImpl.getHttpServletResponse();

    if(! "userReport".equals(req.getParameter(Constants.CMD))){
        return;
    }
    _writeCSV(httpRes,req,res,form);
View Full Code Here

  public void process(ActionRequest req, ActionResponse res, String path)
    throws IOException, ServletException {

    ActionRequestImpl reqImpl = (ActionRequestImpl)req;
    ActionResponseImpl resImpl = (ActionResponseImpl)res;

    HttpServletRequest httpReq = reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes = resImpl.getHttpServletResponse();

    ActionMapping mapping = processMapping(httpReq, httpRes, path);
    if (mapping == null) {
      return;
    }

    if (!processRoles(httpReq, httpRes, mapping)) {
      return;
    }

    ActionForm form = processActionForm(httpReq, httpRes, mapping);
    processPopulate(httpReq, httpRes, form, mapping);
    if (!processValidateAction(httpReq, httpRes, form, mapping)) {
      return;
    }

    PortletAction action =
      (PortletAction)processActionCreate(httpReq, httpRes, mapping);
    if (action == null) {
      return;
    }

    PortletConfigImpl portletConfig =
      (PortletConfigImpl)req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);

    try {
      action.processAction(mapping, form, portletConfig, req, res);
    }
    catch (Exception e) {
      String exceptionId =
        WebKeys.PORTLET_STRUTS_EXCEPTION + StringPool.PERIOD +
          portletConfig.getPortletId();

      req.setAttribute(exceptionId, e);
    }

    String forward =
      (String)req.getAttribute(WebKeys.PORTLET_STRUTS_FORWARD);

    if (forward != null) {
      String queryString = StringPool.BLANK;

      int pos = forward.indexOf("?");
      if (pos != -1) {
        queryString = forward.substring(pos + 1, forward.length());
        forward = forward.substring(0, pos);
      }

      ActionForward actionForward = mapping.findForward(forward);

      if ((actionForward != null) && (actionForward.getRedirect())) {
        if (forward.startsWith("/")) {
          PortletURLImpl forwardURL =
            (PortletURLImpl)resImpl.createRenderURL();

          forwardURL.setParameter("struts_action", forward);

          StrutsURLEncoder.setParameters(forwardURL, queryString);
View Full Code Here

TOP

Related Classes of com.liferay.portlet.ActionResponseImpl

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.