mirror of https://github.com/apache/archiva.git
[MRM-1362] Add simple 'CRUD' pages for project-level metadata along with a "generic metadata" plugin
o added validation for adding new properties git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@951287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f51b049d51
commit
a82088bc3f
|
@ -305,9 +305,9 @@ public class ShowArtifactAction
|
||||||
|
|
||||||
public String addMetadataProperty()
|
public String addMetadataProperty()
|
||||||
{
|
{
|
||||||
ProjectVersionMetadata projectMetadata = getProjectVersionMetadata();
|
|
||||||
String errorMsg = null;
|
String errorMsg = null;
|
||||||
|
|
||||||
|
ProjectVersionMetadata projectMetadata = getProjectVersionMetadata();
|
||||||
if( projectMetadata == null )
|
if( projectMetadata == null )
|
||||||
{
|
{
|
||||||
addActionError( errorMsg != null ? errorMsg : "Artifact not found" );
|
addActionError( errorMsg != null ? errorMsg : "Artifact not found" );
|
||||||
|
@ -323,6 +323,13 @@ public class ShowArtifactAction
|
||||||
genericMetadata = projectMetadata.getFacet( GenericMetadataFacet.FACET_ID ).toProperties();
|
genericMetadata = projectMetadata.getFacet( GenericMetadataFacet.FACET_ID ).toProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( propertyName == null || "".equals( propertyName.trim() ) || propertyValue == null || "".equals( propertyValue.trim() ) )
|
||||||
|
{
|
||||||
|
model = projectMetadata;
|
||||||
|
addActionError( errorMsg != null ? errorMsg : "Property Name and Property Value are required." );
|
||||||
|
return INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
genericMetadata.put( propertyName, propertyValue );
|
genericMetadata.put( propertyName, propertyValue );
|
||||||
|
|
||||||
GenericMetadataFacet genericMetadataFacet = new GenericMetadataFacet();
|
GenericMetadataFacet genericMetadataFacet = new GenericMetadataFacet();
|
||||||
|
|
|
@ -223,7 +223,8 @@
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="addMetadataProperty" class="showArtifactAction" method="addMetadataProperty">
|
<action name="addMetadataProperty" class="showArtifactAction" method="addMetadataProperty">
|
||||||
<result>/WEB-INF/jsp/showArtifact.jsp</result>
|
<result name="input">/WEB-INF/jsp/showArtifact.jsp</result>
|
||||||
|
<result name="success">/WEB-INF/jsp/showArtifact.jsp</result>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="deleteMetadataEntry" class="showArtifactAction" method="deleteMetadataEntry">
|
<action name="deleteMetadataEntry" class="showArtifactAction" method="deleteMetadataEntry">
|
||||||
|
|
|
@ -67,5 +67,19 @@
|
||||||
</c:if>
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<s:if test="hasActionMessages()">
|
||||||
|
<div id="messages">
|
||||||
|
<s:actionmessage/>
|
||||||
|
</div>
|
||||||
|
</s:if>
|
||||||
|
<s:if test="hasActionErrors()">
|
||||||
|
<div id="messages">
|
||||||
|
<s:actionerror/>
|
||||||
|
</div>
|
||||||
|
</s:if>
|
||||||
|
</p>
|
||||||
|
|
||||||
<%-- <archiva:project-metadata object="${projectMetadata}" groupId="${groupId}" artifactId="${artifactId}" version="${version}" /> --%>
|
<%-- <archiva:project-metadata object="${projectMetadata}" groupId="${groupId}" artifactId="${artifactId}" version="${version}" /> --%>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue