[jira] Created: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

View: New views
7 Messages — Rating Filter:   Alert me  

[jira] Created: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
----------------------------------------------------------------------------------------

         Key: GRFT-84
         URL: http://issues.apache.org/jira/browse/GRFT-84
     Project: Graffito
        Type: Bug
  Components: JCR-Mapping  
    Versions: 1.0-a1-dev    
    Reporter: Alexandru Popescu
    Priority: Critical


1/ autocreated properties

When writting a property it ignores the autoCreated properties. But according to JSR-170 the
autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
related to autoCreated properties is that they should have a default value, but this is required to
be provided by the node definition.

2/ protected properties

There is no check against the protected properties. According to JSR-170 these can be read,
but cannot be write, so an attempt to write such a property should result in an exception. The
current implementation relies on the repository to throw this exception, but IMO a better behavior
would be not to attempt to write it.

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


[jira] Commented: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    [ http://issues.apache.org/jira/browse/GRFT-84?page=comments#action_12361740 ]

Christophe Lombart commented on GRFT-84:
----------------------------------------

1/ autocreated properties

What about null value ? eg.  The object contains a null value for an 'autocreated' property
When inserting the object : use the default value ?
When updating the object : set null into the attribute ?

2/ protected properties

Agree - The code has to throw an exception


> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>          Key: GRFT-84
>          URL: http://issues.apache.org/jira/browse/GRFT-84
>      Project: Graffito
>         Type: Bug
>   Components: JCR-Mapping
>     Versions: 1.0-a1-dev
>     Reporter: Alexandru Popescu
>     Priority: Critical

>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

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


[jira] Commented: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    [ http://issues.apache.org/jira/browse/GRFT-84?page=comments#action_12361741 ]

Christophe Lombart commented on GRFT-84:
----------------------------------------

for the second point :
What not to use the following which is more generic :  

if (NodeType.canSetProperty(java.lang.String propertyName, Value value))
{
   // set property
}
else
{
  //throw an exception
}


> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>          Key: GRFT-84
>          URL: http://issues.apache.org/jira/browse/GRFT-84
>      Project: Graffito
>         Type: Bug
>   Components: JCR-Mapping
>     Versions: 1.0-a1-dev
>     Reporter: Alexandru Popescu
>     Priority: Critical

>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

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


[jira] Commented: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    [ http://issues.apache.org/jira/browse/GRFT-84?page=comments#action_12361742 ]

Alexandru Popescu commented on GRFT-84:
---------------------------------------

1/ autocreated properties

Yes the null value should be written, iif the property is not protected or required.

2/ protected properties

Good finding. My strategy would be: is the property configured (in the mapping) as protected: if yes ignore it. If not use the suggested canSetProperty and in case the return is false, throw an exception.

./alex
--
.w( the_mindstorm )p.


> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>          Key: GRFT-84
>          URL: http://issues.apache.org/jira/browse/GRFT-84
>      Project: Graffito
>         Type: Bug
>   Components: JCR-Mapping
>     Versions: 1.0-a1-dev
>     Reporter: Alexandru Popescu
>     Priority: Critical

>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

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


[jira] Assigned: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/GRFT-84?page=all ]

Christophe Lombart reassigned GRFT-84:
--------------------------------------

    Assign To: Christophe Lombart

> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>          Key: GRFT-84
>          URL: http://issues.apache.org/jira/browse/GRFT-84
>      Project: Graffito
>         Type: Bug
>   Components: JCR-Mapping
>     Versions: 1.0-a1-dev
>     Reporter: Alexandru Popescu
>     Assignee: Christophe Lombart
>     Priority: Critical

>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

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


[jira] Commented: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/GRFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484225 ]

Christophe Lombart commented on GRFT-84:
----------------------------------------

Default values & constraints setting are missing in the jcr mapping descriptor.  I will modify the field-descriptor class in order to support them.

> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>                 Key: GRFT-84
>                 URL: https://issues.apache.org/jira/browse/GRFT-84
>             Project: Graffito
>          Issue Type: Bug
>          Components: JCR-Mapping
>    Affects Versions: 1.0-a1-dev
>            Reporter: Alexandru Popescu
>         Assigned To: Christophe Lombart
>            Priority: Critical
>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GRFT-84) ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/GRFT-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christophe Lombart resolved GRFT-84.
------------------------------------

       Resolution: Fixed
    Fix Version/s: ocm-1.0

From now, the ocm tools is  supporting all kind of jcr properties. see the unit test : PersistenceManagerJcrPropertyTest.java

> ObjectConverterImpl wrong behavior when manipulating autoCreate and protected properties
> ----------------------------------------------------------------------------------------
>
>                 Key: GRFT-84
>                 URL: https://issues.apache.org/jira/browse/GRFT-84
>             Project: Graffito
>          Issue Type: Bug
>          Components: JCR-Mapping
>    Affects Versions: 1.0-a1-dev
>            Reporter: Alexandru Popescu
>         Assigned To: Christophe Lombart
>            Priority: Critical
>             Fix For: ocm-1.0
>
>
> 1/ autocreated properties
> When writting a property it ignores the autoCreated properties. But according to JSR-170 the
> autoCreated properties are writtable, so IMO these should not be ignored. The only requirement
> related to autoCreated properties is that they should have a default value, but this is required to
> be provided by the node definition.
> 2/ protected properties
> There is no check against the protected properties. According to JSR-170 these can be read,
> but cannot be write, so an attempt to write such a property should result in an exception. The
> current implementation relies on the repository to throw this exception, but IMO a better behavior
> would be not to attempt to write it.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

LightInTheBox - Buy quality products at wholesale price