jcr

Create a new mixin in sling

早过忘川 提交于 2019-12-11 03:34:59
问题 I am having trouble create a new custom type to the jackrabbit in apache sling using the below code. This worked fine straight on Jackrabbit but not on Apache Sling. Am I doing this correctly for sling? Thanks The following code gives me a "javax.jcr.InvalidItemStateException: Conflict". I am using a standalone sling and am the only user so there is definitely no conflict. Repository repository = JcrUtils.getRepository("http://localhost:8080/server"); Session session = repository.login(new

add a new property to a node(page) using ECMA script

余生颓废 提交于 2019-12-11 02:10:23
问题 I need to add a property to a page on page activation. I have decided to set up a workflow process that does the same before an activation step. My custom workflow step (the one before the activation step) makes use of an ECMA script to achieve this. Here's what I have so far. var workflowData = graniteWorkItem.getWorkflowData(); if (workflowData.getPayloadType() == "JCR_PATH") { var path = workflowData.getPayload().toString(); var jcrsession = graniteWorkflowSession.adaptTo(Packages.javax

JCR-SQL - contains function doesn't escape special characters?

ⅰ亾dé卋堺 提交于 2019-12-10 22:52:11
问题 I have the following query string: SELECT jcr:title, jcr:created, jcr:description FROM cq:PageContent WHERE jcr:path LIKE '/content/.../%' AND CONTAINS (., '*') ORDER BY date ASC The problem is that the query is returning all nodes from the given path even though they don't have asterisk in any proeprty. I wanted to escape the asterisk character, but the result is the same. I've tried something like this: SELECT jcr:title, jcr:created, jcr:description FROM cq:PageContent WHERE jcr:path LIKE '

How can you change the name of a JCR node?

家住魔仙堡 提交于 2019-12-10 15:09:48
问题 I'm trying to change the name of a JCR node, but I have no idea how? Has someone of you some hints? Many thanks. 回答1: The Jackrabbit Wiki provides an example: void rename(Node node, String newName) throws RepositoryException { node.getSession().move(node.getPath(), node.getParent().getPath() + "/" + newName); // Don't forget - not necessarily here at this place: // node.getSession().save(); } 来源: https://stackoverflow.com/questions/4164995/how-can-you-change-the-name-of-a-jcr-node

Using file system instead of database to store pdf files in jackrabbit

无人久伴 提交于 2019-12-09 16:35:48
问题 In our project we use jackrabbit with spring and tomcat to manage pdf files. Currently MySql database is being used to store blob files (in terms of jackrabbit it's called BundleDbPersistenceManager). As soon as the number of generated files grow we thought of using file system instead of database to boost performance and to eliminate replication overhead. In the spec jackrabbit team recommend using BundleFsPersistenceManager instead but with comments like this Not meant to be used in

What is the best way to save my POJOs into Jackrabbit JCR?

走远了吗. 提交于 2019-12-09 15:32:20
问题 In Jackrabbit I have experienced two ways to save my POJOs into repository nodes for storage in the Jackrabbit JCR: writing my own layer and using Apache Graffito Writing my own code has proven time consuming and labor intensive (had to write and run a lot of ugly automated tests) though quite flexible. Using Graffito has been a disappointment because it seems to be a "dead" project stuck in 2006 What are some better alternatives? 回答1: Another alternative is to completely skip an OCM

ADOBE CQ5 JCR - How to orderby/sorting query builder result using node's property

谁说胖子不能爱 提交于 2019-12-09 07:08:25
basically below is the java coding part, which the result will then be populated to a .csv file. However, I dont seem get the ordering part right (last line in below snippet). Map<String, String> map = new HashMap<String, String>(); map.put("path", "/etc/crx-db/form-data/career"); map.put("type", "nt:unstructured"); map.put("p.limit", "-1"); map.put("daterange.property", "created"); map.put("daterange.lowerBound", from); map.put("daterange.lowerOperation", ">="); map.put("daterange.upperOperation", "<="); map.put("daterange.upperBound", to); map.put("orderby", "created"); //<--here Providing

ADOBE CQ5 JCR - How to orderby/sorting query builder result using node's property

只愿长相守 提交于 2019-12-08 05:40:23
问题 basically below is the java coding part, which the result will then be populated to a .csv file. However, I dont seem get the ordering part right (last line in below snippet). Map<String, String> map = new HashMap<String, String>(); map.put("path", "/etc/crx-db/form-data/career"); map.put("type", "nt:unstructured"); map.put("p.limit", "-1"); map.put("daterange.property", "created"); map.put("daterange.lowerBound", from); map.put("daterange.lowerOperation", ">="); map.put("daterange

javax.jcr.nodetype.ConstraintViolationException: No matching property definition: PROPERTY

老子叫甜甜 提交于 2019-12-08 02:30:48
问题 When I am trying to set a property to my JCR node I am getting error javax.jcr.nodetype.ConstraintViolationException: No matching property definition: PROPERTY. I am a newbie to cq5. Please can someone help me to resolve this error? 回答1: In jcr every node has a node-type (value of "jcr:primaryType"). Most node-types define a schema of properties that are allowed on that node. You cannot just add whatever property you like. It has to be defined in the schema. If you try to add and persist

Code examples that use fine grained locks (JCR Jackrabbit?)

混江龙づ霸主 提交于 2019-12-06 13:53:41
问题 I'm doing an academic research in trying to develop a programming tool that assists in implementing fine-grained locking functions, for concurrent programs that maintain tree-like data structures. For example, the programmer may write some functions that receive a tree root-node and modify the tree (by traversing on some routes and adding/removing nodes), and the tool will help him to find where in the code nodes should be locked and where they can be released - so the functions could be