From: Olivier Lamy Date: Wed, 7 Mar 2012 22:01:13 +0000 (+0000) Subject: [MRM-1579] rewrite repositories scanning admin page X-Git-Tag: archiva-1.4-M3~1101 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1f1599658fd034c19bde5bdbe049738c091c7ae0;p=archiva.git [MRM-1579] rewrite repositories scanning admin page start some refactoring to ease implementation (reusable beans) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1298148 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AdminRepositoryConsumer.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AdminRepositoryConsumer.java new file mode 100644 index 000000000..539980a56 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/AdminRepositoryConsumer.java @@ -0,0 +1,79 @@ +package org.apache.archiva.rest.api.model; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * AdminRepositoryConsumer + * + * @version $Id$ + */ +@XmlRootElement( name = "adminRepositoryConsumer" ) +public class AdminRepositoryConsumer +{ + private boolean enabled = false; + + private String id; + + private String description; + + public AdminRepositoryConsumer() + { + // no op + } + + public AdminRepositoryConsumer( boolean enabled, String id, String description ) + { + this.enabled = enabled; + this.id = id; + this.description = description; + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isEnabled() + { + return enabled; + } + + public void setDescription( String description ) + { + this.description = description; + } + + public void setEnabled( boolean enabled ) + { + this.enabled = enabled; + } + + public void setId( String id ) + { + this.id = id; + } +} 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 0b72d7ac2..1a6cfcc51 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 @@ -296,4 +296,43 @@ $(function() { } + //--------------------------- + // repository scanning part + //--------------------------- + + FileType=function(id,patterns){ + //private String id; + this.id=ko.observable(id); + + //private List patterns; + this.patterns=ko.observableArray(patterns); + + } + + mapFileType=function(data){ + return new FileType(data.id,data.patterns); + } + + mapFileTypes=function(data){ + if (data!=null){ + return $.isArray(data)? $.map(data,function(item){ + return mapFileType(item) + }):[mapFileType(data)]; + } + return []; + } + + displayRepositoryScanning=function(){ + + $.ajax("restServices/archivaServices/archivaAdministrationService/getFileTypes", { + type: "GET", + dataType: 'json', + success: function(data){ + var fileTypes=mapFileTypes(data); + } + }); + + } + + }); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html index 9d3125a1a..b87ac8b28 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html @@ -45,6 +45,9 @@
  • ${$.i18n.prop('menu.legacy-artifact-support')}
  • +
  • + ${$.i18n.prop('menu.repository-scanning')} +