From b77cbc5ee28fd4ac370c4ff8ced0bd6403dd98af Mon Sep 17 00:00:00 2001 From: Andrew Hind Date: Thu, 4 Mar 2010 15:05:45 +0000 Subject: [PATCH] Fix for ALF-1578: Custom property data fields not searchable due to lucene DEFAULT.ftsIndexerJobDetail exception - corrected default behaviour in the M2 model by moving from the JibXed classes (we tend not to define default values in the m2 binding) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19070 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/dictionary/M2Property.java | 20 +++++------ .../repo/dictionary/M2PropertyDefinition.java | 36 ++++++++++++++++--- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/source/java/org/alfresco/repo/dictionary/M2Property.java b/source/java/org/alfresco/repo/dictionary/M2Property.java index 0c88f7cf09..1f46ad1c19 100644 --- a/source/java/org/alfresco/repo/dictionary/M2Property.java +++ b/source/java/org/alfresco/repo/dictionary/M2Property.java @@ -41,10 +41,10 @@ public class M2Property private boolean isMandatoryEnforced = false; private boolean isMultiValued = false; private String defaultValue = null; - private boolean isIndexed = true; - private boolean isIndexedAtomically = true; - private boolean isStoredInIndex = false; - private IndexTokenisationMode indexTokenisationMode = IndexTokenisationMode.TRUE; + private Boolean isIndexed = null; + private Boolean isIndexedAtomically = null; + private Boolean isStoredInIndex = null; + private IndexTokenisationMode indexTokenisationMode = null; private List constraints = new ArrayList(); /*package*/ M2Property() @@ -171,7 +171,7 @@ public class M2Property } - public boolean isIndexed() + public Boolean isIndexed() { return isIndexed; } @@ -179,11 +179,11 @@ public class M2Property public void setIndexed(boolean isIndexed) { - this.isIndexed = isIndexed; + this.isIndexed = Boolean.valueOf(isIndexed); } - public boolean isStoredInIndex() + public Boolean isStoredInIndex() { return isStoredInIndex; } @@ -191,11 +191,11 @@ public class M2Property public void setStoredInIndex(boolean isStoredInIndex) { - this.isStoredInIndex = isStoredInIndex; + this.isStoredInIndex = Boolean.valueOf(isStoredInIndex); } - public boolean isIndexedAtomically() + public Boolean isIndexedAtomically() { return isIndexedAtomically; } @@ -203,7 +203,7 @@ public class M2Property public void setIndexedAtomically(boolean isIndexedAtomically) { - this.isIndexedAtomically = isIndexedAtomically; + this.isIndexedAtomically = Boolean.valueOf(isIndexedAtomically); } diff --git a/source/java/org/alfresco/repo/dictionary/M2PropertyDefinition.java b/source/java/org/alfresco/repo/dictionary/M2PropertyDefinition.java index 7ff9072922..9478264aa1 100644 --- a/source/java/org/alfresco/repo/dictionary/M2PropertyDefinition.java +++ b/source/java/org/alfresco/repo/dictionary/M2PropertyDefinition.java @@ -356,7 +356,14 @@ import org.alfresco.util.EqualsHelper; */ public boolean isIndexed() { - return m2Property.isIndexed(); + if(m2Property.isIndexed() == null) + { + return true; + } + else + { + return m2Property.isIndexed(); + } } @@ -365,7 +372,14 @@ import org.alfresco.util.EqualsHelper; */ public boolean isStoredInIndex() { - return m2Property.isStoredInIndex(); + if(m2Property.isStoredInIndex() == null) + { + return false; + } + else + { + return m2Property.isStoredInIndex(); + } } @@ -374,7 +388,14 @@ import org.alfresco.util.EqualsHelper; */ public boolean isIndexedAtomically() { - return m2Property.isIndexedAtomically(); + if(m2Property.isIndexedAtomically() == null) + { + return true; + } + else + { + return m2Property.isIndexedAtomically(); + } } @@ -383,7 +404,14 @@ import org.alfresco.util.EqualsHelper; */ public IndexTokenisationMode getIndexTokenisationMode() { - return m2Property.getIndexTokenisationMode(); + if(m2Property.getIndexTokenisationMode() == null) + { + return IndexTokenisationMode.TRUE; + } + else + { + return m2Property.getIndexTokenisationMode(); + } }