Can I know what library to use?
Is that any there is already included in the WCM installation?
Thanks
Can I know what library to use?
Is that any there is already included in the WCM installation?
Thanks
Hi ,
I am creating a custom tag library and want to use it in one of the components I have created. I have made a bundle inside src/com.mycompany.test.TestBundle/com.mycompany.test.TestBundle.bnd and created my java tag class inside com.mycompany.test.TestBundle/src/main/java/com/mycompany/test/DateTagClass.java and the tld in com.mycompany.test.TestBundle/src/main/resources/META_INF/dateTaglib.tld. Here is the code for both the java tag class and the tld
----------------
tag class
package com.mycompany.test;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
*
* @author ankit-chandrawat
*/
public class DateTagClass extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
out.println(getTodayDate());
}
private String getTodayDate() {
DateFormat df = new SimpleDateFormat("dd MMMM yyyy");
String formattedDate = df.format(new Date());
return formattedDate;
}
}
--------------
tld file
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>date</short-name>
<uri>src/main/resources/META_INF/dateTaglib.tld</uri>
<tag>
<name>todaysDate</name>
<tag-class>com.mycompany.test.DateTagClass</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
--------------------------------------------------
I am trying to use it inside a component jsp that I have created as :
<%@taglib prefix="date" uri="src/main/resources/META_INF/dateTaglib.tld"%>
But with the above taglib include in place, all I see is a blank page. I am trying this on author and have not pushed it to publisher yet. I believe it is not able to recognize the tld. Could you please help me on this.
Thanks
Ankit
Dear All,
Could anyone please let me know how to find out which version of CQ has been installed on publish instance?
Regards
Hi,
I've been evaluating CQ5 for the last week, and one of my key desires (at this stage) is to be able to modify the values added to the class attribute of the "decoration tags" that are wrapped around the components when they are rendered - this will be important in being able to offer a responsive design experience in edit mode...
The options I have explored are:
Adding cq:noDecorate to the components - this removes the decoration tag and the associated JavaScript, which, while I can then add my own wrapping decoration, I need the associated JS in order to actually perform the edit functions.
Adding cq:htmlTag + cg:tagName + class nodes/attributes to the components - this provides what I need, in that I can define the wrapping tag name and add a class to the tag and the JS is still generated. However, this is applied at a configuration level - I need this to be possible on the fly (as the actual class name to be added will be user configurable).
So, as I understand it, you can turn off decoration programatically using componentContext.setDecorate(false); which is supposed to the equivalent to cq:noDecoration. And it is - with the buggy exception that it doesn't remove the opening decoration tag... This then causes all sorts of nested mess. As mentioned above this wouldn't work for me anyway as the JS is removed too and I need this.
The next step was to try componentContext.setDecorationTagName("mytag"); to see whether there is a way to hook into the decoration tags this way.
Using componentContext.setDecorationTagName(""); is supposed to remove the decoration tags. What is appears to do is again only remove the closing tag! It does however leave the JavaScript, and whilst I can manually close the decoration block, I still can't modify the opening tag - which is the actual aim.
Incidentally, using componentContext.setDecorationTagName("mytag"); simply changes the closing tag to "</mytag>" and again it leaves the JS and the opening tag detail untouched.
This area feels very buggy to me and as a new CQ user it raises concerns that this is indicative of CQ5 as a whole - Would this be fair or am I missing something?
Regards
James
Hi,
I want my local instance of AEM to use my system proxy that's already setup in Windows - so that I don't need to specify the proxy details and my credentials in the OSGi settings for the httpclient.
I am running the cq jar in debug mode (-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=30303 -Xnoagent -Djava.compiler=NONE)
I am using Eclipse/IntiellJ ide. The connection is established but the debugger doesn't work.
Response will be appreciated.
Hi
I want to connect to the crx from my script function and retrieve a node in my script so dat i cant retrieve the properties of that node using script... Is dat possible? If yes how is it acheivable ?
Thanks in Advance
Veena
I am running following query on my CQ5 environment and it taking about 15 secs to execute
type=dam:Asset
orderby=@jcr:content/jcr:lastModified
orderby.sort=desc
p.offset=0
p.limit=10
group.p.or=true
group.0_path=/content/dam/node1
group.1_path=/content/dam/node2
As soon as I remove orderby it come down to 0.1 sec
type=dam:Asset
p.offset=0
p.limit=10
group.p.or=true
group.0_path=/content/dam/node1
group.1_path=/content/dam/node2
Any thing I am missing? or should change?
Thanks,
Can querybuilder.json return a similar search? That is if I use
querybuilder.json?fulltext=walnt
I'd like to get the results for "walnut". What predicate should I use?
Id attribute of Div tag is stripped in Rich text component. How do we handled this. Any help regarding this appreciated?
REQUIREMENT
Construct some custom JSON rendition of a page. For example: /content/site/page.my.json
And we want to accomplish this without losing the out-of-the-box functionality:
WHAT WE'VE TRIED
We've added a jsp to our global page template and named it my.json.jsp. This has given us this behavior:
So we're nearly there. Next, we add "json" to the list of extensions that are treated with default resolution behavior, by going to felix config and editing the "Apache Sling Servlet/Script Resolver And Error Handler:
By doing this, now our custom json WORKS, but we get the following results:
How can we provide this custom renderer at *.my.json without losing the functionality of the default *.json renderer, necessary for dialogs in the page properties, etc.
Thanks!
Is is possible to send email using CQ API and custom template.
If yes how can i pass template as Subject
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
Our editors would like to make our site WCAG compatible, but are having problems setting title attributes for hyperlinks.
Is there any way to allow an editor to set the title attribute when creating a link in the Rich Text Editor?
I have a custom 404 set up by following this:
http://dev.day.com/docs/en/cq/current/developing/customizing_error_handler_pages.html
I changed it so that the default.jsp page will now FORWARD to my DYNAMIC 404.html page. If I just allow it to stop at default.jsp, I have a 404 error code, but once it FORWARDs (not redirects), the new page that shows comes in as a 200 code.
How would I force the error code to be preserved, if forwarding the default.jsp to a content page (to keep the same dynamic content on all other pages)? I have the error code and response properly before forwarding (not redirecting), but once I get to the new page, it shows a status code of 200. Is there any way to force this? Disabling the CQ WCM Debug Filter doesn't change this for me.
Hi All,
I am planning to learn Adobe CQ5. Can anyone give me more information on Adobe CQ5?
Also share me the links to download the tool, learning material etc if any one has?
Thank you
Hi ,
i have written a servlet on my instance and i wanto hit this from another instance wihtouht asking fro authentication ?
Please suggest how can i disable authentication on the first CQ instance .
Thanks
I am trying to create a custom Adobe CQ commerce provider using maven, following this tutorial : Creating custom Adobe CQ commerce providers
I am able to create the Adobe CQ archetype project successfully. However, when i try to run the command mvn eclipse:eclipse, i encounter the following error:
C:\AdobeCQ\commerce-training>mvn eclipse:eclipse [INFO] Scanning for projects... [WARNING] The POM for com.day.jcr.vault:content-package-maven-plugin:jar:0.0.13 is missing, no dependency information available [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.adobe.training:commerce-training-content:1.0-SNAPSHOT (C:\AdobeCQ\commerce-training\content\pom.xml) has 2 errors [ERROR] Unresolveable build extension: Plugin com.day.jcr.vault:content-pack age-maven-plugin:0.0.13 or one of its dependencies could not be resolved: Failur e to find com.day.jcr.vault:content-package-maven-plugin:jar:0.0.13 in http://re po.maven.apache.org/maven2 was cached in the local repository, resolution will n ot be reattempted until the update interval of central has elapsed or updates ar e forced -> [Help 2] [ERROR] Unknown packaging: content-package @ line 20, column 16 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin gException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti onException
The pom.xml file is the default one generated from the command executed from the tutorial:
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <!-- ====================================================================== --> <!-- P A R E N T P R O J E C T D E S C R I P T I O N --> <!-- ====================================================================== --> <parent> <groupId>com.adobe.training</groupId> <artifactId>commerce-training</artifactId> <version>1.0-SNAPSHOT</version> </parent> <!-- ====================================================================== --> <!-- P R O J E C T D E S C R I P T I O N --> <!-- ====================================================================== --> <artifactId>commerce-training-content</artifactId> <name>Commerce Training Package Package</name> <packaging>content-package</packaging> <build> <resources> <resource> <directory>src/main/content/jcr_root</directory> <filtering>false</filtering> <excludes> <exclude>**/.vlt</exclude> <exclude>**/.vltignore</exclude> </excludes> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <includeEmptyDirs>true</includeEmptyDirs> </configuration> </plugin> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <extensions>true</extensions> <configuration> <group>adobe training</group> <filters> <filter> <root>/apps/commerce-training</root> </filter> </filters> <embeddeds> <embedded> <groupId>${project.groupId}</groupId> <artifactId>commerce-training-bundle</artifactId> <target>/apps/commerce-training/install</target> </embedded> </embeddeds> <targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>commerce-training-bundle</artifactId> <version>${project.version}</version> </dependency> </dependencies> <profiles> <profile> <id>autoInstallPackage</id> <build> <plugins> <plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <executions> <execution> <id>install-content-package</id> <phase>install</phase> <goals> <goal>install</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles></project>
Any ideas how to get this to work? Thanks in advance!
Hi people,
As I'm viewing pages on my dispatcher server I get 403/404 on some resources:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://our.dispatcher.server/libs/cq/i18n/dict.en.json
Failed to load resource: the server responded with a status of 404 (Not Found)
http://our.dispatcher.server/libs/cq/security/userinfo.json?cq_ck=1373462597320
Failed to load resource: the server responded with a status of 403 (Forbidden)
http://our.dispatcher.server/libs/cq/ui/rte.js
Although I understand the 404s (I can let them pass in the .any file), I was wondering why would I need those on the dispatcher server?
As for the 403s, same remark: why do I need rte (rich text editor?) on the publish/dispatcher site?
Thanks for any help.
JS.
Hi,
I have follow the instruction on this page (http://helpx.adobe.com/adobe-cq/kb/vanity-urls.html) to create the vanity url for my content.
After I have populate the page property with the vanity url, some page the pages are not reflected on the JCR Resolver page -> Resolver Map Entries.
I am running version 5.6 of CQ
Thanks
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?