|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flexive.shared.content.FxData
com.flexive.shared.content.FxGroupData
public class FxGroupData
FxData extension for groups
| Field Summary |
|---|
| Fields inherited from class com.flexive.shared.content.FxData |
|---|
parent, POSITION_BOTTOM, POSITION_TOP, xp, XPathFull, xpPrefix |
| Constructor Summary | |
|---|---|
FxGroupData(FxGroupData other,
FxGroupData parent)
Copy constructor. |
|
FxGroupData(java.lang.String xpPrefix,
java.lang.String alias,
int index,
java.lang.String xPath,
java.lang.String xPathFull,
int[] indices,
long assignmentId,
FxMultiplicity assignmentMultiplicity,
int pos,
FxGroupData parent,
java.util.List<FxData> data,
boolean systemInternal)
|
|
| Method Summary | |
|---|---|
FxData |
addChild(FxData child)
Add a child FxData at the correct position |
FxData |
addEmptyChild(java.lang.String xPath,
int pos)
Add an and FxData entry with the given XPath to this group (must be a direct child of this group, no nesting allowed!). |
void |
addGroup(java.lang.String xPath,
FxGroupAssignment fxGroupAssignment,
int pos)
Add a group entry at the given XPath. |
void |
addGroup(java.lang.String xPath,
FxGroupAssignment fxGroupAssignment,
int pos,
boolean onlySystemInternal)
Add a group entry at the given XPath. |
void |
addProperty(java.lang.String xPath,
FxPropertyAssignment assignment,
FxValue value,
int pos)
Add a property at the given XPath location, removing eventually existing properties. |
protected void |
applyIndices()
Apply the multiplicity to XPath and children if its a group |
void |
compactPositions(boolean includeSubGroups)
Synchronize positions closing gaps optionally including sub groups |
FxData |
containsChild(XPathElement check)
Check if a child with the same alias and multiplicity that is not empty exists. |
protected FxGroupData |
copy(FxGroupData parent)
Create an independent copy of this group or property FxData |
static FxGroupData |
createVirtualRootGroup(java.lang.String xpPrefix)
Helper to create a virtual root group |
void |
explode(boolean explodeChildGroups)
"Explode" this group by adding all creatable assignments at the bottom |
void |
fixChildIndices()
'Fix' the indices of children after they have been added to reflect the parent groups index in their XPath Don't work in the root of a type |
FxValueChangeListener |
getChangeListener()
Get thechange listener if attached |
java.util.List<FxData> |
getChildren()
Get all child entries for this group |
java.util.Collection<FxData> |
getChildrenWithoutInternal()
Get all child entries for this group, excluding all internal properties. |
java.util.List<java.lang.String> |
getCreateableChildren(boolean includeExisting)
Get a list of child FxData instances (as XPath with full indices) that can be created as children for this group. |
FxGroupData |
getGroup(long assignmentId)
Get the FxGroupData entry for the given group assignment. |
FxGroupData |
getGroup(java.lang.String xPath)
Get the group denoted by the given XPath |
FxGroupAssignment |
getGroupAssignment()
Get the groups assignment |
java.util.List<FxPropertyData> |
getPropertyData(long propertyId,
boolean includeEmpty)
Get a list of all FxPropertyData entries that are assigned to propertyId |
protected java.util.List<FxReference> |
getReferences(boolean includeSubGroups)
Get a list of all FxReference values in this group and optionally all sub groups |
boolean |
hasChangeListener()
Is a change listener attached |
boolean |
isEmpty()
Is this data empty? |
boolean |
isGroup()
Is this FxData a property or group? |
boolean |
isHasGroups()
Return true if the content has at least one group. |
boolean |
isHasMultiLangProperty()
Return true if this content has at least one multilingual property set. |
boolean |
isProperty()
Is this FxData a property or group? |
boolean |
isRequiredPropertiesPresent()
Are there any required properties (empty or non-empty) present? |
boolean |
isRootGroup()
Is this group the root group? |
void |
moveChild(XPathElement xp,
int delta)
Move a child element identified by its alias and multiplicity by delta positions within this group If delta is Integer.MAX_VALUE the data will always be placed at the bottom, Integer.MIN_VALUE will always place it at the top. |
void |
removeChild(FxData data)
Remove the requested child data and compact indices and positions |
void |
removeChildren(java.util.List<FxData> dataList)
Remove the requested children and compact indices and positions |
void |
removeEmptyEntries()
Remove all empty entries of this group that are not required |
void |
removeEmptyEntries(boolean includeRequired)
Remove all empty entries of this group |
void |
removeNonInternalData()
Remove all entries that are not system internal form the current group |
void |
replaceChild(XPathElement xpath,
FxData data)
|
void |
setChangeListener(FxValueChangeListener changeListener,
boolean includeSubGroups)
Set the change listener |
void |
setEmpty()
Replace all data with empty values/groups |
protected void |
setXPathFull(java.lang.String xpathFull)
Update the XPath with indices. |
protected void |
valueChanged(java.lang.String xpath,
FxValueChangeListener.ChangeType changeType)
Called internally when a value has changed |
| Methods inherited from class com.flexive.shared.content.FxData |
|---|
compact, createNew, equals, getAlias, getAssignment, getAssignmentId, getAssignmentMultiplicity, getCreateableElements, getElements, getIndex, getIndices, getOccurances, getParent, getPos, getRemoveableElements, getXPath, getXPathElement, getXPathFull, getXPathPrefix, hashCode, isRemoveable, isSystemInternal, mayCreateMore, move, moveIndex, setPos, toString, xpCached |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FxGroupData(java.lang.String xpPrefix,
java.lang.String alias,
int index,
java.lang.String xPath,
java.lang.String xPathFull,
int[] indices,
long assignmentId,
FxMultiplicity assignmentMultiplicity,
int pos,
FxGroupData parent,
java.util.List<FxData> data,
boolean systemInternal)
throws FxInvalidParameterException
FxInvalidParameterException
public FxGroupData(FxGroupData other,
FxGroupData parent)
other - the group data instance to copyparent - the new parent| Method Detail |
|---|
public boolean isProperty()
isProperty in class FxDatapublic boolean isGroup()
isGroup in class FxDatapublic FxGroupAssignment getGroupAssignment()
public java.util.List<FxData> getChildren()
public java.util.Collection<FxData> getChildrenWithoutInternal()
public boolean isEmpty()
isEmpty in class FxDatapublic void setEmpty()
setEmpty in class FxDatapublic boolean isRequiredPropertiesPresent()
isRequiredPropertiesPresent in class FxDatapublic boolean isHasMultiLangProperty()
public static FxGroupData createVirtualRootGroup(java.lang.String xpPrefix)
throws FxInvalidParameterException
xpPrefix - XPath prefix like "FxType name[@pk=..]"
FxInvalidParameterException - on errors
public void moveChild(XPathElement xp,
int delta)
xp - element to movedelta - delta positions to movepublic FxData addChild(FxData child)
child - FxData to add
public FxData addEmptyChild(java.lang.String xPath,
int pos)
xPath - XPath to add to this group (must be a direct child of this group, no nesting allowed!)pos - position in same hierarchy level
protected void applyIndices()
applyIndices in class FxDataprotected void setXPathFull(java.lang.String xpathFull)
setXPathFull in class FxDataxpathFull - the complete XPath including indices.public void fixChildIndices()
public void removeEmptyEntries()
removeEmptyEntries(boolean)public void removeEmptyEntries(boolean includeRequired)
includeRequired - include entries that are required (but empty)?public void compactPositions(boolean includeSubGroups)
includeSubGroups - close gaps for subgroups as well?public boolean isRootGroup()
public FxGroupData getGroup(java.lang.String xPath)
xPath - requested XPath for the group
public FxGroupData getGroup(long assignmentId)
assignmentId - the group assignment ID
FxRuntimeException - if the assignment was not foundpublic boolean isHasGroups()
public void addProperty(java.lang.String xPath,
FxPropertyAssignment assignment,
FxValue value,
int pos)
xPath - requested XPathassignment - assignment of the propertyvalue - valuepos - positionpublic FxData containsChild(XPathElement check)
check - XPathElement to check
null
public void replaceChild(XPathElement xpath,
FxData data)
public void addGroup(java.lang.String xPath,
FxGroupAssignment fxGroupAssignment,
int pos)
throws FxInvalidParameterException,
FxNotFoundException,
FxCreateException
xPath - requested XPathfxGroupAssignment - the assignment of the grouppos - position
FxInvalidParameterException - on errors
FxNotFoundException - on errors
FxCreateException - on errors
public void addGroup(java.lang.String xPath,
FxGroupAssignment fxGroupAssignment,
int pos,
boolean onlySystemInternal)
throws FxInvalidParameterException,
FxNotFoundException,
FxCreateException
xPath - requested XPathfxGroupAssignment - the assignment of the grouppos - positiononlySystemInternal - when true, only system-internal groups or properties are added
FxInvalidParameterException - on errors
FxNotFoundException - on errors
FxCreateException - on errorspublic void removeChild(FxData data)
data - FxData to removepublic void removeChildren(java.util.List<FxData> dataList)
dataList - list of FxData to removepublic void explode(boolean explodeChildGroups)
explodeChildGroups - recursively explode all existing child groups?public java.util.List<java.lang.String> getCreateableChildren(boolean includeExisting)
includeExisting - include entries for children that already exist but with a new (higher) multiplicity?
protected FxGroupData copy(FxGroupData parent)
copy in class FxDataparent - parent group
protected java.util.List<FxReference> getReferences(boolean includeSubGroups)
includeSubGroups - collect FxReferences from sub groups as well?
public java.util.List<FxPropertyData> getPropertyData(long propertyId,
boolean includeEmpty)
propertyId - the property id requested. -1 to return all properties.includeEmpty - include empty data instances?
public void removeNonInternalData()
public boolean hasChangeListener()
public FxValueChangeListener getChangeListener()
public void setChangeListener(FxValueChangeListener changeListener,
boolean includeSubGroups)
changeListener - change listenerincludeSubGroups - set the change listener for subgroups as well?
protected void valueChanged(java.lang.String xpath,
FxValueChangeListener.ChangeType changeType)
xpath - affected xpathchangeType - type of change
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||