Class DocumentModelUtils

    • Method Detail

      • encodePropertyName

        public static String encodePropertyName​(String propertyName)
        Encodes a property name to use it in a url.
        Parameters:
        propertyName - like dc:title, file:content.3.filename (?)
      • decodePropertyName

        public static String decodePropertyName​(String propertyPath)
        Decodes a property path given in a url.
        Parameters:
        propertyPath - like dc:title file/content/3/filename (?)
      • getPropertyValue

        public static Object getPropertyValue​(DocumentModel doc,
                                              String propertyName)
        The given propertyName should have 'schema_name:property_name' format.
        Returns:
        null if any error occurs.
      • getComplexPropertyValue

        public static Object getComplexPropertyValue​(DocumentModel doc,
                                                     String propertyPath)
        Obtains a property value given its path.
        Parameters:
        doc - the document
        propertyPath - the property path
        Returns:
        the property value or null if an error occured.