You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by oc...@apache.org on 2010/05/04 10:54:01 UTC

svn commit: r940775 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src: main/java/org/apache/maven/archiva/web/action/ main/resources/ main/webapp/WEB-INF/jsp/ main/webapp/WEB-INF/jsp/include/ test/java/org/apache/maven/archiva/web/action/

Author: oching
Date: Tue May  4 08:54:00 2010
New Revision: 940775

URL: http://svn.apache.org/viewvc?rev=940775&view=rev
Log:
[MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin
o action methods for updating and retrieving metadata properties
o updated struts config for getting project metadata
o added page for metadata in webapp artifact browse
o added test for getting project metadata

Added:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java?rev=940775&r1=940774&r2=940775&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java Tue May  4 08:54:00 2010
@@ -25,6 +25,7 @@ import org.apache.archiva.metadata.model
 import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionReference;
+import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
 import org.apache.archiva.metadata.repository.MetadataResolver;
 import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
@@ -67,6 +68,11 @@ public class ShowArtifactAction
      */
     private RepositoryContentFactory repositoryFactory;
 
+    /**
+     * @plexus.requirement
+     */
+    private MetadataRepository metadataRepository;
+
     /* .\ Exposed Output Objects \.__________________________________ */
 
     private String groupId;
@@ -95,6 +101,8 @@ public class ShowArtifactAction
 
     private boolean dependencyTree = false;
 
+    private ProjectVersionMetadata projectMetadata;
+   
     /**
      * Show the versioned project information tab.
      * TODO: Change name to 'project' - we are showing project versions here, not specific artifact information (though
@@ -102,13 +110,35 @@ public class ShowArtifactAction
      */
     public String artifact()
     {
-        ProjectVersionMetadata versionMetadata = null;
-        artifacts = new LinkedHashMap<String, List<ArtifactDownloadInfo>>();
 
-        List<String> repos = getObservableRepos();
         // In the future, this should be replaced by the repository grouping mechanism, so that we are only making
         // simple resource requests here and letting the resolver take care of it
         String errorMsg = null;
+        ProjectVersionMetadata versionMetadata = getProjectVersionMetadata();
+
+        if ( versionMetadata == null )
+        {
+            addActionError( errorMsg != null ? errorMsg : "Artifact not found" );
+            return ERROR;
+        }
+
+        if ( versionMetadata.isIncomplete() )
+        {
+            addIncompleteModelWarning();
+        }
+
+        model = versionMetadata;
+
+        return SUCCESS;
+    }
+
+    private ProjectVersionMetadata getProjectVersionMetadata()
+    {
+        ProjectVersionMetadata versionMetadata = null;
+        artifacts = new LinkedHashMap<String, List<ArtifactDownloadInfo>>();
+
+        List<String> repos = getObservableRepos();
+
         for ( String repoId : repos )
         {
             if ( versionMetadata == null )
@@ -122,7 +152,7 @@ public class ShowArtifactAction
                 catch ( MetadataResolutionException e )
                 {
                     addIncompleteModelWarning();
-                    
+
                     // TODO: need a consistent way to construct this - same in ArchivaMetadataCreationConsumer
                     versionMetadata = new ProjectVersionMetadata();
                     versionMetadata.setId( version );
@@ -138,7 +168,7 @@ public class ShowArtifactAction
                         public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
                         {
                             // sort by version (reverse), then ID
-                            // TODO: move version sorting into repository handling (maven2 specific), and perhaps add a 
+                            // TODO: move version sorting into repository handling (maven2 specific), and perhaps add a
                             //       way to get latest instead
                             int result = new DefaultArtifactVersion( o2.getVersion() ).compareTo(
                                 new DefaultArtifactVersion( o1.getVersion() ) );
@@ -160,20 +190,7 @@ public class ShowArtifactAction
             }
         }
 
-        if ( versionMetadata == null )
-        {
-            addActionError( errorMsg != null ? errorMsg : "Artifact not found" );
-            return ERROR;
-        }
-
-        if ( versionMetadata.isIncomplete() )
-        {
-            addIncompleteModelWarning();
-        }
-
-        model = versionMetadata;
-
-        return SUCCESS;
+        return versionMetadata;
     }
 
     private void addIncompleteModelWarning()
@@ -253,6 +270,32 @@ public class ShowArtifactAction
         return artifact();
     }
 
+    public String projectMetadata()
+    {
+        projectMetadata = getProjectVersionMetadata();
+        String errorMsg = null;
+
+        if ( projectMetadata == null )
+        {
+            addActionError( errorMsg != null ? errorMsg : "Artifact not found" );
+            return ERROR;
+        }
+
+        if ( projectMetadata.isIncomplete() )
+        {
+            addIncompleteModelWarning();
+        }
+
+        return SUCCESS;
+    }
+
+    public String updateProjectMetadata()
+    {
+        metadataRepository.updateProjectVersion( repositoryId, groupId, artifactId, projectMetadata );
+
+        return SUCCESS;
+    }
+
     @Override
     public void validate()
     {
@@ -357,6 +400,16 @@ public class ShowArtifactAction
         return dependencyTree;
     }
 
+    public ProjectVersionMetadata getProjectMetadata()
+    {
+        return projectMetadata;
+    }
+
+    public void setProjectMetadata( ProjectVersionMetadata projectMetadata )
+    {
+        this.projectMetadata = projectMetadata;
+    }
+
     // TODO: move this into the artifact metadata itself via facets where necessary
 
     public class ArtifactDownloadInfo
@@ -478,5 +531,7 @@ public class ShowArtifactAction
         {
             return path;
         }
+
+
     }
 }

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml?rev=940775&r1=940774&r2=940775&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/struts.xml Tue May  4 08:54:00 2010
@@ -218,6 +218,10 @@
       <result>/WEB-INF/jsp/showArtifact.jsp</result>
     </action>
 
+    <action name="showProjectMetadata" class="showArtifactAction" method="projectMetadata">
+      <result>/WEB-INF/jsp/showArtifact.jsp</result>
+    </action>
+
   </package>
 
   <package name="components" namespace="/components" extends="struts-default">

Added: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf?rev=940775&view=auto
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf (added)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf Tue May  4 08:54:00 2010
@@ -0,0 +1,278 @@
+<%--
+  ~ 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="s" uri="/struts-tags" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="archiva"   uri="/WEB-INF/taglib.tld" %>
+
+<script type="text/javascript">
+  $(function() {
+    $("#accordion2").accordion();
+  });
+</script>
+
+<p>
+  <archiva:groupIdLink var="${groupId}" includeTop="true" />
+
+  <c:set var="url">
+    <s:url action="browseArtifact" namespace="/">
+      <s:param name="groupId" value="%{#attr.groupId}"/>
+      <s:param name="artifactId" value="%{#attr.artifactId}"/>
+    </s:url>
+  </c:set>
+  <a href="${url}">${artifactId}</a> /
+  <strong>${version}</strong>
+</p>
+
+<c:if test="${!empty (projectMetadata.description)}">
+  <blockquote>${projectMetadata.description}</blockquote>
+</c:if>
+
+<table class="infoTable">
+  <tr>
+    <th>Project Metadata ID</th>
+    <td>${projectMetadata.id}</td>
+  </tr>
+  <tr>
+    <th>URL</th>
+    <td>${projectMetadata.url}</td>
+  </tr>
+  <tr>
+    <th>Name</th>
+    <td>${projectMetadata.name}</td>
+  </tr>
+  <tr>
+    <th>Description</th>
+    <td>${projectMetadata.description}</td>
+  </tr>
+
+<c:if test="${projectMetadata.organization != null || !empty (projectMetadata.licenses)
+    || projectMetadata.issueManagement != null || projectMetadata.ciManagement != null }">
+
+  <h2>Other Details</h2>
+  <table class="infoTable">
+    <c:if test="${projectMetadata.organization != null}">
+      <tr>
+        <th>Organisation</th>
+        <td>
+          <c:choose>
+            <c:when test="${projectMetadata.organization.url != null}">
+              <a href="${projectMetadata.organization.url}">${projectMetadata.organization.name}</a>
+            </c:when>
+            <c:otherwise>
+              ${projectMetadata.organization.name}
+            </c:otherwise>
+          </c:choose>
+        </td>
+      </tr>
+    </c:if>
+    <c:if test="${!empty (projectMetadata.licenses)}">
+      <c:forEach items="${projectMetadata.licenses}" var="license">
+        <tr>
+          <th>License</th>
+          <td>
+            <c:choose>
+              <c:when test="${!empty (license.url)}">
+                <a href="${license.url}">${license.name}</a>
+              </c:when>
+              <c:otherwise>
+                ${license.name}
+              </c:otherwise>
+            </c:choose>
+          </td>
+        </tr>
+      </c:forEach>
+    </c:if>
+    <c:if test="${projectMetadata.issueManagement != null}">
+      <tr>
+        <th>Issue Tracker</th>
+        <td>
+          <c:choose>
+            <c:when test="${!empty (projectMetadata.issueManagement.url)}">
+              <a href="${projectMetadata.issueManagement.url}">${projectMetadata.issueManagement.system}</a>
+            </c:when>
+            <c:otherwise>
+              ${projectMetadata.issueManagement.system}
+            </c:otherwise>
+          </c:choose>
+        </td>
+      </tr>
+    </c:if>
+    <c:if test="${projectMetadata.ciManagement != null}">
+      <tr>
+        <th>Continuous Integration</th>
+        <td>
+          <c:choose>
+            <c:when test="${!empty (projectMetadata.ciManagement.url)}">
+              <a href="${projectMetadata.ciManagement.url}">${projectMetadata.ciManagement.system}</a>
+            </c:when>
+            <c:otherwise>
+              ${projectMetadata.ciManagement.system}
+            </c:otherwise>
+          </c:choose>
+        </td>
+      </tr>
+    </c:if>
+  </table>
+</c:if>
+
+<c:if test="${projectMetadata.scm != null}">
+  <h2>SCM</h2>
+  <table class="infoTable">
+    <c:if test="${!empty (projectMetadata.scm.connection)}">
+      <tr>
+        <th>Connection</th>
+        <td>
+          <code>${projectMetadata.scm.connection}</code>
+        </td>
+      </tr>
+    </c:if>
+    <c:if test="${!empty (projectMetadata.scm.developerConnection)}">
+      <tr>
+        <th>Dev. Connection</th>
+        <td>
+          <code>${projectMetadata.scm.developerConnection}</code>
+        </td>
+      </tr>
+    </c:if>
+    <c:if test="${!empty (projectMetadata.scm.url)}">
+      <tr>
+        <th>Viewer</th>
+        <td>
+          <a href="${projectMetadata.scm.url}">${projectMetadata.scm.url}</a>
+        </td>
+      </tr>
+    </c:if>
+  </table>
+</c:if>
+
+
+<c:if test="${projectMetadata.mailingLists != null || projectMetadata.dependencies != null}">
+ <div id="accordion2">
+    <c:if test="${!empty (projectMetadata.mailingLists)}">
+    <h2><a href="#">Mailing Lists</a></h2>
+    <div>
+       <c:forEach items="${projectMetadata.mailingLists}" var="mailingList">
+         <h3>${mailingList.name}</h3>
+         <table class="infoTable">
+           <c:if test="${!empty (mailingList.subscribeAddress)}">
+             <tr>
+               <th>Subscribe</th>
+               <td>
+                 <code>${mailingList.subscribeAddress}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (mailingList.postAddress)}">
+             <tr>
+               <th>Post</th>
+               <td>
+                 <code>${mailingList.postAddress}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (mailingList.unsubscribeAddress)}">
+             <tr>
+               <th>Unsubscribe</th>
+               <td>
+                 <code>${mailingList.unsubscribeAddress}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (mailingList.mainArchiveUrl)}">
+             <tr>
+               <th>Archive</th>
+               <td>
+                 <code>${mailingList.mainArchiveUrl}</code>
+               </td>
+             </tr>
+           </c:if>
+         </table>
+       </c:forEach>
+    </div>
+    </c:if>
+
+    <c:if test="${!empty (projectMetadata.dependencies)}">
+    <h2><a href="#">Dependencies</a></h2>
+    <div>
+        <c:forEach items="${projectMetadata.dependencies}" var="dependency">
+         <h3>Dependency</h3>
+         <table class="infoTable">
+           <c:if test="${!empty (dependency.groupId)}">
+             <tr>
+               <th>Group ID</th>
+               <td>
+                 <code>${dependency.groupId}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.artifactId)}">
+             <tr>
+               <th>Artifact ID</th>
+               <td>
+                 <code>${dependency.artifactId}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.version)}">
+             <tr>
+               <th>Version</th>
+               <td>
+                 <code>${dependency.version}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.classifier)}">
+             <tr>
+               <th>Classifier</th>
+               <td>
+                 <code>${dependency.classifier}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.type)}">
+             <tr>
+               <th>Type</th>
+               <td>
+                 <code>${dependency.type}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.scope)}">
+             <tr>
+               <th>Scope</th>
+               <td>
+                 <code>${dependency.scope}</code>
+               </td>
+             </tr>
+           </c:if>
+           <c:if test="${!empty (dependency.systemPath)}">
+             <tr>
+               <th>System Path</th>
+               <td>
+                 <code>${dependency.systemPath}</code>
+               </td>
+             </tr>
+           </c:if>
+         </table>
+       </c:forEach>
+      </div>
+    </c:if>
+ </div>
+</c:if>
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp?rev=940775&r1=940774&r2=940775&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp Tue May  4 08:54:00 2010
@@ -126,6 +126,14 @@
         </s:url>
       </c:set>
       <my:currentWWUrl url="${url}">Mailing Lists</my:currentWWUrl>
+      <c:set var="url">
+        <s:url action="showProjectMetadata">
+          <s:param name="groupId" value="%{groupId}"/>
+          <s:param name="artifactId" value="%{artifactId}"/>
+          <s:param name="version" value="%{version}"/>
+        </s:url>
+      </c:set>
+      <my:currentWWUrl url="${url}">Metadata</my:currentWWUrl>
       <%-- TODO
       <redback:ifAnyAuthorized permissions="archiva-access-reports">
         <c:set var="url">
@@ -211,6 +219,9 @@
   <%-- TODO: panels? this is ugly as is --%>
   <div id="tabArea">
     <c:choose>
+      <c:when test="${projectMetadata != null}">
+        <%@ include file="/WEB-INF/jsp/include/projectMetadata.jspf" %>
+      </c:when>
       <c:when test="${dependencies != null}">
         <%@ include file="/WEB-INF/jsp/include/artifactDependencies.jspf" %>
       </c:when>
@@ -229,6 +240,7 @@
       <c:otherwise>
         <%@ include file="/WEB-INF/jsp/include/artifactInfo.jspf" %>
       </c:otherwise>
+
     </c:choose>
 
     <s:if test="hasActionMessages()">

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java?rev=940775&r1=940774&r2=940775&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/ShowArtifactActionTest.java Tue May  4 08:54:00 2010
@@ -368,6 +368,41 @@ public class ShowArtifactActionTest
         assertTrue( action.getArtifacts().isEmpty() );
     }
 
+    public void testGetProjectMetadata()
+    {
+        ProjectVersionMetadata versionMetadata = createProjectModel( TEST_VERSION );
+        Dependency dependency1 = createDependencyBasic( "artifactId1" );
+        Dependency dependency2 = createDependencyExtended( "artifactId2" );
+        versionMetadata.setDependencies( Arrays.asList( dependency1, dependency2 ) );
+
+        MailingList ml1 = createMailingList( "Users List", "users" );
+        MailingList ml2 = createMailingList( "Developers List", "dev" );
+        versionMetadata.setMailingLists( Arrays.asList( ml1, ml2 ) );
+
+        metadataResolver.setProjectVersion( TEST_REPO, TEST_GROUP_ID, TEST_ARTIFACT_ID, versionMetadata );
+
+        setActionParameters();
+
+        String result = action.projectMetadata();
+
+        assertActionSuccess( action, result );
+
+        assertActionParameters( action );
+        ProjectVersionMetadata projectMetadata = action.getProjectMetadata();
+        assertDefaultModel( projectMetadata );
+
+        assertNotNull( projectMetadata.getDependencies() );
+        assertDependencyBasic( projectMetadata.getDependencies().get( 0 ), "artifactId1" );
+        assertDependencyExtended( projectMetadata.getDependencies().get( 1 ), "artifactId2" );
+
+        assertEquals( TEST_REPO, action.getRepositoryId() );
+        assertNull( action.getModel() );
+        assertNull( action.getDependees() );
+        assertNull( action.getDependencies() );
+        assertNull( action.getMailingLists() );
+        assertTrue( action.getArtifacts().isEmpty() );
+    }
+
     private void assertArtifacts( List<ArtifactMetadata> expectedArtifacts,
                                   Map<String, List<ShowArtifactAction.ArtifactDownloadInfo>> artifactMap )
     {



Re: svn commit: r940775 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src: main/java/org/apache/maven/archiva/web/action/ main/resources/ main/webapp/WEB-INF/jsp/ main/webapp/WEB-INF/jsp/include/ test/java/org/apache/maven/archiva/web/action/

Posted by Brett Porter <br...@apache.org>.
Hi Deng,

On 04/05/2010, at 6:54 PM, oching@apache.org wrote:

> Author: oching
> Date: Tue May  4 08:54:00 2010
> New Revision: 940775
> 
> URL: http://svn.apache.org/viewvc?rev=940775&view=rev
> Log:
> [MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin
> o action methods for updating and retrieving metadata properties
> o updated struts config for getting project metadata
> o added page for metadata in webapp artifact browse
> o added test for getting project metadata
> 
> Added:
>    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf


With the metadata page, wouldn't it be better to just show a raw output (perhaps as a tree) of everything available? The stuff displayed on this page is already present on the other tabs, so it's not adding much right now.

FWIW, I like the format of this better (esp. the mailing lists), so maybe that could be moved over to the existing tab :)

Cheers,
Brett

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/





Re: svn commit: r940775 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src: main/java/org/apache/maven/archiva/web/action/ main/resources/ main/webapp/WEB-INF/jsp/ main/webapp/WEB-INF/jsp/include/ test/java/org/apache/maven/archiva/web/action/

Posted by "Jevica Arianne B. Zurbano" <je...@gmail.com>.

oching@apache.org wrote:
> Author: oching
> Date: Tue May  4 08:54:00 2010
> New Revision: 940775
>
> URL: http://svn.apache.org/viewvc?rev=940775&view=rev
> Log:
> [MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin
> o action methods for updating and retrieving metadata properties
> o updated struts config for getting project metadata
> o added page for metadata in webapp artifact browse
> o added test for getting project metadata
>
> Added: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf
> URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf?rev=940775&view=auto
> ==============================================================================
> --- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf (added)
> +++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectMetadata.jspf Tue May  4 08:54:00 2010
> @@ -0,0 +1,278 @@
> +<%--
> +  ~ 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="s" uri="/struts-tags" %>
> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
> +<%@ taglib prefix="archiva"   uri="/WEB-INF/taglib.tld" %>
> +
> +<script type="text/javascript">
> +  $(function() {
> +    $("#accordion2").accordion();
> +  });
> +</script>
> +
> +<p>
> +  <archiva:groupIdLink var="${groupId}" includeTop="true" />
> +
> +  <c:set var="url">
> +    <s:url action="browseArtifact" namespace="/">
> +      <s:param name="groupId" value="%{#attr.groupId}"/>
> +      <s:param name="artifactId" value="%{#attr.artifactId}"/>
> +    </s:url>
> +  </c:set>
> +  <a href="${url}">${artifactId}</a> /
> +  <strong>${version}</strong>
> +</p>
> +
> +<c:if test="${!empty (projectMetadata.description)}">
> +  <blockquote>${projectMetadata.description}</blockquote>
> +</c:if>
> +
> +<table class="infoTable">
>   

This seems to be missing a closing tag. The metadata info is displayed 
in the footer (saw this in snapshot build of trunk r944651).

> +  <tr>
> +    <th>Project Metadata ID</th>
> +    <td>${projectMetadata.id}</td>
> +  </tr>

Thanks,

Jev