You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Geert Vanheusden <g....@aca-it.be> on 2010/07/29 16:33:25 UTC

Create Relationship and Updatability problem

Dear,

I have the following problem using the OpenCMIS Client and Alfresco Enterprise 3.3. 

If I want to create a relationship between two documents I use this code:

=======================
Map<String, Serializable> relProps = new HashMap<String, Serializable>();
relProps.put("cmis:sourceId", doc1.getId());
relProps.put("cmis:targetId", doc2.getId());
relProps.put("cmis:objectTypeId", "cmis:relationship");
session.createRelationship(relProps, null, null, null);
=======================

When I execute this code I get the following exception: 
CmisInvalidArgumentException: Source Id is not set!

When debugging this code I see the following situation.
The convertProperties in PersistentObjectFactoryImpl is called and when it iterates over the first property (cmis:sourceId) it skips the loop at:

=======================
// check updatability
if (updatabilityFilter != null) {
     if (!updatabilityFilter.contains(definition.getUpdatability())) {
         continue;
     }
}
=======================

If I query the property definition for cmis:sourceId I get a READONLY value from Alfresco which isn't available in the list.

=======================
    private static final Set<Updatability> CREATE_UPDATABILITY = new HashSet<Updatability>();
    static {
        CREATE_UPDATABILITY.add(Updatability.ONCREATE);
        CREATE_UPDATABILITY.add(Updatability.READWRITE);
    }
=======================

So it is impossible to create a new Releationship because the cmis:sourceId and cmis:targetId will never be availble after the property conversion.

Not sure if it is an Alfresco or OpenCMIS bug or just me?

Hope you guys can point me in the right direction!

Kind regards,

Geert


Re: Create Relationship and Updatability problem

Posted by Geert Vanheusden <g....@aca-it.be>.
Thanks for the quick reply!

I created a support ticket at Alfresco.

Geert

----- Original Message -----
From: "David Caruana" <da...@alfresco.com>
To: "Florian Müller" <fm...@opentext.com>
Cc: chemistry-dev@incubator.apache.org
Sent: Thursday, July 29, 2010 5:09:14 PM
Subject: Re: Create Relationship and Updatability problem

We'll investigate.

Thanks,
Dave

On 29 Jul 2010, at 15:43, Florian Müller wrote:

> Hi Geert,
> 
> That is an Alfresco bug. The cmis:sourceId and cmis:targetId property definitions are wrong.
> Both are defined with updatability = readonly and required	= true which doesn't make sense. The updatability should be either readwrite or oncreate.
> 
> 
> - Florian
> 
> -----Original Message-----
> From: Geert Vanheusden [mailto:g.vanheusden@aca-it.be] 
> Sent: Donnerstag, 29. Juli 2010 16:33
> To: chemistry-dev@incubator.apache.org
> Subject: Create Relationship and Updatability problem
> 
> Dear,
> 
> I have the following problem using the OpenCMIS Client and Alfresco Enterprise 3.3. 
> 
> If I want to create a relationship between two documents I use this code:
> 
> =======================
> Map<String, Serializable> relProps = new HashMap<String, Serializable>();
> relProps.put("cmis:sourceId", doc1.getId());
> relProps.put("cmis:targetId", doc2.getId());
> relProps.put("cmis:objectTypeId", "cmis:relationship");
> session.createRelationship(relProps, null, null, null);
> =======================
> 
> When I execute this code I get the following exception: 
> CmisInvalidArgumentException: Source Id is not set!
> 
> When debugging this code I see the following situation.
> The convertProperties in PersistentObjectFactoryImpl is called and when it iterates over the first property (cmis:sourceId) it skips the loop at:
> 
> =======================
> // check updatability
> if (updatabilityFilter != null) {
>     if (!updatabilityFilter.contains(definition.getUpdatability())) {
>         continue;
>     }
> }
> =======================
> 
> If I query the property definition for cmis:sourceId I get a READONLY value from Alfresco which isn't available in the list.
> 
> =======================
>    private static final Set<Updatability> CREATE_UPDATABILITY = new HashSet<Updatability>();
>    static {
>        CREATE_UPDATABILITY.add(Updatability.ONCREATE);
>        CREATE_UPDATABILITY.add(Updatability.READWRITE);
>    }
> =======================
> 
> So it is impossible to create a new Releationship because the cmis:sourceId and cmis:targetId will never be availble after the property conversion.
> 
> Not sure if it is an Alfresco or OpenCMIS bug or just me?
> 
> Hope you guys can point me in the right direction!
> 
> Kind regards,
> 
> Geert
> 


Re: Create Relationship and Updatability problem

Posted by David Caruana <da...@alfresco.com>.
We'll investigate.

Thanks,
Dave

On 29 Jul 2010, at 15:43, Florian Müller wrote:

> Hi Geert,
> 
> That is an Alfresco bug. The cmis:sourceId and cmis:targetId property definitions are wrong.
> Both are defined with updatability = readonly and required	= true which doesn't make sense. The updatability should be either readwrite or oncreate.
> 
> 
> - Florian
> 
> -----Original Message-----
> From: Geert Vanheusden [mailto:g.vanheusden@aca-it.be] 
> Sent: Donnerstag, 29. Juli 2010 16:33
> To: chemistry-dev@incubator.apache.org
> Subject: Create Relationship and Updatability problem
> 
> Dear,
> 
> I have the following problem using the OpenCMIS Client and Alfresco Enterprise 3.3. 
> 
> If I want to create a relationship between two documents I use this code:
> 
> =======================
> Map<String, Serializable> relProps = new HashMap<String, Serializable>();
> relProps.put("cmis:sourceId", doc1.getId());
> relProps.put("cmis:targetId", doc2.getId());
> relProps.put("cmis:objectTypeId", "cmis:relationship");
> session.createRelationship(relProps, null, null, null);
> =======================
> 
> When I execute this code I get the following exception: 
> CmisInvalidArgumentException: Source Id is not set!
> 
> When debugging this code I see the following situation.
> The convertProperties in PersistentObjectFactoryImpl is called and when it iterates over the first property (cmis:sourceId) it skips the loop at:
> 
> =======================
> // check updatability
> if (updatabilityFilter != null) {
>     if (!updatabilityFilter.contains(definition.getUpdatability())) {
>         continue;
>     }
> }
> =======================
> 
> If I query the property definition for cmis:sourceId I get a READONLY value from Alfresco which isn't available in the list.
> 
> =======================
>    private static final Set<Updatability> CREATE_UPDATABILITY = new HashSet<Updatability>();
>    static {
>        CREATE_UPDATABILITY.add(Updatability.ONCREATE);
>        CREATE_UPDATABILITY.add(Updatability.READWRITE);
>    }
> =======================
> 
> So it is impossible to create a new Releationship because the cmis:sourceId and cmis:targetId will never be availble after the property conversion.
> 
> Not sure if it is an Alfresco or OpenCMIS bug or just me?
> 
> Hope you guys can point me in the right direction!
> 
> Kind regards,
> 
> Geert
> 


RE: Create Relationship and Updatability problem

Posted by Florian Müller <fm...@opentext.com>.
Hi Geert,

That is an Alfresco bug. The cmis:sourceId and cmis:targetId property definitions are wrong.
Both are defined with updatability = readonly and required	= true which doesn't make sense. The updatability should be either readwrite or oncreate.


- Florian

-----Original Message-----
From: Geert Vanheusden [mailto:g.vanheusden@aca-it.be] 
Sent: Donnerstag, 29. Juli 2010 16:33
To: chemistry-dev@incubator.apache.org
Subject: Create Relationship and Updatability problem

Dear,

I have the following problem using the OpenCMIS Client and Alfresco Enterprise 3.3. 

If I want to create a relationship between two documents I use this code:

=======================
Map<String, Serializable> relProps = new HashMap<String, Serializable>();
relProps.put("cmis:sourceId", doc1.getId());
relProps.put("cmis:targetId", doc2.getId());
relProps.put("cmis:objectTypeId", "cmis:relationship");
session.createRelationship(relProps, null, null, null);
=======================

When I execute this code I get the following exception: 
CmisInvalidArgumentException: Source Id is not set!

When debugging this code I see the following situation.
The convertProperties in PersistentObjectFactoryImpl is called and when it iterates over the first property (cmis:sourceId) it skips the loop at:

=======================
// check updatability
if (updatabilityFilter != null) {
     if (!updatabilityFilter.contains(definition.getUpdatability())) {
         continue;
     }
}
=======================

If I query the property definition for cmis:sourceId I get a READONLY value from Alfresco which isn't available in the list.

=======================
    private static final Set<Updatability> CREATE_UPDATABILITY = new HashSet<Updatability>();
    static {
        CREATE_UPDATABILITY.add(Updatability.ONCREATE);
        CREATE_UPDATABILITY.add(Updatability.READWRITE);
    }
=======================

So it is impossible to create a new Releationship because the cmis:sourceId and cmis:targetId will never be availble after the property conversion.

Not sure if it is an Alfresco or OpenCMIS bug or just me?

Hope you guys can point me in the right direction!

Kind regards,

Geert