Expand my Community achievements bar.

SOLVED

Exception in AEM 6 following creating (slightly) component

Avatar

Level 2

Hi all,

I'm following the instructions from this help page:

https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html

After the section "Create the page component based on the template"

I create a test content page, however this throws the following exception:

10.04.2015 14:16:43.293 *ERROR* [0:0:0:0:0:0:0:1 [1428671797164] GET /editor.html/content/slightlycomponent.html HTTP/1.1] org.apache.sling.scripting.jsp.taglib.CallTag Error while executing script body.jsp
org.apache.sling.api.scripting.ScriptEvaluationException:
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
    at org.apache.sling.scripting.jsp.taglib.CallTag.doEndTag(CallTag.java:131)
    at org.apache.jsp.libs.granite.ui.components.foundation.admin.page.page_jsp._jspx_meth_sling_005fcall_005f1(page_jsp.java:186)
    at org.apache.jsp.libs.granite.ui.components.foundation.admin.page.page_jsp._jspService(page_jsp.java:140)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Have tried this on 6.0 with/without SP2

Is the reason for working with templateSlightly.jsp (extending foundation/components/page) to be able to use Sidekick in Classic UI? In other words does the side kick only appear if the page component is JSP?

Regards,

Jason

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Jason Tarry wrote...

Is the reason for working with templateSlightly.jsp (extending foundation/components/page) to be able to use Sidekick in Classic UI? In other words does the side kick only appear if the page component is JSP?

Hi Jason,

The reason you use the super type is so it will inherit the main parts of the base page component, so you do not have to re-create these yourself. You do not have to work with a JSP in order to get the side kick to appear. This can be accomplished by making your page component, into a sightly component. For example, if you replace your templateSightly.jsp with a templateSightly.html file, you could use sightly to accomplish the same task. Here is an example:

<html> <div data-sly-include="/libs/wcm/core/components/init/init.jsp"></div> <body> <h1>Here is where your Touch UI component will go</h1> <div data-sly-resource="${ @path='par', resourceType='foundation/components/parsys'}"></div> </body> </html>

By using the above code, you will get the same result. The div data-sly-include line will allow you use the side kick in the Classic UI. You can find an example of a page component that is built using sightly in the following location "/libs/wcm/foundation/components/page" in your instance of AEM. Also, you can find a tutorial on building a simple page component using sightly here: http://scottwestover.blogspot.com/2015/04/aem-tutorial-on-building-sightly-page.html

If you are interested in learning more about sightly, there are some great examples here: http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-1/

View solution in original post

4 Replies

Avatar

Level 10

This article works - sometimes when you copy strings from the article to your code editor to create the Touch UI dialog - there may be spaces where the breaks are. The article contains a sample package now that works nicely on AEM6. Use package manager to get up and running while reading the article. 

Sidekick appears as a result of the bolded line:

<html>
<%@include file="/libs/foundation/global.jsp" %>
<cq:include script="/libs/wcm/core/components/init/init.jsp"/>
<body>
<h1>Here is where your Touch UI component will go</h1>
<cq:include path="par" resourceType="foundation/components/parsys" />
</body>
</html>

Avatar

Correct answer by
Former Community Member

Jason Tarry wrote...

Is the reason for working with templateSlightly.jsp (extending foundation/components/page) to be able to use Sidekick in Classic UI? In other words does the side kick only appear if the page component is JSP?

Hi Jason,

The reason you use the super type is so it will inherit the main parts of the base page component, so you do not have to re-create these yourself. You do not have to work with a JSP in order to get the side kick to appear. This can be accomplished by making your page component, into a sightly component. For example, if you replace your templateSightly.jsp with a templateSightly.html file, you could use sightly to accomplish the same task. Here is an example:

<html> <div data-sly-include="/libs/wcm/core/components/init/init.jsp"></div> <body> <h1>Here is where your Touch UI component will go</h1> <div data-sly-resource="${ @path='par', resourceType='foundation/components/parsys'}"></div> </body> </html>

By using the above code, you will get the same result. The div data-sly-include line will allow you use the side kick in the Classic UI. You can find an example of a page component that is built using sightly in the following location "/libs/wcm/foundation/components/page" in your instance of AEM. Also, you can find a tutorial on building a simple page component using sightly here: http://scottwestover.blogspot.com/2015/04/aem-tutorial-on-building-sightly-page.html

If you are interested in learning more about sightly, there are some great examples here: http://blogs.adobe.com/experiencedelivers/experience-management/sightly-intro-part-1/

Avatar

Level 10

I will look into this issue and report back.

Avatar

Level 10

Nice blog - we will promote your AEM content!! Great work! 

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----