mirror of https://github.com/apache/archiva.git
configure cron expression to merge remote indexes tru the UI
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1551471 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f7cdee7b23
commit
dcd4afcdb8
|
@ -857,7 +857,7 @@
|
||||||
<description>The time to live of the merged index of the repository group.</description>
|
<description>The time to live of the merged index of the repository group.</description>
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>mergedIndexCronExpression</name>
|
<name>cronExpression</name>
|
||||||
<version>1.0.0+</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class RepositoryGroup
|
||||||
* default model value is empty so none
|
* default model value is empty so none
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
private String mergedIndexCronExpression;
|
private String cronExpression;
|
||||||
|
|
||||||
public RepositoryGroup()
|
public RepositoryGroup()
|
||||||
{
|
{
|
||||||
|
@ -166,19 +166,19 @@ public class RepositoryGroup
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMergedIndexCronExpression()
|
public String getCronExpression()
|
||||||
{
|
{
|
||||||
return mergedIndexCronExpression;
|
return cronExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMergedIndexCronExpression( String mergedIndexCronExpression )
|
public void setCronExpression( String cronExpression )
|
||||||
{
|
{
|
||||||
this.mergedIndexCronExpression = mergedIndexCronExpression;
|
this.cronExpression = cronExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RepositoryGroup mergedIndexCronExpression( String mergedIndexCronExpression )
|
public RepositoryGroup mergedIndexCronExpression( String mergedIndexCronExpression )
|
||||||
{
|
{
|
||||||
this.mergedIndexCronExpression = mergedIndexCronExpression;
|
this.cronExpression = mergedIndexCronExpression;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ public class RepositoryGroup
|
||||||
sb.append( ", repositories=" ).append( repositories );
|
sb.append( ", repositories=" ).append( repositories );
|
||||||
sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
|
sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
|
||||||
sb.append( ", mergedIndexTtl=" ).append( mergedIndexTtl );
|
sb.append( ", mergedIndexTtl=" ).append( mergedIndexTtl );
|
||||||
sb.append( ", mergedIndexCronExpression='" ).append( mergedIndexCronExpression ).append( '\'' );
|
sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
|
||||||
sb.append( '}' );
|
sb.append( '}' );
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,6 +314,7 @@ repository-groups.grid.tab.title=Repository Groups
|
||||||
repository.group.delete.confirm=Are you sure to delete Repository Group {0} ?
|
repository.group.delete.confirm=Are you sure to delete Repository Group {0} ?
|
||||||
repository.group.mergedIndexPath=Merged Index Path
|
repository.group.mergedIndexPath=Merged Index Path
|
||||||
repository.group.mergedIndexTtl=Merged Index Time to Live (in Minutes)
|
repository.group.mergedIndexTtl=Merged Index Time to Live (in Minutes)
|
||||||
|
repository.group.cronExpression=Cron expression to merge remote indexes
|
||||||
|
|
||||||
#roles
|
#roles
|
||||||
roles.bulk.save.confirm=Are you sure to update {0} Role(s)
|
roles.bulk.save.confirm=Are you sure to update {0} Role(s)
|
||||||
|
|
|
@ -20,7 +20,7 @@ define("archiva/admin/repository/maven2/repository-groups",["jquery","jquery.ui"
|
||||||
,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/repositories"],
|
,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/repositories"],
|
||||||
function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
||||||
|
|
||||||
RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl){
|
RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl,cronExpression){
|
||||||
|
|
||||||
var self=this;
|
var self=this;
|
||||||
|
|
||||||
|
@ -44,6 +44,9 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
||||||
this.managedRepositories=ko.observableArray([]);
|
this.managedRepositories=ko.observableArray([]);
|
||||||
this.managedRepositories.subscribe(function(newValue){self.modified(true)});
|
this.managedRepositories.subscribe(function(newValue){self.modified(true)});
|
||||||
|
|
||||||
|
this.cronExpression = ko.observable(cronExpression);
|
||||||
|
this.cronExpression.subscribe(function(newValue){self.modified(true)});
|
||||||
|
|
||||||
this.modified=ko.observable(false);
|
this.modified=ko.observable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +226,9 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
||||||
var userMessages=$("#user-messages");
|
var userMessages=$("#user-messages");
|
||||||
userMessages.html(mediumSpinnerImg());
|
userMessages.html(mediumSpinnerImg());
|
||||||
var valid = $("#main-content").find("#repository-group-edit-form" ).valid();
|
var valid = $("#main-content").find("#repository-group-edit-form" ).valid();
|
||||||
|
if (valid==false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$("#repository-group-save" ).button('loading');
|
$("#repository-group-save" ).button('loading');
|
||||||
$.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup",
|
$.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup",
|
||||||
|
@ -398,12 +403,19 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
||||||
},
|
},
|
||||||
mergedIndexPath:{
|
mergedIndexPath:{
|
||||||
required:true
|
required:true
|
||||||
|
},
|
||||||
|
cronExpression: {
|
||||||
|
remote: {
|
||||||
|
url: "restServices/archivaServices/commonServices/validateCronExpression",
|
||||||
|
type: "get"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showErrors: function(validator, errorMap, errorList) {
|
showErrors: function(validator, errorMap, errorList) {
|
||||||
customShowError("#main-content #repository-group-edit-form",validator,errorMap,errorMap);
|
customShowError("#main-content #repository-group-edit-form",validator,errorMap,errorMap);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid");
|
||||||
return validator;
|
return validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +430,8 @@ function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mapRepositoryGroup=function(data){
|
mapRepositoryGroup=function(data){
|
||||||
return new RepositoryGroup(data.id, mapStringArray(data.repositories),data.mergedIndexPath,data.mergedIndexTtl);
|
return new RepositoryGroup(data.id, mapStringArray(data.repositories),data.mergedIndexPath
|
||||||
|
,data.mergedIndexTtl,data.cronExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1449,6 +1449,13 @@
|
||||||
data-bind="value: repositoryGroup.mergedIndexTtl"/>
|
data-bind="value: repositoryGroup.mergedIndexTtl"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="cronExpression">${$.i18n.prop('repository.group.cronExpression')}</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="text" class="input-large" id="cronExpression" name="cronExpression"
|
||||||
|
data-bind="value: repositoryGroup.cronExpression"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
|
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
|
||||||
{{if repositoryGroup.id()}}
|
{{if repositoryGroup.id()}}
|
||||||
|
|
Loading…
Reference in New Issue