chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Vanheusden <g.vanheus...@aca-it.be>
Subject Create Relationship and Updatability problem
Date Thu, 29 Jul 2010 14:33:25 GMT
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


Mime
View raw message