continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r358260 - in /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: AddMavenOneProjectAction.java AddMavenTwoProjectAction.java AddProjectAction.java
Date Wed, 21 Dec 2005 10:46:03 GMT
Author: evenisse
Date: Wed Dec 21 02:45:59 2005
New Revision: 358260

URL: http://svn.apache.org/viewcvs?rev=358260&view=rev
Log:
o Add license
o format code

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java?rev=358260&r1=358259&r2=358260&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.java
Wed Dec 21 02:45:59 2005
@@ -1,10 +1,24 @@
 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 java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.Collection;
-import java.util.Iterator;
 
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
@@ -15,7 +29,13 @@
 
 import com.opensymphony.xwork.ActionSupport;
 
-public class AddMavenOneProjectAction extends ActionSupport {
+/**
+ * @author Nick Gonzalez
+ * @version $Id$
+ */
+public class AddMavenOneProjectAction
+    extends ActionSupport
+{
     private Continuum continuum;
 
     private String m1PomUrl;
@@ -24,46 +44,36 @@
 
     private String m1Pom = null;
 
-    public String execute() throws IOException, MalformedURLException, ContinuumException
+    public String execute()
+        throws IOException, MalformedURLException, ContinuumException
     {
-			System.out.println("inside");
+		if ( !StringUtils.isEmpty( m1PomUrl ) )
+		{
+		    m1Pom = m1PomUrl;
+		}
+		else
+		{
+
+			URL url = new URL( "file:/" + m1PomFile );
+
+			String content = IOUtil.toString( url.openStream() ); 
+
+		    if ( !StringUtils.isEmpty( content ) )
+		    {
+		        m1Pom = url.toString();
+		    }
+		}
+
+		if ( !StringUtils.isEmpty( m1Pom ) )
+		{
+			ContinuumProjectBuildingResult result = continuum.addMavenOneProject( m1Pom );
+
+		    if( result.getWarnings().size() > 0 )
+		    {
+		    	addActionMessage( result.getWarnings().toArray().toString() );
+		    }
+		}
 
-			if ( !StringUtils.isEmpty( m1PomUrl ) )
-			{
-			    m1Pom = m1PomUrl;
-			}
-			else
-			{
-
-				URL url = new URL( "file:/"+m1PomFile);
-				//URL m2PomUrl = getM2PomFileUrl();
-				String content = IOUtil.toString( url.openStream() ); 
-					
-			    if ( !StringUtils.isEmpty( content ) )
-			    {
-			        m1Pom = url.toString();
-			    }
-			}
-
-			if ( !StringUtils.isEmpty( m1Pom ) )
-			{
-				if (continuum == null ) System.out.println("shet!!!");
-				ContinuumProjectBuildingResult result = continuum.addMavenOneProject( m1Pom );
-			    
-			    if(result.getWarnings().size() > 0) {
-			    	addActionMessage(result.getWarnings().toArray().toString());
-			    }
-			}
-
-			System.out.println("m2Pom="+m1Pom);
-			Collection coll =  continuum.getProjects();
-			Iterator iter = coll.iterator();
-			
-			while (iter.hasNext()) {
-				
-				Project proj = (Project)iter.next();
-				System.out.println("project "+proj.getId()+": "+proj.getName());
-			}
         return SUCCESS;
     }
 
@@ -72,29 +82,33 @@
         return INPUT;
     }
 
-	public String getM1Pom() {
+	public String getM1Pom()
+	{
 		return m1Pom;
 	}
 
-	public void setM1Pom(String pom) {
+	public void setM1Pom(String pom)
+	{
 		m1Pom = pom;
 	}
 
-	public String getM1PomFile() {
+	public String getM1PomFile()
+	{
 		return m1PomFile;
 	}
 
-	public void setM1PomFile(String pomFile) {
+	public void setM1PomFile(String pomFile)
+	{
 		m1PomFile = pomFile;
 	}
 
-	public String getM1PomUrl() {
+	public String getM1PomUrl()
+	{
 		return m1PomUrl;
 	}
 
-	public void setM1PomUrl(String pomUrl) {
+	public void setM1PomUrl(String pomUrl)
+	{
 		m1PomUrl = pomUrl;
 	}
-
-
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?rev=358260&r1=358259&r2=358260&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
Wed Dec 21 02:45:59 2005
@@ -1,5 +1,20 @@
 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;
@@ -12,13 +27,14 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.Collection;
-import java.util.Iterator;
-
 
+/**
+ * @author Nick Gonzalez
+ * @version $Id$
+ */
 public class AddMavenTwoProjectAction 
     extends ActionSupport  
-    {
+{
     private Continuum continuum;
 
     private String m2PomUrl;
@@ -27,46 +43,35 @@
 
     private String m2Pom = null;
 
-    public String execute() throws IOException, MalformedURLException, ContinuumException
+    public String execute()
+        throws IOException, MalformedURLException, ContinuumException
     {
-			System.out.println("inside");
+		if ( !StringUtils.isEmpty( m2PomUrl ) )
+		{
+		    m2Pom = m2PomUrl;
+		}
+		else
+		{
+			URL url = new URL( "file:/" + m2PomFile );
 
-			if ( !StringUtils.isEmpty( m2PomUrl ) )
-			{
-			    m2Pom = m2PomUrl;
-			}
-			else
-			{
-
-				URL url = new URL( "file:/"+m2PomFile);
-				//URL m2PomUrl = getM2PomFileUrl();
-				String content = IOUtil.toString( url.openStream() ); 
-					
-			    if ( !StringUtils.isEmpty( content ) )
-			    {
-			        m2Pom = url.toString();
-			    }
-			}
-
-			if ( !StringUtils.isEmpty( m2Pom ) )
-			{
-				if (continuum == null ) System.out.println("shet!!!");
-				ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( m2Pom );
-			    
-			    if(result.getWarnings().size() > 0) {
-			    	addActionMessage(result.getWarnings().toArray().toString());
-			    }
-			}
-
-			System.out.println("m2Pom="+m2Pom);
-			Collection coll =  continuum.getProjects();
-			Iterator iter = coll.iterator();
-			
-			while (iter.hasNext()) {
+			String content = IOUtil.toString( url.openStream() ); 
 				
-				Project proj = (Project)iter.next();
-				System.out.println("project "+proj.getId()+": "+proj.getName());
-			}
+		    if ( !StringUtils.isEmpty( content ) )
+		    {
+		        m2Pom = url.toString();
+		    }
+		}
+
+		if ( !StringUtils.isEmpty( m2Pom ) )
+		{
+			ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( m2Pom );
+		    
+		    if( result.getWarnings().size() > 0 )
+		    {
+		    	addActionMessage( result.getWarnings().toArray().toString() );
+		    }
+		}
+
         return SUCCESS;
     }
 
@@ -75,7 +80,7 @@
         return INPUT;
     }
 
-	public void setM2Pom(String pom) {
+	public void setM2Pom( String pom ) {
 		m2Pom = pom;
 	}
 
@@ -83,7 +88,7 @@
 		return m2PomFile;
 	}
 
-	public void setM2PomFile(String pomFile){
+	public void setM2PomFile( String pomFile ){
 			m2PomFile = pomFile;
 	}
 
@@ -91,7 +96,7 @@
 		return m2PomUrl;
 	}
 
-	public void setM2PomUrl(String pomUrl) {
+	public void setM2PomUrl( String pomUrl ) {
 		m2PomUrl = pomUrl;
 	}
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=358260&r1=358259&r2=358260&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
Wed Dec 21 02:45:59 2005
@@ -1,5 +1,21 @@
 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 java.util.Map;
 
 import org.apache.maven.continuum.Continuum;
@@ -8,71 +24,87 @@
 import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.xwork.ActionSupport;
 
-public class AddProjectAction extends ActionSupport{
-    
+/**
+ * @author Nick Gonzalez
+ * @version $Id$
+ */
+public class AddProjectAction
+    extends ActionSupport
+{
 	private Continuum continuum;
-    
+
     private Project project;
-    
+
     private String projectName;
-    
+
     private String projectVersion;
-    
+
     private String projectScmUrl;
-    
+
     private String projectScmUsername;
-    
+
     private String projectScmPassword;
-    
+
     private String projectScmTag;
 
     private String projectType;
 	
-    /*public void addParam(String name, Object value) {
-    	System.out.println(name+" = "+value);
-    	getParams().put(name,value);
-	}*/
-
-	public String execute() throws Exception {
+	public String execute()
+	    throws Exception
+	{
         project = new Project();
-        project.setName(projectName);
-        project.setVersion(projectVersion);
-        project.setScmUrl(projectScmUrl);
-        project.setScmUsername(projectScmUsername);
-        project.setScmPassword(projectScmPassword);
-        project.setScmTag(projectScmTag);
-        
-        continuum.addProject(project, projectType);
+
+        project.setName( projectName );
+
+        project.setVersion( projectVersion );
+
+        project.setScmUrl( projectScmUrl );
+
+        project.setScmUsername( projectScmUsername );
+
+        project.setScmPassword( projectScmPassword );
+
+        project.setScmTag( projectScmTag );
+
+        continuum.addProject( project, projectType );
+
         return SUCCESS;
 	}
 
 	public String doDefault()
     {
-		setProjectType(ServletActionContext.getRequest().getParameter("projectType"));		
+		setProjectType( ServletActionContext.getRequest().getParameter( "projectType" ) );		
+
         return INPUT;
     }
 
-	public String getProjectName() {
+	public String getProjectName()
+	{
 		return projectName;
 	}
 
-	public void setProjectName(String projectName) {
+	public void setProjectName( String projectName )
+	{
 		this.projectName = projectName;
 	}
 
-	public String getProjectScmPassword() {
+	public String getProjectScmPassword()
+	{
 		return projectScmPassword;
 	}
 
-	public void setProjectScmPassword(String projectScmPassword) {
+	public void setProjectScmPassword( String projectScmPassword )
+	{
 		this.projectScmPassword = projectScmPassword;
 	}
 
-	public String getProjectScmTag() {
+	public String getProjectScmTag()
+	{
 		return projectScmTag;
 	}
 
-	public void setProjectScmTag(String projectScmTag) {
+	public void setProjectScmTag( String projectScmTag )
+	{
 		this.projectScmTag = projectScmTag;
 	}
 
@@ -80,32 +112,38 @@
 		return projectScmUrl;
 	}
 
-	public void setProjectScmUrl(String projectScmUrl) {
+	public void setProjectScmUrl( String projectScmUrl )
+	{
 		this.projectScmUrl = projectScmUrl;
 	}
 
-	public String getProjectScmUsername() {
+	public String getProjectScmUsername()
+	{
 		return projectScmUsername;
 	}
 
-	public void setProjectScmUsername(String projectScmUsername) {
+	public void setProjectScmUsername( String projectScmUsername )
+	{
 		this.projectScmUsername = projectScmUsername;
 	}
 
-	public String getProjectType() {
+	public String getProjectType()
+	{
 		return projectType;
 	}
 
-	public void setProjectType(String projectType) {
+	public void setProjectType( String projectType )
+	{
 		this.projectType = projectType;
 	}
 
-	public String getProjectVersion() {
+	public String getProjectVersion()
+	{
 		return projectVersion;
 	}
 
-	public void setProjectVersion(String projectVersion) {
+	public void setProjectVersion( String projectVersion )
+	{
 		this.projectVersion = projectVersion;
 	}
-
 }



Mime
View raw message