Permalink
Browse files

Fixing up for promote and drop mojo support.

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/branches/nexus-1.3.2/nexus-clients/nexus-restlight-clients@3848 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information...
1 parent 6919c4f commit 0bdb68b9add401ad44ef54bb48eb5d803caaf387 jdcasey committed Apr 7, 2009
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-client-common</artifactId>
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-m2-settings-client</artifactId>
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-stage-client</artifactId>
@@ -96,6 +96,24 @@ public StageClient( final String baseUrl, final String user, final String passwo
return parseStageRepositories( doc, STAGE_REPO_LIST_XPATH, true );
}
+ /**
+ * Retrieve the list of all closed (finished) staging repositories that may house artifacts with the specified
+ * groupId, artifactId, and version for the current user.
+ *
+ * @return details about each closed repository
+ */
+ public List<StageRepository> getOpenStageRepositoriesForUser( final String groupId, final String artifactId,
+ final String version )
+ throws RESTLightClientException
+ {
+ Map<String, String> params = new HashMap<String, String>();
+ mapCoord( groupId, artifactId, version, params );
+
+ Document doc = get( PROFILES_PATH, params );
+
+ return parseStageRepositories( doc, STAGE_REPO_XPATH, true );
+ }
+
/**
* Retrieve the details for the open staging repository which would be used for an artifact with the specified
* groupId, artifactId, and version if the current user deployed it. In the event Nexus returns multiple open
@@ -175,9 +193,22 @@ public void finishRepositoryForUser( final String groupId, final String artifact
public void finishRepository( final StageRepository repo, final String description )
throws RESTLightClientException
{
- Element desc = new Element( REPO_DESCRIPTION_ELEMENT ).setText( description );
+ String descElementName =
+ getVocabulary().getProperty( VocabularyKeys.PROMOTE_STAGE_REPO_DESCRIPTION_ELEMENT,
+ VocabularyKeys.SUPPRESS_ELEMENT_VALUE );
+
+ List<Element> extras;
+ if ( !VocabularyKeys.SUPPRESS_ELEMENT_VALUE.equals( descElementName ) )
+ {
+ Element desc = new Element( REPO_DESCRIPTION_ELEMENT ).setText( description );
+ extras = Collections.singletonList( desc );
+ }
+ else
+ {
+ extras = null;
+ }
- performStagingAction( repo, STAGE_REPO_FINISH_ACTION, Collections.singletonList( desc ) );
+ performStagingAction( repo, STAGE_REPO_FINISH_ACTION, extras );
}
/**
@@ -32,6 +32,18 @@
* 1.3.2, the element has been simplified to <code>promoteRequest</code>.
*/
public static final String PROMOTE_STAGE_REPO_ROOT_ELEMENT = "promoteRepository.rootElement";
+
+ /**
+ * This is the description element name to use when finishing a staged repository. In Nexus Professional 1.3.1, it
+ * wasn't used at all, so the value is {@link VocabularyKeys#SUPPRESS_ELEMENT_VALUE}. In Nexus Professional 1.3.2+,
+ * the element is <code>description</code>.
+ */
+ public static final String PROMOTE_STAGE_REPO_DESCRIPTION_ELEMENT = "promoteRepository.descriptionElement";
+
+ /**
+ * Flag value that tells the REST client to suppress that element.
+ */
+ public static final String SUPPRESS_ELEMENT_VALUE = "NONE";
private VocabularyKeys()
{
@@ -4,7 +4,7 @@
<parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>nexus-restlight-test-harness</artifactId>
@@ -24,7 +24,7 @@
private static final String TEST_NX_API_VERSION_SYSPROP = "test.nexus.api.version";
- private static final String DEFAULT_TEST_NX_API_VERSION = "1.3.1";
+ private static final String DEFAULT_TEST_NX_API_VERSION = "1.3.2";
/**
* <p>
View
@@ -4,11 +4,12 @@
<parent>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-clients</artifactId>
- <version>1.3.2.1-SNAPSHOT</version>
+ <version>1.3.2</version>
</parent>
<groupId>org.sonatype.nexus.restlight</groupId>
<artifactId>nexus-restlight-clients</artifactId>
+ <version>1.3.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Nexus Lightweight REST Clients</name>
@@ -26,7 +27,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nexus-restlight-client-common</artifactId>
- <version>${project.version}</version>
+ <version>1.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId> org.jdom</groupId>
@@ -83,7 +84,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nexus-restlight-test-harness</artifactId>
- <version>${project.version}</version>
+ <version>1.3.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>

0 comments on commit 0bdb68b

Please sign in to comment.