* @see com.adito.properties.actions.AbstractPropertiesAction#unspecified(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
super.unspecified(mapping, form, request, response);
ProfilePropertiesForm pf = (ProfilePropertiesForm)form;
if (pf.getSelectedPropertyProfile() == -1) {
if (request.getSession().getAttribute(Constants.SELECTED_PROFILE) != null) {
pf.setSelectedPropertyProfile(((PropertyProfile) request.getSession().getAttribute(Constants.SELECTED_PROFILE)).getResourceId());
} else {
pf.setSelectedPropertyProfile(0);
}
}
PropertyProfile selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(pf.getSelectedPropertyProfile());
if (selectedPropertyProfile == null) {
selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(getSessionInfo(request).getUser().getPrincipalName(),
"Default", getSessionInfo(request).getUser().getRealm().getResourceId());
if (selectedPropertyProfile == null) {
selectedPropertyProfile = ProfilesFactory.getInstance().getPropertyProfile(null, "Default",
UserDatabaseManager.getInstance().getDefaultUserDatabase().getRealm().getResourceId());
}
}
ResourceStack.pushToEditingStack(request.getSession(), selectedPropertyProfile);
// Get the property profiles
List propertyProfiles = (List)request.getSession().getAttribute(Constants.PROFILES);
if (selectedPropertyProfile == null) {
for (Iterator i = propertyProfiles.iterator(); i.hasNext();) {
selectedPropertyProfile = (PropertyProfile) i.next();
if (selectedPropertyProfile.getResourceName().equals("Default")) {
break;
}
}
}
pf.setPropertyProfiles(propertyProfiles);
pf.setSelectedPropertyProfile(selectedPropertyProfile.getResourceId());
// Build an display
return rebuildItems(mapping, pf.getParentCategory(), pf, request, getSessionInfo(request).getUser());
}