svnno****@sourc*****
svnno****@sourc*****
2007年 4月 6日 (金) 15:18:40 JST
Revision: 21 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=21 Author: shinsuke Date: 2007-04-06 15:18:40 +0900 (Fri, 06 Apr 2007) Log Message: ----------- added user admin pages Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/J2SecurityProviderFilter.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java pal-admin/trunk/src/main/resources/appMessages.properties pal-admin/trunk/src/main/webapp/WEB-INF/portlet.xml Added Paths: ----------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/dxo/UserDxo.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/ProfilingRule.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/User.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/pager/UserPager.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/ pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/AbstractUserPage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/label.properties pal-admin/trunk/src/main/webapp/view/user/userConfirm.html pal-admin/trunk/src/main/webapp/view/user/userCreate.html pal-admin/trunk/src/main/webapp/view/user/userEdit.html pal-admin/trunk/src/main/webapp/view/user/userList.html Removed Paths: ------------- pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html pal-admin/trunk/src/main/webapp/view/user/roleEdit.html pal-admin/trunk/src/main/webapp/view/user/roleList.html -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2007-04-06 06:18:40 UTC (rev 21) @@ -18,10 +18,15 @@ public static final String GROUP_MANAGER_COMPONENT = PREFIX + "GroupManager"; + public static final String PROFILER_COMPONENT = PREFIX + "Profiler"; + + public static final String PAGE_MANAGER_COMPONENT = PREFIX + "PageManager"; + public static final String PREVIOUS_PAGE_NUMBER = "previousPageNumber"; public static final String NEXT_PAGE_NUMBER = "nextPageNumber"; public static final int DEFAULT_PAGER_LIMIT_SIZE = 3; + public static final String DEFAULT_TEMPLATE_FOLDER = "/_user/template/"; } Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/dxo/UserDxo.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/dxo/UserDxo.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/dxo/UserDxo.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,17 @@ +package jp.sf.pal.admin.dxo; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.admin.entity.User; +import jp.sf.pal.admin.web.user.AbstractUserPage; + +public interface UserDxo +{ + public void convert(List<User> entities, List<Map<String, Object>> list); + + public void convert(AbstractUserPage page, User entity); + + public void convert(User entity, AbstractUserPage page); + +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/dxo/UserDxo.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/ProfilingRule.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/ProfilingRule.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/ProfilingRule.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,22 @@ +package jp.sf.pal.admin.entity; + +public class ProfilingRule +{ + private String id; + + /** + * @return the id + */ + public String getId() + { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) + { + this.id = id; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/ProfilingRule.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/User.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/User.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/User.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,176 @@ +package jp.sf.pal.admin.entity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.jetspeed.profiler.ProfileLocator; + +public class User +{ + private String name; + + private String password; + + private boolean updateRequired; + + private List<Role> roles; + + private List<Group> groups; + + private Map<String, ProfilingRule> profilingRules; + + public User() + { + roles = new ArrayList<Role>(); + groups = new ArrayList<Group>(); + profilingRules = new HashMap<String, ProfilingRule>(); + } + + /** + * @return the name + */ + public String getName() + { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) + { + this.name = name; + } + + /** + * @return the password + */ + public String getPassword() + { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) + { + this.password = password; + } + + /** + * @return the profileRules + */ + public Map<String, ProfilingRule> getProfilingRules() + { + return profilingRules; + } + + /** + * @param profileRules the profileRules to set + */ + public void setProfilingRules(Map<String, ProfilingRule> profileRules) + { + this.profilingRules = profileRules; + } + + /** + * @return the roles + */ + public List<Role> getRoles() + { + return roles; + } + + /** + * @param roles the roles to set + */ + public void setRoles(List<Role> roles) + { + this.roles = roles; + } + + /** + * @return the groups + */ + public List<Group> getGroups() + { + return groups; + } + + /** + * @param groups the groups to set + */ + public void setGroups(List<Group> groups) + { + this.groups = groups; + } + + /** + * @return the updateRequired + */ + public boolean isUpdateRequired() + { + return updateRequired; + } + + /** + * @param updateRequired the updateRequired to set + */ + public void setUpdateRequired(boolean updateRequired) + { + this.updateRequired = updateRequired; + } + + // Aditional method + + public void setRoleName(String rolename) + { + Role role = new Role(); + role.setName(rolename); + roles.add(role); + } + + public String getRoleName() + { + if (!roles.isEmpty()) + { + return roles.get(0).getName(); + } + return null; + } + + public void setGroupName(String groupname) + { + Group group = new Group(); + group.setName(groupname); + groups.add(group); + } + + public String getGroupName() + { + if (!groups.isEmpty()) + { + return groups.get(0).getName(); + } + return null; + } + + public void setProfilingRuleName(String profilingRulename) + { + ProfilingRule profilingRule = new ProfilingRule(); + profilingRule.setId(profilingRulename); + profilingRules.put(ProfileLocator.PAGE_LOCATOR, profilingRule); + } + + public String getProfilingRuleName() + { + if (!profilingRules.isEmpty()) + { + return profilingRules.get(ProfileLocator.PAGE_LOCATOR).getId(); + } + return null; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/entity/User.java ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/J2SecurityProviderFilter.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/J2SecurityProviderFilter.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/filter/J2SecurityProviderFilter.java 2007-04-06 06:18:40 UTC (rev 21) @@ -13,6 +13,8 @@ import jp.sf.pal.admin.PALAdminConstants; import org.apache.jetspeed.CommonPortletServices; +import org.apache.jetspeed.page.PageManager; +import org.apache.jetspeed.profiler.Profiler; import org.apache.jetspeed.security.GroupManager; import org.apache.jetspeed.security.RoleManager; import org.apache.jetspeed.security.SecurityProvider; @@ -31,6 +33,10 @@ private RoleManager roleManager; + private Profiler profiler; + + private PageManager pageManager; + /* * (non-Javadoc) * @@ -87,6 +93,25 @@ throw new PortletException( "Failed to find the Role Manager on portlet initialization"); } + + // profiler + profiler = (Profiler) portletContext + .getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT); + if (null == profiler) + { + throw new PortletException( + "Failed to find the Profiler on portlet initialization"); + } + + // pageManager + pageManager = (PageManager) portletContext + .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT); + if (null == pageManager) + { + throw new PortletException( + "Failed to find the Page Manager on portlet initialization"); + } + } } @@ -109,6 +134,9 @@ groupManager); request.setAttribute(PALAdminConstants.ROLE_MANAGER_COMPONENT, roleManager); + request.setAttribute(PALAdminConstants.PROFILER_COMPONENT, profiler); + request.setAttribute(PALAdminConstants.PAGE_MANAGER_COMPONENT, + pageManager); chain.processActionFilter(request, response); } @@ -131,72 +159,11 @@ groupManager); request.setAttribute(PALAdminConstants.ROLE_MANAGER_COMPONENT, roleManager); + request.setAttribute(PALAdminConstants.PROFILER_COMPONENT, profiler); + request.setAttribute(PALAdminConstants.PAGE_MANAGER_COMPONENT, + pageManager); chain.renderFilter(request, response); } - /** - * @return the securityProvider - */ - public SecurityProvider getSecurityProvider() - { - return securityProvider; - } - - /** - * @param securityProvider the securityProvider to set - */ - public void setSecurityProvider(SecurityProvider securityProvider) - { - this.securityProvider = securityProvider; - } - - /** - * @return the groupManager - */ - public GroupManager getGroupManager() - { - return groupManager; - } - - /** - * @param groupManager the groupManager to set - */ - public void setGroupManager(GroupManager groupManager) - { - this.groupManager = groupManager; - } - - /** - * @return the roleManager - */ - public RoleManager getRoleManager() - { - return roleManager; - } - - /** - * @param roleManager the roleManager to set - */ - public void setRoleManager(RoleManager roleManager) - { - this.roleManager = roleManager; - } - - /** - * @return the userManager - */ - public UserManager getUserManager() - { - return userManager; - } - - /** - * @param userManager the userManager to set - */ - public void setUserManager(UserManager userManager) - { - this.userManager = userManager; - } - } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SecurityProviderLogic.java 2007-04-06 06:18:40 UTC (rev 21) @@ -2,21 +2,36 @@ import java.security.Principal; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Set; import javax.faces.context.FacesContext; +import javax.security.auth.Subject; import jp.sf.pal.admin.PALAdminConstants; import jp.sf.pal.admin.PALAdminException; import jp.sf.pal.admin.entity.Group; +import jp.sf.pal.admin.entity.ProfilingRule; import jp.sf.pal.admin.entity.Role; +import jp.sf.pal.admin.entity.User; import jp.sf.pal.admin.pager.GroupPager; import jp.sf.pal.admin.pager.RolePager; +import jp.sf.pal.admin.pager.UserPager; +import jp.sf.pal.admin.util.PALAdminUtil; +import org.apache.jetspeed.om.folder.Folder; +import org.apache.jetspeed.page.PageManager; +import org.apache.jetspeed.profiler.Profiler; +import org.apache.jetspeed.security.AuthenticationProviderProxy; import org.apache.jetspeed.security.GroupManager; +import org.apache.jetspeed.security.PasswordCredential; import org.apache.jetspeed.security.RoleManager; import org.apache.jetspeed.security.SecurityException; import org.apache.jetspeed.security.SecurityProvider; +import org.apache.jetspeed.security.UserManager; +import org.apache.jetspeed.security.UserPrincipal; import org.apache.jetspeed.security.spi.GroupSecurityHandler; import org.apache.jetspeed.security.spi.RoleSecurityHandler; import org.apache.log4j.Logger; @@ -31,6 +46,12 @@ private SecurityProvider securityProvider = null; + private AuthenticationProviderProxy authenticationProviderProxy; + + // private UserSecurityHandler userSecurityHandler = null; + + private UserManager userManager = null; + private RoleSecurityHandler roleSecurityHandler = null; private RoleManager roleManager = null; @@ -39,6 +60,10 @@ private GroupManager groupManager = null; + private Profiler profiler = null; + + private PageManager pageManager = null; + /** * @return the facesContext */ @@ -48,6 +73,28 @@ } /** + * @return the authenticationProviderProxy + */ + public AuthenticationProviderProxy getAuthenticationProviderProxy() + { + if (authenticationProviderProxy == null) + { + authenticationProviderProxy = getSecurityProvider() + .getAuthenticationProviderProxy(); + } + return authenticationProviderProxy; + } + + /** + * @param authenticationProviderProxy the authenticationProviderProxy to set + */ + public void setAuthenticationProviderProxy( + AuthenticationProviderProxy authenticationProviderProxy) + { + this.authenticationProviderProxy = authenticationProviderProxy; + } + + /** * @return the roleSecurityHandler */ public RoleSecurityHandler getRoleSecurityHandler() @@ -91,6 +138,28 @@ } /** + * @return the userManager + */ + public UserManager getUserManager() + { + if (userManager == null) + { + userManager = (UserManager) getFacesContext().getExternalContext() + .getRequestMap().get( + PALAdminConstants.USER_MANAGER_COMPONENT); + } + return userManager; + } + + /** + * @param userManager the userManager to set + */ + public void setUserManager(UserManager userManager) + { + this.userManager = userManager; + } + + /** * @return the roleManager */ public RoleManager getRoleManager() @@ -135,6 +204,49 @@ } /** + * @return the profiler + */ + public Profiler getProfiler() + { + if (profiler == null) + { + profiler = (Profiler) getFacesContext().getExternalContext() + .getRequestMap().get(PALAdminConstants.PROFILER_COMPONENT); + } + return profiler; + } + + /** + * @param profiler the profiler to set + */ + public void setProfiler(Profiler profiler) + { + this.profiler = profiler; + } + + /** + * @return the pageManager + */ + public PageManager getPageManager() + { + if (pageManager == null) + { + pageManager = (PageManager) getFacesContext().getExternalContext() + .getRequestMap().get( + PALAdminConstants.PAGE_MANAGER_COMPONENT); + } + return pageManager; + } + + /** + * @param pageManager the pageManager to set + */ + public void setPageManager(PageManager pageManager) + { + this.pageManager = pageManager; + } + + /** * @return the securityProvider */ public SecurityProvider getSecurityProvider() @@ -157,6 +269,187 @@ } // + // User + // + + public List<User> getUsers(UserPager pager) + { + //Debug + if (PALAdminConstants.DEBUG) + { + List<User> list = new ArrayList<User>(); + User entity = new User(); + entity.setName("GROUP"); + list.add(entity); + return list; + } + + List<User> userList = new ArrayList<User>(); + List<Principal> principals = getAuthenticationProviderProxy() + .getUserPrincipals(pager.getFilter()); + + // set count + pager.setCount(principals.size()); + + // create list + int offset = pager.getOffset(); + int limit = pager.getLimit(); + int size = principals.size(); + if (logger.isDebugEnabled()) + { + logger.debug("getUsers(UserPager) - pager.getFilter()=" + + pager.getFilter()); + logger.debug("getUsers(UserPager) - offset=" + offset + ", limit=" + + limit + ", size=" + size); + } + for (int i = offset; i < offset + limit && i < size; i++) + { + User entity = new User(); + entity.setName(principals.get(i).getName()); + // TODO Others + userList.add(entity); + } + + return userList; + + } + + public void insertUser(User user) throws PALAdminException + { + //Debug + if (PALAdminConstants.DEBUG) + { + return; + } + + if (PALAdminUtil.isEmpty(user.getName()) + || PALAdminUtil.isEmpty(user.getPassword())) + { + throw new PALAdminException( + "Invalid user name or password. username=" + user.getName() + + ", password=" + user.getPassword()); + } + + //TODO check duplicate name + try + { + // Add user + getUserManager().addUser(user.getName(), user.getPassword()); + + // Set updateRequired + PasswordCredential credential = getPasswordCredential(user + .getName()); + if (credential != null) + { + if (user.isUpdateRequired() != credential.isUpdateRequired()) + { + getUserManager().setPasswordUpdateRequired(user.getName(), + user.isUpdateRequired()); + } + } + + // Set role + for (Iterator<Role> ite = user.getRoles().iterator(); ite.hasNext();) + { + Role role = ite.next(); + if (!PALAdminUtil.isEmpty(role.getName())) + { + getRoleManager().addRoleToUser(user.getName(), + role.getName()); + } + } + + // Add profiling rule + Principal principal = PALAdminUtil.getPrincipal(getUserSubject(user + .getName()), UserPrincipal.class); + for (Iterator<Map.Entry<String, ProfilingRule>> ite = user + .getProfilingRules().entrySet().iterator(); ite.hasNext();) + { + Map.Entry<String, ProfilingRule> e = ite.next(); + if (!PALAdminUtil.isEmpty(e.getKey()) && e.getValue() != null + && e.getValue().getId() != null) + { + getProfiler().setRuleForPrincipal(principal, + getProfiler().getRule(e.getValue().getId()), + e.getKey()); + } + } + + // Create user's psml + if (!getPageManager().userFolderExists(user.getName())) + { + //TODO where is template folder + String templateFolder = PALAdminConstants.DEFAULT_TEMPLATE_FOLDER; + Folder source = getPageManager().getFolder(templateFolder); + getPageManager().deepCopyFolder(source, + Folder.USER_FOLDER + user.getName(), user.getName()); + } + } + catch (Exception e) + { + logger.error("Could not create user: " + user, e); + throw new PALAdminException(e); + } + } + + private Subject getUserSubject(String username) throws SecurityException + { + org.apache.jetspeed.security.User user = getUserManager().getUser( + username); + return user.getSubject(); + } + + private PasswordCredential getPasswordCredential(String username) + throws SecurityException + { + org.apache.jetspeed.security.User user = getUserManager().getUser( + username); + + PasswordCredential credential = null; + + Set<Object> credentials = user.getSubject().getPrivateCredentials(); + Iterator iter = credentials.iterator(); + while (iter.hasNext()) + { + Object o = iter.next(); + if (o instanceof PasswordCredential) + { + credential = (PasswordCredential) o; + break; + } + } + return credential; + } + + public void deleteUser(User user) throws PALAdminException + { + //Debug + if (PALAdminConstants.DEBUG) + { + return; + } + + try + { + getUserManager().removeUser(user.getName()); + + // Remove user's psml folder + if (getPageManager().folderExists( + Folder.USER_FOLDER + user.getName())) + { + Folder folder = pageManager.getFolder(Folder.USER_FOLDER + + user.getName()); + pageManager.removeFolder(folder); + } + + } + catch (Exception e) + { + throw new PALAdminException(e); + } + } + + // // Role // @@ -237,6 +530,29 @@ } } + public List<String> getRoleNames() + { + //Debug + if (PALAdminConstants.DEBUG) + { + List<String> list = new ArrayList<String>(); + list.add("ROLE"); + return list; + } + + List<String> roleList = new ArrayList<String>(); + List<Principal> principals = getRoleSecurityHandler() + .getRolePrincipals(""); + + for (Iterator<Principal> ite = principals.iterator(); ite.hasNext();) + { + roleList.add(ite.next().getName()); + } + + return roleList; + + } + // // Group // @@ -317,4 +633,20 @@ throw new PALAdminException(e); } } + + // + // ProfilingRule + // + public List<String> getProfilingRuleNames() + { + ArrayList<String> list = new ArrayList<String>(); + for (Iterator<org.apache.jetspeed.profiler.rules.ProfilingRule> ite = getProfiler() + .getRules().iterator(); ite.hasNext();) + { + org.apache.jetspeed.profiler.rules.ProfilingRule profilingRule = ite + .next(); + list.add(profilingRule.getId()); + } + return list; + } } Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/pager/UserPager.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/pager/UserPager.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/pager/UserPager.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,28 @@ +package jp.sf.pal.admin.pager; + +public class UserPager extends DefaultPager +{ + private String filter; + + public UserPager() + { + super(); + filter = ""; + } + + /** + * @return the filter + */ + public String getFilter() + { + return filter; + } + + /** + * @param filter the filter to set + */ + public void setFilter(String filter) + { + this.filter = filter; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/pager/UserPager.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,174 @@ +package jp.sf.pal.admin.service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.faces.context.FacesContext; + +import jp.sf.pal.admin.PALAdminConstants; +import jp.sf.pal.admin.PALAdminException; +import jp.sf.pal.admin.dxo.UserDxo; +import jp.sf.pal.admin.entity.User; +import jp.sf.pal.admin.logic.SecurityProviderLogic; +import jp.sf.pal.admin.pager.UserPager; +import jp.sf.pal.admin.web.user.AbstractUserPage; +import jp.sf.pal.admin.web.user.UserListPage; + +public class UserManagementService +{ + private UserPager userPager; + + private SecurityProviderLogic securityProviderLogic; + + private UserDxo userDxo; + + /** + * @return the securityProviderLogic + */ + public SecurityProviderLogic getSecurityProviderLogic() + { + return securityProviderLogic; + } + + /** + * @param securityProviderLogic the securityProviderLogic to set + */ + public void setSecurityProviderLogic( + SecurityProviderLogic securityProviderLogic) + { + this.securityProviderLogic = securityProviderLogic; + } + + /** + * @return the userDxo + */ + public UserDxo getUserDxo() + { + return userDxo; + } + + /** + * @param userDxo the userDxo to set + */ + public void setUserDxo(UserDxo userDxo) + { + this.userDxo = userDxo; + } + + /** + * @return the userListPager + */ + public UserPager getUserPager() + { + return userPager; + } + + /** + * @param userListPager the userListPager to set + */ + public void setUserPager(UserPager userListPager) + { + this.userPager = userListPager; + } + + public void handlePagerNavigation() + { + Map requestMap = FacesContext.getCurrentInstance().getExternalContext() + .getRequestParameterMap(); + String prev = (String) requestMap + .get(PALAdminConstants.PREVIOUS_PAGE_NUMBER); + if (prev != null) + { + int pageNum = Integer.parseInt(prev); + getUserPager().setOffset((pageNum - 1) * getUserPager().getLimit()); + return; + } + + String next = (String) requestMap + .get(PALAdminConstants.NEXT_PAGE_NUMBER); + if (next != null) + { + int pageNum = Integer.parseInt(next); + getUserPager().setOffset((pageNum - 1) * getUserPager().getLimit()); + return; + } + } + + public List<Map<String, Object>> getUsers(UserListPage page) + { + UserPager pager = getUserPager(); + + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); + userDxo.convert(securityProviderLogic.getUsers(pager), list); + + // update page + page.setCount(pager.getCount()); + page.setMaxPageNumber((pager.getCount() - 1) / pager.getLimit() + 1); + page.setCurrentPageNumber(pager.getOffset() / pager.getLimit() + 1); + if (page.getMaxPageNumber() > page.getCurrentPageNumber()) + { + page.setNextPageNumber(page.getCurrentPageNumber() + 1); + } + else + { + page.setNextPageNumber(null); + } + if (page.getCurrentPageNumber() > 1) + { + page.setPreviousPageNumber(page.getCurrentPageNumber() - 1); + } + else + { + page.setPreviousPageNumber(null); + } + + return list; + } + + public void insert(AbstractUserPage page) throws PALAdminException + { + User entity = new User(); + userDxo.convert(page, entity); + securityProviderLogic.insertUser(entity); + } + + public void delete(AbstractUserPage page) throws PALAdminException + { + User entity = new User(); + userDxo.convert(page, entity); + securityProviderLogic.deleteUser(entity); + } + + public List<Map<String, String>> getRoleNames() + { + ArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>(); + for (Iterator<String> ite = securityProviderLogic.getRoleNames() + .iterator(); ite.hasNext();) + { + Map<String, String> map = new HashMap<String, String>(); + String value = ite.next(); + map.put("label", value); + map.put("value", value); + list.add(map); + } + return list; + } + + public List<Map<String, String>> getProfilingRuleNames() + { + ArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>(); + for (Iterator<String> ite = securityProviderLogic + .getProfilingRuleNames().iterator(); ite.hasNext();) + { + Map<String, String> map = new HashMap<String, String>(); + String value = ite.next(); + map.put("label", value); + map.put("value", value); + list.add(map); + } + return list; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/UserManagementService.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,36 @@ +package jp.sf.pal.admin.util; + +import java.security.Principal; +import java.util.Iterator; + +import javax.security.auth.Subject; + +public class PALAdminUtil +{ + public static boolean isEmpty(String s) + { + if (s == null) + return true; + + if (s.trim().equals("")) + return true; + + return false; + } + + public static Principal getPrincipal(Subject subject, Class cls) + { + Principal principal = null; + Iterator principals = subject.getPrincipals().iterator(); + while (principals.hasNext()) + { + Principal p = (Principal) principals.next(); + if (cls.isInstance(p)) + { + principal = p; + break; + } + } + return principal; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/AbstractUserPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/AbstractUserPage.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/AbstractUserPage.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,122 @@ +package jp.sf.pal.admin.web.user; + +import jp.sf.pal.admin.service.UserManagementService; +import jp.sf.pal.admin.web.AbstractCrudPage; + +import org.seasar.teeda.extension.annotation.validator.Required; + +public class AbstractUserPage extends AbstractCrudPage +{ + + private String name; + + private String password; + + private boolean updateRequired; + + private String roleName; + + private String profilingRuleName; + + private UserManagementService userManagementService; + + public AbstractUserPage() + { + super(); + } + + public String getName() + { + return name; + } + + @Required + public void setName(String userName) + { + this.name = userName; + } + + /** + * @return the password + */ + public String getPassword() + { + return password; + } + + /** + * @param password the password to set + */ + @Required + public void setPassword(String password) + { + this.password = password; + } + + /** + * @return the profilingRule + */ + public String getProfilingRuleName() + { + return profilingRuleName; + } + + /** + * @param profilingRule the profilingRule to set + */ + public void setProfilingRuleName(String profilingRule) + { + this.profilingRuleName = profilingRule; + } + + /** + * @return the role + */ + public String getRoleName() + { + return roleName; + } + + /** + * @param role the role to set + */ + @Required + public void setRoleName(String role) + { + this.roleName = role; + } + + /** + * @return the updateRequired + */ + public boolean isUpdateRequired() + { + return updateRequired; + } + + /** + * @param updateRequired the updateRequired to set + */ + public void setUpdateRequired(boolean updateRequired) + { + this.updateRequired = updateRequired; + } + + /** + * @return the userManagementService + */ + public UserManagementService getUserManagementService() + { + return userManagementService; + } + + /** + * @param userManagementService the userManagementService to set + */ + public void setUserManagementService( + UserManagementService userManagementService) + { + this.userManagementService = userManagementService; + } + +} \ No newline at end of file Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/AbstractUserPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,88 @@ +package jp.sf.pal.admin.web.user; + +import javax.faces.internal.FacesMessageUtil; + +import jp.sf.pal.admin.PALAdminException; +import jp.sf.pal.admin.web.CrudType; + +import org.seasar.framework.log.Logger; +import org.seasar.teeda.extension.annotation.takeover.TakeOver; +import org.seasar.teeda.extension.annotation.takeover.TakeOverType; + +public class UserConfirmPage extends AbstractUserPage +{ + /** + * Logger for this class + */ + private static final Logger logger = Logger + .getLogger(UserConfirmPage.class); + + public String initialize() + { + return null; + } + + public String prerender() + { + return null; + } + + @TakeOver(type = TakeOverType.NEVER) + public Class doFinish() + { + switch (getCrudType()) + { + case CrudType.CREATE: + addUser(); + break; + // case CrudType.UPDATE: + // break; + case CrudType.DELETE: + deleteUser(); + break; + default: + break; + } + return UserListPage.class; + } + + protected void addUser() + { + try + { + getUserManagementService().insert(this); + FacesMessageUtil.addInfoMessage("added.new.user", + new Object[] { getName() }); + } + catch (PALAdminException e) + { + FacesMessageUtil.addErrorMessage("failed.to.add.new.user", + new Object[] { getName() }); + logger.error("Failed to add a new user: " + getName(), e); + } + } + + protected void deleteUser() + { + try + { + getUserManagementService().delete(this); + FacesMessageUtil.addInfoMessage("deleted.user", + new Object[] { getName() }); + } + catch (PALAdminException e) + { + FacesMessageUtil.addErrorMessage("failed.to.delete.user", + new Object[] { getName() }); + logger.error("Failed to delete a new user: " + getName(), e); + } + } + + public boolean isComeFromList() + { + return getCrudType() == CrudType.READ + || getCrudType() == CrudType.DELETE; + + } + +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,61 @@ +package jp.sf.pal.admin.web.user; + +import java.util.List; +import java.util.Map; + +public class UserCreatePage extends AbstractUserPage +{ + private List<Map<String, String>> roleNameItems; + + private List<Map<String, String>> profilingRuleNameItems; + + /** + * @return the profilingRuleItems + */ + public List<Map<String, String>> getProfilingRuleNameItems() + { + return profilingRuleNameItems; + } + + /** + * @param profilingRuleItems the profilingRuleItems to set + */ + public void setProfilingRuleNameItems( + List<Map<String, String>> profilingRuleItems) + { + this.profilingRuleNameItems = profilingRuleItems; + } + + /** + * @return the roleItems + */ + public List<Map<String, String>> getRoleNameItems() + { + return roleNameItems; + } + + /** + * @param roleItems the roleItems to set + */ + public void setRoleNameItems(List<Map<String, String>> roleItems) + { + this.roleNameItems = roleItems; + } + + public String initialize() + { + return null; + } + + public String prerender() + { + // set pull-down + setRoleNameItems(getUserManagementService().getRoleNames()); + setProfilingRuleNameItems(getUserManagementService() + .getProfilingRuleNames()); + + // update? + return null; + } + +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,90 @@ +package jp.sf.pal.admin.web.user; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.admin.service.UserManagementService; +import jp.sf.pal.admin.web.AbstractListPage; +import jp.sf.pal.admin.web.CrudType; + +import org.seasar.teeda.extension.annotation.takeover.TakeOver; + +public class UserListPage extends AbstractListPage +{ + + private String name; + + private int userIndex; + + private List<Map<String, Object>> userItems; + + private UserManagementService userManagementService; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public int getUserIndex() + { + return userIndex; + } + + public void setUserIndex(int userIndex) + { + this.userIndex = userIndex; + } + + public List<Map<String, Object>> getUserItems() + { + return userItems; + } + + public void setUserItems(List<Map<String, Object>> userItems) + { + this.userItems = userItems; + } + + /** + * @return the userManagementService + */ + public UserManagementService getUserManagementService() + { + return userManagementService; + } + + /** + * @param userManagementService the userManagementService to set + */ + public void setUserManagementService(UserManagementService userManagementService) + { + this.userManagementService = userManagementService; + } + + public String initialize() + { + return null; + } + + public String prerender() + { + // check page action + userManagementService.handlePagerNavigation(); + + // set role list + setUserItems(userManagementService.getUsers(this)); + return null; + } + + @TakeOver(properties = "crudType") + public Class doCreate() + { + setCrudType(CrudType.CREATE); + return UserCreatePage.class; + } +} Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserListPage.java ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-admin/trunk/src/main/resources/appMessages.properties =================================================================== --- pal-admin/trunk/src/main/resources/appMessages.properties 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/resources/appMessages.properties 2007-04-06 06:18:40 UTC (rev 21) @@ -1,3 +1,7 @@ +added.new.user=Added a new User({0}). +failed.to.add.new.user=Failed to add a new User({0}). +deleted.user=Delete the User({0}). +failed.to.delete.user=Failed to delete the User({0}). added.new.role=Added a new Role({0}). failed.to.add.new.role=Failed to add a new Role({0}). @@ -8,3 +12,4 @@ failed.to.add.new.group=Failed to add a new Group({0}). deleted.group=Delete the Group({0}). failed.to.delete.group=Failed to delete the Group({0}). + Added: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/label.properties =================================================================== --- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/label.properties 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/label.properties 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,11 @@ +# Common +userName=User Name +password=Password +changePassword=Change Password on first Login +defaultRole=Default Role +profilingRule=Profiling Rule +userList=User List +userInformation=User Information + +# userList +userList.delete=Delete Property changes on: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/user/label.properties ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-admin/trunk/src/main/webapp/WEB-INF/portlet.xml =================================================================== --- pal-admin/trunk/src/main/webapp/WEB-INF/portlet.xml 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/webapp/WEB-INF/portlet.xml 2007-04-06 06:18:40 UTC (rev 21) @@ -26,12 +26,12 @@ </init-param> <init-param> <name>portlet-filters</name> - <value>jp.sf.pal.admin.filter.J2SecurityProviderFilter,jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.pooptimizer.OptimizerFilter,org.seasar.portlet.filter.S2PortletFilter,org.seasar.portlet.filter.HotdeployPortletFilter</value> + <value>org.seasar.portlet.filter.RequestDumpFilter,jp.sf.pal.admin.filter.J2SecurityProviderFilter,jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.pooptimizer.OptimizerFilter,org.seasar.portlet.filter.S2PortletFilter,org.seasar.portlet.filter.HotdeployPortletFilter</value> <!--value>org.seasar.portlet.filter.RequestDumpFilter,jp.sf.pal.admin.filter.J2SecurityProviderFilter,jp.sf.pal.facesresponse.FacesResponseFilter,jp.sf.pal.pooptimizer.OptimizerFilter,org.seasar.portlet.filter.S2PortletFilter,org.seasar.portlet.filter.HotdeployPortletFilter</value--> </init-param> <init-param> <name>view-page</name> - <value>/view/role/roleList.html</value> + <value>/view/user/userList.html</value> </init-param> <!-- <init-param> <name>edit-page</name> Deleted: pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html 2007-04-06 06:18:40 UTC (rev 21) @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="stylesheet" type="text/css" href="../../css/global.css"/> -</head> -<body> -<form id="RoleConfirmForm"><input type="hidden" id="crudType" /> -<!-- tab: BEGIN --> -<a id="jumpUserList" href="../user/userList.html"><label id="userTabLabel">User</label></a> | -<label id="roleTabLabel">Role</label> | -<a id="jumpUserList" href="../group/groupList.html"><label id="groupTabLabel">Group</label></a> <br/> -<!-- tab: END --> - -<div> -<span id="messages"></span> -</div> -<table class="tablebg"> -<tr> - <td><label id="roleNameLabel">Role Name</label></td> - <td><span id="roleName">role</span><input type="hidden" id="roleName-hidden" /></td> - <td><span id="roleNameMessage"></span></td> -</tr> -</table> -<div id="isComeFromList"> - <input type="button" id="jumpRoleList" value="Previous" - onclick="location.href='roleList.html'" - /> -</div> -<div id="isNotComeFromList" style="display: none;"> - <input type="button" id="jumpRoleEdit" value="Previous" - onclick="location.href='roleEdit.html'" - /> -</div> -<div id="isNotRead"> -<input type="button" id="doFinish" value="Finish" onclick="location.href='roleList.html'" /> -</div> -</form> -</body></html> Deleted: pal-admin/trunk/src/main/webapp/view/user/roleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleEdit.html 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/webapp/view/user/roleEdit.html 2007-04-06 06:18:40 UTC (rev 21) @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="stylesheet" type="text/css" href="../../css/global.css"/> -</head> -<body> -<form id="RoleEditForm"><input type="hidden" id="crudType" /> -<div> -<span id="messages"></span> -</div> -<table class="tablebg"> -<tr> - <td><label id="idLabel">id</label></td> - <td><div id="isCreate"> - <input type="text" id="id"/> - </div> - <div id="isNotCreate" style="display: none;"> - <span id="id-out">id</span><input type="hidden" id="id-hidden" /> - </div></td> - <td><span id="idMessage"></span></td> -</tr> -<tr> - <td><label id="nameLabel">name</label></td> - <td><input type="text" id="name"/></td> - <td><span id="nameMessage"></span></td> -</tr> -<tr> - <td><label id="number1Label">number1</label></td> - <td><input type="text" id="number1"/></td> - <td><span id="number1Message"></span></td> -</tr> -<tr> - <td><label id="number2Label">number2</label></td> - <td><input type="text" id="number2"/></td> - <td><span id="number2Message"></span></td> -</tr> -<tr> - <td><label id="number3Label">number3</label></td> - <td><input type="text" id="number3"/></td> - <td><span id="number3Message"></span></td> -</tr> -<tr> - <td><label id="textLabel">text</label></td> - <td><input type="text" id="text"/></td> - <td><span id="textMessage"></span></td> -</tr> -<tr> - <td><label id="notesLabel">notes</label></td> - <td><input type="text" id="notes"/></td> - <td><span id="notesMessage"></span></td> -</tr> -</table> -<input type="button" id="jumpRoleList" value="Previous" - onclick="location.href='RoleList.html'"/> -<div id="isNotRead"> -<input type="button" id="goRoleConfirm" value="Confirm" - onclick="location.href='RoleConfirm.html'"/></div> -</form> -</body></html> Deleted: pal-admin/trunk/src/main/webapp/view/user/roleList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleList.html 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/webapp/view/user/roleList.html 2007-04-06 06:18:40 UTC (rev 21) @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="stylesheet" type="text/css" href="../../css/global.css"/> -</head> -<body> -<form id="RoleListForm"> -<!-- tab: BEGIN --> -<a id="jumpUserList" href="../user/userList.html"><label id="userTabLabel">User</label></a> | -<label id="roleTabLabel">Role</label> | -<a id="jumpGroupList" href="../group/groupList.html"><label id="groupTabLabel">Group</label></a> <br/> -<!-- tab: END --> - - -<input type="button" id="goRoleEdit" value="Create" onclick="location.href='roleEdit.html'"/><br/> -<table> - <thead> - <tr height="50px"> - <th><label id="roleNameLabel">Role Name</label></th> - <th><br/></th> - </tr> - </thead> - <tbody> - <div id=""> - <tr class="row_even"> - <td><span id="roleName">role</span></td> - <td> - <a id="goRoleConfirm" href="roleConfirm.html?fixed_crudType=3&id=id">Delete</a> - </td> - </tr> - </div> - </tbody> -</table> -</form> -</body></html> Copied: pal-admin/trunk/src/main/webapp/view/user/userConfirm.html (from rev 9, pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html) =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleConfirm.html 2007-04-04 14:34:05 UTC (rev 9) +++ pal-admin/trunk/src/main/webapp/view/user/userConfirm.html 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="stylesheet" type="text/css" href="../../css/global.css"/> +</head> +<body> +<form id="UserConfirmForm"><input type="hidden" id="crudType" /> +<!-- tab: BEGIN --> +<div style="padding: 0px 0px 3px 10px; margin:5px 0px;border-bottom:1px solid #000000;"> + <span id="userTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">User</span> + <a id="jumpRoleList" href="../role/roleList.html" style="text-decoration: none;"> + <span id="roleTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Role</span> + </a> + <a id="jumpGroupList" href="../group/groupList.html" style="text-decoration: none;"> + <span id="groupTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Group</span> + </a> +</div> +<!-- tab: END --> + +<div> + <span id="allMessages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span> +</div> + +<!-- content: BEGIN --> +<div style="padding:5px 0px;"> + <div class="portlet-section-header"> + <label id="userInformationLabel">User Information</label> + </div> + + <table class="tablebg"> + <tr> + <td class="portlet-section-subheader"><label id="userNameLabel">User Name</label></td> + <td class="portlet-section-body"><span id="name">user</span><input type="hidden" id="name-hidden" /></td> + <td class="portlet-section-body"><span id="nameMessage"></span></td> + </tr> + <div id="isNotDelete"> + <tr> + <td class="portlet-section-subheader"><label id="passwordLabel">Password</label></td> + <td class="portlet-section-body"><span id="password">TODO</span><input type="hidden" id="password-hidden" /></td> + <td class="portlet-section-body"><span id="passwordMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="changePasswordLabel">Change Password on first Login</label></td> + <td class="portlet-section-body"><span id="updateRequired">true</span><input type="hidden" id="updateRequired-hidden" /></td> + <td class="portlet-section-body"><span id="updateRequiredMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="defaultRoleLabel">Default Role</label></td> + <td class="portlet-section-body"><span id="roleName">ROLE</span><input type="hidden" id="roleName-hidden" /></td> + <td class="portlet-section-body"><span id="roleNameMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="profilingRuleLabel">Profiling Rule</label></td> + <td class="portlet-section-body"><span id="profilingRuleName">RULE</span><input type="hidden" id="profilingRuleName-hidden" /></td> + <td class="portlet-section-body"><span id="profilingRuleNameMessage"></span></td> + </tr> + </div> + </table> + + <div> + <div id="isComeFromList" style="display:inline;"> + <input type="button" id="jumpUserList" value="Back" + onclick="location.href='userList.html'" class="portlet-form-button"/> + </div> + <div id="isNotRead" style="display:inline;"> + <input type="button" id="doFinish-create" value="Finish" onclick="location.href='userList.html'" class="portlet-form-button"/> + </div> + </div> +</div> +<!-- content: END --> +</form> +</body></html> Added: pal-admin/trunk/src/main/webapp/view/user/userCreate.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2007-04-06 06:12:09 UTC (rev 20) +++ pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="stylesheet" type="text/css" href="../../css/global.css"/> +</head> +<body> +<form id="UserCreateForm"><input type="hidden" id="crudType" /> +<!-- tab: BEGIN --> +<div style="padding: 0px 0px 3px 10px; margin:5px 0px;border-bottom:1px solid #000000;"> + <span id="userTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">User</span> + <a id="jumpRoleList" href="../role/roleList.html" style="text-decoration: none;"> + <span id="roleTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Role</span> + </a> + <a id="jumpGroupList" href="../group/groupList.html" style="text-decoration: none;"> + <span id="groupTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Group</span> + </a> +</div> +<!-- tab: END --> + +<div> + <span id="allMessages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span> +</div> + +<!-- content: BEGIN --> +<div style="padding:5px 0px;"> + <div class="portlet-section-header"> + <label id="userInformationLabel">User Information</label> + </div> + + <table class="tablebg"> + <tr> + <td class="portlet-section-subheader"><label id="userNameLabel">User Name</label></td> + <td class="portlet-section-body"><input type="text" id="name"/></td> + <td class="portlet-section-body"><span id="nameMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="passwordLabel">Password</label></td> + <td class="portlet-section-body"><input type="password" id="password"/></td> + <td class="portlet-section-body"><span id="passwordMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="changePasswordLabel">Change Password on first Login</label></td> + <td class="portlet-section-body"><input type="checkbox" id="updateRequired"/></td> + <td class="portlet-section-body"><span id="updateRequiredMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="defaultRoleLabel">Default Role</label></td> + <td class="portlet-section-body"> + <select id="roleNameItems"> + <option>ROLE</option> + </select> + </td> + <td class="portlet-section-body"><span id="roleMessage"></span></td> + </tr> + <tr> + <td class="portlet-section-subheader"><label id="profilingRuleLabel">Profiling Rule</label></td> + <td class="portlet-section-body"> + <select id="profilingRuleNameItems"> + <option>RULE</option> + </select> + </td> + <td class="portlet-section-body"><span id="profilingRuleMessage"></span></td> + </tr> + </table> + + <div> + <input type="button" id="jumpUserList" value="Back" + onclick="location.href='userList.html'" class="portlet-form-button"/> + <div id="isNotRead" style="display:inline;"> + <input type="button" id="goUserConfirm" value="Confirm" + onclick="location.href='userConfirm.html'" class="portlet-form-button"/> + </div> + </div> +</div> +<!-- content: BEGIN --> +</form> +</body></html> Property changes on: pal-admin/trunk/src/main/webapp/view/user/userCreate.html ___________________________________________________________________ Name: svn:eol-style + native Copied: pal-admin/trunk/src/main/webapp/view/user/userEdit.html (from rev 9, pal-admin/trunk/src/main/webapp/view/user/roleEdit.html) =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleEdit.html 2007-04-04 14:34:05 UTC (rev 9) +++ pal-admin/trunk/src/main/webapp/view/user/userEdit.html 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="stylesheet" type="text/css" href="../../css/global.css"/> +</head> +<body> +<form id="UserEditForm"><input type="hidden" id="crudType" /> +<!-- tab: BEGIN --> +<div style="padding: 0px 0px 3px 10px; margin:5px 0px;border-bottom:1px solid #000000;"> + <span id="userTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">User</span> + <a id="jumpRoleList" href="../role/roleList.html" style="text-decoration: none;"> + <span id="roleTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Role</span> + </a> + <a id="jumpGroupList" href="../group/groupList.html" style="text-decoration: none;"> + <span id="groupTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Group</span> + </a> +</div> +<!-- tab: END --> + +<div> + <span id="allMessages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span> +</div> + +<!-- content: BEGIN --> +<div style="padding:5px 0px;"> + <div class="portlet-section-header"> + <label id="userInformationLabel">User Information</label> + </div> + + <table class="tablebg"> + <tr> + <td class="portlet-section-subheader"><label id="userNameLabel">User Name</label></td> + <td class="portlet-section-body"><input type="text" id="name"/></td> + <td class="portlet-section-body"><span id="nameMessage"></span></td> + </tr> + </table> + + <div> + <input type="button" id="jumpUserList" value="Back" + onclick="location.href='userList.html'" class="portlet-form-button"/> + <div id="isNotRead" style="display:inline;"> + <input type="button" id="goUserConfirm" value="Confirm" + onclick="location.href='userConfirm.html'" class="portlet-form-button"/> + </div> + </div> +</div> +<!-- content: BEGIN --> +</form> +</body></html> Copied: pal-admin/trunk/src/main/webapp/view/user/userList.html (from rev 9, pal-admin/trunk/src/main/webapp/view/user/roleList.html) =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/roleList.html 2007-04-04 14:34:05 UTC (rev 9) +++ pal-admin/trunk/src/main/webapp/view/user/userList.html 2007-04-06 06:18:40 UTC (rev 21) @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="stylesheet" type="text/css" href="../../css/global.css"/> +</head> +<body> +<form id="UserListForm"> +<!-- tab: BEGIN --> +<div style="padding: 0px 0px 3px 10px; margin:5px 0px;border-bottom:1px solid #000000;"> + <span id="userTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">User</span> + <a id="jumpRoleList" href="../role/roleList.html" style="text-decoration: none;"> + <span id="roleTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Role</span> + </a> + <a id="jumpGroupList" href="../group/groupList.html" style="text-decoration: none;"> + <span id="groupTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Group</span> + </a> +</div> +<!-- tab: END --> + +<div> + <span id="allMessages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span> +</div> + +<!-- content: BEGIN --> +<div style="padding:5px 0px;"> + <div class="portlet-section-header"> + <label id="userListLabel">User List</label> + </div> + + <div> + <label id="actionLabel" class="portlet-form-label">Action:</label> + <input type="button" id="doCreate" value="Create" onclick="location.href='userCreate.html'" class="portlet-form-button"/><br/> + </div> + + <div> + <span id="count-header">10</span><!-- TODO: i18n--> <label id="foundLabel"> found.</label> + (<span id="currentPageNumber-header">3</span>/<span id="maxPageNumber-header">5</span>) + </div> + + <div> + <a id="goPreviousPage-header" href="userList.html?previousPageNumber=1" + te:rendered="#{user_userListPage.previousPageNumber!=null}"> + <span id="previousPageLabel-header"><<Previous</span> + </a> + <a id="goNextPage-header" href="userList.html?nextPageNumber=2" + te:rendered="#{user_userListPage.nextPageNumber!=null}"> + <span id="nextPageLabel-header">Next>></span> + </a> + </div> + + <table> + <thead class="portlet-section-subheader"> + <tr> + <th><label id="userNameLabel">User Name</label></th> + <th><br/></th> + </tr> + </thead> + <tbody> + <div id="userItems"> + <tr> + <td class="portlet-section-body"><span id="name">user</span></td> + <td class="portlet-section-alternate"> + <a id="goUserConfirm" href="userConfirm.html?fixed_crudType=3&name=name"><span id="deleteLabel">Delete</span></a> + </td> + </tr> + </div> + </tbody> + </table> + + <div> + <a id="goPreviousPage-footer" href="userList.html?previousPageNumber=1" + te:rendered="#{user_userListPage.previousPageNumber!=null}"> + <span id="previousPageLabel-footer"><<Previous</span> + </a> + <a id="goNextPage-footer" href="userList.html?nextPageNumber=2" + te:rendered="#{user_userListPage.nextPageNumber!=null}"> + <span id="nextPageLabel-footer">Next>></span> + </a> + </div> +</div> +<!-- content: END --> +</form> +</body></html>