public class CollectionGroupLineBuilder extends Object implements Serializable
Constructor and Description |
---|
CollectionGroupLineBuilder(LineBuilderContext lineBuilderContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
addUnauthorizedBindingInfo()
Adds a
BindingInfo instance for the given binding
path to the collection groups unauthorized list. |
protected void |
adjustFieldBinding(Field lineField,
String bindingPath)
Adjusts the binding path for the given field to match the collections path.
|
protected void |
adjustFieldBindingAndId(List<Field> lineFields,
String bindingPath)
Adjusts the binding path for the given fields to match the collections path, and sets the container id
suffix for the fields so all nested components will get their ids adjusted.
|
protected void |
adjustFieldId(Field lineField)
Adjusts the id suffix for the given field.
|
protected void |
applyLineFieldAuthorizationAndPresentationLogic(boolean readOnlyLine,
List<Field> lineFields,
List<? extends Component> actionList)
Iterates through the line fields and checks the view field authorization using the view's configured authorizer
and presentation controller.
|
protected void |
applyOnChangeForSave(List<Field> lineFields)
If
CollectionGroup.isRenderSaveLineActions() is true and the line has been added by the user, on change
script is added to any controls in the line to enable the save action. |
void |
buildLine()
Invoked to build a line in the collection.
|
protected void |
buildSubCollectionFieldGroups()
For each configured sub collection of the collection group, creates a field group by copying
CollectionLayoutManager.getSubCollectionFieldGroupPrototype() and adds
to a list which is stored in the line context. |
protected boolean |
checkEditLineAuthorization(List<Field> lineFields)
Determines whether the user is authorized to the edit the line.
|
protected boolean |
checkEditLineAuthorizationAndPresentationLogic(CollectionGroup collectionGroup,
ViewModel model,
Object currentLine)
Invokes the view's configured authorizer and presentation controller to determine if the user has permission
to edit the line (if a permission has been established).
|
protected boolean |
checkSubCollectionRender(CollectionGroup subCollectionGroup)
Checks whether the given sub-collection should be rendered, any conditional render string is evaluated.
|
protected boolean |
checkViewLineAuthorization()
Determines whether the user is authorized to the view the line.
|
protected boolean |
checkViewLineAuthorizationAndPresentationLogic()
Invokes the view's configured authorizer and presentation controller to determine if the user has permission
to view the line (if a permission has been established).
|
protected Map<String,Object> |
getContextForField(View view,
CollectionGroup collectionGroup,
Field field)
Helper method to build the context for a field (needed because the apply model phase for line fields has
not been applied yet and their full context not set)
|
protected List<? extends Component> |
initializeLineItems()
Copies either the collections groups items or add line items to a list of components that will be used
for the collection line.
|
void |
preprocessLine()
Performs various preprocessing of the line components and configuration.
|
List<Field> |
processAnyRemoteFieldsHolder(CollectionGroup group,
List<? extends Component> items)
Iterates through the given items checking for
RemotableFieldsHolder , if found
the holder is invoked to retrieved the remotable fields and translate to attribute fields. |
protected List<Field> |
removeNonRenderLineFields(List<Field> lineFields)
Evaluates the render property for the given list of field instances for the line and removes any fields
from the returned list that have render false.
|
protected void |
setFocusOnIdForActions(List<Action> actions,
List<Field> lineFields)
For any actions with focus id
UifConstants.Order.LINE_FIRST , the focus id
is replaced to match to id of the first control in the line. |
protected void |
setupAddLineControlValidation(InputField lineField,
List<String> selectors,
String suffix)
Add additional information to a field in the add line to allow for correct add control selection.
|
protected void |
setupAddLineControlValidation(List<Field> lineFields)
Add additional information to the fields in the add line to allow for correct add control selection.
|
protected void |
setupEditLineDetails()
Setup edit line dialog group with the line fields
|
public CollectionGroupLineBuilder(LineBuilderContext lineBuilderContext)
public void buildLine()
First the context for the line is preprocessed in preprocessLine()
.
After preprocessing the configured layout manager is invoked to place the line into the layout.
public void preprocessLine()
Preprocessing includes:
protected List<? extends Component> initializeLineItems()
public List<Field> processAnyRemoteFieldsHolder(CollectionGroup group, List<? extends Component> items)
RemotableFieldsHolder
, if found
the holder is invoked to retrieved the remotable fields and translate to attribute fields.
The translated list is then inserted into the returned list at the position of the holder
group
- collection group instance to check for any remotable fields holderitems
- list of items to processprotected void adjustFieldBindingAndId(List<Field> lineFields, String bindingPath)
lineFields
- list of fields to updatebindingPath
- binding path to addprotected void adjustFieldBinding(Field lineField, String bindingPath)
lineField
- field to updatebindingPath
- binding path to addprotected void adjustFieldId(Field lineField)
lineField
- field to updateprotected void setFocusOnIdForActions(List<Action> actions, List<Field> lineFields)
UifConstants.Order.LINE_FIRST
, the focus id
is replaced to match to id of the first control in the line.actions
- list of actions to potientially updatelineFields
- list of line fields, the control for the first field in the list
will be used for the focus idprotected void applyOnChangeForSave(List<Field> lineFields)
CollectionGroup.isRenderSaveLineActions()
is true and the line has been added by the user, on change
script is added to any controls in the line to enable the save action.lineFields
- list of line fieldsprotected List<Field> removeNonRenderLineFields(List<Field> lineFields)
The conditional render string is also taken into account. This needs to be done here as opposed to during the normal condition evaluation so the the fields are not used while building the collection lines
lineFields
- list of fields configured for the lineprotected boolean checkViewLineAuthorization()
protected boolean checkViewLineAuthorizationAndPresentationLogic()
protected boolean checkEditLineAuthorization(List<Field> lineFields)
lineFields
- list of fields configured for the lineprotected boolean checkEditLineAuthorizationAndPresentationLogic(CollectionGroup collectionGroup, ViewModel model, Object currentLine)
protected void addUnauthorizedBindingInfo()
BindingInfo
instance for the given binding
path to the collection groups unauthorized list.protected void applyLineFieldAuthorizationAndPresentationLogic(boolean readOnlyLine, List<Field> lineFields, List<? extends Component> actionList)
If the field is viewable, then sets the edit field authorization. Finally iterates through the line actions invoking the authorizer and presentation controller to authorizer the action
readOnlyLine
- flag indicating whether the line has been marked as read only (which will force the fields
to be read only)lineFields
- list of fields instances for the lineactionList
- list of action field instances for the lineprotected void buildSubCollectionFieldGroups()
CollectionLayoutManager.getSubCollectionFieldGroupPrototype()
and adds
to a list which is stored in the line context.protected boolean checkSubCollectionRender(CollectionGroup subCollectionGroup)
subCollectionGroup
- sub collection group to check render status forprotected void setupAddLineControlValidation(List<Field> lineFields)
lineFields
- list of fields instances for the lineprotected void setupAddLineControlValidation(InputField lineField, List<String> selectors, String suffix)
lineField
- field instance for the lineselectors
- list of selectorssuffix
- id suffix to addprotected void setupEditLineDetails()
The items for a dialog are created from line fields and added if not provided by the user, but if they are then each item is processed.
protected Map<String,Object> getContextForField(View view, CollectionGroup collectionGroup, Field field)
view
- view instance the field belongs tocollectionGroup
- collection group instance the field belongs tofield
- field instance to build context forCopyright © 2005–2015 The Kuali Foundation. All rights reserved.