1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import java.util.ArrayList ; 27 import java.util.List ; 28 29 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 30 import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController; 31 import org.infoglue.cms.controllers.kernel.impl.simple.GroupControllerProxy; 32 import org.infoglue.cms.controllers.kernel.impl.simple.RoleControllerProxy; 33 import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy; 34 import org.infoglue.cms.controllers.kernel.impl.simple.UserPropertiesController; 35 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO; 36 import org.infoglue.cms.security.InfoGluePrincipal; 37 38 public class ViewSystemUserAction extends InfoGlueAbstractAction 39 { 40 private static final long serialVersionUID = 1L; 41 42 private String userName; 43 private boolean supportsUpdate = true; 44 private InfoGluePrincipal infoGluePrincipal; 45 private List roles = new ArrayList (); 46 private List assignedRoleVOList; 47 private List groups = new ArrayList (); 48 private List assignedGroupVOList; 49 private List contentTypeDefinitionVOList; 50 private List assignedContentTypeDefinitionVOList; 51 52 protected void initialize(String userName) throws Exception 53 { 54 this.infoGluePrincipal = UserControllerProxy.getController().getUser(userName); 56 this.supportsUpdate = this.infoGluePrincipal.getAutorizationModule().getSupportUpdate(); 57 58 this.assignedRoleVOList = infoGluePrincipal.getRoles(); 59 if(this.supportsUpdate) this.roles = this.infoGluePrincipal.getAutorizationModule().getRoles(); 61 62 this.assignedGroupVOList = infoGluePrincipal.getGroups(); 63 if(this.supportsUpdate) this.groups = this.infoGluePrincipal.getAutorizationModule().getGroups(); 65 66 this.contentTypeDefinitionVOList = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList(ContentTypeDefinitionVO.EXTRANET_USER_PROPERTIES); 67 this.assignedContentTypeDefinitionVOList = UserPropertiesController.getController().getContentTypeDefinitionVOList(userName); 68 } 69 70 public String doExecute() throws Exception 71 { 72 this.initialize(getUserName()); 73 74 return "success"; 75 } 76 77 public List getAssignedRoles() throws Exception 78 { 79 return this.assignedRoleVOList; 80 } 81 82 public List getAllRoles() throws Exception 83 { 84 return this.roles; 85 } 86 87 public List getAssignedGroups() throws Exception 88 { 89 return this.assignedGroupVOList; 90 } 91 92 public List getAllGroups() throws Exception 93 { 94 return this.groups; 95 } 96 97 public List getContentTypeDefinitionVOList() 98 { 99 return contentTypeDefinitionVOList; 100 } 101 102 public String getUserName() 103 { 104 return this.userName; 105 } 106 107 public void setUserName(String userName) 108 { 109 this.userName = userName; 110 } 111 112 public String getFirstName() 113 { 114 return infoGluePrincipal.getFirstName(); 115 } 116 117 public String getLastName() 118 { 119 return infoGluePrincipal.getLastName(); 120 } 121 122 public String getEmail() 123 { 124 return infoGluePrincipal.getEmail(); 125 } 126 127 public boolean getSupportsUpdate() 128 { 129 return this.supportsUpdate; 130 } 131 132 public List getAssignedContentTypeDefinitionVOList() 133 { 134 return assignedContentTypeDefinitionVOList; 135 } 136 137 } 138 | Popular Tags |