Index: src/main/java/org/apache/maven/continuum/web/action/UsersAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/UsersAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/UsersAction.java (revision 0) @@ -0,0 +1,60 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2004-2005 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 com.opensymphony.xwork.ActionSupport; +import org.apache.maven.continuum.Continuum; +import org.apache.maven.continuum.ContinuumException; + +import java.util.Collection; + +/** + * @author Henry Isidro + * + */ +public class UsersAction + extends ActionSupport +{ + private Continuum continuum; + + private Collection users; + + + public String execute() + { + try + { + users = continuum.getUsers(); + } + catch (ContinuumException ce ) + { + addActionError( "Can't get continuum users: " + ce.getMessage() ); + + ce.printStackTrace(); + + return ERROR; + } + + return SUCCESS; + } + + public Collection getUsers() + { + return users; + } + +} Property changes on: src/main/java/org/apache/maven/continuum/web/action/UsersAction.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 0) +++ src/main/java/org/apache/maven/continuum/web/action/DeleteUserAction.java (revision 0) @@ -0,0 +1,82 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2004-2005 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 com.opensymphony.xwork.ActionSupport; +import org.apache.maven.continuum.Continuum; +import org.apache.maven.continuum.ContinuumException; + +import java.util.Collection; + +/** + * @author Henry Isidro + * + */ +public class DeleteUserAction + extends ActionSupport +{ + private Continuum continuum; + + private int userId; + + private String username; + + + public String execute() + { + try + { + continuum.removeUser( userId ); + } + catch ( ContinuumException e ) + { + addActionMessage( "Can't delete user (id=" + userId + ") : " + e.getMessage() ); + + e.printStackTrace(); + + return ERROR; + } + + return SUCCESS; + } + + public String doDefault() + { + return "delete user"; + } + + public void setUserId( int userId ) + { + this.userId = userId; + } + + public int getUserId() + { + return userId; + } + + public void setUsername( String username ) + { + this.username = username; + } + + public String getUsername() + { + return username; + } + +} Property changes on: src/main/java/org/apache/maven/continuum/web/action/DeleteUserAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native Index: src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java =================================================================== --- src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java (revision 0) +++ src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java (revision 0) @@ -0,0 +1,122 @@ +package org.apache.maven.continuum.web.action; + +/* + * Copyright 2004-2005 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.apache.maven.continuum.model.system.ContinuumUser; + +import com.opensymphony.xwork.ActionSupport; + +/** + * @author Henry Isidro + * + */ +public class EditUserAction + extends ActionSupport +{ + + private Continuum continuum; + + private ContinuumUser user; + + private int userId; + + private String username; + + private String password; + + private String email; + + public String execute() + throws Exception + { + try + { + user = continuum.getUser( userId ); + + } + catch ( ContinuumException e ) + { + e.printStackTrace(); + } + user.setUsername( username ); + user.setPassword( password ); + user.setEmail( email ); + + try + { + continuum.updateUser( user ); + } + catch ( ContinuumException e ) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return SUCCESS; + } + + public String doEdit() + throws Exception + { + try + { + user = continuum.getUser( userId ); + } + catch ( ContinuumException e ) + { + e.printStackTrace(); + } + + username = user.getUsername(); + password = user.getPassword(); + email = user.getEmail(); + + return INPUT; + } + + public String getEmail() + { + return email; + } + + public void setEmail( String email ) + { + this.email = email; + } + + public String getPassword() + { + return password; + } + + public void setPassword( String password ) + { + this.password = password; + } + + public String getUsername() + { + return username; + } + + public void setUsername( String username ) + { + this.username = username; + } + +} \ No newline at end of file Property changes on: src/main/java/org/apache/maven/continuum/web/action/EditUserAction.java ___________________________________________________________________ Name: svn:keywords + "Author Date Id Revision" Name: svn:eol-style + native Index: src/main/resources/xwork.xml =================================================================== --- src/main/resources/xwork.xml (revision 421471) +++ src/main/resources/xwork.xml (working copy) @@ -184,5 +184,24 @@ schedules + + users + + + + editUser.jsp + users + + + + editUser.jsp + users + + + + deleteUser.jsp + users + +