mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ALF-11591: Externalise diff/validation messages
system-messages.properties now contains log messages and diff/validation output messages. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32236 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,6 +27,7 @@ import org.alfresco.util.schemacomp.DiffContext;
|
||||
import org.alfresco.util.schemacomp.ValidationResult;
|
||||
import org.alfresco.util.schemacomp.model.DbObject;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Validates the name of a DbObject using a regular expression. A regular expression
|
||||
@@ -44,11 +45,11 @@ public class NameValidator implements DbValidator
|
||||
public void validate(DbObject reference, DbObject target, DiffContext ctx)
|
||||
{
|
||||
String name = target.getName();
|
||||
|
||||
ValidationResult result = new ValidationResult(new DbProperty(target, "name"));
|
||||
|
||||
|
||||
if (pattern != null && !pattern.matcher(name).matches())
|
||||
{
|
||||
String message = I18NUtil.getMessage("system.schema_comp.name_validator", pattern);
|
||||
ValidationResult result = new ValidationResult(new DbProperty(target, "name"), message);
|
||||
ctx.getComparisonResults().add(result);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user