com.flexive.shared.structure
Class FxPropertyEdit

java.lang.Object
  extended by com.flexive.shared.structure.FxStructureElement
      extended by com.flexive.shared.structure.FxProperty
          extended by com.flexive.shared.structure.FxPropertyEdit
All Implemented Interfaces:
SelectableObject, SelectableObjectWithName, java.io.Serializable

public class FxPropertyEdit
extends FxProperty

FxProperty used for structure editing

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.flexive.shared.structure.FxProperty
ACL, dataType, defaultValue, fulltextIndexed, overrideACL, referencedList, referencedType, systemInternal, uniqueMode
 
Fields inherited from class com.flexive.shared.structure.FxStructureElement
hint, label, multiplicity, name, options, overrideMultiplicity, referenced
 
Constructor Summary
FxPropertyEdit(FxProperty prop)
          Make an editable instance of an existing property
 
Method Summary
 void checkConsistency()
          Perform some consistency checks, called internally!
 void clearDefaultValue()
          Clear the default value
 void clearOption(java.lang.String key)
          Clear an option entry
static FxPropertyEdit createNew(FxProperty base, java.lang.String newName)
          Create a clone of an existing property with a new name
static FxPropertyEdit createNew(FxProperty base, java.lang.String newName, boolean autoUniquePropertyName)
          Create a clone of an existing property with a new name
static FxPropertyEdit createNew(java.lang.String name, FxString description, FxString hint, boolean overrideBaseMultiplicity, FxMultiplicity multiplicity, boolean overrideACL, ACL acl, FxDataType dataType, FxString defaultValue, boolean fulltextIndexed, FxType referencedType, FxSelectList referencedList, java.util.List<FxStructureOption> options)
          Create a new FxPropertyEdit instance
static FxPropertyEdit createNew(java.lang.String name, FxString description, FxString hint, FxMultiplicity multiplicity, ACL acl, FxDataType dataType)
          Create a new FxPropertyEdit instance - simplified with many defaults (everything set to true except useHTMLEditor)
 int getAssignmentDefaultMultiplicity()
          Get the created assignments default multiplicity
 boolean isAutoUniquePropertyName()
          If creating a new property and the property name (not assignment! xalias will remain!) is taken probe for and use a unique property name?
 boolean isNew()
          Is this a new property
 FxPropertyEdit setACL(ACL acl)
          Set the ACL
 FxPropertyEdit setAssignmentDefaultMultiplicity(int defaultMultiplicity)
          This value set will only be used when creating a new property and will be set for the created assignment! Set the default multiplicity (used i.e.
 FxPropertyEdit setAutoUniquePropertyName(boolean autoUniquePropertyName)
          If creating a new property and the property name (not assignment! xalias will remain!) is taken probe for and use a unique property name?
 FxPropertyEdit setDataType(FxDataType dataType)
          Set the data type
 FxPropertyEdit setDefaultValue(FxValue value)
          Set the default value for this propery
 FxPropertyEdit setFulltextIndexed(boolean fulltextIndexed)
          Set if values of this property should be fulltext indexed?
 FxPropertyEdit setHint(FxString hint)
          Set the hint message
 FxPropertyEdit setInOverview(boolean inOverview)
          Set overview appearance setting
 FxPropertyEdit setLabel(FxString label)
          Set the label
 FxPropertyEdit setMaxLength(int maxLength)
          Shortcut to set the maximum input length (if applicable to the component)
 FxPropertyEdit setMultiLang(boolean multiLang)
          Set multilinguality
 FxPropertyEdit setMultiLine(boolean multiLine)
          Set multiline display ability
 FxPropertyEdit setMultiplicity(FxMultiplicity multiplicity)
          Set the multiplicity
 FxPropertyEdit setName(java.lang.String name)
          Set the properties name (has to be unique!)
 FxPropertyEdit setOption(java.lang.String key, boolean overrideable, boolean value)
          Set a boolean option
 FxPropertyEdit setOption(java.lang.String key, boolean overrideable, java.lang.String value)
          Set an option
 FxPropertyEdit setOptionOverrideable(java.lang.String key, boolean overrideable)
          Change the overrideable status of an option, will only have effect if the option exists!
 void setOptions(java.util.List<FxStructureOption> options)
          Assign options
 FxPropertyEdit setOverrideACL(boolean overrideACL)
          Set if assignments of this propery are allowed to override this properties ACL?
 FxPropertyEdit setOverrideHTMLEditor(boolean overrideHTMLEditor)
          Set if assignments are allowed to override this properties use of HTML editor setting?
 FxPropertyEdit setOverrideMaxLength(boolean overrideMaxLEngth)
          Set if assignments are allowed to override this properties maxLength setting?
 FxPropertyEdit setOverrideMultiLang(boolean overrideMultiLang)
          Set if assignments are allowed to override this properties multilanguage setting?
 FxPropertyEdit setOverrideMultiLine(boolean overrideMultiLine)
          Set if assignments are allowed to override this properties multiline setting?
 FxPropertyEdit setOverrideMultiplicity(boolean overrideMultiplicity)
          Set if assignments are allowed to override this properties multiplicity?
 FxPropertyEdit setOverrideOverview(boolean overrideOverview)
          Set if assignments are allowed to override this properties appearance in overviews?
 FxPropertyEdit setOverrideSearchable(boolean overrideSearchable)
          Set if assignments are allowed to override this properties multilanguage setting?
 FxPropertyEdit setReferencedList(FxSelectList referencedList)
          If this propery is a (multi) select list, set the referenced list
 FxPropertyEdit setReferencedType(FxType referencedType)
          If this propery is a reference to a FxType, set the referenced type
 FxPropertyEdit setSearchable(boolean searchable)
          Set if this property be used in the visual query editor (UI hint)
 FxPropertyEdit setUniqueMode(UniqueMode uniqueMode)
          Set the uniqueness mode of this property
 FxPropertyEdit setUseHTMLEditor(boolean useHTMLEditor)
          Set if to use an HTML editor to edit values of this property?
 
Methods inherited from class com.flexive.shared.structure.FxProperty
asEditable, equals, getACL, getDataType, getDefaultValue, getEmptyValue, getEmptyValue, getEmptyValue, getMaxLength, getMultiLines, getReferencedList, getReferencedType, getUniqueMode, hashCode, hasMaxLength, hasReferencedList, hasReferencedType, isDefaultValueSet, isFulltextIndexed, isInOverview, isMultiLang, isMultiLine, isSearchable, isSystemInternal, isUseHTMLEditor, mayOverrideACL, mayOverrideInOverview, mayOverrideMaxLength, mayOverrideMultiLang, mayOverrideMultiLine, mayOverrideSearchable, mayOverrideUseHTMLEditor, resolveReferencedType, updateEnvironmentData
 
Methods inherited from class com.flexive.shared.structure.FxStructureElement
getHint, getId, getLabel, getMultiplicity, getName, getOption, getOptions, hasOption, isReferenced, mayOverrideBaseMultiplicity, setReferenced
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxPropertyEdit

public FxPropertyEdit(FxProperty prop)
Make an editable instance of an existing property

Parameters:
prop - original property
Method Detail

createNew

public static FxPropertyEdit createNew(FxProperty base,
                                       java.lang.String newName,
                                       boolean autoUniquePropertyName)
                                throws FxInvalidParameterException
Create a clone of an existing property with a new name

Parameters:
base - property to clone
newName - new name to assign
autoUniquePropertyName - if the property name already exists, try to find a unique one (by appending "_([counter])"). Useful if creating property assignments and the used property name is not important
Returns:
FxPropertyEdit
Throws:
FxInvalidParameterException - on errors

createNew

public static FxPropertyEdit createNew(FxProperty base,
                                       java.lang.String newName)
Create a clone of an existing property with a new name

Parameters:
base - property to clone
newName - new name to assign (has to be mandatorwide unique!)
Returns:
FxPropertyEdit

createNew

public static FxPropertyEdit createNew(java.lang.String name,
                                       FxString description,
                                       FxString hint,
                                       boolean overrideBaseMultiplicity,
                                       FxMultiplicity multiplicity,
                                       boolean overrideACL,
                                       ACL acl,
                                       FxDataType dataType,
                                       FxString defaultValue,
                                       boolean fulltextIndexed,
                                       FxType referencedType,
                                       FxSelectList referencedList,
                                       java.util.List<FxStructureOption> options)
Create a new FxPropertyEdit instance

Parameters:
name - (mandator wide unique) name of the property
description - description
hint - hint message
overrideBaseMultiplicity - are assignments allowed to override this properties multiplicity?
multiplicity - multiplicity
overrideACL - are assignments allowed to override this properties ACL?
acl - ACL
dataType - FxDataType
defaultValue - default value to assign
fulltextIndexed - should values of this property be fulltext indexed?
referencedType - if dataType is reference this is the referenced type
referencedList - if dataType is (multi) select list this is the referenced list
options - this properties options
Returns:
FxPropertyEdit instance

createNew

public static FxPropertyEdit createNew(java.lang.String name,
                                       FxString description,
                                       FxString hint,
                                       FxMultiplicity multiplicity,
                                       ACL acl,
                                       FxDataType dataType)
Create a new FxPropertyEdit instance - simplified with many defaults (everything set to true except useHTMLEditor)

Parameters:
name - (mandator wide unique) name of the property
description - description
hint - hint message
multiplicity - multiplicity
acl - ACL
dataType - FxDataType
Returns:
FxPropertyEdit instance

isNew

public boolean isNew()
Is this a new property

Returns:
if this is a new property

isAutoUniquePropertyName

public boolean isAutoUniquePropertyName()
If creating a new property and the property name (not assignment! xalias will remain!) is taken probe for and use a unique property name?

Returns:
probe for unique property name if a property with the requested xalias already exist?

setAutoUniquePropertyName

public FxPropertyEdit setAutoUniquePropertyName(boolean autoUniquePropertyName)
If creating a new property and the property name (not assignment! xalias will remain!) is taken probe for and use a unique property name?

Parameters:
autoUniquePropertyName - probe for a unique propery name if a property with the requested xalias already exist?
Returns:
the property itself, useful for chained calls

setName

public FxPropertyEdit setName(java.lang.String name)
Set the properties name (has to be unique!)

Parameters:
name - (unique) name of the property
Returns:
the property itself, useful for chained calls
Throws:
FxRuntimeException - if the name is empty (uniqueness will be checked during save operation)

setLabel

public FxPropertyEdit setLabel(FxString label)
Set the label

Parameters:
label - the label
Returns:
the property itself, useful for chained calls

setHint

public FxPropertyEdit setHint(FxString hint)
Set the hint message

Parameters:
hint - hint message
Returns:
the property itself, useful for chained calls

setMultiplicity

public FxPropertyEdit setMultiplicity(FxMultiplicity multiplicity)
Set the multiplicity

Parameters:
multiplicity - multiplicity
Returns:
the property itself, useful for chained calls

setOverrideMultiplicity

public FxPropertyEdit setOverrideMultiplicity(boolean overrideMultiplicity)
Set if assignments are allowed to override this properties multiplicity?

Parameters:
overrideMultiplicity - are assignments allowed to override this properties multiplicity?
Returns:
the property itself, useful for chained calls

setACL

public FxPropertyEdit setACL(ACL acl)
Set the ACL

Parameters:
acl - ACL
Returns:
the property itself, useful for chained calls

setOverrideACL

public FxPropertyEdit setOverrideACL(boolean overrideACL)
Set if assignments of this propery are allowed to override this properties ACL?

Parameters:
overrideACL - are assignments allowed to override this properties ACL?
Returns:
the property itself, useful for chained calls

setDataType

public FxPropertyEdit setDataType(FxDataType dataType)
Set the data type

Parameters:
dataType - data type
Returns:
the property itself, useful for chained calls

setMultiLang

public FxPropertyEdit setMultiLang(boolean multiLang)
Set multilinguality

Parameters:
multiLang - are values of this property multilingual?
Returns:
the property itself, useful for chained calls

setOverrideMultiLang

public FxPropertyEdit setOverrideMultiLang(boolean overrideMultiLang)
Set if assignments are allowed to override this properties multilanguage setting?

Parameters:
overrideMultiLang - are assignments allowed to override this properties multilanguage setting?
Returns:
the property itself, useful for chained calls

setMultiLine

public FxPropertyEdit setMultiLine(boolean multiLine)
Set multiline display ability

Parameters:
multiLine - render property in multiple lines?
Returns:
the property itself, useful for chained calls

setOverrideMultiLine

public FxPropertyEdit setOverrideMultiLine(boolean overrideMultiLine)
Set if assignments are allowed to override this properties multiline setting?

Parameters:
overrideMultiLine - are assignments allowed to override this properties multiline setting?
Returns:
the property itself, useful for chained calls

setMaxLength

public FxPropertyEdit setMaxLength(int maxLength)
                            throws FxInvalidParameterException
Shortcut to set the maximum input length (if applicable to the component)

Parameters:
maxLength - desired maximum input length
Returns:
the property itself, useful for chained calls
Throws:
FxInvalidParameterException - on errors

setOverrideMaxLength

public FxPropertyEdit setOverrideMaxLength(boolean overrideMaxLEngth)
Set if assignments are allowed to override this properties maxLength setting?

Parameters:
overrideMaxLEngth - are assignments allowed to override this properties maxLength setting?
Returns:
the property itself, useful for chained calls

setSearchable

public FxPropertyEdit setSearchable(boolean searchable)
Set if this property be used in the visual query editor (UI hint)

Parameters:
searchable - property can be used in the visual query editor
Returns:
the property itself, useful for chained calls

setOverrideSearchable

public FxPropertyEdit setOverrideSearchable(boolean overrideSearchable)
Set if assignments are allowed to override this properties multilanguage setting?

Parameters:
overrideSearchable - are assignments allowed to override this properties multilanguage setting?
Returns:
the property itself, useful for chained calls

setInOverview

public FxPropertyEdit setInOverview(boolean inOverview)
Set overview appearance setting

Parameters:
inOverview - overview appearance setting
Returns:
the property itself, useful for chained calls

setOverrideOverview

public FxPropertyEdit setOverrideOverview(boolean overrideOverview)
Set if assignments are allowed to override this properties appearance in overviews?

Parameters:
overrideOverview - are assignments allowed to override this properties appearance in overviews?
Returns:
the property itself, useful for chained calls

setUseHTMLEditor

public FxPropertyEdit setUseHTMLEditor(boolean useHTMLEditor)
Set if to use an HTML editor to edit values of this property?

Parameters:
useHTMLEditor - use HTML editor to edit values of this property?
Returns:
the property itself, useful for chained calls

setOverrideHTMLEditor

public FxPropertyEdit setOverrideHTMLEditor(boolean overrideHTMLEditor)
Set if assignments are allowed to override this properties use of HTML editor setting?

Parameters:
overrideHTMLEditor - are assignments allowed to override this properties use of HTML editor setting?
Returns:
the property itself, useful for chained calls

setOption

public FxPropertyEdit setOption(java.lang.String key,
                                boolean overrideable,
                                java.lang.String value)
Set an option

Parameters:
key - option key
overrideable - is the option overrideable from assignments?
value - value of the option
Returns:
the property itself, useful for chained calls

setOption

public FxPropertyEdit setOption(java.lang.String key,
                                boolean overrideable,
                                boolean value)
Set a boolean option

Parameters:
key - option key
overrideable - is the option overrideable from assignments?
value - value of the option
Returns:
the property itself, useful for chained calls

setOptionOverrideable

public FxPropertyEdit setOptionOverrideable(java.lang.String key,
                                            boolean overrideable)
Change the overrideable status of an option, will only have effect if the option exists!

Parameters:
key - option key
overrideable - overrideable status
Returns:
the property itself, useful for chained calls

clearOption

public void clearOption(java.lang.String key)
Clear an option entry

Parameters:
key - option name

setFulltextIndexed

public FxPropertyEdit setFulltextIndexed(boolean fulltextIndexed)
Set if values of this property should be fulltext indexed?

Parameters:
fulltextIndexed - should values of this property be fulltext indexed?
Returns:
the property itself, useful for chained calls

setUniqueMode

public FxPropertyEdit setUniqueMode(UniqueMode uniqueMode)
Set the uniqueness mode of this property

Parameters:
uniqueMode - uniqueness mode
Returns:
the property itself, useful for chained calls

setReferencedType

public FxPropertyEdit setReferencedType(FxType referencedType)
If this propery is a reference to a FxType, set the referenced type

Parameters:
referencedType - if dataType is reference this is the referenced type
Returns:
the property itself, useful for chained calls

setReferencedList

public FxPropertyEdit setReferencedList(FxSelectList referencedList)
If this propery is a (multi) select list, set the referenced list

Parameters:
referencedList - if dataType is a (multi) select list, set the referenced list
Returns:
the property itself, useful for chained calls

setDefaultValue

public FxPropertyEdit setDefaultValue(FxValue value)
Set the default value for this propery

Parameters:
value - default value
Returns:
the property itself, useful for chained calls

checkConsistency

public void checkConsistency()
Perform some consistency checks, called internally!


setAssignmentDefaultMultiplicity

public FxPropertyEdit setAssignmentDefaultMultiplicity(int defaultMultiplicity)
This value set will only be used when creating a new property and will be set for the created assignment! Set the default multiplicity (used i.e. in user interfaces editors and determines the amount of values that will be initialized when creating an empty element).

If the set value is < min or > max multiplicity of this assignment it will be auto adjusted to the next valid value without throwing an exception

Parameters:
defaultMultiplicity - the default multiplicity
Returns:
this

getAssignmentDefaultMultiplicity

public int getAssignmentDefaultMultiplicity()
Get the created assignments default multiplicity

Returns:
default multiplicity

setOptions

public void setOptions(java.util.List<FxStructureOption> options)
Assign options

Parameters:
options - options to assign

clearDefaultValue

public void clearDefaultValue()
Clear the default value