Hello
2009/10/29 J Aaron Farr <[email protected]>:
>
> I'm trying to figure out loading initial-content from a bundle, but I'm
> having a bit of trouble.
>
> First, if I understand correctly, if I change files under my
> initial-content directory and then reinstall the bundle, they *don't*
> change in the repository, right?
>
No, you can reloaded the content when you reinstall the bundle.
for exemple, you can add in your bundle pom.xml :
<Sling-Initial-Content>
SLING-INF/initial-content;path:=/content/myfolder;overwrite:=true;uninstall:=true
</Sling-Initial-Content>
You have other options for the initial-content.
see on the page :
http://sling.apache.org/site/content-loading-jcrcontentloader.html
> Second, I was playing around with the espblog sample, to see if I
> understand things correctly. I added the following file:
>
>
> espblog/src/main/resources/initial-content/content/espblog/posts/first_post.json
>
> that looks like this:
>
> {
> "jcr:primaryType":"nt:unstructured",
> "posttext":"I'd like this post to be initial content.",
> "title":"First post"
> }
>
> And when I deploy this bundle, the post is loaded where I expect:
>
> http://localhost:8080/content/espblog/posts/first_post.html
>
> But, this URL no longer works:
>
> http://gandalf.local:8080/content/espblog/posts.list.html
>
> and I believe that's because 'posts' is not a sling:Folder:
>
> Resource dumped by HtmlRendererServlet
> Resource path: /content/espblog/posts
> Resource metadata: {sling.resolutionPath=/content/espblog/posts,
> sling.resolutionPathInfo=.list.html}
> Resource type: sling:Folder
> Resource super type: -
> Resource properties
> jcr:created: java.util.GregorianCalendar...
> jcr:primaryType: sling:Folder
>
>
> So, if that's not the way to load the espblog with some initial blog
> posts, what is?
>
Sorry, I never used this application but your content loading seems to be good.
If needed, you can also initialize the properties for the "posts" node.
Maybe, someone else can help ?
Christophe
> --
> J. Aaron Farr
> 馮傑仁
> www.cubiclemuses.com
>