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

i18n value in sling include

$
0
0

I am unable to get I18n value in sling include content in 404.jsp/default.jsp.

 

Basically I am including a 404 page ( based on some template ) into sling/servlet/errorhandler/default.jsp like

<sling:include path="/content/mysite/en/errorpage" />

 

I am able to see the included error page in case of 404. But the i18n value that are used in errorpage is not applied, instead i am getting the sling:key as the value itself.

The standalone page (if i directly open the page instead of going thru 404 error ) shows correct i18n value

I am using i18n as:

 

ResourceBundle i18n = slingRequest.getResourceBundle(locale);

or

I18n i18n1= new I18n(slingRequest);

 

Please suggest if i m doing something wrong.


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

CQ5.4, about compiled jsp files

$
0
0

Hi guys,

 

I have problems with caching and compiled versions, this is because of installing a package on a publish server with an older version of the same web app. This is CQ5.4, so I read you shouldn't delete the class files on the var directory.

 

What options do we have in this situation to delete compiled classes/force compilation?

 

Many thanks in advance.

Alejandro.

Permission sensitive caching

$
0
0

Hello,

 

I am trying to use permission sensitive caching on my website "www.domain.com" for resources that are in a particular location in the DAM. I want to make sure users are logged in when they download resources using this URL: www.domain.com/content/dam/secured/*.*

 

That "secured" folder has been secured using a CUG.

 

I've done the following:

 

1) Configured the dispatcher.any file (under the website directive) with the following /URL:

/url /custom/path/to/servlet

 

2) I've configured the filter to check "/content/dam/secured/*.*"

 

3) After restarting the dispatcher I can see from the logs that auth_checker is configured

 

4) I've created a servlet that implements the dohead method of SlingAllMethodsServlet. The value of the path has been set to /custom/path/to/servlet. I added quite a bit of logging into this servlet/

 

From the dispatchers'log file it looks like all is configured correctly. However, the servlet is never called. I don't see anything appear in the error.log (nor the logging I put in, nor any errors with that servlet). When I use the sling resource resolver tool in system/console/ all seems to work fine when I type www.domain.com/custom/path/to/servlet?uri=test in the test box.

 

Any suggestions about what else I can do to debug this? Has anyone else used sensitive caching before, would you mind sharing your dispatcher exact details + servlet?

 

Many thanks!

Override IIS default 404 erorr page with CQ 404.jsp

$
0
0

Hi guys,

 

Anyone is using IIS server?

 

I have got the 404.jsp and placed it under /apps/sling/serlvet/errorhandler.

 

All works well until the page is deployed into production enviornment which is running on an IIS server.

 

Now whenever CQ gets a 404 page, instead of display the customised 404 page instructed by the 404.jsp, the IIS 404 standard (ugly) page gets displayed all the time.

 

We don't want to change the IIS configuration to be too specific to point to a single jsp page because there are other things running on the IIS server. Any suggestions on making IIS pass on the 404 error and let the application handle it?

 

many thanks.

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

Adding addthis_widget.js disabled the rte plugin

$
0
0

Hi,

 

i have added the share button in the component with the script tag lik this:

 

<a class="atc_s addthis_button_compact" href="https://www.addthis.com/bookmark.php?v=250&pubid=xa-4e5ae0915143e3be"></a>

<script type="text/javascript"src="https://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e5ae0915143e3be">

    </script>

 

on the same page i dropped the text component , the rteplugins get disabled . I found the problem is in the script tag of addthis button js , as it makes the plugin disabled . Can any one help me on this.

Thanks in advance

 

Sumit

Using multi-value properties in JSP components

$
0
0

I am trying to figure out if I am doing some small step wrong or if I don't have a full grasp on how some things work.

 

I am accessing a multi-value property from the JSP of my component:

 

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

    <h2>Keys</h2>

    <div class="container_16">

        <div class="grid_8"><%

Object keysObj = properties.get("keys");

if (keysObj != null)

{

String[] keys = (String[]) keysObj;

%>

<%= keys %><%

} %></div>

</div>

 

Here is how I defined my component:

 

{

     "jcr:createdBy":"admin",

     "jcr:title":"My Listing",

     "allowedParents":["*/*parsys"],

     "componentGroup":"Listing Group",

     "sling:resourceSuperType":"foundation/components/parbase",

     "jcr:created":"Wed Aug 15 2012 20:01:15 GMT-0400",

     "jcr:primaryType":"cq:Component",

     "keys":[""]

}

 

So keys is a multi-value String object. I am supposing the value is a String[].

 

I created a dialog to set the values within the CQ page edit.

 

- myList

--- dialog [cq:Dialog]

----- items [cq:Widget]

------- items [cq:WidgetCollection]

--------- tabs1 [cq:Panel]

----------- items [cq:WidgetCollection]

------------- keys [cq:Widget]

 

The keys cq:Widget is defined as:

 

{

     "fieldLabel":"Keys to List",

     "xtype":"multifield",

     "name":"./keys",

     "jcr:primaryType":"cq:Widget",

     "fieldDescription":"List keys to display"

}

 

I placed the component into an existing geometrixx page to test. When I double-clicked on it I was able to add multiple values.

 

It is failing when I attempt to coerce the properties.get method to a String[]: String[] keys = (String[]) keysObj;

 

16.08.2012 11:58:29.444 *ERROR* [10.176.196.66 [1345132705084] GET /content/geometrixx/en/services.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Error during include of SlingRequestPathInfo: path='/content/geometrixx/en/services/jcr:content/par/keylist', selectorString='null', extension='html', suffix='null' org.apache.sling.api.scripting.ScriptEvaluationException: An exception occurred processing JSP page /apps/myList/components/keyList/keyList.jsp at line 14

<snip stack trace>

Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;

 

So all that leads to my question.

 

It looks like I am wrong on how to coerce the results of properties.get to a String[]. What is the best way to work with multi-value properties? I want to iterate through the values in the multi-value property.

 

Should I have specified the index in the method?

---- properties.get("keys[0]");

 

Thanks!


Received 409 (Conflict) for saving changes in workspace crx.default

$
0
0

When i creat a new jsp file and save the file  , i get the following error on CRXDE lite  :

 

Could not save changes. Received 409 (Conflict) for saving changes in workspace crx.default. This node already exists: /content/TrainingSite/contentpage.jsp

 

Can anybody please suggest the cause of the problem and the meaning of the code.

 

 

Thanks

changes made in jsp are not reflected

$
0
0

webpages are not reflected after modifying jsp pages

 

what i need to do??

 

thanks in advance

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

Writing and reading value in widget to parent node

$
0
0

Hello,

 

CQ 5.6.1

 

Using the Page's dialog, I have a property being written to and read from <current page>/jcr:content@isMenuRoot.

 

I'd like to have another statically defined component on the page read and write to the same property on the page node.  It's easy enough to get the value written.  In this component's dialog, I set the name of the widget to "../isMenuRoot".  When I check the box and click OK, the expected attribute is written to the jcr:content node.  When I leave the box unchecked, the @isMenuRoot is removed.

 

However, the saved value isn't being loaded when the dialog is invoked.  Hooking into the loadcontent event for the dialog simply doesn't show it in the record.  I've tried this with various xtypes and it makes no difference.

 

I could have sworn I'd written and read values to parent nodes in older versions of CQ, but perhaps I'm remembering wrong.

 

Does anyone know if I can load values written to a parent node from a component's dialog?

 

Thanks!

Garth

LDAP set up with CQ 5.5

Correct Syntax for Reteriving Current Template

$
0
0

I've been reading over the documentation and I'm have a difficult time getting the template being used on the current page.  In my component, all I want to do is use an IF statement to see if template MyTemplate is being used and apply some  HTML - if not, apply different HTML.

 

<%@include file="/libs/foundation/global.jsp"%><%@page session="false"            import="com.day.cq.wcm.api.WCMMode"
%>

if (currentPage.getTemplate().equals(MyTemplate) {
    %>temp = my template<%
} else {    %>temp not equal to my template<%       }

 

Can someone correct my syntax?

404 Custom Forwards

$
0
0

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.


External redirect for a page/node

$
0
0

Hi,

 

How can i assign an external URL(out of domain; say http://google.com) to a page (node). Need to have similar functionality as "redirectTarget" has for internal redirect.

Can I use some sling property to achieve this? Wats the behavior of sling:redirect?

 

 

Thanks in advance!

$CQ, $, JQuery, and JQPlot

$
0
0

Can someone explain the use of $CQ versus $ in more detail for JQuery?  I already know that $CQ refers to CQ's built-in version of JQuery and that $ refera to any secondary jquery package that I may load.

 

Let me be more precise.  My app requires charts and JQPlot seems one of the best plotting solutions available.  By default (as you would expect) jqplot.js file refers to JQuery through $.  My expectation would be that this would not work in CQ unless I renamed all the $ to $CQ in the jqplot.js file.  Oddly this wasn't true.  I simply added jqplot.js to my clientlib folder and was able to start rendering graphs.

 

Very odd!  Why is that?

 

The primary reason for asking is that while the JQuery base package is working, a JQPlot plugin (Cursor) is not...and I can only track it down to some issue between referring to $ versus $CQ.

 

Thanks!

can I intercept replication event on cq publish instance?

$
0
0

http://dev.day.com/docs/en/cq/current/deploying/configuring_cq/replication.html says this happens on the publish instance during replication:

a servlet in the publish environment receives the request and publishes the received content; the default servlet ishttp://localhost:4503/bin/receive.

 

Is there a way I can write custom Java or any kind of CQ handler whatsoever to intercept that replication request on the cq publish instance?  I would like to send a notification to a downstream system when a publish is successful.

 

We have also considered writing our notification handler on the cq author instance but then we have a race condition between receipt of notification and completion of the publish ... the author would unwisely send our notification without any opportunity to know if publish was successful.

How to insert HR-tag with the Rich Text Editor (RTE)?

$
0
0

The discussion started with a comment from Jan 17, 2013 on http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html

The following "summary" is mainly an adapted copy:

 

Question: How is the RTE to be configured to allow the insertion of a horizontal rule (line, HR-tag)?

 

Reply:
* You can enable the misctools plugin and configure it to alow Source Editing Mode, so that you can manually add <hr> tags.

These ideas might work too:

* (miscadmin plugin) enable special characters and define one that adds <hr>

* (paraformat plugin) define a format that adds <hr>

 

Question:

* Unfortunately Source Editing Mode is not allowed (a customer requirement).

* The hr-tag as special character is quoted out (encoded, escaped) by the RTE. Can that be omitted?

* With paraformat the RTE adds another hr-tag when pressing the return key. I end up with more weird RTE-behavior, e.g. I cannot change back to another format. Also the hr-tag is not very well placed in the format drop down box (for intuitive usability).

 

Can the encoding of special characters be ommited or is there again another way to insert hr-tags?

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

Viewing all 12476 articles
Browse latest View live


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