*/
public ActionForward edit(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
if (log.isDebugEnabled())
{log.debug("edit method called");}
Application currentApplication = (Application)request.getSession().getAttribute(ConsoleCst.CURRENT_APPLICATION);
Resource currentResource = (Resource) request.getSession().getAttribute(ConsoleCst.CURRENT_RESOURCE);
if(currentResource==null){
currentResource = new Resource();
request.getSession().setAttribute(ConsoleCst.CURRENT_RESOURCE,currentResource);
}
DynaActionForm resourceForm = (DynaActionForm) form;
String currentResourceId = (String) request.getParameter(ConsoleCst.CURRENT_RESOURCE_ID);
if (currentResourceId != null && !"".equals(currentResourceId)){
resourceForm.set(ConsoleCst.RESOURCE_REQUEST_BEAN, currentResource);
for(Iterator it=currentResource.getAttributes().iterator();it.hasNext();) {
Attribute a = (Attribute) it.next();
if("objectClass".equals(a.getAttributeLDAP()))
request.setAttribute("objectClass",a.getDefaultValue());
}
}
// put resources list in session to check the name of the new application to add
// is not yet in the list
request.getSession().setAttribute(ConsoleCst.RESOURCES_SESSION_BEAN,
currentApplication.getResources());
return mapping.findForward(ConsoleCst.RESOURCE_PAGE_FORWARD);
}