Class HippoBinaryNodeUtils
java.lang.Object
org.onehippo.forge.content.exim.core.util.HippoBinaryNodeUtils
Internal utility for Hippo binary related nodes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Node
createMissingHippoBinaryFolders
(Session session, String absPath, String primaryTypeName, String[] folderTypes, String[] galleryTypes) Checks if all the binary folders exist in the givenabsPath
and creates binary folders if not existing.static void
extractTextFromBinariesAndSaveHippoTexts
(Session session, Node handle) Finds binary resource node (hippo:resource
) under thehandle
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.static void
extractTextFromBinariesAndSaveHippoTextsUnderHandlePath
(Session session, String handlePath) Finds binary resource node (hippo:resource
) under thehandlePath
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.
-
Method Details
-
createMissingHippoBinaryFolders
public static Node createMissingHippoBinaryFolders(Session session, String absPath, String primaryTypeName, String[] folderTypes, String[] galleryTypes) throws RepositoryException, org.hippoecm.repository.api.WorkflowException Checks if all the binary folders exist in the givenabsPath
and creates binary folders if not existing.- Parameters:
session
- JCR sessionabsPath
- absolute binary folder node pathprimaryTypeName
- primary folder node type namefolderTypes
- folderTypesgalleryTypes
- galleryTypes- Returns:
- the final folder node if successful
- Throws:
RepositoryException
- if any repository exception occursorg.hippoecm.repository.api.WorkflowException
- if any workflow exception occurs
-
extractTextFromBinariesAndSaveHippoTextsUnderHandlePath
public static void extractTextFromBinariesAndSaveHippoTextsUnderHandlePath(Session session, String handlePath) throws RepositoryException, IOException, org.apache.tika.exception.TikaException Finds binary resource node (hippo:resource
) under thehandlePath
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.- Parameters:
session
- JCR sessionhandlePath
- binary handle node path- Throws:
RepositoryException
- if repository exception occursIOException
- if IO exception occursorg.apache.tika.exception.TikaException
- if TIKA exception occurs
-
extractTextFromBinariesAndSaveHippoTexts
public static void extractTextFromBinariesAndSaveHippoTexts(Session session, Node handle) throws RepositoryException, IOException, org.apache.tika.exception.TikaException Finds binary resource node (hippo:resource
) under thehandle
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.- Parameters:
session
- JCR sessionhandle
- binary handle node- Throws:
RepositoryException
- if repository exception occursIOException
- if IO exception occursorg.apache.tika.exception.TikaException
- if TIKA exception occurs
-