Package org.jasig.portal

Examples of org.jasig.portal.UserProfile


          // fill out user-defined profiles
          Element uEl = doc.createElement("user");
          Hashtable upList=this.getUserProfileList();

          for(Enumeration upe = this.getUserProfileList().elements(); upe.hasMoreElements();) {
              UserProfile p = (UserProfile)upe.nextElement();
              Element pEl = doc.createElement("profile");
              Boolean expState=(Boolean) userExpandStates.get(Integer.toString(p.getProfileId()));
              if(expState!=null && expState.booleanValue()) {
                  pEl.setAttribute("view","expanded");
              } else {
                  pEl.setAttribute("view","condensed");
              }
              pEl.setAttribute("id", Integer.toString(p.getProfileId()));
              pEl.setAttribute("name", p.getProfileName());
              Element dEl = doc.createElement("description");
              dEl.appendChild(doc.createTextNode(p.getProfileDescription()));
              pEl.appendChild(dEl);
              uEl.appendChild(pEl);
          }
          edEl.appendChild(uEl);
      }
      // fill out system-defined profiles
      Element sEl = doc.createElement("system");
      for (Enumeration spe = this.getSystemProfileList().elements(); spe.hasMoreElements();) {
        UserProfile p = (UserProfile)spe.nextElement();
        Element pEl = doc.createElement("profile");

        Boolean expState=(Boolean)systemExpandStates.get(Integer.toString(p.getProfileId()));
        if(expState!=null && expState.booleanValue()) {
            pEl.setAttribute("view","expanded");
        } else {
            pEl.setAttribute("view","condensed");
        }
        pEl.setAttribute("id", Integer.toString(p.getProfileId()));
        pEl.setAttribute("name", p.getProfileName());
        Element dEl = doc.createElement("description");
        dEl.appendChild(doc.createTextNode(p.getProfileDescription()));
        pEl.appendChild(dEl);
        sEl.appendChild(pEl);
      }
      edEl.appendChild(sEl);
      /*  try {
       log.debug(org.jasig.portal.utils.XML.serializeNode(doc));
       } catch (Exception e) {
       log.error(e, e);
       }
       */
      // debug printout of the document sent to the XSLT
      /*
      StringWriter dbwr1 = new StringWriter();
      org.apache.xml.serialize.OutputFormat outputFormat = new org.apache.xml.serialize.OutputFormat();
      outputFormat.setIndenting(true);
      org.apache.xml.serialize.XMLSerializer dbser1 = new org.apache.xml.serialize.XMLSerializer(dbwr1, outputFormat);
      try {
          dbser1.serialize(doc);
      log.debug("ManageProfilesState::renderXML() : XML incoming to the XSLT :\n\n" + dbwr1.toString() + "\n\n");
      } catch (Exception e) {
          log.debug("ManageProfilesState::renderXML() : problems serializing incoming XML");
      }
      */

      // find the stylesheet and transform
      StylesheetSet set = context.getStylesheetSet();
      if (set == null)
        throw  new GeneralRenderingException("Unable to determine the stylesheet list");
      String xslURI = set.getStylesheetURI("profileList", runtimeData.getBrowserInfo());
      UserProfile currentProfile = context.getCurrentUserPreferences().getProfile();
      Hashtable params = new Hashtable();

      params.put("allowNewProfile",new Boolean(ALLOW_NEW_PROFILE_BUTTON));
      params.put("allowSystemProfileMapping",new Boolean(ALLOW_SYSTEM_BROWSER_MAPPING));


      params.put("baseActionURL", runtimeData.getBaseActionURL());
      params.put("profileId", Integer.toString(currentProfile.getProfileId()));
      if (currentProfile.isSystemProfile()) {
          params.put("profileType", "system");
      } else {
          params.put("profileType", "user");
      }

View Full Code Here


     * @param owner
     * @throws Exception
     */
    private void saveLayout(UserView view, IPerson owner) throws Exception
    {
        UserProfile profile = new UserProfile();
        profile.setProfileId(view.profileId);
        dls.setUserLayout(owner, profile, view.layout, true, false);
    }
View Full Code Here

        Document layout = null;

        try
        {
            // fix hard coded 1 later for multiple profiles
            UserProfile profile = dls.getUserProfileById(owner, 1);
           
            // see if we have structure & theme stylesheets for this user yet.
            // If not then fall back on system's selected stylesheets.
            if (profile.getStructureStylesheetId() == 0 ||
                    profile.getThemeStylesheetId() == 0)
                profile = dls.getSystemProfileById(profile.getProfileId());
           
            view.profileId = profile.getProfileId();
            view.layoutId = profile.getLayoutId();
            view.structureStylesheetId = profile.getStructureStylesheetId();
            view.themeStylesheetId = profile.getThemeStylesheetId();
           
            layout = dls.getFragmentLayout( owner, profile );
            Element root = layout.getDocumentElement();
            root.setAttribute( Constants.ATT_ID,
                               "u" + fragment.userID + "l" + view.layoutId );
View Full Code Here

                                // cycle through each layout owner and clear out their
                                // respective layouts so users fragments will be cleared
                                for ( Enumeration e = owners.keys(); e.hasMoreElements(); )
                                {
                                    IPerson p = (IPerson) e.nextElement();
                                    UserProfile profile = getUserProfileById(p, 1);
                                    // fix hard coded 1 later for profiling
                                    profile.setProfileId(1);
                                    Document layout = getFragmentLayout(p,profile);
                                    FragmentDefinition fragment = (FragmentDefinition) owners.get(p);
                                    updateCachedLayout( layout, profile, fragment );
                                }
                            }
View Full Code Here

            return;

        // make a copy so the original is unchanged for the user
        try
        {
            UserProfile profile = getUserProfileById(person, 1);
            ssup = new DistributedUserPreferences(
                    (StructureStylesheetUserPreferences) ssup);
            UserView view = new UserView(profile, ownedFragment.view.layout,
                    ssup, ownedFragment.view.themeUserPrefs);
            activator.fragmentizeSSUP(view, ownedFragment);
View Full Code Here

            }
            int themeSsId = rs.getInt(7);
            if (rs.wasNull()) {
              themeSsId = 0;
            }
            UserProfile userProfile = new UserProfile(profileId, temp3,temp4, layoutId, structSsId, themeSsId);
            userProfile.setLocaleManager(new LocaleManager(person));
            return userProfile;
          }
          else {
            throw new Exception("Unable to find User Profile for user " + userId + " and profile " + profileId);
          }
View Full Code Here

            int themeSsId = rs.getInt(7);
            if (rs.wasNull()) {
              themeSsId = 0;
            }

            UserProfile upl = new UserProfile(rs.getInt(2), rs.getString(3), rs.getString(4),
                layoutId, structSsId, themeSsId);
            pv.put(new Integer(upl.getProfileId()), upl);
          }
        } finally {
          rs.close();
        }
      } finally {
View Full Code Here

  public UserProfile getSystemProfile (String userAgent) throws Exception {
    int profileId = getSystemBrowserMapping(userAgent);
    if (profileId == 0)
      return  null;
    UserProfile up = this.getUserProfileById(systemUser, profileId);
    up.setSystemProfile(true);
    return  up;
  }
View Full Code Here

    up.setSystemProfile(true);
    return  up;
  }

  public UserProfile getSystemProfileById (int profileId) throws Exception {
    UserProfile up = this.getUserProfileById(systemUser, profileId);
    up.setSystemProfile(true);
    return  up;
  }
View Full Code Here

  }

  public Hashtable getSystemProfileList () throws Exception {
    Hashtable pl = this.getUserProfileList(systemUser);
    for (Enumeration e = pl.elements(); e.hasMoreElements();) {
      UserProfile up = (UserProfile)e.nextElement();
      up.setSystemProfile(true);
    }
    return  pl;
  }
View Full Code Here

TOP

Related Classes of org.jasig.portal.UserProfile

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.