Revision: 107
          http://mvn-infix.svn.sourceforge.net/mvn-infix/?rev=107&view=rev
Author:   bindul
Date:     2011-02-14 00:56:09 +0000 (Mon, 14 Feb 2011)

Log Message:
-----------
Little more progress on the report

Modified Paths:
--------------
    
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
    
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java

Added Paths:
-----------
    
plugins/sfnet-mvnrepo-plugin/trunk/src/main/resources/sfnet-mvnrepo-plugin.properties

Property Changed:
----------------
    
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
    
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java

Modified: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
===================================================================
--- 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
        2011-02-14 00:49:06 UTC (rev 106)
+++ 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
        2011-02-14 00:56:09 UTC (rev 107)
@@ -25,6 +25,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
 
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLStreamException;
@@ -200,4 +202,13 @@
        public MavenProjectHelper getProjectHelper () {
                return projectHelper;
        }
+       
+       /**
+        * Returns the Java Resouce Bundle for the requested locale
+        * @param locale The locale for which the bundle is requested
+        * @return The resource bundle
+        */
+       protected ResourceBundle getBundle (Locale locale) {
+               return ResourceBundle.getBundle("sfnet-mvnrepo-plugin", locale, 
getClass().getClassLoader());
+       }
 }


Property changes on: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/AbstractRepositoryMojo.java
___________________________________________________________________
Modified: svn:keywords
   - Date Author Id Revision HeadURL
   + LastChangedDate LastChangedRevision LastChangedBy HeadURL Id

Modified: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java
===================================================================
--- 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java
      2011-02-14 00:49:06 UTC (rev 106)
+++ 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java
      2011-02-14 00:56:09 UTC (rev 107)
@@ -28,6 +28,7 @@
 import org.apache.maven.reporting.MavenReport;
 import org.apache.maven.reporting.MavenReportException;
 import org.codehaus.doxia.sink.Sink;
+import org.codehaus.plexus.util.StringUtils;
 
 import 
com.mindtree.techworks.infix.plugins.sfnetmvnrepo.mapper.MapGenerationException;
 
@@ -38,6 +39,36 @@
  *
  */
 public class RepositoryReport extends AbstractRepositoryMojo implements 
MavenReport {
+       
+       /**
+        * The name of the Repository report to be displayed in the Maven 
Generated Reports page
+     * (i.e. <code>project-reports.html</code>).
+     * 
+     * @parameter expression="${name}"
+        */
+       private String name;
+       
+       /**
+        * The description of the Repository report to be displayed in the 
Maven Generated Reports page
+     * (i.e. <code>project-reports.html</code>).
+     * 
+     * @parameter expression="${description}"
+        */
+       private String description;
+       
+       /**
+     * Report output directory. Note that this parameter is only relevant if 
the goal is run from the command line or
+     * from the default build lifecycle. If the goal is run indirectly as part 
of a site generation, the output
+     * directory configured in the Maven Site Plugin is used instead.
+     * 
+     * @parameter default-value="${project.reporting.outputDirectory}"
+     */
+    private File outputDirectory;
+       
+       /**
+        * The report output directory
+        */
+       private File reportOutputDirectory;
 
        /* (non-Javadoc)
         * @see 
org.apache.maven.reporting.MavenReport#generate(org.codehaus.doxia.sink.Sink, 
java.util.Locale)
@@ -53,8 +84,7 @@
         */
        @Override
        public String getOutputName () {
-               // TODO Auto-generated method stub
-               return null;
+               return "sfnet-mvnrepos";
        }
 
        /* (non-Javadoc)
@@ -62,8 +92,7 @@
         */
        @Override
        public String getCategoryName () {
-               // TODO Auto-generated method stub
-               return null;
+               return CATEGORY_PROJECT_INFORMATION;
        }
 
        /* (non-Javadoc)
@@ -71,8 +100,11 @@
         */
        @Override
        public String getName (Locale locale) {
-               // TODO Auto-generated method stub
-               return null;
+               
+               if (StringUtils.isEmpty(name)) {
+                       return 
getBundle(locale).getString("report.repository.name");
+               }
+               return name;
        }
 
        /* (non-Javadoc)
@@ -80,8 +112,11 @@
         */
        @Override
        public String getDescription (Locale locale) {
-               // TODO Auto-generated method stub
-               return null;
+               
+               if (StringUtils.isEmpty(description)) {
+                       return 
getBundle(locale).getString("report.repository.description");
+               }
+               return description;
        }
 
        /* (non-Javadoc)
@@ -89,8 +124,7 @@
         */
        @Override
        public void setReportOutputDirectory (File outputDirectory) {
-               // TODO Auto-generated method stub
-
+               this.reportOutputDirectory = outputDirectory;
        }
 
        /* (non-Javadoc)
@@ -98,8 +132,10 @@
         */
        @Override
        public File getReportOutputDirectory () {
-               // TODO Auto-generated method stub
-               return null;
+               if (null == this.reportOutputDirectory) {
+                       this.reportOutputDirectory = new File ( 
getOutputDirectory() );
+               }
+               return this.reportOutputDirectory;
        }
 
        /* (non-Javadoc)
@@ -107,7 +143,6 @@
         */
        @Override
        public boolean isExternalReport () {
-               // TODO Auto-generated method stub
                return false;
        }
 
@@ -129,5 +164,12 @@
                // TODO Auto-generated method stub
 
        }
+       
+        /**
+     * @see org.apache.maven.reporting.AbstractMavenReport#getOutputDirectory()
+     */
+    protected String getOutputDirectory() {
+        return outputDirectory.getAbsolutePath();
+    }
 
 }


Property changes on: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/java/com/mindtree/techworks/infix/plugins/sfnetmvnrepo/mojos/RepositoryReport.java
___________________________________________________________________
Modified: svn:keywords
   - Date Author Id Revision HeadURL
   + LastChangedDate LastChangedRevision LastChangedBy HeadURL Id

Added: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/resources/sfnet-mvnrepo-plugin.properties
===================================================================
--- 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/resources/sfnet-mvnrepo-plugin.properties
                               (rev 0)
+++ 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/resources/sfnet-mvnrepo-plugin.properties
       2011-02-14 00:56:09 UTC (rev 107)
@@ -0,0 +1,23 @@
+## 
+ # Copyright (c) 2011 MindTree Ltd.
+ # 
+ # This file is part of Infix Maven Plugins.
+ # 
+ # Infix Maven Plugins is free software: you can redistribute 
+ # it and/or modify it under the terms of the GNU General Public License as 
+ # published by the Free Software Foundation, either version 3 of the License, 
+ # or (at your option) any later version.
+ # 
+ # Infix Maven Plugins is distributed in the hope that it will 
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
+ # Public License for more details.
+ # 
+ # You should have received a copy of the GNU General Public License along 
with 
+ # Infix Maven Plugins. If not, see <http://www.gnu.org/licenses/>.
+ #
+ # $Id$ 
+ ##
+ 
+ report.repository.name=Repositories
+ report.repository.description=Maven 2/3 Repositories
\ No newline at end of file


Property changes on: 
plugins/sfnet-mvnrepo-plugin/trunk/src/main/resources/sfnet-mvnrepo-plugin.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
mvn-Infix-commits mailing list
mvn-Infix-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mvn-infix-commits

Reply via email to