AjaxButton validate = new AjaxButton("save", ruleForm) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
ArtifactNotificationRule rule = ArtifactNotificationRuleFormPopupPanel.this.getModelObject();
FollowedArtifact followedArtifact = rule.getFollowedArtifact();
if (StringUtils.hasText(rule.getRegex()) && rule.getType() != null) {
try {
if (artifactNotificationRuleService.isRuleValid(rule.getRegex())) {
ArtifactNotificationRule ruleDuplicate =
artifactNotificationRuleService.getByFollowedArtifactAndRegex(followedArtifact, rule.getRegex());
if (ruleDuplicate == null || rule.equals(ruleDuplicate)) {
artifactNotificationRuleService.update(rule);
getSession().success(getString("artifact.rules.edit.success"));
closePopup(target);