jcr

How to store images to jackrabbit and deliver those images to HTML pages?

若如初见. 提交于 2019-12-06 11:32:12
问题 How to store images to jackrabbit and deliver those images to HTML pages? Ex. If user will upload multiple images from one HTML page then he should be able to see all those images in next html page or any other page when required 回答1: This is the way: public class JackRabbitServiceImpl { Repository repository = new TransientRepository(); public JackRabbitServiceImpl() throws Exception{ Session session = repository.login( new SimpleCredentials("username", "password".toCharArray())); try{

ranked full text search results using Lucene with modeshape

独自空忆成欢 提交于 2019-12-06 07:23:34
问题 I'm trying to get full-text search working with modeshape. I'm particularly interested in ranked results based on lucene index. Here is my repository configuration "indexProviders": { "lucene": { "classname": "lucene", "directory": "${user.home}/repository/indexes" } }, "indexes": { "textFromFiles": { "kind": "text", "provider": "lucene", "nodeType": "nt:resource", "columns": "jcr:data(BINARY)" } }, I noticed a lucene index created at the specified location. I added 10-15 filesc with varied

how to get array values of a node property in jcr

て烟熏妆下的殇ゞ 提交于 2019-12-06 07:20:15
问题 Need help in getting the string[] values of node property?? for example I have a node image which has property "references" of type String[] . I need to get the first value of array. Thanks 回答1: From the Node, you can get the references property. And then call getValues to the reference values. From there, just take the first. Something like public String getFirstReference(Node node) throws RepositoryException { Property references = node.getProperty("references"); Value[] values = references

Adobe CQ : Regarding Session in Event Listener

烈酒焚心 提交于 2019-12-06 07:11:40
I have a question regarding event listener. We have a event listener which listen to delete node event and perform some activity say "send email". While code review i found this, although this code is working fine i am not convinced with the session being handled here : @Activate protected void activate(ComponentContext context) { try{ final String path="/content/dam/"; Session session = repository.loginAdministrative(repository.getDefaultWorkspace()); observationManager = session.getWorkspace().getObservationManager(); observationManager.addEventListener(this, Event.PROPERTY_REMOVED, path,

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

十年热恋 提交于 2019-12-06 05:45:05
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? 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 (commit) a property that is not defined, you get exactly this ConstraintViolationException . So here's what

How do you backup an apache Jackrabbit repository without shutting Jackrabbit down?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 04:02:18
When running Apache Jackrabbit JCR as an embedded service in your app, is there a quick way to get a sound and consistent backup of the contents of the Jackrabbit repository without shutting Jackrabbit down? If so how? See BackupAndMigration on the Jackrabbit Wiki for a list of options. I would recommend to use XML export (system view), as it is the simplest solution. Also, because it is part of the JCR standard, so it should work on other JCR implementations as well. Note that this approach has one drawback: it is currently not possible to re-import a full export, ie. from the root node and

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

纵饮孤独 提交于 2019-12-04 20:12:43
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 executed concurrently on the same tree. I am looking for some real-life code examples in which such fine

How to store images to jackrabbit and deliver those images to HTML pages?

落花浮王杯 提交于 2019-12-04 15:44:51
How to store images to jackrabbit and deliver those images to HTML pages? Ex. If user will upload multiple images from one HTML page then he should be able to see all those images in next html page or any other page when required This is the way: public class JackRabbitServiceImpl { Repository repository = new TransientRepository(); public JackRabbitServiceImpl() throws Exception{ Session session = repository.login( new SimpleCredentials("username", "password".toCharArray())); try{ InputStream stream = new BufferedInputStream(JackRabbitServiceImpl.class.getResourceAsStream("red_rose.jpg"));

ranked full text search results using Lucene with modeshape

帅比萌擦擦* 提交于 2019-12-04 14:28:14
I'm trying to get full-text search working with modeshape. I'm particularly interested in ranked results based on lucene index. Here is my repository configuration "indexProviders": { "lucene": { "classname": "lucene", "directory": "${user.home}/repository/indexes" } }, "indexes": { "textFromFiles": { "kind": "text", "provider": "lucene", "nodeType": "nt:resource", "columns": "jcr:data(BINARY)" } }, I noticed a lucene index created at the specified location. I added 10-15 filesc with varied number of occurrence of search term into repository, and tried searching using some words. I am printing

What is the difference between jcr:primaryType and jcr:mixinTypes?

亡梦爱人 提交于 2019-12-04 13:04:04
问题 I am just curious to know what is the difference between jcr:primaryType and jcr:mixinTypes, and why exactly does jcr:mixinTypes is used ? what does it signifies ? If you check /content/dam folder in crx it shows jcr:primaryType property value as sling:OrderedFolder and jcr:mixinTypes as mix:lockable,rep:AccessControllable where jcr:primaryType means this a sling folder but why mixin type. Also went through these docs http://www.day.com/specs/jcr/1.0/6.7.4_Primary_and_Mixin_Node_Types.html