jcr

How to determine if a JCR property is multivalue?

限于喜欢 提交于 2020-02-04 03:33:26
问题 How do you determine if a JCR property is multivalve? I tried calling getType() on the property but that returns the same value if it's a String or String Array. Thanks! 回答1: Using the isMultiple() method of the Property class you can determine if the property is multi-valued or not. Property prop = node.getProperty("some-property"); if (prop.isMultiple()) { //do something } else { //do something else } 来源: https://stackoverflow.com/questions/42822066/how-to-determine-if-a-jcr-property-is

Create new workspace

自作多情 提交于 2020-01-15 07:01:29
问题 Section 7.1.6 of the Modeshape docs say 'Your application can now create and remove workspaces using the standard JCR 2.0 API.' The JCR 2.0 doc says to use Workspace.createWorkspace(String name) How do I make this part of my repository obtained using the code at the bottom of this post? Also, how to I get a list of the workspaces already in the repository? Thanks for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) { if (factory instanceof org.modeshape.jcr.api

Magnolia CMS 5.5.5 Choose from roles

五迷三道 提交于 2020-01-13 06:57:08
问题 I am looking for a possibility to choose certain roles in a Page property Dialog. Some parts of the page should be only viewable to certain roles. What I got is - name: allowedRoles class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition label: Select Roles field: name: roleLinkField class: info.magnolia.ui.form.field.definition.LinkFieldDefinition targetWorkspace: userroles appName: security identifierToPathConverter: class: info.magnolia.ui.form.field.converter

Adobe CQ : Regarding Session in Event Listener

a 夏天 提交于 2020-01-02 09:19:10
问题 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

Programatically render template area in Magnolia CMS

…衆ロ難τιáo~ 提交于 2019-12-24 14:02:06
问题 I am using Magnolia CMS 5.4 and I want to build a module that will render some content of a page and expose it over REST API. The task is simple but not sure how to approach it and/or where to start. I want my module to generate partial template or an area of a template for a given reference, let's say that is "header". I need to render the header template/area get the HTML and return that as a response to another system. So questions are: is this possible at all and where to start? 回答1: OK

Saving Data in JCR Node, what am I doing wrong?

為{幸葍}努か 提交于 2019-12-24 11:27:06
问题 I have created and deployed a bundle(Servlet) successfully that accepts username and password from user, now I want to save it in JCR Repository under /content/mydata/ I am getting Exception java.lang.IllegalArgumentException: relPath is not a relative path: {} {}oliver Here is my code public class CustomerJCRAccessImp implements CustomerService { @Reference protected SlingRepository repository; protected static final Logger log = LoggerFactory.getLogger(CustomerJCRAccessImp.class); public

How can I find out what is causing a certain URL to be resolved to a synthetic resources?

浪尽此生 提交于 2019-12-24 07:07:08
问题 On my Adobe CQ 5 (CQ 5.6) installation, for some reason, there's a URL ( http://localhost:4503/services ) that is getting resolved to a synthetic resource: This is causing CQ to show the following page, rather than a 404 Page Not Found page: What is causing this behavior? 回答1: You get Forbidden error not because of the strange type of the /services , but because you didn't add any extension (you'll get the same result requesting /content/geometrixx ). Let's try to add some extension: .html

Case insensitive search in CQ5 using querybuilder

一世执手 提交于 2019-12-24 03:07:05
问题 Please suggest on how to implement case insensitive search using querybuilder in CQ5. My code is as below ... paramMap.put("1_property", searchType); paramMap.put("1_property.value", "%" + searchString + "%"); paramMap.put("1_property.operation", "like"); paramMap.put("2_property", "documentId"); paramMap.put("2_property.operation", "exists"); paramMap.put("3_orderby.sort", "asc"); paramMap.put("p.limit", "0"); searchType is the node property searchString is the string that needs to be

How to create repository instance in JackRabbit Oak using MicroKernel

半腔热情 提交于 2019-12-24 02:25:07
问题 According to JackRabbit Oak official documentation, one of the ways of creating Repository instance is to create a MicroKernel object and pass it to JCR's parameterized constructor like this: MicroKernel kernel = ...; Repository repository = new Jcr(kernel).createRepository(); But looking at the JCR class javadocs, i can't find any constructor which takes an object of type MicroKernel . So my questions is : How can we get a repository object using MicroKernel in JackRabbit Oak( not JackRabbit

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

痴心易碎 提交于 2019-12-22 04:24:06
问题 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? 回答1: 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