summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-rest
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-05-25 12:33:18 +0000
committerOlivier Lamy <olamy@apache.org>2012-05-25 12:33:18 +0000
commit5f43a65cd8ea0d320f1c942e613506539d40c7b9 (patch)
tree178279a5a01ba79f7aba79697432bf2fcac06354 /archiva-modules/archiva-web/archiva-rest
parent2db8f333d8521a3ae088a704c3d13b521bbcb22e (diff)
downloadarchiva-5f43a65cd8ea0d320f1c942e613506539d40c7b9.tar.gz
archiva-5f43a65cd8ea0d320f1c942e613506539d40c7b9.zip
use configured applicationUrl to send registration email
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1342595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java16
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java13
2 files changed, 26 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java
index 5bc34cfd4..180dec9bf 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java
@@ -23,9 +23,9 @@ import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
import org.apache.archiva.admin.model.beans.NetworkConfiguration;
import org.apache.archiva.admin.model.beans.OrganisationInformation;
import org.apache.archiva.admin.model.beans.UiConfiguration;
+import org.apache.archiva.redback.authorization.RedbackAuthorization;
import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
import org.apache.archiva.security.common.ArchivaRoleConstants;
-import org.apache.archiva.redback.authorization.RedbackAuthorization;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -189,7 +189,7 @@ public interface ArchivaAdministrationService
@Path( "getOrganisationInformation" )
@GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
- @RedbackAuthorization( noPermission = true, noRestriction = true)
+ @RedbackAuthorization( noPermission = true, noRestriction = true )
OrganisationInformation getOrganisationInformation()
throws ArchivaRestServiceException;
@@ -214,10 +214,20 @@ public interface ArchivaAdministrationService
void setUiConfiguration( UiConfiguration uiConfiguration )
throws ArchivaRestServiceException;
+ @Path( "applicationUrl" )
+ @GET
+ @Produces( MediaType.TEXT_PLAIN )
+ @RedbackAuthorization( noRestriction = true, noPermission = true )
+ /**
+ * @since 1.4-M3
+ */
+ String getApplicationUrl()
+ throws ArchivaRestServiceException;
+
@Path( "getNetworkConfiguration" )
@GET
- @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
NetworkConfiguration getNetworkConfiguration()
throws ArchivaRestServiceException;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java
index abb4915b7..63aa63d09 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java
@@ -369,6 +369,19 @@ public class DefaultArchivaAdministrationService
}
}
+ public String getApplicationUrl()
+ throws ArchivaRestServiceException
+ {
+ try
+ {
+ return archivaAdministration.getUiConfiguration().getApplicationUrl();
+ }
+ catch ( RepositoryAdminException e )
+ {
+ throw new ArchivaRestServiceException( e.getMessage(), e );
+ }
+ }
+
public NetworkConfiguration getNetworkConfiguration()
throws ArchivaRestServiceException
{