You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Bjarki Gudlaugsson (JIRA)" <ji...@apache.org> on 2011/07/12 15:46:59 UTC

[jira] [Created] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

Empty custom CMIS properties on custom document types result in faulty XML
--------------------------------------------------------------------------

                 Key: CMIS-399
                 URL: https://issues.apache.org/jira/browse/CMIS-399
             Project: Chemistry
          Issue Type: Bug
          Components: python-cmislib
    Affects Versions: OpenCMIS 0.4.0
         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
python version 2.6
cmislib version 0.4.1
            Reporter: Bjarki Gudlaugsson


When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:

<cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
  <cmis:value>D:custom:custom_document_type</cmis:value>
</cmis:propertyId>
<cmis:propertyString propertyDefinitionId="custom:custom_property">
  <cmis:value></cmis:value>
</cmis:propertyString>

It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):

<cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
  <cmis:value>D:custom:custom_document_type</cmis:value>
</cmis:propertyId>
<cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

Posted by "Jeff Potts (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160514#comment-13160514 ] 

Jeff Potts commented on CMIS-399:
---------------------------------

What version of Alfresco are you using for this? I cannot recreate the problem using either cmislib 0.4.1 or cmislib head against Alfresco 4.0b Community.
                
> Empty custom CMIS properties on custom document types result in faulty XML
> --------------------------------------------------------------------------
>
>                 Key: CMIS-399
>                 URL: https://issues.apache.org/jira/browse/CMIS-399
>             Project: Chemistry
>          Issue Type: Bug
>          Components: python-cmislib
>    Affects Versions: OpenCMIS 0.4.0
>         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
> python version 2.6
> cmislib version 0.4.1
>            Reporter: Bjarki Gudlaugsson
>            Assignee: Jeff Potts
>              Labels: cmis, property, python, xml
>
> When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property">
>   <cmis:value></cmis:value>
> </cmis:propertyString>
> It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

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

Jeff Potts closed CMIS-399.
---------------------------

    
> Empty custom CMIS properties on custom document types result in faulty XML
> --------------------------------------------------------------------------
>
>                 Key: CMIS-399
>                 URL: https://issues.apache.org/jira/browse/CMIS-399
>             Project: Chemistry
>          Issue Type: Bug
>          Components: python-cmislib
>    Affects Versions: OpenCMIS 0.4.0
>         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
> python version 2.6
> cmislib version 0.4.1
>            Reporter: Bjarki Gudlaugsson
>            Assignee: Jeff Potts
>              Labels: cmis, property, python, xml
>
> When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property">
>   <cmis:value></cmis:value>
> </cmis:propertyString>
> It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

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

Jeff Potts reassigned CMIS-399:
-------------------------------

    Assignee: Jeff Potts
    
> Empty custom CMIS properties on custom document types result in faulty XML
> --------------------------------------------------------------------------
>
>                 Key: CMIS-399
>                 URL: https://issues.apache.org/jira/browse/CMIS-399
>             Project: Chemistry
>          Issue Type: Bug
>          Components: python-cmislib
>    Affects Versions: OpenCMIS 0.4.0
>         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
> python version 2.6
> cmislib version 0.4.1
>            Reporter: Bjarki Gudlaugsson
>            Assignee: Jeff Potts
>              Labels: cmis, property, python, xml
>
> When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property">
>   <cmis:value></cmis:value>
> </cmis:propertyString>
> It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

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

Jeff Potts resolved CMIS-399.
-----------------------------

    Resolution: Cannot Reproduce

I cannot reproduce this problem as reported, but I highly suspect the reporter is seeing CMIS-481, which is when you try to set a prop to None for any prop type other than String.
                
> Empty custom CMIS properties on custom document types result in faulty XML
> --------------------------------------------------------------------------
>
>                 Key: CMIS-399
>                 URL: https://issues.apache.org/jira/browse/CMIS-399
>             Project: Chemistry
>          Issue Type: Bug
>          Components: python-cmislib
>    Affects Versions: OpenCMIS 0.4.0
>         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
> python version 2.6
> cmislib version 0.4.1
>            Reporter: Bjarki Gudlaugsson
>            Assignee: Jeff Potts
>              Labels: cmis, property, python, xml
>
> When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property">
>   <cmis:value></cmis:value>
> </cmis:propertyString>
> It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CMIS-399) Empty custom CMIS properties on custom document types result in faulty XML

Posted by "Jeff Potts (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160980#comment-13160980 ] 

Jeff Potts commented on CMIS-399:
---------------------------------

Also cannot recreate it using 0.4.1 against 3.4d community.

Here is a python shell showing three tests. The first test sets two custom properties. The second test sets one custom property and the other to an empty string. The third test sets one custom property and the other to None.

>>> repo.getRepositoryInfo()['productVersion']
u'3.4.0 (d 3370)'
>>> folder = repo.getObjectByPath('/test')
>>> folder.deleteTree()
>>> folder = root.createFolder('test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'root' is not defined
>>> root = repo.rootFolder
>>> folder = root.createFolder('test')
>>> props = {'cmis:objectTypeId':'D:sc:whitepaper', 'sc:source':'test source', 'sc:difficulty':'test difficulty'}
>>> doc = folder.createDocument('test1.txt', props)
>>> doc.properties['sc:source']
u'test source'
>>> doc.properties['sc:difficulty']
u'test difficulty'
>>> props['sc:difficulty'] = ''
>>> doc = folder.createDocument('test2.txt', props)
>>> doc.properties['sc:source']
u'test source'
>>> doc.properties['sc:difficulty']
>>> props['sc:difficulty'] = None
>>> doc = folder.createDocument('test3.txt', props)
>>> doc.properties['sc:source']
u'test source'
>>> doc.properties['sc:difficulty']
u'None'

In all three cases, both properties are set successfully although in the last test, the None is being converted to a string which I will log as a separate issue to fix.

Here is the content model snippet showing the definition of my custom type:

<type name="sc:whitepaper">
  <title>Someco Whitepaper</title>
  <parent>sc:marketingDoc</parent>
  <properties>
    <property name="sc:source">
      <type>d:text</type>
    </property>
    <property name="sc:difficulty">
      <type>d:text</type>
    </property>
    <property name="sc:internalOnly">
      <type>d:boolean</type>
      <default>false</default>
    </property>
  </properties>
</type>

Maybe you have one or both of your properties set to mandatory?

                
> Empty custom CMIS properties on custom document types result in faulty XML
> --------------------------------------------------------------------------
>
>                 Key: CMIS-399
>                 URL: https://issues.apache.org/jira/browse/CMIS-399
>             Project: Chemistry
>          Issue Type: Bug
>          Components: python-cmislib
>    Affects Versions: OpenCMIS 0.4.0
>         Environment: This behaviour has been replicated on several systems including CentOS 5, Windows 7, Ubuntu 10.04 and Fedora 15.
> python version 2.6
> cmislib version 0.4.1
>            Reporter: Bjarki Gudlaugsson
>            Assignee: Jeff Potts
>              Labels: cmis, property, python, xml
>
> When calling createDocument on CmisFolder and submitting an empty property (e.g. custom:custom_property) for a custom document type (e.g. custom:custom_document_type) the resulting xml looks like this:
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property">
>   <cmis:value></cmis:value>
> </cmis:propertyString>
> It is invalid and it results in the CMIS server (Alfresco in my case) not setting any of the submitted custom properties. It should look like this (and this is how the Java version does it):
> <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
>   <cmis:value>D:custom:custom_document_type</cmis:value>
> </cmis:propertyId>
> <cmis:propertyString propertyDefinitionId="custom:custom_property" />

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira