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 NodecreateMissingHippoBinaryFolders(Session session, String absPath, String primaryTypeName, String[] folderTypes, String[] galleryTypes) Checks if all the binary folders exist in the givenabsPathand creates binary folders if not existing.static voidextractTextFromBinariesAndSaveHippoTexts(Session session, Node handle) Finds binary resource node (hippo:resource) under thehandle, extracts text content and saveshippo:textproperty if the binary data isapplication/pdfcontent.static voidextractTextFromBinariesAndSaveHippoTextsUnderHandlePath(Session session, String handlePath) Finds binary resource node (hippo:resource) under thehandlePath, extracts text content and saveshippo:textproperty if the binary data isapplication/pdfcontent.
-
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 givenabsPathand 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:textproperty if the binary data isapplication/pdfcontent.- 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:textproperty if the binary data isapplication/pdfcontent.- 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
-