private void traverseStoredDescendants ( ItemData parent , DataManager dataManager , int action , Map < String , ItemData > ret , boolean listOnly , Collection < ItemState > transientDescendants ) throws RepositoryException { if ( parent . isNode ( ) && ! isNew ( parent . getIdentifier ( ) ) ) { if ( action != MERGE_PROPS ) { List < NodeData > childNodes = dataManager . getChildNodesData ( ( NodeData ) parent ) ; for ( int i = 0 , length = childNodes . size ( ) ; i < length ; i ++ ) { NodeData childNode = childNodes . get ( i ) ; ret . put ( childNode . getIdentifier ( ) , childNode ) ; } } if ( action != MERGE_NODES ) { List < PropertyData > childProps = listOnly ? dataManager . listChildPropertiesData ( ( NodeData ) parent ) : dataManager . getChildPropertiesData ( ( NodeData ) parent ) ; outer : for ( int i = 0 , length = childProps . size ( ) ; i < length ; i ++ ) { PropertyData childProp = childProps . get ( i ) ; for ( ItemState transientState : transientDescendants ) { if ( ! transientState . isNode ( ) && ! transientState . isDeleted ( ) && transientState . getData ( ) . getQPath ( ) . getDepth ( ) == childProp . getQPath ( ) . getDepth ( ) && transientState . getData ( ) . getQPath ( ) . getName ( ) . equals ( childProp . getQPath ( ) . getName ( ) ) ) { continue outer ; } } if ( ! childProp . getQPath ( ) . isDescendantOf ( parent . getQPath ( ) , true ) ) { // In case we get the data from the cache, we need to set the correct path QPath qpath = QPath . makeChildPath ( parent . getQPath ( ) , childProp . getQPath ( ) . getName ( ) ) ; childProp = new PersistedPropertyData ( childProp . getIdentifier ( ) , qpath , childProp . getParentIdentifier ( ) , childProp . getPersistedVersion ( ) , childProp . getType ( ) , childProp . isMultiValued ( ) , childProp . getValues ( ) , new SimplePersistedSize ( ( ( PersistedPropertyData ) childProp ) . getPersistedSize ( ) ) ) ; } ret . put ( childProp . getIdentifier ( ) , childProp ) ; } } } }
Calculate all stored descendants for the given parent node