Class HippoBinaryNodeUtils
- java.lang.Object
-
- org.onehippo.forge.content.exim.core.util.HippoBinaryNodeUtils
-
public class HippoBinaryNodeUtils extends Object
Internal utility for Hippo binary related nodes.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.jcr.Node
createMissingHippoBinaryFolders(javax.jcr.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(javax.jcr.Session session, javax.jcr.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(javax.jcr.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 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 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:
javax.jcr.RepositoryException
- if any repository exception occursorg.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 thehandlePath
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.- Parameters:
session
- JCR sessionhandlePath
- binary handle node path- Throws:
javax.jcr.RepositoryException
- if repository exception occursIOException
- if IO exception occursorg.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 thehandle
, extracts text content and saveshippo:text
property if the binary data isapplication/pdf
content.- Parameters:
session
- JCR sessionhandle
- binary handle node- Throws:
javax.jcr.RepositoryException
- if repository exception occursIOException
- if IO exception occursorg.apache.tika.exception.TikaException
- if TIKA exception occurs
-
-