info.magnolia.ui.form.field.transformer.multi
Class MultiValueSubChildrenNodeTransformer

java.lang.Object
  extended by info.magnolia.ui.form.field.transformer.basic.BasicTransformer<com.vaadin.data.util.PropertysetItem>
      extended by info.magnolia.ui.form.field.transformer.multi.MultiValueChildrenNodeTransformer
          extended by info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodeTransformer
All Implemented Interfaces:
I18NAwareHandler, Transformer<com.vaadin.data.util.PropertysetItem>

public class MultiValueSubChildrenNodeTransformer
extends MultiValueChildrenNodeTransformer

Sub Nodes implementation of Transformer storing and retrieving properties (as PropertysetItem) displayed in MultiField.
Storage strategy:
- root node (relatedFormItem)
-- main child node (nodeName = field name)
--- child node 1 (used to store the first value of the MultiField as a property)
---- property1 (store the first value of the MultiField)
--- child node 2 (used to store the second value of the MultiField as a property)
---- property2 (store the second value of the MultiField)
...
Main child node : field name
Child node name : 20 first char of the related value
Property name : field name


Field Summary
 
Fields inherited from class info.magnolia.ui.form.field.transformer.basic.BasicTransformer
basePropertyName, definition, i18NPropertyName, relatedFormItem, type
 
Constructor Summary
MultiValueSubChildrenNodeTransformer(com.vaadin.data.Item relatedFormItem, ConfiguredFieldDefinition definition, Class<com.vaadin.data.util.PropertysetItem> type)
           
 
Method Summary
protected  String createChildItemName(Set<String> childNames, Object value, JcrNodeAdapter rootItem)
          Basic Implementation that create child Nodes with increasing number as Name.
protected  org.apache.jackrabbit.commons.predicate.Predicate createPredicateToEvaluateChildNode()
          Return a null predicate.
protected  JcrNodeAdapter getRootItem()
          Define the root Item used in order to set the SubNodes list.
protected  void handleRootitemAndParent(JcrNodeAdapter rootItem)
          Handle the relation between parent and rootItem.
Typically, if rootItem would be a child of parentItem:
 
Methods inherited from class info.magnolia.ui.form.field.transformer.multi.MultiValueChildrenNodeTransformer
getOrCreateChildNode, getStoredChildNodes, getValueFromChildNode, hasI18NSupport, initializeChildItem, readFromItem, setChildItemValue, setChildValuePropertyName, setNewChildItem, writeToItem
 
Methods inherited from class info.magnolia.ui.form.field.transformer.basic.BasicTransformer
definePropertyName, getBasePropertyName, getLocale, getOrCreateProperty, getType, setI18NPropertyName, setLocale, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiValueSubChildrenNodeTransformer

@Inject
public MultiValueSubChildrenNodeTransformer(com.vaadin.data.Item relatedFormItem,
                                                   ConfiguredFieldDefinition definition,
                                                   Class<com.vaadin.data.util.PropertysetItem> type)
Method Detail

getRootItem

protected JcrNodeAdapter getRootItem()
Description copied from class: MultiValueChildrenNodeTransformer
Define the root Item used in order to set the SubNodes list.

Overrides:
getRootItem in class MultiValueChildrenNodeTransformer

createChildItemName

protected String createChildItemName(Set<String> childNames,
                                     Object value,
                                     JcrNodeAdapter rootItem)
Description copied from class: MultiValueChildrenNodeTransformer
Basic Implementation that create child Nodes with increasing number as Name.

Overrides:
createChildItemName in class MultiValueChildrenNodeTransformer

handleRootitemAndParent

protected void handleRootitemAndParent(JcrNodeAdapter rootItem)
Description copied from class: MultiValueChildrenNodeTransformer
Handle the relation between parent and rootItem.
Typically, if rootItem would be a child of parentItem:

if (childItem.getChildren() != null && !childItem.getChildren().isEmpty()) { ((JcrNodeAdapter) parent).addChild(childItem); } else { ((JcrNodeAdapter) parent).removeChild(childItem); }

Overrides:
handleRootitemAndParent in class MultiValueChildrenNodeTransformer

createPredicateToEvaluateChildNode

protected org.apache.jackrabbit.commons.predicate.Predicate createPredicateToEvaluateChildNode()
Return a null predicate.

Overrides:
createPredicateToEvaluateChildNode in class MultiValueChildrenNodeTransformer


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.