// 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");
}