Modify node from HippoEventBus handler

16 views
Skip to first unread message

Wojciech Oledzki

unread,
Jan 24, 2018, 5:04:04 PM1/24/18
to Hippo Community
How to get session with "write" access in DaemonModule class.

I want to modify nodes in HippoEventBus handler (on commit, publish, depublish). But session.save() trows errors.

code available here: 


Thanks,
Wojtek

Marijan Milicevic

unread,
Jan 24, 2018, 7:08:54 PM1/24/18
to hippo-c...@googlegroups.com
what error do you get? 
/m 

Thanks,
Wojtek

Voytek Solutions Ltd is a company registered in England and Wales.
Registered number: 9449603, VAT number: 206143743,
Registered office: First Floor, Telecom House, 125-135 Preston Road, Brighton BN1 6AF

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

Marijan Milicevic

unread,
Jan 24, 2018, 7:11:34 PM1/24/18
to hippo-c...@googlegroups.com
On Thu, Jan 25, 2018 at 1:08 AM, Marijan Milicevic <marijan....@bloomreach.com> wrote:
On Wed, Jan 24, 2018 at 11:04 PM, Wojciech Oledzki <woj...@voytek.solutions> wrote:
How to get session with "write" access in DaemonModule class.

I want to modify nodes in HippoEventBus handler (on commit, publish, depublish). But session.save() trows errors.

code available here: 


what error do you get? 

I suspect item not found or item externally changed  kind of exceptions due to race conditions, 

Wojciech Oledzki

unread,
Jan 25, 2018, 3:01:11 AM1/25/18
to Hippo Community
It's "Item cannot be saved because it has been removed" kind of error.

How should I approach modifying nodes in "commit" / "publish" / "depublish" event bus handler?

Thanks,
Wojtek


On Thursday, 25 January 2018 00:11:34 UTC, marijan milicevic wrote:
On Thu, Jan 25, 2018 at 1:08 AM, Marijan Milicevic <marijan....@bloomreach.com> wrote:
On Wed, Jan 24, 2018 at 11:04 PM, Wojciech Oledzki <woj...@voytek.solutions> wrote:
How to get session with "write" access in DaemonModule class.

I want to modify nodes in HippoEventBus handler (on commit, publish, depublish). But session.save() trows errors.

code available here: 


what error do you get? 

I suspect item not found or item externally changed  kind of exceptions due to race conditions, 
/m 

Thanks,
Wojtek

Voytek Solutions Ltd is a company registered in England and Wales.
Registered number: 9449603, VAT number: 206143743,
Registered office: First Floor, Telecom House, 125-135 Preston Road, Brighton BN1 6AF

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

Wojciech Oledzki

unread,
Jan 26, 2018, 6:48:59 AM1/26/18
to Hippo Community
Turned out that all I needed was `JcrUtils.ensureIsCheckedOut(node);` before editing the node.
Reply all
Reply to author
Forward
0 new messages