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;
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" )
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" )
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" )
}
});
}
+
+ 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(){
<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>