|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flexive.shared.structure.FxAssignment
public abstract class FxAssignment
Base class for assignments of a group or property to a type or another group/property
| Field Summary | |
|---|---|
protected java.lang.String |
alias
(optional) alias, if not defined the name of the assigned element |
protected long |
baseAssignment
base assignment (if derived the parent, if not the root assignment, if its a root assignment FxAssignment.ROOT_BASE) |
protected int |
defaultMultCalc
|
protected int |
defaultMultiplicity
Default multiplicity, will be auto adjusted if < min or > max |
protected boolean |
enabled
Is this assignment enabled at all? Disabled assignments will only show up in the admin area for structure and will be hidden from all other areas |
protected FxString |
hint
(optional) hint |
protected FxString |
label
(optional) description |
protected FxMultiplicity |
multiplicity
Multiplicity of this assignment |
static long |
NO_BASE
constant if an assignment has no base assignment |
static long |
NO_PARENT
parent id value if an assignment has no parent |
(package private) java.util.List<FxStructureOption> |
options
|
protected FxGroupAssignment |
parentGroupAssignment
(optional) parent group |
protected int |
position
Position of this assignment within the same XPath hierarchy |
static int |
POSITION_BOTTOM
Position constant to assign if an assignment should be positioned at the bottom |
static long |
ROOT_BASE
base id value if an assignment belongs to the virtual root type |
protected java.util.Map<FxScriptEvent,long[]> |
scriptMapping
Script mapping, is resolved while loading the environment |
static int |
TYPE_GROUP
Constant to determine type of the assignment in database; group |
static int |
TYPE_PROPERTY
Constant to determine type of the assignment in database; property |
protected java.lang.String |
XPath
Absolute XPath without indices from the base FxType |
| Constructor Summary | |
|---|---|
protected |
FxAssignment(long assignmentId,
boolean enabled,
FxType assignedType,
java.lang.String alias,
java.lang.String xpath,
int position,
FxMultiplicity multiplicity,
int defaultMultiplicity,
FxGroupAssignment parentGroupAssignment,
long baseAssignment,
FxString label,
FxString hint,
java.util.List<FxStructureOption> options)
Constructor |
| Method Summary | |
|---|---|
FxAssignment |
_setSystemInternal()
Mark this assignment as system internal - this is a one-way INTERNAL function!!! |
int |
compareTo(FxAssignment o)
Compare function |
abstract FxData |
createEmptyData(FxGroupData parent,
int index)
Create an empty FxData entry for this assignment |
FxData |
createEmptyData(FxGroupData parent,
int index,
int position)
Create an empty FxData entry for this assignment |
abstract FxData |
createEmptyData(FxGroupData parent,
int index,
int position,
boolean onlySystemInternal)
Create an empty FxData entry for this assignment |
abstract FxData |
createRandomData(java.util.Random rnd,
FxEnvironment env,
FxGroupData parent,
int index,
int maxMultiplicity)
Create a random FxData entry for this assignment |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getAlias()
Get the alias of this assignment. |
FxType |
getAssignedType()
The FxType this assignment is associated with |
long |
getAssignedTypeId()
Return the associated FxType ID. |
long |
getBaseAssignmentId()
base assignment (if derived the parent, if not the root assignment, if its a root assignment FxAssignment.ROOT_BASE) |
int |
getDefaultMultiplicity()
Get the default multiplicity (used i.e. |
FxString |
getDisplayLabel()
Return a human-readable string to present this assignment to the user. |
java.lang.String |
getDisplayName()
Return a human-readable string to present this assignment to the user. |
java.lang.String |
getDisplayName(boolean includePath)
Return a human-readable string to present this assignment to the user. |
FxString |
getHint()
Get the optional hint |
long |
getId()
The internal id of this assignment as stored in the database |
FxString |
getLabel()
Get the assignment label |
abstract FxMultiplicity |
getMultiplicity()
Get the multiplicity of this assignment. |
FxStructureOption |
getOption(java.lang.String key)
Get an option entry for the given key, if the key is invalid or not found a FxStructureOption object
will be returned with set set to false, overridable set to false and value
set to an empty String. |
java.util.List<FxStructureOption> |
getOptions()
Get a (unmodifiable) list of all options set for this assignment |
FxGroupAssignment |
getParentGroupAssignment()
If this assignment is assigned to a group, the assignment of the parent group (in the context of the current type) |
int |
getPosition()
Get the position within the current XPath hierarchy |
long[] |
getScriptMapping(FxScriptEvent event)
Get the mapped script ids for the requested script type |
java.lang.String |
getXPath()
Get the XPath of this assignment without indices |
int |
hashCode()
|
boolean |
hasOption(java.lang.String key)
Check if an option is set for the requested key |
boolean |
hasParentGroupAssignment()
Returns true if this assignment is the child of another assignment or false if it is directly attached to a FxType |
boolean |
hasScriptMapping(FxScriptEvent event)
Does this assignment have mappings for the requested script event? |
boolean |
hasScriptMappings()
Does this assignment have mappings for any script type? |
boolean |
isDerivedAssignment()
Returns true if the assignment is derived from a supertype. |
boolean |
isDerivedFrom(FxEnvironment environment,
long assignmentId)
Returns true if this assignment is a (direct or indirect) descendant of the given assignment. |
boolean |
isEnabled()
Is this assignment enabled? |
boolean |
isSystemInternal()
Is this a system internal assignment? |
boolean |
isValid(java.lang.Object value)
Validate the given value for this assignment. |
void |
resolveDependencies(java.util.Map<java.lang.Long,FxGroupAssignment> groupAssignments)
Resolve preload dependencies after initial loading (improved version for large environments). |
void |
resolveParentDependencies(java.util.List<FxAssignment> assignments)
Deprecated. Use resolveDependencies(java.util.Map) |
void |
resolvePreloadDependencies(java.util.List<FxAssignment> assignments)
Deprecated. Use resolveDependencies(java.util.Map) |
void |
resolveReferences(FxEnvironment environment)
Resolve references after initial loading |
static java.util.List<FxAssignment> |
sort(java.util.List<FxAssignment> assignments)
Sort FxAssignments by their position |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long NO_PARENT
public static final long NO_BASE
public static final long ROOT_BASE
public static final int TYPE_GROUP
public static final int TYPE_PROPERTY
public static final int POSITION_BOTTOM
protected boolean enabled
protected FxMultiplicity multiplicity
protected int defaultMultiplicity
protected int position
protected java.lang.String XPath
protected java.lang.String alias
protected FxGroupAssignment parentGroupAssignment
protected long baseAssignment
protected FxString label
protected FxString hint
protected java.util.Map<FxScriptEvent,long[]> scriptMapping
java.util.List<FxStructureOption> options
protected int defaultMultCalc
| Constructor Detail |
|---|
protected FxAssignment(long assignmentId,
boolean enabled,
FxType assignedType,
java.lang.String alias,
java.lang.String xpath,
int position,
FxMultiplicity multiplicity,
int defaultMultiplicity,
FxGroupAssignment parentGroupAssignment,
long baseAssignment,
FxString label,
FxString hint,
java.util.List<FxStructureOption> options)
assignmentId - internal id of this assignmentenabled - is this assignment enabled?assignedType - the FxType this assignment belongs toalias - an optional alias, if null the original name will be usedxpath - absolute XPath without indices from the base FxTypeposition - position within the same XPath hierarchymultiplicity - multiplicitydefaultMultiplicity - default multiplicityparentGroupAssignment - (optional) parent FxGroupAssignment this assignment belongs tobaseAssignment - base assignment (if derived the parent, if not the root assignment, if its a root assignment FxAssignment.ROOT_BASE)label - (optional) labelhint - (optional) hintoptions - options| Method Detail |
|---|
public java.lang.String getAlias()
public long getId()
getId in interface SelectableObjectpublic boolean isEnabled()
public boolean hasParentGroupAssignment()
public FxGroupAssignment getParentGroupAssignment()
public long getBaseAssignmentId()
ROOT_BASEpublic boolean isDerivedAssignment()
public boolean isDerivedFrom(FxEnvironment environment,
long assignmentId)
environment - the current environmentassignmentId - the parent assignment ID to be checked
public FxType getAssignedType()
public long getAssignedTypeId()
public java.lang.String getXPath()
public abstract FxMultiplicity getMultiplicity()
public int getDefaultMultiplicity()
public int getPosition()
public FxString getLabel()
getLabel in interface ObjectWithLabelpublic java.lang.String getDisplayName()
public java.lang.String getDisplayName(boolean includePath)
includePath - if the path to the assignment (the parent groups) should be included
public FxString getDisplayLabel()
public FxString getHint()
public boolean hasOption(java.lang.String key)
key - option key
public FxStructureOption getOption(java.lang.String key)
FxStructureOption object
will be returned with set set to false, overridable set to false and value
set to an empty String.
key - option key
public java.util.List<FxStructureOption> getOptions()
public boolean hasScriptMapping(FxScriptEvent event)
event - requested script event
public boolean hasScriptMappings()
public long[] getScriptMapping(FxScriptEvent event)
event - requested script event
null if mappings do not exist for this assignment
public abstract FxData createEmptyData(FxGroupData parent,
int index)
parent - the parent groupindex - the index of the new entry
FxCreateException - on errors
public FxData createEmptyData(FxGroupData parent,
int index,
int position)
parent - the parent groupindex - the index of the new entryposition - the position to use (to avoid puting multiple elemtns of the same type on the same position)
FxCreateException - on errors
public abstract FxData createEmptyData(FxGroupData parent,
int index,
int position,
boolean onlySystemInternal)
parent - the parent groupindex - the index of the new entryposition - the position to use (to avoid puting multiple elemtns of the same type on the same position)onlySystemInternal - when true, only system-internal groups or properties are added
FxCreateException - on errors
public abstract FxData createRandomData(java.util.Random rnd,
FxEnvironment env,
FxGroupData parent,
int index,
int maxMultiplicity)
rnd - the Random to useenv - environmentparent - the parent groupindex - the index of the new entrymaxMultiplicity - the maximum multiplicity
FxCreateException - on errorspublic void resolvePreloadDependencies(java.util.List<FxAssignment> assignments)
resolveDependencies(java.util.Map)
assignments - all known assignmentpublic void resolveDependencies(java.util.Map<java.lang.Long,FxGroupAssignment> groupAssignments)
groupAssignments - all known group assignments
public void resolveReferences(FxEnvironment environment)
throws FxNotFoundException
environment - environment for references
FxNotFoundException - on errorspublic void resolveParentDependencies(java.util.List<FxAssignment> assignments)
resolveDependencies(java.util.Map)
assignments - all known assignmentspublic int compareTo(FxAssignment o)
compareTo in interface java.lang.Comparable<FxAssignment>o - other assignment to compare to
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static java.util.List<FxAssignment> sort(java.util.List<FxAssignment> assignments)
assignments - FxAssignments to sort
public boolean isValid(java.lang.Object value)
value - the value to be checked
public boolean isSystemInternal()
public FxAssignment _setSystemInternal()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||