* default model value is empty so none
* @since 2.0.0
*/
- private String mergedIndexCronExpression;
+ private String cronExpression;
public RepositoryGroup()
{
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 )
{
- this.mergedIndexCronExpression = mergedIndexCronExpression;
+ this.cronExpression = mergedIndexCronExpression;
return this;
}
sb.append( ", repositories=" ).append( repositories );
sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
sb.append( ", mergedIndexTtl=" ).append( mergedIndexTtl );
- sb.append( ", mergedIndexCronExpression='" ).append( mergedIndexCronExpression ).append( '\'' );
+ sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
sb.append( '}' );
return sb.toString();
}
,"knockout.simpleGrid","knockout.sortable","archiva/admin/repository/maven2/repositories"],
function(jquery,jqueryUi,i18n,jqueryTmpl,bootstrap,jqueryValidate,ko) {
- RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl){
+ RepositoryGroup=function(id,repositories,mergedIndexPath,mergedIndexTtl,cronExpression){
var self=this;
this.managedRepositories=ko.observableArray([]);
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);
}
var userMessages=$("#user-messages");
userMessages.html(mediumSpinnerImg());
var valid = $("#main-content").find("#repository-group-edit-form" ).valid();
-
+ if (valid==false) {
+ return;
+ }
$("#repository-group-save" ).button('loading');
$.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup",
rules: {
id: {
required: true
- },
+ },
mergedIndexPath:{
required:true
+ },
+ cronExpression: {
+ remote: {
+ url: "restServices/archivaServices/commonServices/validateCronExpression",
+ type: "get"
}
+ }
},
showErrors: function(validator, errorMap, errorList) {
customShowError("#main-content #repository-group-edit-form",validator,errorMap,errorMap);
}
});
+ validator.settings.messages["cronExpression"]=$.i18n.prop("cronExpression.notvalid");
return validator;
}
}
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);
}
});
data-bind="value: repositoryGroup.mergedIndexTtl"/>
</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>
<a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
{{if repositoryGroup.id()}}