[
https://issues.apache.org/jira/browse/SLING-553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608626#action_12608626
]
Bryce Ewing commented on SLING-553:
-----------------------------------
That was mentioned in the original jira case (but only nt:file was mentioned).
Basically the situation I am trying to accommodate for is where loading some
data, say:
/pages/test - json definition of a page
{
"jcr:primaryType":"nt:unstructured",
"sling:resourceType":"/page/main",
"title":"Test",
"content": {
"jcr:primaryType":"nt:unstructured",
"jcr:reference:main":"/content/test.html"
}
}
/content/test.html - an html file fragment
/apps/page/main/html.ftl - a freemarker template
<html>
<head><title>[EMAIL PROTECTED]</title></head>
<body>
... some pre page content templating html ...
<div
class="maincontent">${currentNode.content.main["jcr:content"]["@jcr:data"]}</div>
... some post page content templating html ...
</body>
</html>
This will render the "test.html" html fragment into the main content div of the
page. This all works except for the loading of the content which fails because
the test.html file is not of type "mix:referenceable". I have tried a few ways
of setting this (e.g. having a json definition to give the mixin type as well
as then having the html file) but non of these worked.
So it seemed to me that it was safe to assume that if someone created some data
that was referencing a file (or folder) that wasn't currently referenceable
that they wanted that node to be referenceable. Maybe there is another way of
doing this, or maybe another way could be created in order to do this? Curious
of your thoughts on this matter.
> Allow references and paths to be loaded from JSON through JsonReader
> --------------------------------------------------------------------
>
> Key: SLING-553
> URL: https://issues.apache.org/jira/browse/SLING-553
> Project: Sling
> Issue Type: Improvement
> Components: JCR Contentloader
> Affects Versions: JCR Contentloader 2.0.2
> Reporter: Bryce Ewing
> Assignee: Carsten Ziegeler
> Priority: Minor
> Attachments: contentloader.patch
>
>
> Allows references and paths to be loaded from json through JsonReader, when a
> value starts with "reference:" or "path:". Also needed to be able to
> reference a file that had been loaded in from say test.html which loads as
> just nt:file, so thought that when a reference is made to a nt:file type then
> automatically add the "mix:referenceable" type.
> If either of these options doesn't seem like a good idea please let me know
> what some other options might be.
> Cheers Bryce
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.