You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Stephan Klevenz (JIRA)" <ji...@apache.org> on 2010/07/22 13:13:50 UTC

[jira] Created: (CMIS-240) getProperties vs. updateProperties

getProperties vs. updateProperties
----------------------------------

                 Key: CMIS-240
                 URL: https://issues.apache.org/jira/browse/CMIS-240
             Project: Chemistry
          Issue Type: Wish
            Reporter: Stephan Klevenz
             Fix For: 0.2.0-incubating


The method CmisObject.getProperties() returns List<Property<?>> but for setting properties with CmisObject.updateProperties(Map<String,?> properties) I need another type Map<String,?>.  Why are there two different types and how to convert one type into another? 

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


[jira] Commented: (CMIS-240) getProperties vs. updateProperties

Posted by "Florian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909708#action_12909708 ] 

Florian Müller commented on CMIS-240:
-------------------------------------

Well, getProperties() provides easy access to (for example) the display name, the query name or the default value. Even if you know the property you are looking for, you can't guess those.
But I agree, getPropertiesValues() would be good to have.

> getProperties vs. updateProperties
> ----------------------------------
>
>                 Key: CMIS-240
>                 URL: https://issues.apache.org/jira/browse/CMIS-240
>             Project: Chemistry
>          Issue Type: Wish
>          Components: opencmis-client
>            Reporter: Stephan Klevenz
>             Fix For: 0.2.0-incubating
>
>
> The method CmisObject.getProperties() returns List<Property<?>> but for setting properties with CmisObject.updateProperties(Map<String,?> properties) I need another type Map<String,?>.  Why are there two different types and how to convert one type into another? 

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


[jira] Updated: (CMIS-240) getProperties vs. updateProperties

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume updated CMIS-240:
-----------------------------------

    Component/s: opencmis-client

> getProperties vs. updateProperties
> ----------------------------------
>
>                 Key: CMIS-240
>                 URL: https://issues.apache.org/jira/browse/CMIS-240
>             Project: Chemistry
>          Issue Type: Wish
>          Components: opencmis-client
>            Reporter: Stephan Klevenz
>             Fix For: 0.2.0-incubating
>
>
> The method CmisObject.getProperties() returns List<Property<?>> but for setting properties with CmisObject.updateProperties(Map<String,?> properties) I need another type Map<String,?>.  Why are there two different types and how to convert one type into another? 

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


[jira] Commented: (CMIS-240) getProperties vs. updateProperties

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12909702#action_12909702 ] 

Florent Guillaume commented on CMIS-240:
----------------------------------------

But usually the callers of getProperties know what properties they're asking for so they'll know what they'll get.

I agree with Stephan that for this high-level interface the common case will be to want to just get a map of id -> value. To do that, similarly to the existing getPropertyValue, we could introduce a getPropertiesValues.


> getProperties vs. updateProperties
> ----------------------------------
>
>                 Key: CMIS-240
>                 URL: https://issues.apache.org/jira/browse/CMIS-240
>             Project: Chemistry
>          Issue Type: Wish
>          Components: opencmis-client
>            Reporter: Stephan Klevenz
>             Fix For: 0.2.0-incubating
>
>
> The method CmisObject.getProperties() returns List<Property<?>> but for setting properties with CmisObject.updateProperties(Map<String,?> properties) I need another type Map<String,?>.  Why are there two different types and how to convert one type into another? 

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


[jira] Commented: (CMIS-240) getProperties vs. updateProperties

Posted by "Florian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891114#action_12891114 ] 

Florian Müller commented on CMIS-240:
-------------------------------------

This is for convenience. 

The list that is returned by getProperties() contains not only the property values but also the data type, display name, query name, etc. of each property. If it would just a return a Map<String, ?> the application would have to fetch this information from the type system. That would be an often repeated pattern that can be covered by the framework.

updateProperties(), on the other hand, only requires the id and the value of the properties that should be updated. Creating complete Property<?> objects for this is very inconvenient for applications. Creating a Map<String, ?> is easy.

There should be no need to convert the output of getProperties() into something that updateProperties() accepts. Most of the standard properties a read-only, anyway. Usually the application knows which properties have to be updated. Only set those in the Map.


> getProperties vs. updateProperties
> ----------------------------------
>
>                 Key: CMIS-240
>                 URL: https://issues.apache.org/jira/browse/CMIS-240
>             Project: Chemistry
>          Issue Type: Wish
>            Reporter: Stephan Klevenz
>             Fix For: 0.2.0-incubating
>
>
> The method CmisObject.getProperties() returns List<Property<?>> but for setting properties with CmisObject.updateProperties(Map<String,?> properties) I need another type Map<String,?>.  Why are there two different types and how to convert one type into another? 

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