Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all 12476 articles
Browse latest View live

How to inject TokenAuthenticationHandler object in custom AuthenticationHandler?

$
0
0

Hi all,

 

I have requirement to get the user logged-in in CQ from encrypted password. In order to achieve this, I have created a custom authentication handler is to decrypt user's encrypted password and then generate AuthenticationInfo Map for authentication. So I have overrided extractCredentials method to solve this problem.

I need to inject TokenAuthenticationHandler object in my custom CustomAuthenticationHandler which implements AuthenticationHandler.

I require this to call the authenticationSucceeded method of TokenAuthenticationHandler in my custom AuthenticationFeedbackHandler to generate login-token cookie for CQ authentication.

I tried to inject TokenAuthenticationHandler as service by reference but dint work. I also tried to inject by interface AuthenticationHandler which always injects Day CQ LoginSelectorHandler.

I also tried to extend my CustomAuthenticationHandler to TokenAuthenticationHandler in order to call its authenticationSucceeded method. The call does takes place, but it refers to attributes of my CustomAuthenticationHandler instead of TokenAuthenticationHandler.

 

So I am not able to successfully call the authenticationSucceeded method of TokenAuthenticationHandler to generate login-token.

 

Any way to inject TokenAuthenticationHandler in my custom Authentication Handler will be really helpful.

Any other solution/approach to decrypt password and get the user login in CQ will also be helpful.

 

Thanks,

Vatsal


How to add a document to the JCR Repository via Java API

$
0
0

I'm trying to get started with the JCR 2.0 " Content Repository Java Technology API Specification" It's really a great document but I miss a minimum of examples to visualize how it is all fits together.

For a start I want to add a pdf-document to my local CRX repository. Form the book I see, that I must add a Node and add the Properties.

 

File file = new File("/mypath/mydocument.pdf");
FileInputStream is = new FileInputStream(file);
ValueFactory valueFactory = session.getValueFactory();
Binary myBinary = valFact.createBinary(is);
Value valueFactory =valFact.createValue(myBinary);
Node nodeCarl=content.addNode("Carl", "nt:file");
Property pCarl=nodeCarl.setProperty("jcr:data", myBinary);

The program fails with:

javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.jcp.org/jcr/1.0}data in the lastt cited line.

I don't know, why this comes up with ..jcr/1.0; The Classpath consists of JCR-2.0.jar and jackrabbit-standalone-2.2.13.jar.

 

Any hint to get this stored is appreciated.

Ulrich

Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through j

$
0
0

Certainly I realized that Apache Sling JCR Resource Resolver doesn't work for the anchor tags which is been rendered through jquery or javascript.

 

e.g.

 

In Felix Console , in Apache Sling JCR Resource Resolver configuration I have added following mapping.

 

/content/myproject/-/

 

So If any anchor tag is there like <a href="/content/myproject/en.html"> click me </a> then it will be mapped to "/en.html" automatically.

 

But the problem is there in following scenario.

 

I have an anchor tag as follows.

 

<a href="#" id="test"> click here </a>

 

And I am assigning the href to anchor through JQUERY.

 

<script>

$("#test").attr("href","/content/myproject/en.html");

</script>

 

Ideally this should have been mapped to "/en.html".

 

But it is not mapping to "/en.html". It still shows "/content/myproject/en.html".

 

How to resolve this.

 

Thanks,

Sai

How to limit path field selection only to one level?

$
0
0

Hi

 

Requirement:

 

      I have a pathfield where i have set a root path

 

for eg: /content/geometrix

 

 

req1.png

author shud be able to select only among these nodes. he shud not be able to select the child nodes of each individual nodes

 

eg: he can select /content/geometrixx/English

 

req2.png

 

 

but he shud not select child page of English

 

ie : /content/geometrixx/English/Toolbar shud not be assesible to him

 

req3.png

 

 

 

Hope my requirement is clear. Is there anyway we can achieve this.. If we can limit the nodes from expanding; then it would be very useful . Is there any way we can achieve this??

 

 

Thanks

 

Veena

CQ5.5 Workflow Model doesn't load in http://localhost:4502/lib/cq/workflow/content/console.html

$
0
0

Hi,

 

We noticed an unusual issue where in the models of the workflow doesn't gets loaded in (http://localhost:4502/lib/cq/workflow/content/console.html).

Although the models exists as expected in /etc/workflow/model but doesn't show up or doesnt get loaded.

 

I know most of people will immediately look into the users (permissions) but the concerned user is an admin and he has all the required permissions to view the workflow.

 

We get the below error in the logs:

*WARN* GET /libs/cq/workflow/content/console/instances.json HTTP/1.1] com.day.cq.workflow.impl.jcr.WorkflowManager Workflow cannot be loaded: Cannot create Workflow instance from node

*ERROR* GET /libs/cq/workflow/content/console/instances.json HTTP/1.1] com.day.cq.workflow.impl.model.CQWorkflowModelCache cannot load model. id: /etc/workflow/models/{suppressed workflowname}/jcr:content/model vid: 1.61

*ERROR* GET /libs/cq/workflow/content/console/instances.json HTTP/1.1] com.day.cq.workflow.impl.util.NodeReader Cannot create Workflow instance object from node javax.jcr.version.VersionException: Version 1.61 does not exist for /etc/workflow/models/{suppressed workflowname}/jcr:content/model

        at com.day.cq.workflow.impl.jcr.WorkflowModelManager.getWorkflowModel(WorkflowModelManager.j ava:90)

        at com.day.cq.workflow.impl.CQWorkflowSession.getModel(CQWorkflowSession.java:246)

        at com.day.cq.workflow.impl.util.NodeReader.createWorkflow(NodeReader.java:205)

        at com.day.cq.workflow.impl.jcr.WorkflowManager.getWorkflowInstances(WorkflowManager.java:74 9)

        at com.day.cq.workflow.impl.jcr.WorkflowManager.getAllWorkflowInstances(WorkflowManager.java :131)

        at com.day.cq.workflow.impl.CQWorkflowSession.getWorkflows(CQWorkflowSession.java:347)

        at org.apache.jsp.libs.cq.workflow.components.console.instances.json_jsp._jspService(json_js p.java:136)

        at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:497)

        at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:447)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java :235)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.j ava:85)

        at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngin eFactory.java:432)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:4 63)

        at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:500)

        at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:45)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)

        at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:147)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:308 )

        at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:141)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProce ssorImpl.java:257)

        at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChai n.java:49)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:64)

        at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:305)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.thehartford.thf.core.sessionmanagement.filter.ApplicationFilterServiceImpl.doFilter(A pplicationFilterServiceImpl.java:105)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgre ssTrackerLogFilter.java:59)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.j ava:220)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.day.cq.theme.impl.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:76)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:89)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:117)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServle tStarterFilter.java:135)

        at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilter Chain.java:60)

        at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcess orImpl.java:153)

        at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:206)

        at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:9 6)

        at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)

        at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java: 42)

        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:49)

        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

        at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:117)

        at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

        at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:238)

        at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

        at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)

        at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

        at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75 )

        at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)

        at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)

        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFil terChain.java:47)

        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.jav a:33)

        at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java: 48)

        at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)

        at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

        at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.ja va:250)

        at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:321)

        at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:340)

        at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:383)

        at com.day.j2ee.servletengine.ServletHandlerImpl.process(ServletHandlerImpl.java:351)

        at com.day.j2ee.servletengine.HttpListener$Worker.run(HttpListener.java:625)

        at java.lang.Thread.run(Thread.java:662)

*WARN* GET /libs/cq/workflow/content/console/instances.json HTTP/1.1] com.day.cq.workflow.impl.jcr.WorkflowManager Workflow cannot be loaded: Cannot create Workflow instance from node

CQ5 as Windows Service with LDAP Authentication

$
0
0

CQ5 as Windows Service with LDAP Authentication

1 Introduction

 

  • LDAP:  Lightweight Directory Access Protocol
  • Used for accessing centralized directory services.
  • LDAP is often used to achieve Single Sign On which allows a user to access multiple applications after logging in once.


2 Steps

 

1.    Install LDAP server,

1)    Double click the file(Download from apache website first)

ApacheDirectoryStudio-win32-x86_<architecture>-<version>

2)    After start the system, Create a new server (CQ5LDAP)

New-New Server

3)    Add group and users and save them

Name: Adobe

Suffix: ou=groups, dc=adobe, dc=com)

Name: Adobe2

Suffix: ou=users, dc=adobe, dc=com)

4)    Start the server

5)    Create a new connection (CQ5LDAP)

Connection name: CQ5LDAP

Hostname: localhost

Port: 10389

 

6)    Fill in the Authentication information

Bind DNor user: uid=admin, ou=system

Bind password: secret

 

7)    Right click the connection name, Import users with LDIF Import

 

2.    Configure repository.xml

 

  • Remove or comment the LoginModule element in the repository configuration (repository.xml). The configuration file can be found in the folder crx-quickstart/repository.
  • Ensure that the file ldap_login.conf is in a folder such as crx-quickstart/conf/ of your CRX installation folder.
  • Add the following bolded code to repository.xml so that users can login

    <SecurityManagerclass="com.day.crx.core.CRXSecurityManager">

        <WorkspaceAccessManager  class="org.apache.jackrabbit.core.

               security.simple.SimpleWorkspaceAccessManager"/>

        <UserManagerclass="com.day.crx.core.CRXUserManagerImpl">

            <paramname="usersPath"value="/home/users"/>

            <paramname="groupsPath"value="/home/groups"/>

            <paramname="defaultDepth"value="1"/>

        </UserManager>

    </SecurityManager>

 

3.    Change start.bat and Quickstart.bat


From the command line, start Quickstart with the option:

-Djava.security.auth.login.config=crx-quickstart/conf/ldap_login.conf

    For example:

    32-bit VM:

     java -Djava.security.auth.login.config=crx-quickstart/conf/ldap_login.conf -Xmx384M -jar crx-quickstart-<version>.jar

    64-bit VM:

     java -Djava.security.auth.login.config=crx-quickstart/conf/ldap_login.conf -XX:MaxPermSize=128m -Xmx512M -jar crx-quickstart-<version>.jar


4.    Starting CQ5 as Windows Service

 

We install CQ5 as a windows service with instsrv.bat located in C:\author\crx-quickstart\opt\helpers.Hence, if we want to use CQ5 service with LDAP. We need to change instsrv.bat and then run instsrv.bat to install CQ5 as a Windows Service.

Replace line 40: set jvm_options=-XX:MaxPermSize=256M

With: set jvm_options=-Djava.security.auth.login.config=C:/author2013/crx-quickstart/conf/ldap_logi n.conf";"-XX:MaxPermSize=256M

 

5.    Start the CQ5 service with CMD or Service of Task Manager

        c:>sc start CQ5 (or any service name you installed, say cq5author)


6.    Now you can login by LDAP users

CQ5 quickstart fails to complete with launchpad failure

$
0
0

I am attempting to run the CQ5 quickstart by both double-clicking the jar (in my case, C:\tools\cq\demo\cq-wcm-quickstart-5.4.0.jar) and launching from command prompt (C:\tools\cq\demo>java -Xmx384M -jar cq-wcm-quickstart-5.4.0.jar). The launcher app eventually times out and displays "Server not ready, browser not launched".

 

The login page (http://localhost:4502/login.html) displays...

Service Unavailable

 

In the server.log, I see…

 

...28.11.2011 12:58:49 *MARK * webapp-CRX Launchpad Webapp: Start Filter 'CRXLaunchpadLicenseFilter'

28.11.2011 12:58:49 *MARK * webapp-CRX Launchpad Webapp: Start servlet 'sling'

28.11.2011 12:58:50 *ERROR* webapp-CRX Launchpad Webapp: ERROR: Error parsing system bundle export statement: org.osgi.framework; version=1.5, org.osgi.framework.hooks.service; version=1.0, org.osgi.framework.launch; version=1.0, org.osgi.service.packageadmin; version=1.2, org.osgi.service.startlevel; version=1.1, org.osgi.service.url; version=1.0, org.osgi.util.tracker;version="1.4", org.apache.sling.launchpad.api;version=1.0.0,  ,javax.servlet;javax.servlet.http;javax.servlet.resources; version=2.4 (java.lang.IllegalArgumentException: No paths specified in header: )

java.lang.IllegalArgumentException: No paths specified in header:

                at org.apache.felix.framework.util.manifestparser.ManifestParser.parseStandardHeaderClause(M anifestParser.java:1432)

                at org.apache.felix.framework.util.manifestparser.ManifestParser.parseStandardHeader(Manifes tParser.java:1400)

                at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java: 162)

                at org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:193)

                at org.apache.felix.framework.Felix.<init>(Felix.java:374)

                at org.apache.sling.launchpad.base.impl.SlingFelix.<init>(SlingFelix.java:39)

                at org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:235)

                at org.apache.sling.launchpad.base.webapp.SlingBridge.<init>(SlingBridge.java:41)

                at org.apache.sling.launchpad.base.webapp.SlingServletDelegate.init(SlingServletDelegate.jav a:203)

                at javax.servlet.GenericServlet.init(GenericServlet.java:211)

                at org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:358)

                at org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:300)

                at org.apache.sling.launchpad.webapp.SlingServlet.init(SlingServlet.java:111)

                at javax.servlet.GenericServlet.init(GenericServlet.java:211)

                at com.day.j2ee.servletengine.ServletRuntimeEnvironment.doStart(ServletRuntimeEnvironment.ja va:113)

                at com.day.j2ee.servletengine.ServletRuntimeEnvironment.start(ServletRuntimeEnvironment.java :93)

                at com.day.j2ee.servletengine.WebApplication.loadStartupServlets(WebApplication.java:702)

                at com.day.j2ee.servletengine.WebApplication.start(WebApplication.java:631)

                at com.day.j2ee.servletengine.ServletContainer.start(ServletContainer.java:318)

                at com.day.j2ee.servletengine.ServletEngine.start(ServletEngine.java:285)

                at com.day.j2ee.server.Server.start(Server.java:227)

                at com.day.j2ee.server.Server.main(Server.java:607)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                at java.lang.reflect.Method.invoke(Unknown Source)

                at com.day.launcher.Bootstrap.run(Bootstrap.java:118)

                at com.day.crx.quickstart.Quickstart.run(Quickstart.java:680)

                at com.day.crx.quickstart.Main.<init>(Main.java:675)

                at com.day.crx.quickstart.Main.main(Main.java:730)

28.11.2011 12:58:50 *ERROR* webapp-CRX Launchpad Webapp: ERROR: Error starting slinginstall:C:\tools\cq\demo\crx-quickstart\launchpad\startup\1\org.apache.felix.http.br idge-2.2.0.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.felix.http.bridge [1]: Unable to resolve 1.0: missing requirement [1.0] package; (package=javax.servlet))

org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.felix.http.bridge [1]: Unable to resolve 1.0: missing requirement [1.0] package; (package=javax.servlet)

                at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)

                at org.apache.felix.framework.Felix.startBundle(Felix.java:1719)

                at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1148)

                at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)

                at java.lang.Thread.run(Unknown Source) ...

 

Then a bunch more errors "ERROR: Error starting slinginstall".


I’ve tried the “publisher” and “author” as well as the “generic” quick-start configurations and all fail the same way at the same spot.  Here is the sling.properties file:

 

#Overlay properties for configuration

#Mon Nov 28 14:26:17 PST 2011

org.apache.sling.commons.log.file.number=5

sling.installer.dir=${sling.home}/installer

sling.home=C\:\\tools\\cq\\demo\\crx-quickstart\\launchpad

ds.loglevel=warn

org.osgi.framework.system.packages=${osgi-core-packages}, ${osgi-compendium-services}, org.apache.sling.launchpad.api;version\=1.0.0, ${jre-${java.specification.version}} ${org.apache.sling.launcher.system.packages}

org.apache.sling.commons.log.file.size='.'yyyy-MM-dd

org.osgi.framework.bootdelegation=com.yourkit.*, ${org.apache.sling.launcher.bootdelegation}

felix.service.urlhandlers=true

org.osgi.framework.storage=${sling.home}/felix

org.osgi.framework.bundle.parent=framework

sling.ignoreSystemProperties=true

osgi-core-packages=org.osgi.framework; version\=1.5, org.osgi.framework.hooks.service; version\=1.0, org.osgi.framework.launch; version\=1.0, org.osgi.service.packageadmin; version\=1.2, org.osgi.service.startlevel; version\=1.1, org.osgi.service.url; version\=1.0

osgi-compendium-services=org.osgi.util.tracker;version\="1.4"

sling.context.default=default

ds.factory.enabled=true

org.apache.sling.commons.log.file=${sling.home}/logs/error.log

org.apache.sling.commons.log.level=INFO

org.apache.sling.launcher.system.packages=,javax.servlet;javax.servlet.http;javax.servlet. resources; version\=2.4

sling.bootdelegation.sun.reflect=sun.reflect

org.apache.felix.http.shared_servlet_context_attributes=true

obr.repository.url=http\://sling.apache.org/obr/repository.xml

org.osgi.framework.startlevel.beginning=30

felix.startlevel.bundle=20

felix.cm.dir=${sling.home}/config

 

A problem with my version of Java, maybe?

 

C:\tools\cq\demo>java -version

java version "1.7.0_01"

Java(TM) SE Runtime Environment (build 1.7.0_01-b08)

  Java HotSpot(TM) Client VM (build 21.1-b02, mixed mode, sharing)

 

The crx (http://localhost:4502/crx) and cq admin (http://localhost:4502/admin) sites seem to work.  But, the launchpad (http://localhost:4502/bin/login.html or http://localhost:4502/system/console) doesn’t.

 

Thanks in advance for any help!

~rollo

Using cURL to alter properties in a node

$
0
0

I'm wondering if anyone has figured out how to leverage cURL to change properties in existing nodes.

 

I have figured out how to upload, install and replicate packages, but we have a config node holding server addresses and other tidbits that need to be updated.

 

I'm hoping someone can give me an example of how to change a property to a node existing at say /apps/myApp/config/configuration with the property being server1URL.

 

Any help would be appreciated.


Insensitive search using query builder

$
0
0

Hi,

 

I want to convert below sql query so as to use for querybuilder .

 

select * from nt:unstructured where jcr:path like '/content/dam/company/project/data/%' and UPPER(ctn_no) LIKE 'HD%' or UPPER(family_name) LIKE 'HD%' order by jcr:score desc

 

I tried with below values from querybuilder component.

 

type=nt:unstructured

path=/content/dam/company/project/data

group.1_property=ctn_no

group.1_property.value=HD%

group.1_property.operation=like

group.p.or = true

group.2_property=family_name

group.2_property.value=HD%

group.2_property.operation=like

orderby=jcr:score

orderby.sort=desc

 

To do a case insensitive search, I am always converting input parameter to upper case so I can match that parameter with the value from CRX.

 

Please guide me if I am in right direction and how can I do case insensitive search using querybuilder with above approach.

 

 

Thanks,

Nishant Varandani

Customise CQ welcome page.

$
0
0

Hi,

     I am trying to customise the CQ welcome page. Under "WEB EXPERIENCE MANAGEMENT SOLUTION", I want to create a new children say "Profile". How should i go about it?Attaching the screen shot of the welcome page.

Welcomepage.png

 

Thanks in advance!

Event listener when a particular field value changes in dialog

$
0
0

Hi there,  Issue is that I need to change a jcr property when a specific field value is changed in dialog. Since all the fileds are modified / rewriten in jcr when the dialog is saved, i can not identify the modification on a particular field.

Does CQ provide a valid example of reverse replication for forms?

$
0
0

I am not talking about this:

http://helpx.adobe.com/cq/kb/HowToUseReverseReplication.html

and not this:

http://mkalugin-cq.blogspot.com/2012/02/reverse-replication-woes-solved.html

 

They work for polls and comments, but they don't seem to be working for forms. As far as I understand, the default servlet for forms creates a "sling:Folder" as a data container, under which all form values are set into properties. However, polls and comments are created as an entity(or node) under a container. A working example for comment is under "/content/usergenerated/content/geometrixx/en/blog/2009/02/shapecon_2009_inveg". All essential properties such as "cq:distribute", "cq:lastModified" are set correctly under this node. I tried to copy the idea of this example, but it never works for me.

 

Here's how I did.

1. I need to make a node as a "cq:Page", since reverse replication only works for this primary type. Let's name it "Page-1"

2. Create a "jcr:content" node under this node, make it as "cq:PageContent". I also set resourceType and template in "jcr:content". I need to make "Page-1" as a content page.

3. Create a data container under "cq:Page" node, make it "nt:unstructured". Let's name it "form_container". All form values are set into properties in this node. set "cq:lastModified", "cq:lastModifiedBy" and "cq:distribute" under this node.

4. Create a "jcr:content" node under "form_container", make it "nt:structured", set "cq:lastModified", "cq:lastModifiedBy" and "cq:distribute" under this node.

 

Obviously CQ doesn't know what I did and refuses to reverse replicate. Any help will greatly appreciate.

 

A finished upload will look like this:

 

/content

    /usergenerated

        /newsevent [cq:Page]

            /1351359963325_1 [cq:Page]

                |

                + form_content [cq:PageContent, cq:distribute==>true, and all form values stored as properties]

                |

                -- jrc:content [cq:distribute==> true, cq:lastModified==>Date Instance, cq:lastModifiedBy==>admin]

 

Kevin

Is there a max # of Sidekick Component Groups?

$
0
0

Our site currently has 5 component groups including 'Other', but if I try to add a new one, they just get added to 'Other' instead of their own component group that I tried to create.

 

Is there a maximun number of component groups that can display in the sidekick?   If there is a maximun number, can this be configured?

How to get the nodes from session through java program?

$
0
0

Hi,

 

     I would like to get the nodes from session objects through java program. I wrote the program like this,

 

package com.mycomp.node;

 

import javax.jcr.Node;

import javax.jcr.NodeIterator;

import javax.jcr.Property;

import javax.jcr.RepositoryException;

import javax.jcr.Session;

import javax.jcr.observation.Event;

import javax.jcr.observation.EventIterator;

import javax.jcr.observation.EventListener;

import javax.jcr.observation.ObservationManager;

 

import org.apache.felix.scr.annotations.Reference;

import org.apache.sling.jcr.api.SlingRepository;

import org.osgi.service.component.ComponentContext;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

import org.apache.felix.scr.annotations.Component;

import org.apache.sling.api.SlingHttpServletRequest;

import org.apache.sling.api.resource.Resource;

import javax.jcr.Session;

 

public class GetNode {

 

    public String getNodeName() throws Exception

    {

        Node node=null;

        SlingHttpServletRequest slingRequest=null;

        Session session=slingRequest.getResourceResolver().adaptTo(Session.class);

        node=session.getNode("/apps/mysite/components/page/samplecomponent");

        System.out.println("nnnnnnnnn"+node.getName());

        return node.getName();

    }

}

 

 

And the jsp is,

 

<%@include file="/libs/foundation/global.jsp"%><%

%><%@page session="false" %>

<%@page import="com.mycomp.node.GetNode"%>

%><%

    GetNode gn = new GetNode();

%>

<%=gn.getNodeName()%>

 

 

I successfully build the bundle and it is also in active state. But I'm getting the error like "only a type can be imported, com.mycomp.node resolve to a package".

 

Is this the way to get the objects from session. There is another method we have for getting the nodes i.e using session.getWorkspace().getObservationManager(). But I need the solution in this way. Please give the suggestuons.

 

 

Best Regards,

G.Dinakar.

@Reference annotation causing customised servlet stop getting called

$
0
0

Hi guys,

 

I noticed that as soon as I add the @Reference annotation in my servlet, the sevlet will not be called when the form is submitted. As soon as I remove @Reference the servlet will be called. But the email will not function because @Reference is required to make the email to work.

 

I have the servlet registered and briefly it looks like below:

 

@Service(value = Servlet.class)

@SlingServlet(

                    resourceTypes = {"myapp/components/content/faqNewQuestions"},

                    methods = {"POST"},

                    selectors = {"email"},

                    extensions = {"html"}

                    )

 

@SuppressWarnings("serial")

public class FAQNewQuestionServlet extends SlingAllMethodsServlet {

 

@Reference

          private MessageGatewayService messageGatewayService;

 

@Override

    protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException

    {

              response.setContentType("text/plain");

              response.getOutputStream().print("FAQNewQuestionServlet is called");

    }

}

 

MessageGatewayService is imported through:

import com.day.cq.mailer.MessageGatewayService;

 

This package is added to the .bnd file under:

Import-Package: ..., com.day.cq.mailer, org.apache.felix.scr,org.apache.felix.scr.annotations,...

 

the faqNewQuestions.jsp (which lives under apps/myapp/components/content/faqNewQuestions) has a form looks like this:

 

<form method="POST" action="<c:out value="${resource.path}" />.email.html">

          <input type="text" id="email" name="email"/>

          <textarea name="question" id="question"></textarea>

          <input class="button" id="questionSubmit" type="submit" value="submit" />

</form>

 

I just keep getting 'Content modified' page rather seeing the "FAQNewQuestionServlet is called" I was expecting.

 

Content modified /content/my-trick/jcr:content/par/faqnewquestions

Status

200

Message

OK

Location/my-trick/_jcr_content/par/faqnewquestions
Parent Location/my-trick/_jcr_content/par

 

Really appreciate any inputs..


Need to remove additional markup around components in preview/ publish

$
0
0

Hi all,

 

I have a quick question concerning the cq:noDecoration property on a

component that - if set to "true" - removes the <div> markup from a

component.

I need this behaviour because the markup produces invalid HTML. But

sadly when removing the wrap the component can not be selected any

more?

 

How can i create a component that has no additional markup wrapped

around it but can still be edited/selected?

 

It would be ok to have additional markup in edit mode but not in

preview mode.

 

Regards,

Shelly

CQ5.5 Session Timeout

$
0
0

Hello,

 

We would like to change the session timeout value for the Author server so that if an Author doesn't do anything for 30 minutes the CQ session expires.  Seems the default is several hours.

Manually Clean Dispatcher Cache

$
0
0

We have a requirement that we update some details of a page from a feed after certain interval of time and then we need to clean the dispatcher cache.

 

We have done few sling mapping also

e.g.

for page  /content/mysite/page1.html we have defined a sling mapping and whenever a request comes for http://domainname/mysite/page1.html it serves /content/mysite/page1.html

 

Cache generated : /mysite/page1.html in docroot folder

 

Once the page data is updated by the feed, we need to clean the cache.

 

I am trying to manually clean the cache by making following  POST request at http://domainname/dispatcher/invalidate.cache with parameters

CQ-Action: Activate
CQ-Handle:
/mysite

Content-Length: 0


It returns 201 with following but the cache is not deleted.  Am I doing something wrong ?

 

 

Any help will be much appreciated.

 

Regards,

-Yogesh

Inserting fragments in CQ AEM 5.6

$
0
0

Hello all,

 

Is there a way to retrieve a fragment from apache docroot and place it in CQ,

probably header as a fragment to be inserted to my site developed in CQ5.6

 

Regards,

NZ

How to write an ajax call to a JSP page

$
0
0

Hi

 

 

    In CQ publish side, I want to call a jsp page on click of a button . I know we cant directly call it from script. For that we have to use ajax either directly or using jquery.ajax. Can any one help me how can i acheive dis. A sample working example code will be very much helpful .

 

 

Thanks

 

veena

Viewing all 12476 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>