jcr

How to add multivalue property to jcr node through java code?

北城以北 提交于 2019-12-13 00:42:16
问题 According this answer https://stackoverflow.com/a/18726682/2674303 I see that I can add property to node in crxde. But I don't understand how can I add multivalue property(array) to node. Please, help. 回答1: You have to create an array of values: ValueFactory valueFactory = session.getValueFactory(); Node node = session.getNode("/content/path/to/my/node"); Value[] values = new Value[3]; values[0] = valueFactory.createValue("First value"); values[1] = valueFactory.createValue("Second value");

apache camel jcr jackrabbit

送分小仙女□ 提交于 2019-12-12 14:21:55
问题 I'm new in camel world and I have problems making a connection with the jcr component. look at my test code: import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.jcr.JcrConstants; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Test; public class ObjectToJCRRouteTest extends CamelTestSupport { @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception

AEM DefaultValue written to JCR

左心房为你撑大大i 提交于 2019-12-12 13:32:52
问题 I noticed that when I set my defaultValue for a dropdown, altho it is correctly selected in the drop down when I first add my component to the page it does not write the defaultValue to the corresponding JCR until I edit the component and save it. Even if I just open the corresponding dialog and click OK now my component works as expected because the values have been added to the JCR. I am sure there is an important piece that I am missing here, does anyone knows how defaultValues that are

What's the purpose of resourceResolver.adaptTo(Session.class) in Apache Sling?

≯℡__Kan透↙ 提交于 2019-12-12 10:41:53
问题 I am new to Apache Sling, CQ5, etc. In our codebase, we have a code snippet similar to this: void perform(SlingHttpServletRequest request, SlingHttpServletResponse response) { ResourceResolver resourceResolver = request.getResourceResolver(); Session session = resourceResolver.adaptTo(Session.class); PageManager pageManager = resourceResolver.adaptTo(PageManager.class); } What's adapTo doing here? Also is there a good documentation/user manual available I can read to get started using Sling,

JCR OAK Query & NodeType

纵然是瞬间 提交于 2019-12-12 05:43:00
问题 I am working on Apache JackRabbit OAK (1.3.2). I have created a node (MyNode) with the following structure and saved in the repository. -- 'jcr:primaryType'=oak:Unstructured -- 'name'='myNode' I also created a lucene index to index all the properties as per the documentation. However when i run the following query i get no results. select * from [oak:Unstructured] where name='myNode' And when the run the following query i get the saved 'MyNode' in result 'select * from [nt:base] where [jcr

How to programatically delete revisions of a page in CQ5?

南楼画角 提交于 2019-12-12 04:06:22
问题 In the current setup; we are trying to automate the process of creating the blueprint page, rolling it out to its live copies; and activating the live copy pages.Also; deactivation and deletion of pages is also done programmatically . All this is done via code using the com.day.cq.wcm.api.msm and com.day.cq.replication api. The problem we are facing right now is after deleting the blueprint and live copy pages programmatically ; if we again create the same page programmatically ; then; there

Versionhistory of node disappered after restore parentnode to lower version jackrabbit

筅森魡賤 提交于 2019-12-11 18:08:14
问题 Given the fact i have a versionable node with a versionable subnode. I checkin the first node with 1 subnode for version 1.0. Now i add a new subnode on parentnode (1.1). If i restore parentnode on version 1.0 i can see theres only first checkedin subnode available. When i now wanna restore parent back to version 1.1 and try to get VersionHistory for second subnode ill receive a pathNotfoundException while querying. I did ...restore(absPath, restoreToVersion, false); public static final

JCR - Jackrabbit - Xpath expression for search content text of a file contained inside a node

不想你离开。 提交于 2019-12-11 14:20:06
问题 i am having a headache working with JackRabbit JCR in java. It's about making a xpath expression for searching for entities in my repository. Let's do a brief synopsis of what kind of data is stored, we have 3 a node class called "Entry", that extends another node class named "BaseEntry" and that extends another called "BaseNode". The Entry class represents a Node in our JCR system, and has a set of properties (mapped as attributes in the corresponding class), an also inherits the properties

Node Identifier of copied node in Jackrabbit not found while deleting

一个人想着一个人 提交于 2019-12-11 09:16:28
问题 I copied a node in Jackrabbit using session.getWorkspace().copy(sourceNode.getPath(), destinationNode.getPath()) This operation changes are persisted instantly as far as I know. But when I tried to get the copied node for deleting it using session.getNodeByIdentifier("nodeId of copied node") , it gives ItemNotFoundException. The reason for that error is that the copied node loses is mix:referenceable property during copy which causes getNodeByIdentifier to fail. The question is how do I set

Recursive search in JCR repo via java

寵の児 提交于 2019-12-11 04:24:52
问题 I know how to search for something in the JCR via JCR SQL2 queries. However, I would like to use Java in certain cases, using the JCR API: javax.jcr.Node , javax.jcr.NodeIterator and the like. I'm afraid I will simply reinvent the wheel by coding my own. Is there anything already available ( Gist , Github or else )? 回答1: You can use for that SlingQuery. It's inspired by jQuery and follows it's syntax. You should use it only to search small number of nodes (in best case under 100), because