Package javax.servlet.http

Examples of javax.servlet.http.HttpSession


   * @param response HttpServletResponse
   * @return ActionForward
   */
  public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
  {
    HttpSession session = request.getSession(true);
    String nextURL = "showadhocreportresult";
    DynaActionForm adHocReportForm = (DynaActionForm)actionForm;

    UserObject userobject = (UserObject)session.getAttribute("userobject");
    int userId = userobject.getIndividualID();
    int reportId = 0;
    int moduleId = getModuleId(request);

    reportId = getTheId("reportId", request);
    // if we are coming from one of the form pages, we should have
    // a searchVO on the form, if so pass it on.
    SearchVO search = getSearchVOFromForm(actionForm, request);

    ReportResultVO reportResults = getReportResults(userId, reportId, search);
    String action = request.getParameter("action");
    if (action != null) {
      if (action.equals("export")) {
        nextURL = "csvadhocreportresult";
        request.setAttribute("reportResults", reportResults);
      } else if (action.equals("print")) {
        nextURL = "printadhocreportresult";
      }
    }

    moduleId = reportResults.getModuleId();
    ArrayList columnHeaders = reportResults.getTitles();
    ArrayList columns = new ArrayList();
    ValueListParameters parameters = new ValueListParameters(0, reportResults.getResults().size(), 1);
    for (int i = 0; i < columnHeaders.size(); i++) {
      columns.add(new FieldDescriptor((String)columnHeaders.get(i), i+1, false, ""));
    }
    parameters.setColumns(columns);
    // results is an arraylist of arraylists, it needs to be converted to an arraylist of ValueListRows
    ArrayList results = reportResults.getResults();
    ArrayList list = new ArrayList();
    for (int j = 0; j < results.size(); j++) {
      list.add(new ValueListRow(j, (ArrayList)results.get(j)));
    }
    ValueListVO valueList = new ValueListVO(list, parameters);
    ValueListDisplay displayParameters = new ValueListDisplay(new ArrayList(), false, false, false, false, false, false);
    valueList.setDisplay(displayParameters);
    request.setAttribute("valueList", valueList);
    request.setAttribute("reportName", reportResults.getName());
    request.setAttribute("moduleId", String.valueOf(moduleId));
    session.setAttribute("moduleId", String.valueOf(moduleId));
    request.setAttribute("reportId", String.valueOf(reportId));
    session.setAttribute("reportId", String.valueOf(reportId));
    request.setAttribute("reportType", String.valueOf(ReportConstants.ADHOC_REPORT_CODE));
    String forwardName = "";
    switch (moduleId) {
      case 14: forwardName = ".view.reports.entities.adhoc"; break;
      case 15: forwardName = ".view.reports.individuals.adhoc"; break;
View Full Code Here


  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    try
    {
      HttpSession session = request.getSession();
      UserObject userObject = (UserObject) session.getAttribute("userobject");
      int individualID = userObject.getIndividualID();
      DynaActionForm qForm = (DynaActionForm) form;
      QuestionVO QVO = null;

      if (request.getParameter(Constants.TYPEOFOPERATION).equals(SupportConstantKeys.EDIT)) {
View Full Code Here

  {
    int rowID=0;
    SupportFacadeHome supportFacade = (SupportFacadeHome)CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome","SupportFacade");
    try {

      HttpSession session = request.getSession();
      int userId = ((UserObject)session.getAttribute("userobject")).getIndividualID();

      // call ejb to insert record
      // initialize file vo
      CategoryVO categoryVO = new CategoryVO();
      CategoryForm catForm = (CategoryForm)form;


      SupportFacade remote =(SupportFacade)supportFacade.create();

      // set the VO from form bean data
      // set the CategoryVO
      if((String)catForm.getCategoryname() != null)
        categoryVO.setTitle((String)catForm.getCategoryname());

      if((String)catForm.getParentcategory() != null)
        categoryVO.setParent(Integer.parseInt((catForm.getParentcategory()).toString()));

      categoryVO.setCreatedBy(userId);
      categoryVO.setOwner(userId);

      if (catForm.getStatus() != null)
      {
        categoryVO.setStatus((String) catForm.getStatus());
      }

      if (catForm.getPublishToCustomerView() != null)
      {
        categoryVO.setPublishToCustomerView((String) catForm.getPublishToCustomerView());
      }

      rowID=remote.insertCategory(userId,categoryVO);

      FORWARD_final=  FORWARD_editsavecategory;

      String closeornew = (String)request.getParameter("closeornew");
      String saveandclose = null;
      String saveandnew = null;
      if (closeornew.equals("close"))
        saveandclose = "saveandclose";
      else if (closeornew.equals("new")) {
        saveandnew = "saveandnew";
        catForm.setCategoryname("");
        FORWARD_final =  "newcategory";
      }

      // set refresh and closewindow flag
      if (saveandclose != null)
      request.setAttribute("closeWindow", "true");

      request.setAttribute("refreshWindow", "true");


      if (!request.getParameter("Button").equals("yes"))
      {
        if ((request.getParameter("Flag").equals("Knowledgebase")))
        {
          session.setAttribute("modulename",request.getParameter("Flag"));
          session.setAttribute("rowID",rowID+"");
          request.setAttribute("DETAILPRESS","NO");
          session.setAttribute("Type","Category");
          FORWARD_final="permission";
        }
      }
      else
      {
View Full Code Here

  /**
   * Gets the Folders and other information required to render the File left nav
   */
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession();
    UserObject userObject = (UserObject) session.getAttribute("userobject");
    CvFileFacade cvf = new CvFileFacade();
    ArrayList userFolderList = cvf.getUserFolders(userObject.getIndividualID(), dataSource);
    ArrayList publicFolderList = cvf.getPublicFolders(dataSource);
    // Get the id of the public folder and set it on the request
    Integer publicFolderId = cvf.getPublicFolderId(dataSource);
View Full Code Here

    KnowledgeBaseHome kbHome = (KnowledgeBaseHome)
        CVUtility.getHomeObject("com.centraview.support.knowledgebase.KnowledgeBaseHome", "KnowledgeBase");
    try
    {
      HttpSession session = request.getSession();
      UserObject userObject = (UserObject) session.getAttribute("userobject");
      int individualID = userObject.getIndividualID();
      int kbId = Integer.parseInt((String) request.getParameter("rowId"));

      KnowledgeVO knowledgeVO = new KnowledgeVO();
      KnowledgeBaseForm kbForm = (KnowledgeBaseForm) form;
View Full Code Here

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
  {
      String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
      try
      {
      HttpSession session=request.getSession(true);
      com.centraview.common.UserObject  userobjectd = (com.centraview.common.UserObject)session.getAttribute( "userobject" );
            int individualID = userobjectd.getIndividualID();//get the IndividualId of the user logged in
      int curFileID=(Integer.parseInt(request.getParameter("rowId")));
      int folderID=Integer.parseInt(((FileForm)form).getUploadfolderid());
       
      // call ejb to insert record
View Full Code Here

   * @exception   Exception 
   */
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
  {
      String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session=request.getSession(true);
   
    UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );//get the user object
    int individualID = userobjectd.getIndividualID();//get the individualId of the user logged in
   
    request.setAttribute(FileConstantKeys.TYPEOFFILE, FileConstantKeys.FOLDER);
    request.setAttribute(FileConstantKeys.CURRENTTAB, FileConstantKeys.DETAIL);
    request.setAttribute(FileConstantKeys.TYPEOFOPERATION, FileConstantKeys.DUPLICATE);
    request.setAttribute(FileConstantKeys.WINDOWID, "1");
   
    int rowID=0;
   
    if (request.getParameter("rowId")!=null)
    {
      rowID=Integer.parseInt((String)request.getParameter("rowId"))//This is the folderId which has been requested to be duplicated
    }
   
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    CvFileFacade cvf = new CvFileFacade();
    CvFolderVO fdvo = cvf.getFolder(individualID,rowID,dataSource);//get the original values of the folder
    FolderForm folderForm = (FolderForm)form;
    folderForm.setFoldername(fdvo.getName());
    folderForm.setFolderId(new Integer(fdvo.getFolderId()).toString());
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws RuntimeException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    HttpSession session = request.getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");

    int individualID = userObject.getIndividualID();    // logged in user

    ActionErrors allErrors = new ActionErrors();
    String forward = "mailList";
View Full Code Here

  {
    String nextURL = "editStandard";
    ActionForward forward = null;
    try
    {
      HttpSession session = request.getSession();
      UserObject userobject = (UserObject)session.getAttribute("userobject");
      String timeZone = userobject.getUserPref().getTimeZone();
      int userId = userobject.getIndividualID();
      int reportId = getTheId("reportId", request);
      int moduleId = getModuleId(request);
      DynaActionForm reportForm = (DynaActionForm)actionForm;
      String createNew = (String)reportForm.get("createNew");
      if (createNew.equals("true"))
      {
        reportForm.initialize(actionMapping);
        reportForm.set("moduleId", new Integer(moduleId));
      }
      ReportVO reportVO = null;
      ReportFacade remote = getReportFacade();
      String action = request.getParameter("action");
      String showFields = (String)((DynaActionForm)actionForm).get("showFields");
      if (action == null) // means we are probably coming here from the list view.
                          // or have resubmitted to manipulate search criteria.
      {
        reportVO = remote.getStandardReport(userId, reportId);
        moduleId = reportVO.getModuleId();
        // See if we should add a row.
        SearchCriteriaVO[] searchCriteria = (SearchCriteriaVO[])reportForm.get("searchCriteria");
        String addRow = (String)reportForm.get("addRow");
        String removeRow = (String)reportForm.get("removeRow");
        if (addRow.equals("true"))
        {
          searchCriteria = AdvancedSearchUtil.addRow(searchCriteria);
          reportForm.set("addRow", "false");
          reportForm.set("searchCriteria", searchCriteria);
        } else if (!removeRow.equals("false")) {
          searchCriteria = AdvancedSearchUtil.removeRow(searchCriteria, removeRow);
          reportForm.set("removeRow", "false");
          reportForm.set("searchCriteria", searchCriteria);
        } else if (!showFields.equals("true")) {
          // showfield probably means we have changed some fields on the form, and we need to parse
          // the form and update the VO that we got from the database to reflect those changes.
          reportForm = (DynaActionForm)getStandardReportFormFromReportVO(reportVO, actionForm, request);
        }
        moduleId = reportVO.getModuleId();
        request.setAttribute("pagedata", reportVO);
      } else if (action.equals("save")) {
        reportVO = getStandardReportVOFromForm(timeZone, actionForm);
        remote.updateStandardReport(userId, reportVO, false);
        // save is save and close (although there is nothing we can update)
        nextURL = "showstandardreportlist";
      } else if (action.equals("run") || action.equals("export") || action.equals("print")) {
        if (action.equals("run"))
        {
          reportVO = getStandardReportVOFromForm(timeZone, actionForm);
          remote.updateStandardReport(userId, reportVO, false);
          reportForm.set("createNew", "true");
          nextURL = "showstandardreportresult";
        } else if (action.equals("export")) {
          reportForm.set("createNew", "true");
          nextURL = "csvstandardreportresult";
        } else if (action.equals("print")) {
          reportForm.set("createNew", "true");
          nextURL = "printstandardreportresult";
        }
        // Extract the SearchVO from the form
        SearchVO search = this.getSearchVOFromForm(actionForm, request);
        if (action.equals("run")){
          session.removeAttribute("searchVO");
          session.setAttribute("searchVO",search);
        }
        // Run the report and get the results.
        if (action.equals("export") || action.equals("print")){
          search = (SearchVO)session.getAttribute("searchVO");
        }
        ReportResultVO reportResultVO = remote.getStandardReportResult(userId, reportId, search);
        moduleId = reportResultVO.getModuleId();
        request.setAttribute("pagedata", reportResultVO);
      }
      request.setAttribute("reportId", String.valueOf(reportId));
      request.setAttribute("moduleId", String.valueOf(moduleId));
      session.setAttribute("moduleId", String.valueOf(moduleId));
      request.setAttribute("reportType", String.valueOf(ReportConstants.STANDARD_REPORT_CODE));
      // based on the module ID pick the forward name this name is used to set the selections on the left nav.
      String forwardName = "";
      switch (moduleId) {
        case 14: forwardName = ".view.reports.contacts.standard"; break;
View Full Code Here

      // get file id from request
      int fileId = 0;
      if (request.getParameter("rowId") != null)
        fileId = Integer.parseInt(request.getParameter("rowId"));
     
      HttpSession session = request.getSession();
      int userId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
      // get the data from db thru ejb
      CvFileFacade fileFacade = new CvFileFacade();
      CvFileVO fileVO = fileFacade.getFile(userId, fileId, dataSource);
     
      // set the form bean data from VO
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpSession

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.