content API cleanup: improve/align createNodeData(), getNodeData and 
setNodeData(), respectively make them compliant to JCR
---------------------------------------------------------------------------------------------------------------------------

                 Key: MAGNOLIA-3022
                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3022
             Project: Magnolia
          Issue Type: Sub-task
            Reporter: Philipp Bärfuss
            Assignee: Boris Kraft


The JCR specification does not support empty properties:
- only the setProperty() method exists
- setting a property to null removes it

But the content API has both createNodeData() and setNodeData() methods but 
since they use JCR properties they behave which I consider being wrong:
- createNodeData(name) will not fail if a node data already exist
- setNodeData(name) will not fail it the node data doesn't exist yet
- getNodeData(name) will never fail but return an nodeData where isExists() 
might return false
- createNodeData(name, type) creates a property by setting an empty string 
value (null would not create a property) no matter what type you specify

So there are two solutions possible
A) differentiate the creation and setting
- means throw exception if you are doing wrong
B) drop the explicit creation (as in JCR)

I am very much in favor of B) and would like to deprecate all createNodeData() 
methods



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to