Package com.liferay.portlet

Examples of com.liferay.portlet.ActionResponseImpl


        message ="File Downloaded";
        String x = UtilMethods.dateToJDBC(new Date()).replace(':', '-').replace(' ', '_');
        File zipFile = new File(backupFilePath + "/backup_" + x + "_.zip");

        ActionResponseImpl responseImpl = (ActionResponseImpl) res;
        HttpServletResponse httpResponse = responseImpl.getHttpServletResponse();
        httpResponse.setHeader("Content-type", "");
        httpResponse.setHeader("Content-Disposition", "attachment; filename=" + zipFile.getName());

        if(!dataOnly){
          moveAssetsToBackupDir();
        }

        createXMLFiles();

        zipTempDirectoryToStream(httpResponse.getOutputStream());

      }else if(cmd.equals("upload")) {

        UploadPortletRequest uploadReq = PortalUtil.getUploadPortletRequest(req);
        ActionResponseImpl responseImpl = (ActionResponseImpl) res;
        HttpServletResponse httpResponse = responseImpl.getHttpServletResponse();

        ActionRequestImpl requestImpl = (ActionRequestImpl) req;
        HttpServletRequest httpRequest = requestImpl.getHttpServletRequest();

        //message ="file upload Done.";
View Full Code Here


//            if (!hasPermission) {
//              _processRenderRequest(req, res);
//            }else{
              _processActionRequest(req, res);

              ActionResponseImpl actionResponse =
                (ActionResponseImpl)req.getAttribute(
                  WebKeys.JAVAX_PORTLET_RESPONSE);

              String redirectLocation =
                actionResponse.getRedirectLocation();

              if (Validator.isNotNull(redirectLocation)) {
                res.sendRedirect(SecurityUtils.stripReferer(req, redirectLocation));

                return null;
View Full Code Here

    if (action) {
      ActionRequestImpl actionRequest = new ActionRequestImpl(
        req, portlet, cachePortlet, portletCtx, windowState,
        portletMode, portletPrefs, layout.getId());

      ActionResponseImpl actionResponse = new ActionResponseImpl(
        actionRequest, res, portletId, user, layout, windowState,
        portletMode);

      actionRequest.defineObjects(portletConfig, actionResponse);

      cachePortlet.processAction(actionRequest, actionResponse);

      RenderParametersPool.put(
        req, layout.getId(), portletId,
        actionResponse.getRenderParameters());
    }
    else {
//      PortalUtil.updateWindowState(portletId, user, layout, windowState);
//
//      PortalUtil.updatePortletMode(portletId, user, layout, portletMode);
View Full Code Here

    ActionRequest req, ActionResponse res) {

    // Set the request parameters as the render parameters

    try {
      ActionResponseImpl resImpl = (ActionResponseImpl)res;

      Map renderParameters = resImpl.getRenderParameters();

      res.setRenderParameter(WebKeys.PORTLET_URL_ACTION, "1");

      Enumeration enu = req.getParameterNames();

      while (enu.hasMoreElements()) {
        String param = (String)enu.nextElement();
        String[] values = req.getParameterValues(param);

        if (renderParameters.get(
            resImpl.getNamespace() + param) == null) {

          res.setRenderParameter(param, values);
        }
      }
    }
View Full Code Here

      ActionRequest req, ActionResponse res, String userId,
      String password1, String password2, boolean passwordReset)
    throws PortalException, SystemException {

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

    return updateUser(
      reqImpl.getHttpServletRequest(), resImpl.getHttpServletResponse(),
      userId, password1,  password2, passwordReset);
  }
View Full Code Here

      boolean dottedSkins, boolean roundedSkins, String greeting,
      String resolution, String refreshRate, String comments)
    throws PortalException, SystemException {

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

    return updateUser(
      reqImpl.getHttpServletRequest(), resImpl.getHttpServletResponse(),
      userId, firstName, middleName, lastName, nickName, male, birthday,
      emailAddress, smsId, aimId, icqId, msnId, ymId, favoriteActivity,
      favoriteBibleVerse, favoriteFood, favoriteMovie, favoriteMusic,
      languageId, timeZoneId, skinId, dottedSkins, roundedSkins, greeting,
      resolution, refreshRate, comments);
View Full Code Here

    @SuppressWarnings("unchecked")
    private void _exportExcel(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form) throws Exception {

        HttpSession session = ((ActionRequestImpl) req).getHttpServletRequest().getSession();

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

        User searcherUser = PortalUtil.getUser(req);

        UserManagerListSearchForm searchForm = (UserManagerListSearchForm) session.getAttribute(WebKeys.USERMANAGERLISTPARAMETERS);
        searchForm.setStartRow(0);
View Full Code Here

     * @exception Exception
     *                return an exception if there is an error
     */
    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

  List<Role> roles = com.dotmarketing.business.APILocator.getRoleAPI().loadRolesForUser(user.getUserId());
  req.setAttribute(ViewReportsAction.REPORT_EDITOR_OR_ADMIN, true);

  ActionRequestImpl reqImpl = (ActionRequestImpl) req;
  HttpServletRequest httpReq = reqImpl.getHttpServletRequest();
  ActionResponseImpl resImpl = (ActionResponseImpl) res;
  HttpServletResponse httpRes = resImpl.getHttpServletResponse();
  reportParameters = new ArrayList<ReportParameter>();
  String cmd = req.getParameter(Constants.CMD);
  pdf = Parameter.getBooleanFromString(req.getParameter("pdf"),false);
  xls = Parameter.getBooleanFromString(req.getParameter("xls"),false);
  rtf = Parameter.getBooleanFromString(req.getParameter("rtf"),false);
View Full Code Here

        setForward(req, "portlet.ext.report.edit_report");
      }
    }

    if ((cmd != null) && cmd.equals("downloadReportSource")) {
      ActionResponseImpl resImpl = (ActionResponseImpl) res;
      HttpServletResponse response = resImpl.getHttpServletResponse();
      if (!downloadSourceReport(reportId, httpReq, response)) {
        SessionMessages.add(req, "error",
            "message.report.source.file.not.found");
      }
    }
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.