Index: src/main/java/org/apache/maven/continuum/web/action/AbstractEditUserAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/AbstractEditUserAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/AbstractEditUserAction.java (revision 0) @@ -0,0 +1,148 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import com.opensymphony.webwork.interceptor.ServletRequestAware; + +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * @author Henry Isidro + * + */ +public abstract class AbstractEditUserAction + extends PlexusActionSupport + implements ServletRequestAware +{ + + protected List staticPermissions; + + protected List availablePermissions; + + protected String permissionName; + + protected boolean addMode = false; + + protected int accountId; + + protected String username; + + protected String password; + + protected String email; + + protected List permissions; + + protected HttpServletRequest request; + + public abstract String execute() throws Exception; + + public abstract String doEdit() throws Exception; + + public abstract String doGetAvailablePermissions() throws Exception; + + public abstract String doAddPermission() throws Exception; + + public abstract String doDeletePermission() throws Exception; + + public String doAdd() + throws Exception + { + addMode = true; + return INPUT; + } + + public List getAvailablePermissions() + { + return availablePermissions; + } + + public String getPermissionName() + { + return permissionName; + } + + public void setPermissionName( String permissionName ) + { + this.permissionName = permissionName; + } + + public boolean isAddMode() + { + return addMode; + } + + public void setAddMode( boolean addMode ) + { + this.addMode = addMode; + } + + public int getAccountId() + { + return accountId; + } + + public void setAccountId( int accountId ) + { + this.accountId = accountId; + } + + public String getUsername() + { + return username; + } + + public void setUsername( String username ) + { + this.username = username; + } + + public String getPassword() + { + return password; + } + + public void setPassword( String password ) + { + this.password = password; + } + + public String getEmail() + { + return email; + } + + public void setEmail( String email ) + { + this.email = email; + } + + public List getPermissions() + { + return this.permissions; + } + + public void setServletRequest( HttpServletRequest request ) + { + this.request = request; + } + +} Property changes on: src/main/java/org/apache/maven/continuum/web/action/AbstractEditUserAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native Index: src/main/java/org/apache/maven/continuum/web/action/DeleteUserAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/DeleteUserAction.java (revision 427388) +++ src/main/java/org/apache/maven/continuum/web/action/DeleteUserAction.java (working copy) @@ -19,8 +19,6 @@ import org.apache.maven.continuum.Continuum; import org.apache.maven.continuum.ContinuumException; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; - /** * @author Henry Isidro * @version $Id$ @@ -30,14 +28,10 @@ * role-hint="deleteUser" */ public class DeleteUserAction - extends PlexusActionSupport + extends AbstractDeleteUserAction { private Continuum continuum; - private int accountId; - - private String username; - public String execute() throws Exception { @@ -56,29 +50,4 @@ return SUCCESS; } - - public String doDelete() - { - return "delete"; - } - - public int getAccountId() - { - return accountId; - } - - public void setAccountId( int accountId ) - { - this.accountId = accountId; - } - - public String getUsername() - { - return username; - } - public void setUsername( String username ) - { - this.username = username; - } - } Index: src/main/java/org/apache/maven/continuum/web/action/UsersAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/UsersAction.java (revision 427388) +++ src/main/java/org/apache/maven/continuum/web/action/UsersAction.java (working copy) @@ -21,8 +21,6 @@ import java.util.Collection; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; - /** * @author Henry Isidro * @version $Id$ @@ -32,7 +30,7 @@ * role-hint="users" */ public class UsersAction - extends PlexusActionSupport + extends AbstractUsersAction { private Continuum continuum; Index: src/main/java/org/apache/maven/continuum/web/action/AddUserRoleAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/AddUserRoleAction.java (revision 427388) +++ src/main/java/org/apache/maven/continuum/web/action/AddUserRoleAction.java (working copy) @@ -16,16 +16,12 @@ * limitations under the License. */ -import java.util.List; - import org.apache.maven.continuum.Continuum; import org.apache.maven.continuum.ContinuumException; import org.apache.maven.continuum.model.system.ContinuumUser; import org.apache.maven.continuum.model.system.Permission; import org.apache.maven.continuum.store.ContinuumStore; -import org.codehaus.plexus.xwork.action.PlexusActionSupport; - /** * @author Teody Cue * @version $Id$ @@ -35,7 +31,7 @@ * role-hint="addUserRole" */ public class AddUserRoleAction - extends PlexusActionSupport + extends AbstractAddUserRoleAction { private Continuum continuum; @@ -44,14 +40,8 @@ private ContinuumUser user; - private List permissions; - private Permission permission; - private int accountId; - - private String permissionName; - public String execute() throws Exception { @@ -91,25 +81,4 @@ return SUCCESS; } - - public int getAccountId() - { - return accountId; - } - - public void setAccountId( int accountId ) - { - this.accountId = accountId; - } - - public String getPermissionName() - { - return permissionName; - } - - public void setPermissionName( String permissionName ) - { - this.permissionName = permissionName; - } - } Index: src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java (revision 427388) +++ src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java (working copy) @@ -19,8 +19,6 @@ import java.util.ArrayList; import java.util.List; -import javax.servlet.http.HttpServletRequest; - import org.apache.maven.continuum.Continuum; import org.apache.maven.continuum.ContinuumException; import org.apache.maven.continuum.model.system.ContinuumUser; @@ -29,10 +27,6 @@ import org.apache.maven.continuum.store.ContinuumStore; import org.apache.maven.continuum.store.ContinuumStoreException; -import com.opensymphony.webwork.interceptor.ServletRequestAware; - -import org.codehaus.plexus.xwork.action.PlexusActionSupport; - /** * @author Henry Isidro * @version $Id$ @@ -42,8 +36,7 @@ * role-hint="editUser" */ public class EditUserAction - extends PlexusActionSupport - implements ServletRequestAware + extends AbstractEditUserAction { private ContinuumStore store; @@ -54,30 +47,10 @@ private UserGroup userGroup; - private List staticPermissions; - - private List availablePermissions; - private Permission staticPermission; private Permission permission; - private String permissionName; - - private boolean addMode = false; - - private int accountId; - - private String username; - - private String password; - - private String email; - - private List permissions; - - private HttpServletRequest request; - public String execute() throws Exception { @@ -155,13 +128,6 @@ return SUCCESS; } - public String doAdd() - throws Exception - { - addMode = true; - return INPUT; - } - public String doEdit() throws Exception { @@ -318,80 +284,4 @@ return INPUT; } - - public List getAvailablePermissions() - { - return availablePermissions; - } - - public String getPermissionName() - { - return permissionName; - } - - public void setPermissionName( String permissionName ) - { - this.permissionName = permissionName; - } - - public boolean isAddMode() - { - return addMode; - } - - public void setAddMode( boolean addMode ) - { - this.addMode = addMode; - } - - public int getAccountId() - { - return accountId; - } - - public void setAccountId( int accountId ) - { - this.accountId = accountId; - } - - public String getUsername() - { - return username; - } - - public void setUsername( String username ) - { - this.username = username; - } - - public String getPassword() - { - return password; - } - - public void setPassword( String password ) - { - this.password = password; - } - - public String getEmail() - { - return email; - } - - public void setEmail( String email ) - { - this.email = email; - } - - public List getPermissions() - { - return this.permissions; - } - - public void setServletRequest( HttpServletRequest request ) - { - this.request = request; - } - } Index: src/main/java/org/apache/maven/continuum/web/action/AbstractUsersAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/AbstractUsersAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/AbstractUsersAction.java (revision 0) @@ -0,0 +1,31 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * @author Henry Isidro + * + */ +public abstract class AbstractUsersAction + extends PlexusActionSupport +{ + + public abstract String execute(); + +} Property changes on: src/main/java/org/apache/maven/continuum/web/action/AbstractUsersAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native Index: src/main/java/org/apache/maven/continuum/web/action/AbstractDeleteUserAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/AbstractDeleteUserAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/AbstractDeleteUserAction.java (revision 0) @@ -0,0 +1,61 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.continuum.Continuum; +import org.apache.maven.continuum.ContinuumException; + +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * @author Henry Isidro + * + */ +public abstract class AbstractDeleteUserAction + extends PlexusActionSupport +{ + protected int accountId; + + protected String username; + + public abstract String execute() throws Exception; + + public String doDelete() + { + return "delete"; + } + + public int getAccountId() + { + return accountId; + } + + public void setAccountId( int accountId ) + { + this.accountId = accountId; + } + + public String getUsername() + { + return username; + } + public void setUsername( String username ) + { + this.username = username; + } + +} Property changes on: src/main/java/org/apache/maven/continuum/web/action/AbstractDeleteUserAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native Index: src/main/java/org/apache/maven/continuum/web/action/AbstractAddUserRoleAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/AbstractAddUserRoleAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/AbstractAddUserRoleAction.java (revision 0) @@ -0,0 +1,59 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.util.List; + +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * @author Henry Isidro + * + */ +public abstract class AbstractAddUserRoleAction + extends PlexusActionSupport +{ + + protected List permissions; + + protected int accountId; + + protected String permissionName; + + public abstract String execute() throws Exception; + + public int getAccountId() + { + return accountId; + } + + public void setAccountId( int accountId ) + { + this.accountId = accountId; + } + + public String getPermissionName() + { + return permissionName; + } + + public void setPermissionName( String permissionName ) + { + this.permissionName = permissionName; + } + +} \ No newline at end of file Property changes on: src/main/java/org/apache/maven/continuum/web/action/AbstractAddUserRoleAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native