Package com.centraview.common

Examples of com.centraview.common.UserObject


    String finalForward = ".view.email.lookup.list";
   
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
   
    HttpSession session = request.getSession(true);
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();

    //  Check the session for an existing error message (possibly from the delete handler)
    ActionErrors allErrors = (ActionErrors)session.getAttribute("listErrorMessage");
    if (allErrors != null) {
      saveErrors(request, allErrors);
      session.removeAttribute("listErrorMessage");
    }
    ListPreference listPreference = userObject.getListPreference("EmailLookup");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));

    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) { // build up new Parameters
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();
    HttpSession session = request.getSession(true);
    session.removeAttribute("printtemplate");
    UserObject userObject = (UserObject) session.getAttribute("userobject");
    int individualID = userObject.getIndividualID();
    try {
      DynaActionForm dynaform = (DynaActionForm) form;
      dynaform.reset(mapping, request);
      dynaform.set("templateName", "");
      dynaform.set("id", "");
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws RuntimeException, Exception
  {
    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 = "closeWindow";
    String errorForward = "errorOccurred";
   
View Full Code Here

    try
    {
      DynaActionForm dynaForm = (DynaActionForm) form;

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

      String strEventid = (String) dynaForm.get("eventid");
      strEventid = (String) request.getParameter("eventid");

      String strIndividualId = (String) request.getParameter("Individualid");
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws RuntimeException, Exception
  {
    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 = "displayComposeForm";
    String errorForward = "errorOccurred";
View Full Code Here

      HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException {
    String finalForward = ".view.files.list";
    String dataSource = Settings.getInstance().getSiteInfo(
        CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    UserObject userObject = (UserObject) session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();

    // Check the session for an existing error message (possibly from the delete
    // handler)
    ActionErrors allErrors = (ActionErrors) session.getAttribute("listErrorMessage");
    if (allErrors != null) {
      saveErrors(request, allErrors);
      session.removeAttribute("listErrorMessage");
    }

    // Check wheather the actionType is it Lookup or not
    String actionType = request.getParameter("actionType");

    GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);
    HashMap moduleList = new HashMap();
    if (globalMasterLists.get("moduleList") != null) {
      moduleList = (HashMap) globalMasterLists.get("moduleList");
    }

    ListPreference listPreference = userObject.getListPreference("File");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));

    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters) request.getAttribute("listParameters");
    if (requestListParameters == null) { // build up new Parameters
      listParameters = new ValueListParameters(ValueListConstants.FILE_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the
              // request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
      FieldDescriptor sortField = (FieldDescriptor) ValueListConstants.fileViewMap.get(listPreference.getSortElement());
      listParameters.setSortColumn(sortField.getQueryIndex());
      if (listPreference.getsortOrder())
        listParameters.setSortDirection("ASC");
      else
        listParameters.setSortDirection("DESC");
    }

    int defaultFolder = userObject.getUserPref().getDefaultFolderID();
    int folderID = defaultFolder;
    String param = request.getParameter("folderId");
    if (param != null) {
      if (param.indexOf("*") == -1) {
        folderID = Integer.parseInt(param);
      } else {
        folderID = Integer.parseInt(param.substring(0, param.indexOf("*")));
      }
    }
    listParameters.setFolderID(folderID);
    request.setAttribute("folderId", String.valueOf(folderID));

    String scope = request.getParameter(FileConstantKeys.TYPEOFFILELIST);
    if (scope != null && !scope.equals("")) {
      request.setAttribute("fileTypeRequest", scope);
      request.setAttribute(FileConstantKeys.TYPEOFFILELIST, scope);
    } else {
      scope = "MY";
      request.setAttribute("fileTypeRequest", "MY");
      request.setAttribute(FileConstantKeys.TYPEOFFILELIST, "MY");
    }

    // Search handling
    String filter = null;
    String filterParameter = request.getParameter("filter");
    if (filterParameter != null) {
      filter = (String) session.getAttribute("listFilter");
      if (scope.equals("MY")) {
        filter += " AND Owner = " + individualId;
        session.setAttribute("listFilter", filter);
      }
      request.setAttribute("appliedSearch", filterParameter);
    } else {
      // TODO Need to handle folder access too.
      if (scope.equals("MY"))
        filter = "SELECT FileID FROM cvfile WHERE Owner = " + individualId;
      session.removeAttribute("listFilter");
    }
    listParameters.setFilter(filter);

    // Build up the breadcrumbs on the folder bar.
    // the crumbs will be the complete FolderRootPath except in the
    // cases where you are looking at ALL, MY or PUBLIC then we will manually get rid of
    // the leading things.
    try {
      Vector vec = null;
      int rootId = 0;
      ArrayList remove = new ArrayList();
      CvFileFacade fileFacade = new CvFileFacade();
      vec = fileFacade.getFolderRootPath(individualId, folderID, dataSource);
      if (vec != null) {
        Collections.reverse(vec);
        if (scope.equals("ALL")) {
          Iterator iter = vec.iterator();
          while (iter.hasNext()) {
            DDNameValue current = (DDNameValue) iter.next();
            if (current.getName().equals("CV_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_ROOT")) {
              rootId = current.getId();
              remove.add(current);
            }
          }
          iter = remove.iterator();
          while (iter.hasNext()) {
            vec.remove(iter.next());
          }
          vec.add(0, new DDNameValue(rootId, "All Files"));
        } else if (scope.equals("MY")) {
          Iterator iter = vec.iterator();
          while (iter.hasNext()) {
            DDNameValue current = (DDNameValue) iter.next();
            if (current.getName().equals("CV_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_USER")) {
              remove.add(current);
            } else if (current.getName().equals(userObject.getLoginName())) {
              rootId = current.getId();
              remove.add(current);
            }
          }
          iter = remove.iterator();
View Full Code Here

      {
        listid = Integer.parseInt((String)session.getAttribute("listid"));
      }

      ListMemberForm dyn = (ListMemberForm)session.getAttribute("importListForm");
      UserObject userobject = (UserObject)session.getAttribute("userobject");

      int indvID = 0;

      if (userobject != null)
      {
        indvID = userobject.getIndividualID();
      }

      ListGenerator lg = ListGenerator.getListGenerator(dataSource);
      lg.makeListDirty("Entity");
      lg.makeListDirty("Individual");
View Full Code Here

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

    try
    {
      HttpSession session = request.getSession(true);
      UserObject userobjectd = (UserObject)session.getAttribute("userobject");
      int individualid = userobjectd.getIndividualID();
      int eventid = Integer.parseInt(request.getParameter("eventid").toString());

      HashMap mapEvent = new HashMap();
      mapEvent.put("eventid", "" + eventid);
      mapEvent.put("individualid", "" + individualid);
View Full Code Here

      throws RuntimeException, IOException, ServletException, 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 = "displayComposeForm";
    String errorForward = "errorOccurred";

    // "composeMailForm", defined in struts-config-email.xml
    DynaActionForm emailForm = (DynaActionForm) form;
    MailHome home = (MailHome) CVUtility.getHomeObject("com.centraview.mail.MailHome", "Mail");

    try {
      // get the message ID from the form bean
      Integer messageID = (Integer) emailForm.get("messageID");

      // now, check the message ID on the form...
      if (messageID == null || messageID.intValue() <= 0) {
        // if Message ID is not set on the form, then there is
        // no point in continuing forward. Show user the door. :-)
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Message ID"));
        return (mapping.findForward(errorForward));
      }

      Mail remote = home.create();
      remote.setDataSource(dataSource);
      MailMessageVO messageVO = remote.getEmailMessageVO(individualID, messageID.intValue());

      // set the subject on the form bean. Don't forget to prepend "Re: "
      String prevSubject = messageVO.getSubject();
      StringBuffer newSubject = new StringBuffer("");
      if (prevSubject != null && prevSubject.length() > 0) {
        if ((prevSubject.toLowerCase()).startsWith("re: ")) {
          // If the subject already has "Re:" pre-pended,
          // do not add another "Re:"
          newSubject.append(prevSubject);
        } else {
          newSubject.append("Re: " + prevSubject);
        }
      } else {
        newSubject.append("Re: your message");
      }
      emailForm.set("subject", newSubject.toString());

      String linebreak = "\n";
      UserPrefererences userPref = userObject.getUserPref();
      if ((userPref.getContentType()).equals("HTML")) {
        linebreak = "<br>\n";
      }

      StringBuffer body = new StringBuffer();
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)) {
        SupportFacadeHome sfh = (SupportFacadeHome) CVUtility.getHomeObject("com.centraview.support.supportfacade.SupportFacadeHome",
View Full Code Here

TOP

Related Classes of com.centraview.common.UserObject

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.