archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r562691 - in /maven/archiva/trunk/archiva-web/archiva-webapp: pom.xml src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java src/main/resources/xwork.xml src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
Date Sat, 04 Aug 2007 10:58:41 GMT
Author: brett
Date: Sat Aug  4 03:58:40 2007
New Revision: 562691

URL: http://svn.apache.org/viewvc?view=rev&rev=562691
Log:
[MRM-447] Jasper is only included if built with a profile

Added:
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
  (with props)
Modified:
    maven/archiva/trunk/archiva-web/archiva-webapp/pom.xml
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/pom.xml?view=diff&rev=562691&r1=562690&r2=562691
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/pom.xml (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/pom.xml Sat Aug  4 03:58:40 2007
@@ -18,7 +18,8 @@
   ~ under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.maven.archiva</groupId>
@@ -211,11 +212,6 @@
       <artifactId>activation</artifactId>
       <scope>provided</scope>
     </dependency>
-    <dependency>
-      <groupId>jasperreports</groupId>
-      <artifactId>jasperreports</artifactId>
-      <version>1.2.0</version>
-    </dependency>
   </dependencies>
   <build>
     <plugins>
@@ -397,29 +393,13 @@
             <configuration>
               <tasks>
                 <copy todir="${project.build.directory}/appserver-base">
-                  <fileset dir="src/appserver-base" />
+                  <fileset dir="src/appserver-base"/>
                 </copy>
               </tasks>
             </configuration>
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>jasperreports-maven-plugin</artifactId>
-        <version>1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <phase>compile</phase>
-            <goals>
-              <goal>compile-reports</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <targetDirectory>src/main/webapp/WEB-INF/jasperreports</targetDirectory>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
   <profiles>
@@ -465,17 +445,57 @@
         </plugins>
       </build>
     </profile>
-   </profiles>
-  <pluginRepositories>
-    <pluginRepository>
-      <id>Codehaus Snapshots</id>
-      <url>http://snapshots.repository.codehaus.org/</url>
-      <snapshots>
-        <enabled>true</enabled>
-      </snapshots>
-      <releases>
-        <enabled>false</enabled>
-      </releases>
-    </pluginRepository>
-  </pluginRepositories>
+    <profile>
+      <!--
+        Inclusion of this profile brings in Jasper, which is not distributed by default due
to ASF licensing policy
+        regarding LGPL dependencies. A basic report is used instead.
+
+        Note: in the future, it may be better to use the jasperreports plugin at all times
(so the compiled report is
+        included), so that we just require that the JAR be on the classpath to activate it.
We haven't taken this step
+        here because the jasperreports plugin is not yet released.
+
+        See also: MRM-447
+      -->
+      <id>jasper</id>
+      <dependencies>
+        <dependency>
+          <groupId>jasperreports</groupId>
+          <artifactId>jasperreports</artifactId>
+          <version>1.2.0</version>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>jasperreports-maven-plugin</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <executions>
+              <execution>
+                <phase>compile</phase>
+                <goals>
+                  <goal>compile-reports</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <targetDirectory>src/main/webapp/WEB-INF/jasperreports</targetDirectory>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>Codehaus Snapshots</id>
+          <url>http://snapshots.repository.codehaus.org/</url>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
 </project>

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java?view=diff&rev=562691&r1=562690&r2=562691
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
(original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
Sat Aug  4 03:58:40 2007
@@ -75,6 +75,10 @@
 
     public static final String BLANK = "blank";
 
+    public static final String BASIC = "basic";
+
+    private static Boolean jasperPresent;
+
     public String execute()
         throws Exception
     {
@@ -114,10 +118,31 @@
         {
             return BLANK;
         }
+        else if ( !isJasperPresent() )
+        {
+            return BASIC;
+        }
         else
         {
             return SUCCESS;
         }
+    }
+
+    private static boolean isJasperPresent()
+    {
+        if ( jasperPresent == null )
+        {
+            try
+            {
+                Class.forName( "net.sf.jasperreports.engine.JRExporterParameter" );
+                jasperPresent = Boolean.TRUE;
+            }
+            catch ( ClassNotFoundException e )
+            {
+                jasperPresent = Boolean.FALSE;
+            }
+        }
+        return jasperPresent.booleanValue();
     }
 
     private Constraint configureConstraint()

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml?view=diff&rev=562691&r1=562690&r2=562691
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml Sat Aug  4
03:58:40 2007
@@ -401,6 +401,7 @@
         <param name="dataSource">reports</param>
         <param name="format">HTML</param>
       </result>
+      <result name="basic">/WEB-INF/jsp/reports/basicReport.jsp</result>
       <result name="blank">/WEB-INF/jsp/reports/blankReport.jsp</result>
     </action>
   </package>

Added: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp?view=auto&rev=562691
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
(added)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
Sat Aug  4 03:58:40 2007
@@ -0,0 +1,62 @@
+<%--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you 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.
+  --%>
+
+<%@ taglib prefix="ww" uri="/webwork" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="archiva" uri="http://maven.apache.org/archiva" %>
+
+<html>
+<head>
+  <title>Reports</title>
+  <ww:head/>
+</head>
+
+<body>
+<h1>Reports</h1>
+
+<div id="contentArea">
+
+  <ww:set name="reports" value="reports"/>
+  <c:forEach items="${reports}" var="report">
+
+    <p>
+      <archiva:groupIdLink var="${report.groupId}" includeTop="true"/>
+
+      <c:set var="url">
+        <ww:url action="browseArtifact" namespace="/">
+          <ww:param name="groupId" value="%{'${report.groupId}'}"/>
+          <ww:param name="artifactId" value="%{'${report.artifactId}'}"/>
+        </ww:url>
+      </c:set>
+      <a href="${url}">${report.artifactId}</a> /
+      <strong>${report.version}</strong>
+    </p>
+
+    <blockquote>${report.message}</blockquote>
+  </c:forEach>
+
+  <ww:set name="page" value="page"/>
+  <c:if test="${page > 1}"><a href="<ww:property value='prev' />">&lt;&lt;</a></c:if>
+  Page: ${page}
+  <ww:set name="isLastPage" value="isLastPage"/>
+  <c:if test="${!isLastPage}"><a href="<ww:property value='next' />">&gt;&gt;</a></c:if>
+
+</div>
+</body>
+</html>

Propchange: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message