continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r553822 - in /maven/continuum/trunk/continuum-xmlrpc: continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ continuum-xmlrpc-server/src/main/jav...
Date Fri, 06 Jul 2007 09:57:19 GMT
Author: evenisse
Date: Fri Jul  6 02:57:17 2007
New Revision: 553822

URL: http://svn.apache.org/viewvc?view=rev&rev=553822
Log:
Add methods to update projects and groups

Modified:
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?view=diff&rev=553822&r1=553821&r2=553822
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
Fri Jul  6 02:57:17 2007
@@ -83,6 +83,16 @@
     int removeProject( int projectId )
         throws ContinuumException, XmlRpcException;
 
+    /**
+     * Update a project. Useful to change the scm parameters.
+     *
+     * @param project The project to update
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    ProjectSummary updateProject( ProjectSummary project )
+        throws ContinuumException, XmlRpcException;
+
     // ----------------------------------------------------------------------
     // Projects Groups
     // ----------------------------------------------------------------------
@@ -117,6 +127,16 @@
      * @throws XmlRpcException
      */
     int removeProjectGroup( int projectGroupId )
+        throws ContinuumException, XmlRpcException;
+
+    /**
+     * Update a project Group.
+     *
+     * @param projectGroup The project group to update
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    ProjectGroupSummary updateProjectGroup( ProjectGroupSummary projectGroup )
         throws ContinuumException, XmlRpcException;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?view=diff&rev=553822&r1=553821&r2=553822
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
Fri Jul  6 02:57:17 2007
@@ -28,6 +28,7 @@
 import org.apache.maven.continuum.xmlrpc.project.ProjectGroup;
 import org.apache.maven.continuum.xmlrpc.project.ProjectGroupSummary;
 import org.apache.maven.continuum.xmlrpc.project.ProjectSummary;
+import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
 import org.apache.xmlrpc.client.util.ClientFactory;
@@ -158,6 +159,19 @@
         }
     }
 
+    public ProjectSummary updateProject( ProjectSummary project )
+        throws ContinuumException, XmlRpcException
+    {
+        try
+        {
+            return continuum.updateProject( project );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
+    }
+
     public ProjectSummary refreshProjectSummary( ProjectSummary project )
         throws ContinuumException
     {
@@ -239,6 +253,19 @@
             return null;
         }
         return getProjectGroupWithProjects( projectGroup.getId() );
+    }
+
+    public ProjectGroupSummary updateProjectGroup( ProjectGroupSummary projectGroup )
+        throws ContinuumException, XmlRpcException
+    {
+        try
+        {
+            return continuum.updateProjectGroup( projectGroup );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?view=diff&rev=553822&r1=553821&r2=553822
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Fri Jul  6 02:57:17 2007
@@ -39,6 +39,7 @@
 import org.apache.maven.continuum.xmlrpc.test.SuiteResult;
 import org.apache.maven.continuum.xmlrpc.test.TestCaseFailure;
 import org.apache.maven.continuum.xmlrpc.test.TestResult;
+import org.apache.xmlrpc.XmlRpcException;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -124,6 +125,17 @@
         return 0;
     }
 
+    public ProjectSummary updateProject( ProjectSummary project )
+        throws ContinuumException
+    {
+        ProjectSummary ps = getProjectSummary( project.getId() );
+
+        checkRemoveProjectFromGroupAuthorization( ps.getProjectGroup().getName() );
+
+        continuum.updateProject( populateProject( project ) );
+        return getProjectSummary( project.getId() );
+    }
+
     // ----------------------------------------------------------------------
     // Projects Groups
     // ----------------------------------------------------------------------
@@ -172,6 +184,15 @@
         return 0;
     }
 
+    public ProjectGroupSummary updateProjectGroup( ProjectGroupSummary projectGroup )
+        throws ContinuumException, XmlRpcException
+    {
+        checkModifyProjectGroupAuthorization( getProjectGroupName( projectGroup.getId() )
);
+
+        continuum.updateProjectGroup( populateProjectGroupSummary( projectGroup ) );
+        return getProjectGroupSummary( projectGroup.getId() );
+    }
+
     // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
@@ -540,6 +561,23 @@
         }
 
         ProjectGroupSummary g = new ProjectGroup();
+        g.setDescription( group.getDescription() );
+        g.setGroupId( group.getGroupId() );
+        g.setId( group.getId() );
+        g.setName( group.getName() );
+        return g;
+    }
+
+    private org.apache.maven.continuum.model.project.ProjectGroup populateProjectGroupSummary(
+        ProjectGroupSummary group )
+    {
+        if ( group == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.continuum.model.project.ProjectGroup g =
+            new org.apache.maven.continuum.model.project.ProjectGroup();
         g.setDescription( group.getDescription() );
         g.setGroupId( group.getGroupId() );
         g.setId( group.getId() );



Mime
View raw message