jcr

how to get array values of a node property in jcr

浪尽此生 提交于 2019-12-04 09:13:52
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 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.getValues(); return values[0].getString(); } Siddharth Rawat Property nProp = node.getProperty("references"

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

耗尽温柔 提交于 2019-12-04 03:43:29
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 production environments (except for read-only uses) Does anyone have any experience using

jackrabbit-standalone-2.4.0.jar Populate does not work

怎甘沉沦 提交于 2019-12-04 02:01:32
I just downloaded and started Jackrabbit using: java -jar jackrabbit-standalone-2.4.0.jar When I call the populate.jsp, I get this error: Error while accessing the repository: LoginModule ignored Credentials Check the configuration or use the easy setup wizard. When I click easy setup wizard link, I get this: HTTP ERROR 404 Problem accessing /admin/. Reason: NOT_FOUND Is there something wrong with this Jackrabbit build? It appears that the implementation has changed but the documentation hasn't been updated. I got this same error using the "stand alone" server like you. If you look into the

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

你。 提交于 2019-12-04 01:59:35
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? Another alternative is to completely skip an OCM framework and simply use javax.jcr.Node as a very flexible DAO itself. The fundamental reason why OCM frameworks

JCR checkin/checkout operations

微笑、不失礼 提交于 2019-12-03 06:01:53
I'm just starting to work with JCR (apache jackrabbit), i want to ask simple question (because i coudn't find good tutorial for it): So for what do i need Node.checkout and Node.checkin methods? What do they mean? Thx The 'checkin' and 'checkout' methods have to do with how a JCR repository tracks the versions of content. The 'checkout' method signals to the repository that your client application is (likely) going to be modifying some versionable content. The 'checkin' methods signals to the repository that your client application has made changes to the versionable content, and that the

CQ5 QueryBuilder Reference in Sling Servlet

拥有回忆 提交于 2019-12-02 09:38:55
I am declaring a sling servlet like so @Component(metatype = false) @Service(Servlet.class) @Properties({ @Property(name = "sling.servlet.paths", value = "/bin/foo/bar"), @Property(name = "sling.servlet.methods", value = "POST") }) public class FooBarServlet extends SlingAllMethodsServlet { ... } I override doPost like so @Override protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException { ... } And I am able to post from a client. Great! I throw in the following @Reference private QueryBuilder queryBuilder; as per the documentation, a

Jackrabbit Running Queries against UUID

假如想象 提交于 2019-12-02 04:17:43
问题 I am using Jackrabbit and I am trying to query for an existing node which has a UUID. My code is shown below. The problem is that UUID for referenceNode is of the form "'90be246a-a17c-445e-a5ad-81b064de0bee'" and it seems that the XPATH engine used in Jackrabbit (Lucene) has problems dealing with hyphens. If I run query2, everything is fine and referenceNode is printed. If I run query1 (with the UUID) inside Eclipse, nothing is returned. HOWEVER, if I run query1 inside Jackrabbit Viewer, the

Jackrabbit Running Queries against UUID

拥有回忆 提交于 2019-12-01 23:42:36
I am using Jackrabbit and I am trying to query for an existing node which has a UUID. My code is shown below. The problem is that UUID for referenceNode is of the form "'90be246a-a17c-445e-a5ad-81b064de0bee'" and it seems that the XPATH engine used in Jackrabbit (Lucene) has problems dealing with hyphens. If I run query2, everything is fine and referenceNode is printed. If I run query1 (with the UUID) inside Eclipse, nothing is returned. HOWEVER, if I run query1 inside Jackrabbit Viewer, the query runs fine. It seems like I have to escape the hyphens in my queryString but I tried adding double

Set a CQ5 component to editable or not editable

跟風遠走 提交于 2019-11-30 18:24:40
问题 Is it posible if i want to set a cq5 component editable in page A, but not editable in page B. For example: at page A, i have C component we allow authors to open dialog and edit the component. But we do not allow authors to open dialog to edit component C on Page B. I try to research cq:EditConfig link, but It's not enough documentation to resolve my issue. 回答1: You can set ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE before the include, and remove it after the include.

How to set a resource property

霸气de小男生 提交于 2019-11-30 17:49:50
I have a Sling Resource object. What is the best way to set or update its property? Tomek Rękawek It depends on the Sling version: Sling >= 2.3.0 (since CQ 5.6) Adapt your resource to ModifiableValueMap , use its put method and commit the resource resolver: ModifiableValueMap map = resource.adaptTo(ModifiableValueMap.class); map.put("property", "value"); resource.getResourceResolver().commit(); Sling < 2.3.0 (CQ 5.5 and earlier) Adapt your resource to PersistableValueMap , use its put and save methods: PersistableValueMap map = resource.adaptTo(PersistableValueMap.class); map.put("property",