You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by NITIN KISHEN <ni...@yahoo.com> on 2010/02/05 09:43:00 UTC

esp file not resolving properly

Hi all,


I had followed the firststeps example and tried to create my own esp in the Day CRX which would talk to my node. However my esp not getting called. I'll explain my steps:

I have the following esp file (listunits.esp):

------------------------------------------------------------------------------------------------

<html>
<head><title>Sling: list content units</title>
  <link rel="stylesheet" href="/apps/firststeps/style.css" type="text/css">
</head>
<body>
    <h1>ESP-generated list of entries</h1>
    
    <div>
        <%
        log.info("Executing my listunits scripts");
        var entries= currentNode.getNodes();
        for (var a in entries) {
            var entry=entries[a]; 
            var path = entry.getPath();
            var contentType = entry.contentType;
            var newPath = path + '.' + contentType + '.html';
            log.info("Executing my listunits scripts: Path: " + newPath);
            %>
            <div><h2><%= a %></h2>
                <p>
                    <a href="<%=  newPath %>">Create/Edit</a>
                </p>                    
            </div>
        <%
        }
        %>
    </div>
    
    <div class="note">
        This page is generated by the poc/listunits.esp server-side script.
    </div> 

</body>
</html>
------------------------------------------------------------------------------------------------

So i go and put this listunits.esp into the apps/test folder. (1)Also where does the log.info go to?

Next i'm creating my node named 'mytestnode' under /content/test. The 'mytestnode' is of a custom node type which eventually is of type nt:unstructured. This 'mytestnode' has around 8 child nodes (some child nodes have nodes within them). 

When i try to access the url http://localhost:7402/content/poc/mytestnode.listunits.html i get the below error:

--------------------------------------------------------------------------------------------------

Resource dumped by HtmlRendererServlet
Resource path: /content/poc/mytestnode
Resource metadata: {sling.resolutionPathInfo=.listunits.html, sling.resolutionPath=/content/poc/mytestnode}
Resource properties
jcr:predecessors: [c0605bf1-9b72-4967-ae28-1817af648ac3]
jcr:uuid: ed40c5a9-d57f-4198-ad98-6d1ec020e19e
jcr:versionHistory: a73f3d35-2fce-4b7c-9b43-92162eb65bbc
jcr:baseVersion: c0605bf1-9b72-4967-ae28-1817af648ac3
jcr:isCheckedOut: true
jcr:primaryType: mycc:Content_InlineEditItem
--------------------------------------------------------------------------------------------------

(2)Could anyone let me know why?


The nodetype of my node is mycc:Content_InlineEditItem which eventually extends nt:unstructured.

However i checked the firststeps node under the content/firststeps in CRX. I did not find any sling:ResourceType property associated with the nodes. But that resolves correctly to the esp files under apps/firststeps. I'm not sure why that resolve, but in my case it doesnt.

P.S. If i were to put the sling:ResourceType property to my nodes my esp scripts gets resolved. But i'm trying to see how for firststeps it's getting resolved without the sling:ResourceType.

Thanks