From: Olivier Lamy Date: Tue, 24 Jan 2012 09:17:37 +0000 (+0000) Subject: javascript mapping for RemoteRepository model X-Git-Tag: archiva-1.4-M3~1492 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1526829bea7ae0f58f200618ac0ccf91b495d010;p=archiva.git javascript mapping for RemoteRepository model git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1235175 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js index 7cedecd43..5b6e46acc 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js @@ -507,4 +507,67 @@ $(function() { + RemoteRepository=function(id,name,layout,indexDirectory,url,userName,password,timeout,downloadRemoteIndex,remoteIndexUrl, + remoteDownloadNetworkProxyId,cronExpression,remoteDownloadTimeout,downloadRemoteIndexOnStartup){ + + + //private String id; + this.id=ko.observable(id); + + //private String name; + this.name=ko.observable(name); + + //private String layout = "default"; + this.layout=ko.observable(layout); + + //private String indexDirectory; + this.indexDirectory=ko.observable(indexDirectory); + + //private String url; + this.url=ko.observable(url); + + //private String userName; + this.userName=ko.observable(userName); + + //private String password; + this.password=ko.observable(password); + + //private int timeout = 60; + this.timeout=ko.observable(timeout); + + //private boolean downloadRemoteIndex = false; + this.downloadRemoteIndex=ko.observable(downloadRemoteIndex); + + //private String remoteIndexUrl = ".index"; + this.remoteIndexUrl=ko.observable(remoteIndexUrl); + + //private String remoteDownloadNetworkProxyId; + this.remoteDownloadNetworkProxyId=ko.observable(remoteDownloadNetworkProxyId); + + //private String cronExpression = "0 0 08 ? * SUN"; + this.cronExpression=ko.observable(cronExpression); + + //private int remoteDownloadTimeout = 300; + this.remoteDownloadTimeout=ko.observable(remoteDownloadTimeout); + + //private boolean downloadRemoteIndexOnStartup = false; + this.downloadRemoteIndexOnStartup=ko.observable(downloadRemoteIndexOnStartup); + } + + mapRemoteRepository=function(data){ + if (data==null){ + return null; + } + return new RemoteRepository(data.id,data.name,data.layout,data.indexDirectory,data.url,data.userName,data.password, + data.timeout,data.downloadRemoteIndex,data.remoteIndexUrl,data.remoteDownloadNetworkProxyId, + data.cronExpression,data.remoteDownloadTimeout,data.downloadRemoteIndexOnStartup); + } + + mapRemoteRepositories=function(data){ + var mappedRemoteRepositories = $.map(data.remoteRepository, function(item) { + return mapRemoteRepository(item); + }); + return mappedRemoteRepositories; + } + }); \ No newline at end of file