[
https://issues.apache.org/jira/browse/CAMEL-8323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14311081#comment-14311081
]
Maksim Kviatkouski edited comment on CAMEL-8323 at 2/8/15 3:24 AM:
-------------------------------------------------------------------
I think that would be also great to provide a config option for JCR Producer
not to persist changes into JCR session right after message was received. For
example if I need to create a node with type "nt:file" I cannot create
"nt:file" node only - I'll get a ConstraintViolationExcaption due to missing
child jcr:content node. So there are two options:
- allow more flexible creation of parent-child pairs (specifying headers for
both of them)
- let jcr producer not to do session.save() after each message received so code
can look like that:
{code}
from("direct:someInput")
.multicast("direct:createParent", "direct:createChild", "direct:saveChanges");
from("direct:createParent")
.to("jcr://user:pass@repo/tmp/parent?saveImmediately=false");
from("direct:createChild")
.to("jcr://user:pass@repo/tmp/parent/child?saveImmediately=false");
from("direct:saveChanges")
.to("jcr://user:pass@repo/tmp/parent?noop=true"); //noop would mean that no
node should be created
{code}
Though in this case session needs to be kept open during Camel context lifetime
and I'm not sure how well it fits its architecture.
I'd be grateful if you could help me to understand what would be right solution
there and I'll be more than happy to implement it.
was (Author: maksim_kviatkouski):
I think that would be also great to provide a config option for JCR Producer
not to persist changes into JCR session right after message was received. For
example if I need to create a node with type "nt:file" I cannot create
"nt:file" node only - I'll get a ConstraintViolationExcaption due to missing
child jcr:content node. So there are two options:
- allow more flexible creation of parent-child pairs (specifying headers for
both of them)
- let jcr producer not to do session.save() after each message received so code
can look like that:
{{from("direct:someInput")
.multicast("direct:createParent", "direct:createChild", "direct:saveChanges");
from("direct:createParent")
.to("jcr://user:pass@repo/tmp/parent?saveImmediately=false);
from("direct:createChild")
.to("jcr://user:pass@repo/tmp/parent/child?saveImmediately=false);
from("direct:saveChanges")
.to(jcr://user:pass@repo/tmp/parent?noop=true); //noop would mean that no node
should be created}}
Though in this case session needs to be kept open during Camel context lifetime
and I'm not sure how well it fits its architecture.
I'd be grateful if you could help me to understand what would be right solution
there and I'll be more than happy to implement it.
> Provide ability to specify node type
> ------------------------------------
>
> Key: CAMEL-8323
> URL: https://issues.apache.org/jira/browse/CAMEL-8323
> Project: Camel
> Issue Type: Improvement
> Components: camel-jcr
> Affects Versions: 2.14.1
> Reporter: Maksim Kviatkouski
> Labels: patch
> Attachments:
> CAMEL-8323_added_ability_to_specify_node_type_through_message_header.patch
>
>
> JcrProducer creates nt:unstructured nodes without ability to specify node
> type. There should be possibility to specify node type by passing it through
> message header JcrConstants.JCR_NODE_TYPE
> Documentation at http://camel.apache.org/jcr.html will need to be updated
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)