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

Inbox Notification from Workflow

$
0
0

Hi,

I've got a problem with Inbox Notification.

I want to inform an author about all steps during the workflow process (activated, deactivated, terminated) using Inbox Notification (not e-mail!)

I found a class InboxManagerImpl (method createMessage) so I create a method in ParticipantStepChooser class:

 

void sendTheNotification(WorkflowSession session) throws IOException {

com.day.cq.wcm.notification.inbox.impl.MessageImpl message = (MessageImpl) new InboxManagerImpl().createMessage(session.getUser());

message.setReason("Workflow has been Terminated");

message.save();

}

 

but after it, on my OSGi Console in CQ5, in the section Bundles I have sth like this:

com.day.cq.wcm.notification.inbox -- Cannot be resolved
com.day.cq.wcm.notification.inbox.impl -- Cannot be resolved

 

Can someone help me?

Question: How to create an Inbox Message (in Notification Inbox) using Java code?

 

Regards

Michal


How to implement Ajax

$
0
0

Hi All,

 

I need to implement Ajax functionality in my component.

 

The requirement is,

1. On clicking on a button Java servlet needs to be invoked.

2. In the servelt, need to access CRX nodes and store a particular value.

3. Back in the component, i need to retrieve this value(this can be doneby accessing the node value).

4. Page should not be refreshed.

 

How can i implement this? any sample code will be helpful to understand the ajax with sevlet implementation.

 

 

if there are any other possiblities, kindly let me know.

 

It is very urgent and needs to implement is as soon as possible.

 

i am in very needy situation.

 

Any help will be really helpful.

 

Thanks a ton in advance.

 

Regards,

Raja R

How to clean tarJournal?

$
0
0

Hi all,

 

We had a bug in which an endless loop was continuously creating and then deleting the same node.  I noticed that the size of the repository on disc (under crx-quickstart/repository) did grow significantly.  By running the tar optimization I was able to reduce the files under crx-quickstart/repository/workspaces/crx.default from about 30GB to 300MB.  However, under crx-quickstart/repository/tarJournal we still have data files amounting about 50GB, while I noticed on other servers this should also be around the 300MB.  The tar optimization process is not cleaning up this folder apparently.  How can this be cleaned up?

 

Thanks,

Jan

Vanity URLs in multiple domains with one CQ5 instance

$
0
0

I have two websites which are in different domains but use the same CQ5 author instance. How can I setup the same Vanity URLs for both websites.

For example, one.com/shorturl and two.com/shorturl. I tried it with /shorturl in Vanity URL for both page templates, but only one matching is always successful.

Multiple smartimage widgets in a component dialog

$
0
0

Is there a way to have multiple smartimage widgets in a single dialog? Specifically I'm struggling with the requestSuffix parameter. Most of the other ones I can adapt to get the second widget to save its info to a different location from the first, but I can't see how to do that with requestSuffix. If the values are the same for both widgets, then once an image is selected, I see the same image in both tabs of the dialog. If I change it to something like /image2.img.png, it's no longer hitting the component as the resource. If I change it to .image2.img.png, the script handling this selector appears to break. I might be able to change that script, but that doesn't seem like it'll be a very flexible approach.

 

Any other options? I'm in CQ 5.4 if that matters.

How can you re-size an image on the fly in CQ?

$
0
0

How can you re-size an image on the fly in CQ?  I have a few components that are using the image associated with a page, but all the components require a different size but same aspect ratio of the same image.  I don't want to have the DAM create the sizes on upload.

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


How do I use ?

$
0
0

Hi,

 

I am trying to <sling:include> a content node wrapped inside <div> on a jsp.

 

For example I have a textimage content node:  "/content/company/en/product/jcr:content/par/textimage"

 

I can access the html content by hitting http://localhost:4502/content/comapny/en/product/jcr:content/part/textimage.html

 

But now, I would like those HTML content to be rendered inside another JSP like this, so I tried using <sling:include>

 

<%@ taglib uri="http://cms.ecom.shc.com/bundles/commerce/global/trends/common" prefix="content" %>

<%@include file="/apps/commerce/global-commerce/global.jsp" %>

<%@page session="false"

        trimDirectiveWhitespaces="true" %>

<div>HELLO</div>

<div><sling:include path="/content/verticalpages/fashiontrends/en/trends/prom-shop/jcr:content/par/textimage" /></div>

<div>WORLD</div>

 

However, I am only seeing empty <div> where the <sling:include> is, no HTML content was returned.

 

What am I doing wrong?

 

 

Thanks in advance.

CRXDE vs Eclipse

$
0
0

Hey everyone,

     Just wondering how most of you do development for CQ5. I did have the developer training and we used CRXDE. Recently however we have consultants that do not recommend it. They recommend Eclipse. It is my understanding that CRXDE is Eclipse but cq-ified. Is CRXDE still distributed with CQ?

 

     We are just about to begin a huge project and I am trying to decide if I want to use Eclipse or CRXDE. My impression was that there were spcific features with CRXDE that relate to CQ that Eclipse would not have. And the consultants argue that CRXDE is obsolete? I'd rather use CRXDE since it is what CQ came with and all the documentation I have from training is in CRXDE.

    

     Can anyone help?

Adobe CQ5 Training? Where and who is best

$
0
0

Does anyone have any insight on where to get training on CQ5?  it would be helpfull if i can het the information if any third party provides training /certification in cq5.

If anybody

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

How to write a subquery using JCR SQL2 in CQ5(without ModeShape)

$
0
0

Hi,

 

We have a parent node with several levels of child nodes. We are trying to do a node level search i.e., if the search key is present in any of the properties in the parent node or the child nodes, the query must return the parent node alone(NOT the child nodes).

 

The below JCR SQL2 query will do the above said functionality,

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/DB/ParentNode]) and CONTAINS(s.*, 'searchKey')

 

The constraint is that we have other filters, which when applied, will give only the nodes which has the required property. For example

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/DB/ParentNode]) and CONTAINS(s.*, 'searchKey') and column1 = 'filter1'

 

where column1 is present only in the ParentNode and not the child nodes.

 

Hence the above query will limit the search to the ParentNode only and it will not search the child nodes. Also when you use the first query you are getting child node path but my requirement is to get all the Parent Node paths.

 

And so I decided to write a sub-query like the one shown below,

SELECT * FROM [nt:base] as a

WHERE PATH() IN (

   SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/DB/ParentNode]) and CONTAINS(s.*, 'searchKey')

)

and column1 = 'filter1'

 

But the above query is not working in CRXDE Lite. When i searched the web it is said that sub-query and join conditions are possible only using ModeShape.

 

I have no idea what ModeShape is. If any one has any idea on writing a sub query using JCR SQL2 in CQ5 without ModeShape, please help. Thanks in advance.

No cache invalidation when statsfilelevel > 0 and JCR Resource Resolver URL Mapping being used

$
0
0

IF  :

  • JCR Resource Resolver [1] is used to allow requests missing the initial /content

       AND

  • Dispatcher has a /statsfilelevel greater than 0

 

THEN

 

     It is impossible for dispatcher to invalidate the cache.

 

 

EXAMPLE:

 

  1. Content in CRX has /content/mysite/mylanguage/mypage
  2. Request comes in to dispatcher for /mylanguage/mypage.html
  3. CQ serves /mylanguage/mypage.html successfully
  4. Dispatcher saves the cache at /mylanguage/mypage.html
  5. Author server sends activation request for /content/mysite/mylanguage/mypage
  6. Dispatcher recieves the activation request and touches stat file at :
    1. /content
    2. /content/mysite
    3. /content/mysite/mylanguage
  7. Request comes in to dispatcher for /mylanguage/mypage.html
  8. The stat file at /mylanguage has never been touched, and statsfilelevel > 0, so /mylanguage/mypage.html is considered valid
  9. Dispatcher returns the cached file at /mylanguage/mypage.html

 

I have seen this suggestion from DAYCARE [2], but it says to rewrite the URL so that the cache is still stored in full context. We can't do this for multiple technical reasons, and so I'm wondering if, instead, there is a way to make the {path} variable in the extended replication agent options [3] intelligent enough to strip activation path URI based on URL Mappings, the same way the Link Rewriter rewrites links based on these exact settings. We really need the activation path to change rather than the request path in the web server.

 

 

[1]: Go to http://localhost:4502/system/console/configMgr and click Apache Sling JCR Resource Resolver. Then add a URL Mapping such as /content/mysite/-/

 

[2]: http://dev.day.com/content/kb/home/cq5/CQ5SystemAdministration/HowToFlushMappedContent.htm l

 

[3]: Go to http://localhost:4502/etc/replication/agents.author/flush.html , click edit, and go to Extended tab

Send Email Using CQ API and custom template

$
0
0

Is is possible to send email using CQ API and custom template.

 

If yes how can i pass template as Subject

 

http://blogs.adobe.com/learningwem/2011/11/27/cq5-4-workflow-process-to-send-an-email-usin g-messagegateway/

 

I was followed this and able send email to the recipients .

 

But is it possible to send email CQ APi and custome email template ?

 

I was tried this using workflow process

................................................................................

public class SendEmailWorkflowProcess implements WorkflowProcess {

 

    @Reference

           private MessageGatewayService messageGatewayService;

   

    public void execute(WorkItem item, WorkflowSession wfsession,MetaDataMap metaData) throws WorkflowException {

 

 

              HtmlEmail email = new HtmlEmail();

 

         try{

               .......................

               ...................

               email.setTo( emailRecipients );

              email.setSubject( "This is subject");

              email.setHtmlMsg( "Email testing is on");

 

              String template = "/apps/cq/workflow/email/test/en.txt";

              Session session = wfsession.getSession();

 

              Resource templateRsrc = jcrResolverFactory.getResourceResolver(session).getResource(template);

 

              if (templateRsrc.getChild("file") != null) {

                 templateRsrc = templateRsrc.getChild("file");

              }

              if (templateRsrc == null) {

                 throw new IllegalArgumentException("Missing template:---------- " + template);

              }

             

              final MailTemplate mailTemplate = MailTemplate.create(templateRsrc.getPath(),

                      templateRsrc.getResourceResolver().adaptTo(Session.class));

           

                        email = mailTemplate.getEmail(StrLookup.lookup(properties,HtmlEmail.class));

      

              //Check the logs to see that messageGatewayService is not null

              log.info("messageGatewayService : " + messageGatewayService);

 

 

              messageGateway = messageGatewayService.getGateway(HtmlEmail.class);

 

 

              //Check the logs to see that messageGateway is not null

              log.info("messageGateway : " + messageGateway);

 

 

              messageGateway.send( email );

             }

          catch ( Exception e ) {

              e.printStackTrace();

              log.error( "Fatal error while sending email in workflow", e );

          }

 

 

     } 

 

 

    }

 

..............................................

 

If this is correct procedure ,

 

email = mailTemplate.getEmail(StrLookup.lookup(properties,HtmlEmail.class));

 

what value required for " properties "(properties can't be resolved)

 

All sugestions are accepted


Dispatcher Flush Agent on Publisher not invalidating cache

$
0
0

Hi all,

 

We're having an issue with invalidating that cache apon activation/replication of content, but only from the Publish flush agent.  I've copied the default flush agent on the Publish instance, updated the URI to point to my dispatcher, and enabled the agent.  Clicking Test Connection shows a successful connection to the dispatcher.  Also, I can see that the .stat file has been created at the web root on the dispatcher (I'm not specifying a specific statsfile or a statsfile level in the dispatcher.any).  When I change a setting in the publisher flush agent and save it, or stop and start it, the .stat file is updated.  So I know the Publisher is able to correctly reach the dispatcher and pass along the invalidate message to update the .stat file.

 

When I replicate a node from Author the Publisher, I see the following in the Publisher error.log:

 

22.05.2013 04:23:23.241 *INFO* [ObservationManager] com.day.cq.wcm.core.impl.components.ComponentCacheImpl Detecting component change. invalidating cache.

22.05.2013 04:23:23.245 *INFO* [10.20.30.40 [1369196603165] POST /bin/receive HTTP/1.1] com.day.cq.replication.impl.content.durbo.DurboImporter imported content in 79ms for durbo request on path: /apps/my-project/components/page/base/footer.jsp

22.05.2013 04:23:23.245 *INFO* [10.20.30.40 [1369196603165] POST /bin/receive HTTP/1.1] com.day.cq.replication.impl.servlets.ReplicationServlet Processed replication action in 79ms: ACTIVATE of /apps/my-project/components/page/base/footer.jsp

 

However when I check the dispatcher, I see that the .stat file has not had its timestamp updated.  I've also noticed that when I change the node and replicate it, the 'Detecting component change. invalidating cache.' log line above does not always appear in the log file - it appears only sometimes with the other 2 long lines.  This part seems random.

 

In my testing, I've also created a Dispatcher Flush agent on the Author instance (after disabling the one on the Publish instance), and 100% of the time when I replicate the /apps/my-project/components/page/base/footer.jsp to the Publisher, the Author flush agent correctly updates the .stat file timestamp.  So I'm 100% confident that the file I'm editing is able to be cached, and that changing and replicating it does update the .stat file.

 

Just never from the Publish flush agent!

 

I've tried all combinations of trigger settings on the Publish agent to no avail.  I've also inspected the properties of the agent in CRXDE Lite, and I can't see anything that the Author agent has and the publish agent is missing!

 

I've also tried creating the Publish agent by copying the default one from the tools console and updating the URI, creating a Publish agent on the Author and replicating it to the Publisher, and also creating it directly on the Publisher via curl calls - all of these methods seem to create a valid dispatcher flush agent on the Publisher that successfully connects to the dispatcher (confirmed by a successful 'Test Connection' click after creating), but none of them ever update the .stat file on the dispatcher after content replication.

 

Any thoughts here on where else to look would be greatly appreciated!!

 

Cheers,

K

Vaultclipse plugin

$
0
0

Has anyone got vaultclipse plugin working for Eclipse in windows machine.  I have it working just fine in Mac.

In windows, same configuration gives me filenotfound error when "import".  It looks like it exports in different folder and tries to import from different folder.

 

Any thoughts?

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.

CQ, CQ.i18n is not Defined | Publish Instance | CQ 5.4

$
0
0

Hi,

 

We are using OOTB CQ.i18n.getMessage for localized JQuery Messages. everything is working as expected on Auhor instances but on Publish , it is throwing CQ is not Defined, CQ.i18n is not defined JAVA SCRIPT Errors.

 

Code e.g.

email: CQ.I18n.getMessage("APP201")

 

Do we need to enable any extra JS call or include any JS file into the clientlibs? Any pointers to this would be apreciated.

 

 

Thanks

Vinay

can I set sidekick's Allowed Components for a parsys at the Template level?

$
0
0

The components page section on parsys[1] explains that you can set the sidekick's Allowed Components for a parsys by clicking Design Mode (ruler icon) in sidekick, then clicking Edit on the parsys and putting a checkmark on the components you want.  We are defining templates for our authoring users and I don't want them to have to go through that effort for every page.  I want to define something at the Template level which specifies the Allowed Components so that the user can use WCM New Page and the parsys on the page will already be set up right.  How do I do this?

 

Our template has sling:resourceType=/apps/hello/components/ourpage, and ourpage has a JSP which specifies:

    <cq:include path="par" resourceType="hello/components/ourparsys"/>

We just copied ourparsys from the foundation parsys.  Inside it has a design_dialog, which I double-clicked in CRXDE Lite and I see the Design View ("Edit Component," "ParSys (Design)").  I put a checkmark on one of the Allowed Components, clicked Save, but the checkmark was not saved.  When I closed this view and double-clicked the design_dialog again, the checkmark was gone, and when I went to WCM Websites and made a New Page from our template the sidekick still did not show our desired component.

 

So please advise, is there any way to set Allowed Components so it will take effect on all New Page webpages made from a given template?

 

[1] http://wem.help.adobe.com/enterprise/en_US/10-0/wem/wcm/default_components.html#Paragraph System (parsys)

Viewing all 12476 articles
Browse latest View live


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