Insert dump.sql using hippo cms

21 views
Skip to first unread message

rdjava30

unread,
Jun 26, 2018, 2:54:33 PM6/26/18
to Hippo Community
I am not sure how to run insert table record from dump.sql to hippo cms, So I find following solution

I create java class which will add node or property for testing purpose. I have to do step by step.
Currently If I override hst-config.properties with adding default.repository.user=sitewriter, I can add node or property by using

 currentNode =  session.getRootNode().getNode(path);
currentNode.addNode("test","hst:component");

I want to do same thing, when user login as sitewriter via form or basic authentication, and it should create session based on user login not by properties file.

Please let me know if you need any information.

Woonsan Ko

unread,
Jun 28, 2018, 2:55:12 PM6/28/18
to hippo-c...@googlegroups.com
On Tue, Jun 26, 2018 at 2:54 PM, rdjava30 <rdja...@gmail.com> wrote:
I am not sure how to run insert table record from dump.sql to hippo cms, So I find following solution
What does the data in dump.sql look like? Is it your domain specific custom tables from somewhere?
Or are you talking about a dump from another Hippo/Jackrabbit database and do you want to import that in another environment?

Woonsan
 

I create java class which will add node or property for testing purpose. I have to do step by step.
Currently If I override hst-config.properties with adding default.repository.user=sitewriter, I can add node or property by using

 currentNode =  session.getRootNode().getNode(path);
currentNode.addNode("test","hst:component");

I want to do same thing, when user login as sitewriter via form or basic authentication, and it should create session based on user login not by properties file.

Please let me know if you need any information.

--
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-community@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-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--

rdjava30

unread,
Jun 29, 2018, 11:55:00 AM6/29/18
to Hippo Community
I created CSV file , I can add manually record , 
For example , I have product record -- name, description, price

I can create node one by one and define properties

but it doesn't make sense if records are more than 1000, 

I want to know if thr is anyway I can use csv file to run query.


On Thursday, June 28, 2018 at 2:55:12 PM UTC-4, woonsan.ko wrote:
On Tue, Jun 26, 2018 at 2:54 PM, rdjava30 <rdja...@gmail.com> wrote:
I am not sure how to run insert table record from dump.sql to hippo cms, So I find following solution
What does the data in dump.sql look like? Is it your domain specific custom tables from somewhere?
Or are you talking about a dump from another Hippo/Jackrabbit database and do you want to import that in another environment?

Woonsan
 

I create java class which will add node or property for testing purpose. I have to do step by step.
Currently If I override hst-config.properties with adding default.repository.user=sitewriter, I can add node or property by using

 currentNode =  session.getRootNode().getNode(path);
currentNode.addNode("test","hst:component");

I want to do same thing, when user login as sitewriter via form or basic authentication, and it should create session based on user login not by properties file.

Please let me know if you need any information.

--
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.

Woonsan Ko

unread,
Jun 29, 2018, 12:17:29 PM6/29/18
to hippo-c...@googlegroups.com
You can use groovy updater script instead of custom Java code:

Set "XPath query" to "/jcr:root.
And, add JCR code in doUpdate() method.
Read and iterate CSV, and on every batch count (e.g, 100), invoke visitorContext.reportUpdated(path) to inform the groovy updater engine of batch executions.

Then you don't need to worry about changing hst-config.properties or JCR session/credentials.

Regards,

Woonsan


To post to this group, send email to hippo-community@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-community+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages