1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import org.infoglue.cms.controllers.kernel.impl.simple.GroupControllerProxy; 27 import org.infoglue.cms.controllers.kernel.impl.simple.GroupPropertiesController; 28 import org.infoglue.cms.entities.management.GroupVO; 29 import org.infoglue.cms.util.ConstraintExceptionBuffer; 30 31 34 35 public class UpdateGroupAction extends ViewGroupAction 36 { 37 private ConstraintExceptionBuffer ceb; 38 private GroupVO groupVO; 39 40 public UpdateGroupAction() 41 { 42 this(new GroupVO()); 43 } 44 45 public UpdateGroupAction(GroupVO GroupVO) 46 { 47 this.groupVO = GroupVO; 48 this.ceb = new ConstraintExceptionBuffer(); 49 } 50 51 public String doExecute() throws Exception 52 { 53 super.initialize(getGroupName()); 54 55 ceb.add(this.groupVO.validate()); 56 ceb.throwIfNotEmpty(); 57 58 String [] values = getRequest().getParameterValues("userName"); 59 String [] contentTypeDefinitionIds = getRequest().getParameterValues("contentTypeDefinitionId"); 60 61 GroupControllerProxy.getController().updateGroup(this.groupVO, values); 62 63 if(contentTypeDefinitionIds != null && contentTypeDefinitionIds.length > 0 && !contentTypeDefinitionIds[0].equals("")) 64 GroupPropertiesController.getController().updateContentTypeDefinitions(this.getGroupName(), 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 setGroupName(String groupName) 77 { 78 this.groupVO.setGroupName(groupName); 79 } 80 81 public String getGroupName() 82 { 83 return this.groupVO.getGroupName(); 84 } 85 86 public void setDescription(java.lang.String description) 87 { 88 this.groupVO.setDescription(description); 89 } 90 91 public String getDescription() 92 { 93 return this.groupVO.getDescription(); 94 } 95 96 97 } 98 | Popular Tags |