private Collection < JcrProperty > getProperties ( String repository , String workspace , String path , Node node ) throws RepositoryException { ArrayList < PropertyDefinition > names = new ArrayList <> ( ) ; NodeType primaryType = node . getPrimaryNodeType ( ) ; PropertyDefinition [ ] defs = primaryType . getPropertyDefinitions ( ) ; names . addAll ( Arrays . asList ( defs ) ) ; NodeType [ ] mixinType = node . getMixinNodeTypes ( ) ; for ( NodeType type : mixinType ) { defs = type . getPropertyDefinitions ( ) ; names . addAll ( Arrays . asList ( defs ) ) ; } ArrayList < JcrProperty > list = new ArrayList <> ( ) ; for ( PropertyDefinition def : names ) { String name = def . getName ( ) ; String type = PropertyType . nameFromValue ( def . getRequiredType ( ) ) ; Property p = null ; try { p = node . getProperty ( def . getName ( ) ) ; } catch ( PathNotFoundException e ) { } String display = values ( def , p ) ; String value = def . isMultiple ( ) ? multiValue ( p ) : singleValue ( p , def , repository , workspace , path ) ; list . add ( new JcrProperty ( name , type , value , display ) ) ; } return list ; }
Reads properties of the given node .