You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Andreas Hartmann (JIRA)" <ji...@apache.org> on 2009/03/15 19:20:50 UTC
[jira] Resolved: (SLING-883) SlingNodeStore.newItem() adds item URI
as property
[ https://issues.apache.org/jira/browse/SLING-883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Hartmann resolved SLING-883.
------------------------------------
Resolution: Invalid
Rory, thanks for clarifying!
> SlingNodeStore.newItem() adds item URI as property
> --------------------------------------------------
>
> Key: SLING-883
> URL: https://issues.apache.org/jira/browse/SLING-883
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Reporter: Andreas Hartmann
> Priority: Minor
>
> SlingNodeStore.newItem() uses the passed item argument directly to create the Sling resource. Since the item has a "uri" field, the corresponding "uri" property of the Sling resource will be set. This causes an exception if the JCR node type doesn't support this property.
> Maybe it makes sense to use a "content" field inside the item object to provide the content:
> store.newItem({
> uri: "/foo/bar/baz",
> content: {
> "jcr:primaryType": "foo:bar"
> }
> });
> Index: src/main/resources/dojox/data/SlingNodeStore.js
> ===================================================================
> --- src/main/resources/dojox/data/SlingNodeStore.js (revision 752029)
> +++ src/main/resources/dojox/data/SlingNodeStore.js (working copy)
> @@ -638,7 +638,7 @@
>
> var xhr = xhr = dojo.xhrPost({
> url: item.uri,
> - content: item,
> + content: item.content,
> load: function(response, ioargs) {
> item.dirty = false;
> console.log("onNew");
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.