1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import org.infoglue.cms.controllers.kernel.impl.simple.RoleControllerProxy; 27 import org.infoglue.cms.controllers.kernel.impl.simple.RolePropertiesController; 28 import org.infoglue.cms.entities.management.RoleVO; 29 import org.infoglue.cms.util.ConstraintExceptionBuffer; 30 31 34 35 public class UpdateRoleAction extends ViewRoleAction { 37 private ConstraintExceptionBuffer ceb; 38 private RoleVO roleVO; 39 40 public UpdateRoleAction() 41 { 42 this(new RoleVO()); 43 } 44 45 public UpdateRoleAction(RoleVO RoleVO) 46 { 47 this.roleVO = RoleVO; 48 this.ceb = new ConstraintExceptionBuffer(); 49 } 50 51 public String doExecute() throws Exception 52 { 53 super.initialize(getRoleName()); 54 55 ceb.add(this.roleVO.validate()); 56 ceb.throwIfNotEmpty(); 57 58 String [] values = getRequest().getParameterValues("userName"); 59 String [] contentTypeDefinitionIds = getRequest().getParameterValues("contentTypeDefinitionId"); 60 61 RoleControllerProxy.getController().updateRole(this.roleVO, values); 62 63 if(contentTypeDefinitionIds != null && contentTypeDefinitionIds.length > 0 && !contentTypeDefinitionIds[0].equals("")) 64 RolePropertiesController.getController().updateContentTypeDefinitions(this.getRoleName(), contentTypeDefinitionIds); 65 66 return "success"; 67 } 68 69 public String doSaveAndExit() throws Exception 70 { 71 doExecute(); 72 73 return "saveAndExit"; 74 } 75 76 public void setRoleName(String roleName) 77 { 78 this.roleVO.setRoleName(roleName); 79 } 80 81 public String getRoleName() 82 { 83 return this.roleVO.getRoleName(); 84 } 85 86 public void setDescription(java.lang.String description) 87 { 88 this.roleVO.setDescription(description); 89 } 90 91 public String getDescription() 92 { 93 return this.roleVO.getDescription(); 94 } 95 96 97 } 98 | Popular Tags |