diff options
author | Olivier Lamy <olamy@apache.org> | 2012-03-08 09:31:51 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-03-08 09:31:51 +0000 |
commit | 345a7d6a75745b01c76541958b5ebe34bb3789f4 (patch) | |
tree | b366f8c882e3df01c5e26b79f0371ab6703df269 /archiva-modules/archiva-web | |
parent | 45273b5e2b50bf692124b65000fd993fc27473fa (diff) | |
download | archiva-345a7d6a75745b01c76541958b5ebe34bb3789f4.tar.gz archiva-345a7d6a75745b01c76541958b5ebe34bb3789f4.zip |
[MRM-1579] rewrite repositories scanning admin page
enabled/disabled consummers.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1298321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
3 files changed, 51 insertions, 9 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 01e867fbf..8012a29b5 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 @@ -31,6 +31,7 @@ import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; @@ -101,11 +102,11 @@ public interface ArchivaAdministrationService Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId ) throws ArchivaRestServiceException; - @Path( "enabledKnownContentConsumer" ) + @Path( "enabledKnownContentConsumer/{knownContentConsumer}" ) @GET @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) - Boolean enabledKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer ) + Boolean enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer ) throws ArchivaRestServiceException; @Path( "enabledKnownContentConsumers" ) @@ -116,18 +117,18 @@ public interface ArchivaAdministrationService throws ArchivaRestServiceException; - @Path( "disabledKnownContentConsumer" ) + @Path( "disabledKnownContentConsumer/{knownContentConsumer}" ) @GET @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) - Boolean disabledKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer ) + Boolean disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer ) throws ArchivaRestServiceException; - @Path( "enabledInvalidContentConsumer" ) + @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" ) @GET @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) - Boolean enabledInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer ) + Boolean enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer ) throws ArchivaRestServiceException; @Path( "enabledInvalidContentConsumers" ) @@ -137,11 +138,11 @@ public interface ArchivaAdministrationService void enabledInvalidContentConsumers( List<String> invalidContentConsumers ) throws ArchivaRestServiceException; - @Path( "disabledInvalidContentConsumer" ) + @Path( "disabledInvalidContentConsumer/{invalidContentConsumer}" ) @GET @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) - Boolean disabledInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer ) + Boolean disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer ) throws ArchivaRestServiceException; @Path( "getFileTypes" ) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js index 453f3de03..62a75b81e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js @@ -397,6 +397,34 @@ $(function() { } }); } + + disableKnowContentConsumer=function(adminRepositoryConsumer){ + clearUserMessages(); + var url="restServices/archivaServices/archivaAdministrationService/disabledKnownContentConsumer/" + url+=encodeURIComponent(adminRepositoryConsumer.id()); + $.ajax(url, { + type: "GET", + dataType: 'json', + success: function(data){ + adminRepositoryConsumer.enabled(false); + displaySuccessMessage( $.i18n.prop("repository-scanning.consumers.know.disabled",adminRepositoryConsumer.id())); + } + }); + } + + enableKnowContentConsumer=function(adminRepositoryConsumer){ + clearUserMessages(); + var url="restServices/archivaServices/archivaAdministrationService/enabledKnownContentConsumer/" + url+=encodeURIComponent(adminRepositoryConsumer.id()); + $.ajax(url, { + type: "GET", + dataType: 'json', + success: function(data){ + adminRepositoryConsumer.enabled(true); + displaySuccessMessage( $.i18n.prop("repository-scanning.consumers.know.enabled",adminRepositoryConsumer.id())); + } + }); + } } displayRepositoryScanning=function(){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html index 8b26652cd..84ee3108c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html @@ -216,7 +216,20 @@ <tbody> {{each(i,knownAdminRepositoryConsumer) knownAdminRepositoryConsumers}} <tr> - <td>${knownAdminRepositoryConsumer.enabled}</td> + {{if knownAdminRepositoryConsumer.enabled()==true}} + <td> + <a href="#" data-bind="click: function(){ disableKnowContentConsumer(knownAdminRepositoryConsumer) }"> + <img src="images/weather-clear-22-22.png"/> + </a> + </td> + {{else}} + <td> + <a href="#" data-bind="click: function(){ enableKnowContentConsumer(knownAdminRepositoryConsumer) }"> + <img src="images/dialog-error-22-22.png"/> + </a> + </td> + {{/if}} + <td>${knownAdminRepositoryConsumer.id}</td> <td>${knownAdminRepositoryConsumer.description}</td> </tr> |