Package com.centraview.common

Examples of com.centraview.common.UserPrefererences


      // if the type wasn't set on the parameter
      // use the user preferences defaulting to daily view.
      type = request.getParameter("Type");
      if (type == null || type.length() <= 0) {
        // Get the preferred view from the Preferences
        UserPrefererences up = userobject.getUserPref();
        String prefView = (up.getCalendarDefaultView() == null) ? "DAILY" : up.getCalendarDefaultView(); // default
                                                                                                          // it
                                                                                                          // to
                                                                                                          // DAILY
        if (prefView.equals("DAILY")) {
          type = "DAILY";
View Full Code Here


      String typeOfSave = "save";
      int individualID = 0;
      UserObject userObject = (UserObject)session.getAttribute("userobject");

    UserPrefererences userPrefererences = userObject.getUserPref();

      // no need to check for null on userobjectd here, because if it is null
      // we should fail now! instead of making an EJB call with bogus info.    
      individualID = userObject.getIndividualID();

      if (request.getParameter("buttonpress") != null)
      {
        typeOfSave = request.getParameter("buttonpress");
        String minutes = (String) (dynaForm.get("minutes"));
        String seconds = (String) (dynaForm.get("seconds"));
        Vector vec = new Vector();
        PreferenceVO pvo1 = new PreferenceVO();
        PreferenceVO pvo2 = new PreferenceVO();
        PreferenceVO pvo3 = new PreferenceVO();
        pvo1.setModuleId(4);
        pvo1.setPreferenceName("calendarrefreshmin");
        pvo1.setPreferenceValue(minutes);
        pvo2.setModuleId(4);
        pvo2.setPreferenceName("calendarrefreshsec");
        pvo2.setPreferenceValue(seconds);
        pvo3.setModuleId(4);
        pvo3.setPreferenceName("caldefaultview");
        pvo3.setPreferenceValue((String) (dynaForm.get("radio")));

        if(minutes != null && !minutes.equals("") && !minutes.equals("null")
              && seconds != null && !seconds.equals("") && !seconds.equals("null"))
        {
            userPrefererences.setCalendarRefreshMin(minutes);
          userPrefererences.setCalendarRefreshSec(seconds);
          userObject.setUserPref(userPrefererences);
          session.setAttribute("userobject",userObject);
        }
       
        if(dynaForm.get("radio") != null)
        {
          userPrefererences.setCalendarDefaultView((String) dynaForm.get("radio"));
          userObject.setUserPref(userPrefererences);
          session.setAttribute("userobject",userObject);
        }
       
        vec.addElement(pvo1);
View Full Code Here

    int individualID = userObject.getIndividualID();    // logged in user
   
    // "mailCheckForm" defined in struts-config-preference.xml
    DynaActionForm mailForm = (DynaActionForm)form;
   
    UserPrefererences userPrefs = userObject.getUserPref();
    int prefValue = userPrefs.getEmailCheckInterval();
   
    try {
      mailForm.set("mailCheckInterval", new Integer(prefValue));
    }catch(NumberFormatException nfe){
      mailForm.set("mailCheckInterval", new Integer(10));
View Full Code Here

    try
    {
      DynaActionForm dynaForm = (DynaActionForm)form;
      HttpSession session = request.getSession();
    UserObject userobject =(UserObject) session.getAttribute("userobject");
    UserPrefererences userPrefererences = userobject.getUserPref();
     
      String typeOfSave = "save";
      int individualID = 0;
      String[] leftportlet = (String[])request.getParameterValues("portletsLeft");
      String[] rightportlet = (String[])request.getParameterValues("portletsRight");
      Vector vec = new Vector();

      if (rightportlet != null)
      {
        for (int i = 0; i < rightportlet.length; i++)
        {
          PreferenceVO pvo3 = new PreferenceVO();
          pvo3.setModuleId(4);
          pvo3.setPreferenceName(rightportlet[i]);
          pvo3.setPreferenceValue("YES");

          vec.addElement(pvo3);

        }
      }
      if (leftportlet != null)
      {

        for (int i = 0; i < leftportlet.length; i++)
        {
          PreferenceVO pvo4 = new PreferenceVO();
          pvo4.setModuleId(4);
          pvo4.setPreferenceName(leftportlet[i]);
          pvo4.setPreferenceValue("NO");

          vec.addElement(pvo4);
        }
      }
      UserObject userObject = (UserObject)session.getAttribute("userobject");
      // might as well null pointer now before we do any real harm
      individualID = userObject.getIndividualID();
      if (request.getParameter("buttonpress") != null)
      {
        typeOfSave = request.getParameter("buttonpress");

        PreferenceVO pvo1 = new PreferenceVO();
        PreferenceVO pvo2 = new PreferenceVO();

        pvo1.setModuleId(4);
        pvo1.setPreferenceName("homesettingrefreshmin");
        String minutes = (String) (dynaForm.get("minutes"));
        pvo1.setPreferenceValue(minutes);
        pvo2.setModuleId(4);
        pvo2.setPreferenceName("homesettingrefreshsec");
        String seconds = (String) (dynaForm.get("seconds"));
        pvo2.setPreferenceValue(seconds);
        vec.addElement(pvo1);
        vec.addElement(pvo2);
       
        PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
        Preference prefRemote = prefHome.create();
        prefRemote.setDataSource(dataSource);
        prefRemote.updateUserPreference(individualID, vec);

        updatePrefs(prefRemote.getUserPreferences(individualID),
                    userObject.getUserPref());

        if(minutes != null && !minutes.equals("") && !minutes.equals("null")
              && seconds != null && !seconds.equals("") && !seconds.equals("null"))
        {
            userPrefererences.setHomeRefreshMin(minutes);
          userPrefererences.setHomeRefreshSec(seconds);
          userobject.setUserPref(userPrefererences);
          session.setAttribute("userobject",userobject);
        }
       
        FORWARD_final = FORWARD_save;
View Full Code Here

  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession();
    UserObject user = (UserObject)session.getAttribute("userobject");
    int individualId = user.getIndividualID();
    UserPrefererences preferences = user.getUserPref();
    String type = request.getParameter("type");
    PreferenceVO preferenceVO = new PreferenceVO();

    StringBuffer returnPath = new StringBuffer(mapping.findForward(type).getPath());

  String listScope = request.getParameter("listScope");
  if (listScope == null ){
    listScope = "my";
  }
  if (listScope != null && listScope.length() > 0)
  {
    returnPath.append("?listScope="+listScope);
  }

    if (type != null && type.equals(TICKET))
    {
      preferences.setShowTicketCharts(!preferences.isShowTicketCharts());
      String preferenceValue = (preferences.isShowTicketCharts())?"Yes":"No";
      preferenceVO.setTag("");
      preferenceVO.setPreferenceName("showticketcharts");
      preferenceVO.setPreferenceValue(preferenceValue);
    } else if (type != null && type.equals(SALES)){
      preferences.setShowSalesCharts(!preferences.isShowSalesCharts());
      String preferenceValue = (preferences.isShowSalesCharts())?"Yes":"No";
      preferenceVO.setTag("");
      preferenceVO.setPreferenceName("showsalescharts");
      preferenceVO.setPreferenceValue(preferenceValue);
    }
View Full Code Here

      prefRemote.setDataSource(dataSource);
      prefRemote.updateUserPreference(individualID, vec);
     
      request.setAttribute("emailComposition", composeType);
     
      UserPrefererences userPref= userObject.getUserPref();
      userPref.setContentType(composeType);
      userObject.setUserPref(userPref);
      session.setAttribute("userobject", userObject);
     
      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "EMAILCOMPOSITION");
    } catch (Exception e) {
View Full Code Here

        // Please note that the next line has a severe mis-spelling on it.
        // The class name was mis-spelled when it was created, and it was
        // never fixed. So please be careful when trying to use the class
        // "UserPrefererences" - make sure you spell it wrong intentionally
        UserPrefererences userPrefs = userObject.getUserPref();

        AuthorizationHome authHome = (AuthorizationHome)CVUtility.getHomeObject(
            "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
        Authorization authRemote = authHome.create();
        authRemote.setDataSource(this.dataSource);

        ModuleFieldRightMatrix rightsMatrix = authRemote.getUserSecurityProfileMatrix(userObject
            .getIndividualID());

        if (!rightsMatrix.isModuleVisible("Synchronize")) {
          return (false);
        }

        userPrefs.setModuleAuthorizationMatrix(rightsMatrix);
        userObject.setUserPref(userPrefs);

        // now, save the userObject in the request session
        session.setAttribute("userobject", userObject);
View Full Code Here

        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();
      body.append(linebreak + linebreak + "---- Original Message: ----" + linebreak);
View Full Code Here

        individualID = userObject.getIndividualID();
      }
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = prefHome.create();
      prefRemote.setDataSource(dataSource);
      UserPrefererences up = prefRemote.getUserPreferences(individualID);

      //UserPrefererences up  = userObject.getUserPref();
      dynaForm.set("minutes", up.getCalendarRefreshMin());
      dynaForm.set("seconds", up.getCalendarRefreshSec());
      dynaForm.set("radio", up.getCalendarDefaultView());

      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "CALENDAR");
      FORWARD_final = FORWARD_calendarpage;
    } catch (Exception e) {
      System.out.println("[Exception][DisplayCalendarHandler.execute] Exception Thrown: " + e);
View Full Code Here

        individualID = userObject.getIndividualID();
      }
     
      DynaActionForm composeForm = (DynaActionForm)form;

      UserPrefererences userPref = prefRemote.getUserPreferences(individualID);
      request.setAttribute("emailComposition", userPref.getContentType());

      composeForm.set("composeType", userPref.getContentType());

      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "EMAILCOMPOSITION");
      FORWARD_final = FORWARD_emailcompositionpage;
    } catch (Exception e) {
      System.out.println("[Exception][DisplayEmailComposition.execute] Exception Thrown: " + e);
View Full Code Here

TOP

Related Classes of com.centraview.common.UserPrefererences

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.