mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +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:
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.alfresco.util.schemacomp;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,6 +44,13 @@ public final class Difference extends Result
|
||||
public Difference(Where where, DbProperty left, DbProperty right, Strength strength)
|
||||
{
|
||||
super(null);
|
||||
|
||||
// Sanity check parameters
|
||||
if (left == null && right == null)
|
||||
{
|
||||
throw new IllegalArgumentException("DbProperty parameters cannot BOTH be null.");
|
||||
}
|
||||
|
||||
this.where = where;
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
@@ -75,37 +84,30 @@ public final class Difference extends Result
|
||||
@Override
|
||||
public String describe()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("Difference: ")
|
||||
.append(getWhere());
|
||||
|
||||
sb.append(" reference path:");
|
||||
if (getLeft() != null)
|
||||
if (getLeft() == null)
|
||||
{
|
||||
sb.append(getLeft().getPath());
|
||||
sb.append(" (value: ")
|
||||
.append(getLeft().getPropertyValue())
|
||||
.append(")");
|
||||
return I18NUtil.getMessage(
|
||||
"system.schema_comp.diff.target_only",
|
||||
getWhere(),
|
||||
getRight().getPath(),
|
||||
getRight().getPropertyValue());
|
||||
}
|
||||
else
|
||||
if (getRight() == null)
|
||||
{
|
||||
sb.append("null");
|
||||
return I18NUtil.getMessage(
|
||||
"system.schema_comp.diff.ref_only",
|
||||
getWhere(),
|
||||
getLeft().getPath(),
|
||||
getLeft().getPropertyValue());
|
||||
}
|
||||
|
||||
sb.append(" target path:");
|
||||
if (getRight() != null)
|
||||
{
|
||||
sb.append(getRight().getPath());
|
||||
sb.append(" (value: ")
|
||||
.append(getRight().getPropertyValue())
|
||||
.append(")");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append("null");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
return I18NUtil.getMessage(
|
||||
"system.schema_comp.diff",
|
||||
getWhere(),
|
||||
getLeft().getPath(),
|
||||
getLeft().getPropertyValue(),
|
||||
getRight().getPath(),
|
||||
getRight().getPropertyValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user