Class HippoBinaryNodeUtils


  • public class HippoBinaryNodeUtils
    extends Object
    Internal utility for Hippo binary related nodes.
    • Method Detail

      • createMissingHippoBinaryFolders

        public static javax.jcr.Node createMissingHippoBinaryFolders​(javax.jcr.Session session,
                                                                     String absPath,
                                                                     String primaryTypeName,
                                                                     String[] folderTypes,
                                                                     String[] galleryTypes)
                                                              throws javax.jcr.RepositoryException,
                                                                     org.hippoecm.repository.api.WorkflowException
        Checks if all the binary folders exist in the given absPath and creates binary folders if not existing.
        Parameters:
        session - JCR session
        absPath - absolute binary folder node path
        primaryTypeName - primary folder node type name
        folderTypes - folderTypes
        galleryTypes - galleryTypes
        Returns:
        the final folder node if successful
        Throws:
        javax.jcr.RepositoryException - if any repository exception occurs
        org.hippoecm.repository.api.WorkflowException - if any workflow exception occurs
      • extractTextFromBinariesAndSaveHippoTextsUnderHandlePath

        public static void extractTextFromBinariesAndSaveHippoTextsUnderHandlePath​(javax.jcr.Session session,
                                                                                   String handlePath)
                                                                            throws javax.jcr.RepositoryException,
                                                                                   IOException,
                                                                                   org.apache.tika.exception.TikaException
        Finds binary resource node (hippo:resource) under the handlePath, extracts text content and saves hippo:text property if the binary data is application/pdf content.
        Parameters:
        session - JCR session
        handlePath - binary handle node path
        Throws:
        javax.jcr.RepositoryException - if repository exception occurs
        IOException - if IO exception occurs
        org.apache.tika.exception.TikaException - if TIKA exception occurs
      • extractTextFromBinariesAndSaveHippoTexts

        public static void extractTextFromBinariesAndSaveHippoTexts​(javax.jcr.Session session,
                                                                    javax.jcr.Node handle)
                                                             throws javax.jcr.RepositoryException,
                                                                    IOException,
                                                                    org.apache.tika.exception.TikaException
        Finds binary resource node (hippo:resource) under the handle, extracts text content and saves hippo:text property if the binary data is application/pdf content.
        Parameters:
        session - JCR session
        handle - binary handle node
        Throws:
        javax.jcr.RepositoryException - if repository exception occurs
        IOException - if IO exception occurs
        org.apache.tika.exception.TikaException - if TIKA exception occurs