Extracting images from JCR Repository Database

168 views
Skip to first unread message

Dante

unread,
Nov 6, 2014, 8:52:23 AM11/6/14
to hippo-c...@googlegroups.com
Hello,

Do you know a way to extract images from the CMS database (in my case MySQL) ?
As JCR stores data in an encrypted way, no human readable, i can't see how can i find and extract images from the database.
Like for example to select an image from the database table (previously uploaded through the CMS web application) , take the binary data from the BLOB field and create a file with it in a physical folder in the server.

Thanks ,

Dante

Laurens Leeuwis

unread,
Nov 6, 2014, 10:01:52 AM11/6/14
to hippo-c...@googlegroups.com
Hi Dante,

You could create a program that connects to the (JCR) repository using RMI, and navigates the JCR tree to the images and then retrieve and store the images.

Going directly from the SQL BLOB's isn't possible I believe.

Kind regards,
Laurens

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

Olivier Bourgeois

unread,
Nov 7, 2014, 5:36:31 AM11/7/14
to hippo-c...@googlegroups.com
Yes, RMI is a way to do it, note that you'll need to activate RMI since it's disabled by default:


For the record it's possible to get to the Blob using a tool like MySQL Workbench or the equivalent for your database of choice. But you don't want to mess with Jackrabbit's internal data structure, that's why using the JCR API through RMI is a better solution.


Inline image 1

Rob Krabbendam

unread,
Nov 10, 2014, 11:18:18 AM11/10/14
to hippo-c...@googlegroups.com
Consider implementing a jcr-runner. You can let it select nodes of your imageset nodetype (hippogallery:imageset for instance). Then fetch the child node containing the original file data and dump this into a file. On the imageset node you can also find the original filename in a property called HippoGalleryNodeType.IMAGE_SET_FILE_NAME.

Then do something like:

Node original = node.getNode(HippoGalleryNodeType.IMAGE_SET_ORIGINAL);
InputStream is = getData(original);
...


Rob


Op donderdag 6 november 2014 14:52:23 UTC+1 schreef Dante:

Rob Krabbendam

unread,
Nov 10, 2014, 11:28:00 AM11/10/14
to hippo-c...@googlegroups.com
btw...

private InputStream getData(Node node) throws PathNotFoundException, RepositoryException {
      return node.getProperty(JcrConstants.JCR_DATA).getBinary().getStream();
   }

Op maandag 10 november 2014 17:18:18 UTC+1 schreef Rob Krabbendam:

Dante

unread,
Nov 11, 2014, 4:21:12 AM11/11/14
to hippo-c...@googlegroups.com
Hi
Thanks to all for the suggestions.

Regards,
Dante
Reply all
Reply to author
Forward
0 new messages