From: Olivier Lamy Date: Mon, 6 Feb 2012 09:13:21 +0000 (+0000) Subject: implements bulk save for managed repositories grid X-Git-Tag: archiva-1.4-M3~1357 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd2f77122c3b4302caec6a08d57dd4e20146c8a1;p=archiva.git implements bulk save for managed repositories grid git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1240937 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 34f83db20..99a798a7d 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -76,6 +76,7 @@ deleteReleasedSnapshots=Delete Released Snapshots releases=Releases stageRepoNeeded=Staging Repository cronExpression.notvalid=Cron Expression not valid +managedrepository.updated=Managed Repository {0} updated. # remote repositories screen diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js index 06a6395c4..6fa855cd8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js @@ -141,11 +141,13 @@ $(function() { getModifiedNetworkProxies=function(){ var prx = $.grep(self.networkProxies(), function (networkProxy,i) { - $.log("networkProxy.modified():"+networkProxy.modified()) return networkProxy.modified(); }); return prx; } + updateModifiedManagedRepositories=function(){ + + } updateModifiedNetworkProxy=function(){ var modifiedNetworkProxies = getModifiedNetworkProxies(); 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 098e863cb..de0467f2f 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 @@ -34,52 +34,67 @@ $(function() { ManagedRepository=function(id,name,layout,indexDirectory,location,snapshots,releases,blockRedeployments,cronExpression, scanned,daysOlder,retentionCount,deleteReleasedSnapshots,stageRepoNeeded){ + var self=this; //private String id; this.id=ko.observable(id); + this.id.subscribe(function(newValue){self.modified(true)}); //private String name; this.name=ko.observable(name); + this.name.subscribe(function(newValue){self.modified(true)}); //private String layout = "default"; this.layout=ko.observable(layout); + this.layout.subscribe(function(newValue){self.modified(true)}); //private String indexDirectory; this.indexDirectory=ko.observable(indexDirectory); + this.indexDirectory.subscribe(function(newValue){self.modified(true)}); //private String location; this.location=ko.observable(location); + this.location.subscribe(function(newValue){self.modified(true)}); //private String cronExpression = "0 0 * * * ?"; this.cronExpression=ko.observable(cronExpression); + this.cronExpression.subscribe(function(newValue){self.modified(true)}); //private ManagedRepository stagingRepository; //private int daysOlder = 100; this.daysOlder=ko.observable(daysOlder); + this.daysOlder.subscribe(function(newValue){self.modified(true)}); //private int retentionCount = 2; this.retentionCount=ko.observable(retentionCount); + this.retentionCount.subscribe(function(newValue){self.modified(true)}); //private boolean scanned = false; this.scanned=ko.observable(scanned); + this.scanned.subscribe(function(newValue){self.modified(true)}); //private boolean deleteReleasedSnapshots; this.deleteReleasedSnapshots=ko.observable(deleteReleasedSnapshots); + this.deleteReleasedSnapshots.subscribe(function(newValue){self.modified(true)}); //private boolean stageRepoNeeded; this.stageRepoNeeded=ko.observable(stageRepoNeeded); + this.stageRepoNeeded.subscribe(function(newValue){self.modified(true)}); //private boolean snapshots = false; this.snapshots=ko.observable(snapshots); + this.snapshots.subscribe(function(newValue){self.modified(true)}); //private boolean releases = true; this.releases=ko.observable(releases); + this.releases.subscribe(function(newValue){self.modified(true)}); //private boolean blockRedeployments = false; this.blockRedeployments=ko.observable(blockRedeployments); + this.blockRedeployments.subscribe(function(newValue){self.modified(true)}); + - var self=this; this.getTypeLabel=function(){ for(i=0;i0; + } + + getModifiedManagedRepositories=function(){ + var prx = $.grep(self.managedRepositories(), + function (managedRepository,i) { + return managedRepository.modified(); + }); + return prx; + } + updateModifiedManagedRepositories=function(){ + var repos = getModifiedManagedRepositories(); + for (i=0;i + diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html index c7f5b3fe0..38a2fce9b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html @@ -40,6 +40,7 @@
+
Policies
@@ -87,13 +88,14 @@ + {{each(i, row) itemsOnCurrentPage()}} - + {{each(j, columnDefinition) columns}} {{/each}} @@ -123,6 +125,13 @@ + {{if row.modified()}} + + {{else}} + + {{/if}}
Scan ${$.i18n.prop('edit')} ${$.i18n.prop('delete')}${$.i18n.prop('modified')} ${$.i18n.prop('managedrepository.pomsnippet')} Stats
${ typeof columnDefinition.rowText == 'function' ? columnDefinition.rowText(row) : row[columnDefinition.rowText] } + ${$.i18n.prop('save')} + ${$.i18n.prop('managedrepository.pomsnippet')} ${$.i18n.prop('remoterepository.scan.full')}: + + + \ No newline at end of file