com.flexive.shared.structure
Class FxGroupAssignmentEdit

java.lang.Object
  extended by com.flexive.shared.structure.FxAssignment
      extended by com.flexive.shared.structure.FxGroupAssignment
          extended by com.flexive.shared.structure.FxGroupAssignmentEdit
All Implemented Interfaces:
ObjectWithLabel, SelectableObject, SelectableObjectWithLabel, java.io.Serializable, java.lang.Comparable<FxAssignment>

public class FxGroupAssignmentEdit
extends FxGroupAssignment

FxGroupAssignment for 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.FxGroupAssignment
group, mode
 
Fields inherited from class com.flexive.shared.structure.FxAssignment
alias, baseAssignment, defaultMultCalc, defaultMultiplicity, enabled, hint, label, multiplicity, NO_BASE, NO_PARENT, options, parentGroupAssignment, position, POSITION_BOTTOM, ROOT_BASE, scriptMapping, TYPE_GROUP, TYPE_PROPERTY, XPath
 
Constructor Summary
FxGroupAssignmentEdit(FxGroupAssignment ga)
          Ctor to make a FxGroupAssignment editable
 
Method Summary
 void clearDerivedUse()
          Remove any references of derived usage
 void clearOption(java.lang.String key)
          Clear an option entry
static FxGroupAssignmentEdit createNew(FxGroupAssignment ga, FxType type, java.lang.String alias, java.lang.String parentXPath)
          Create a new FxGroupAssignmentEdit from an existing FxGroupAssignment as a new one for a given type with a new alias and a given parentXPath
static FxGroupAssignmentEdit createNew(FxGroupAssignment ga, FxType type, java.lang.String alias, java.lang.String parentXPath, FxAssignment parent)
          Create a new FxGroupAssignmentEdit from an existing FxGroupAssignment as a new one for a given type with a new alias and a given parentXPath
 FxGroupEdit getGroupEdit()
          Returns the group of this assignment as editable.
 boolean isNew()
          Is this a new instance?
 FxGroupAssignmentEdit setAlias(java.lang.String alias)
          Set a new alias, will affect the xpath as well
 FxGroupAssignmentEdit setDefaultMultiplicity(int defaultMultiplicity)
          Set the default multiplicity (the number of elements created upon initialization)
 FxGroupAssignmentEdit setEnabled(boolean enabled)
          Set the enabled flag
 FxGroupAssignmentEdit setHint(FxString hint)
          Set the hint message
 FxGroupAssignmentEdit setLabel(FxString label)
          Set the label
 FxGroupAssignmentEdit setMode(GroupMode mode)
          Set the GroupMode for this group assignment (any-of, one-of)
 FxGroupAssignmentEdit setMultiplicity(FxMultiplicity multiplicity)
          Set the multiplicity of this assignment.
 FxGroupAssignmentEdit setOption(java.lang.String key, boolean value)
          Set a boolean option with defaults of overridable & isInherited == true
 FxGroupAssignmentEdit setOption(java.lang.String key, boolean overridable, boolean isInherited, boolean value)
          Set a boolean option
 FxGroupAssignmentEdit setOption(java.lang.String key, boolean overridable, boolean isInherited, java.lang.String value)
          Set an option
 FxGroupAssignmentEdit setOption(java.lang.String key, java.lang.String value)
          Set an option with defaults of overridable & isInherited == true
 void setOptions(java.util.List<FxStructureOption> options)
          Assign options
 void setParentGroupAssignment(FxGroupAssignment parent)
          Sets the parent group assignment.
 FxGroupAssignmentEdit setPosition(int position)
          Set the new absolute position
 FxGroupAssignmentEdit setXPath(java.lang.String XPath)
          Set the XPath, will affect the alias as well
 
Methods inherited from class com.flexive.shared.structure.FxGroupAssignment
addAssignment, asEditable, createEmptyData, createEmptyData, createRandomData, getAllChildAssignments, getAllProperties, getAssignedGroups, getAssignedProperties, getAssignment, getAssignments, getDerivedAssignments, getGroup, getMode, getMultiplicity, getOption, hasMandatorySubAssignments, save
 
Methods inherited from class com.flexive.shared.structure.FxAssignment
_setSystemInternal, compareTo, createEmptyData, equals, getAlias, getAssignedType, getAssignedTypeId, getBaseAssignmentId, getDefaultMultiplicity, getDepth, getDisplayLabel, getDisplayName, getDisplayName, getHint, getId, getLabel, getOptions, getParentGroupAssignment, getPosition, getScriptMapping, getXPath, hashCode, hasOption, hasParentGroupAssignment, hasScriptMapping, hasScriptMappings, isDerivedAssignment, isDerivedFrom, isEnabled, isSystemInternal, isValid, resolveDependencies, resolveReferences, sort, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FxGroupAssignmentEdit

public FxGroupAssignmentEdit(FxGroupAssignment ga)
Ctor to make a FxGroupAssignment editable

Parameters:
ga - FxGroupAssignment to make editable
Method Detail

isNew

public boolean isNew()
Is this a new instance?

Returns:
new instance?

setEnabled

public FxGroupAssignmentEdit setEnabled(boolean enabled)
Set the enabled flag

Parameters:
enabled - enabled flag
Returns:
this

setMultiplicity

public FxGroupAssignmentEdit setMultiplicity(FxMultiplicity multiplicity)
                                      throws FxInvalidParameterException
Set the multiplicity of this assignment. May only be set if the group this assignment belongs to allows overriding the multiplicity.

Parameters:
multiplicity - new multiplicity
Returns:
this
Throws:
FxInvalidParameterException - on errors

setDefaultMultiplicity

public FxGroupAssignmentEdit setDefaultMultiplicity(int defaultMultiplicity)
Set the default multiplicity (the number of elements created upon initialization)

Parameters:
defaultMultiplicity - the default multiplicity
Returns:
this

setPosition

public FxGroupAssignmentEdit setPosition(int position)
Set the new absolute position

Parameters:
position - new absolute position
Returns:
this

setAlias

public FxGroupAssignmentEdit setAlias(java.lang.String alias)
                               throws FxInvalidParameterException
Set a new alias, will affect the xpath as well

Parameters:
alias - new alias
Returns:
this
Throws:
FxInvalidParameterException - on errors

setXPath

public FxGroupAssignmentEdit setXPath(java.lang.String XPath)
                               throws FxInvalidParameterException
Set the XPath, will affect the alias as well

Parameters:
XPath - new XPath
Returns:
this
Throws:
FxInvalidParameterException - on errors

setLabel

public FxGroupAssignmentEdit setLabel(FxString label)
Set the label

Parameters:
label - label
Returns:
this

setHint

public FxGroupAssignmentEdit setHint(FxString hint)
Set the hint message

Parameters:
hint - hint message
Returns:
this

setMode

public FxGroupAssignmentEdit setMode(GroupMode mode)
Set the GroupMode for this group assignment (any-of, one-of)

Parameters:
mode - group mode
Returns:
this

createNew

public static FxGroupAssignmentEdit createNew(FxGroupAssignment ga,
                                              FxType type,
                                              java.lang.String alias,
                                              java.lang.String parentXPath,
                                              FxAssignment parent)
                                       throws FxNotFoundException,
                                              FxInvalidParameterException
Create a new FxGroupAssignmentEdit from an existing FxGroupAssignment as a new one for a given type with a new alias and a given parentXPath

Parameters:
ga - original group assignment
type - type to assign it
alias - new alias
parentXPath - parent XPath within the type to assign
parent - optional parent assignment if already known
Returns:
new FxGroupAssignmentEdit
Throws:
FxNotFoundException - if parentXPath is invalid
FxInvalidParameterException - if parentXPath is invalid

createNew

public static FxGroupAssignmentEdit createNew(FxGroupAssignment ga,
                                              FxType type,
                                              java.lang.String alias,
                                              java.lang.String parentXPath)
                                       throws FxNotFoundException,
                                              FxInvalidParameterException
Create a new FxGroupAssignmentEdit from an existing FxGroupAssignment as a new one for a given type with a new alias and a given parentXPath

Parameters:
ga - original group assignment
type - type to assign it
alias - new alias
parentXPath - parent XPath within the type to assign
Returns:
new FxGroupAssignmentEdit
Throws:
FxNotFoundException - if parentXPath is invalid
FxInvalidParameterException - if parentXPath is invalid

setParentGroupAssignment

public void setParentGroupAssignment(FxGroupAssignment parent)
Sets the parent group assignment.

Parameters:
parent - the parent group assignment.

clearDerivedUse

public void clearDerivedUse()
Remove any references of derived usage


setOption

public FxGroupAssignmentEdit setOption(java.lang.String key,
                                       java.lang.String value)
                                throws FxInvalidParameterException
Set an option with defaults of overridable & isInherited == true

Parameters:
key - option key
value - value of the option
Returns:
the assignment itself, useful for chained calls
Throws:
FxInvalidParameterException - if the property does not allow overriding

setOption

public FxGroupAssignmentEdit setOption(java.lang.String key,
                                       boolean value)
                                throws FxInvalidParameterException
Set a boolean option with defaults of overridable & isInherited == true

Parameters:
key - option key
value - value of the option
Returns:
the assignment itself, useful for chained calls
Throws:
FxInvalidParameterException - if the property does not allow overriding

setOption

public FxGroupAssignmentEdit setOption(java.lang.String key,
                                       boolean overridable,
                                       boolean isInherited,
                                       java.lang.String value)
                                throws FxInvalidParameterException
Set an option

Parameters:
key - option key
overridable - flag to indicate that derived assignments may override this option
isInherited - flag to indicate that derived assignments inherit this option
value - value of the option
Returns:
the assignment itself, useful for chained calls
Throws:
FxInvalidParameterException - on errors
Since:
3.1.1

setOption

public FxGroupAssignmentEdit setOption(java.lang.String key,
                                       boolean overridable,
                                       boolean isInherited,
                                       boolean value)
                                throws FxInvalidParameterException
Set a boolean option

Parameters:
key - option key
overridable - flag to indicate that derived assignments may override this option
isInherited - flag to indicate that derived assignments inherit this option
value - value of the option
Returns:
the assignment itself, useful for chained calls
Throws:
FxInvalidParameterException - on errors
Since:
3.1.1

clearOption

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

Parameters:
key - option name

setOptions

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

Parameters:
options - options to assign

getGroupEdit

public FxGroupEdit getGroupEdit()
Returns the group of this assignment as editable.

Returns:
the editable group object.