cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS does not seem to care about mandatory custom properties

tullo
Champ in-the-making
Champ in-the-making
Hi!

There is something strange going on when a externals SAP system exports documents to our Alfresco 3.4.6 installation via CMIS SOAP requests.

When the SAP system sends createDocument requests and leaves out a mandatory custom property - the documents still get created by Alfresco without any stack trace or SAOP Fault at all!

The created document is also versionable, which should not be the case either as this was not activated!

What do I have to do to get the Repository rejected faulty CMIS request?

Regards
Andreas

Alfresco 3.4.6
Windows Server 2008


        <type name="foo:document">
            <title>Foo document</title>
            <parent>cm:content</parent>
            <properties>
                <property name="foo:apbNr">
                    <description>Foo Number</description>
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>both</tokenised>
                    </index>
                    <constraints>
                        <constraint ref="foo:string-length-132"/>
                    </constraints>
                </property>
            </properties>
        </type>
3 REPLIES 3

nmcminn
Champ in-the-making
Champ in-the-making
Have you tried adding enforced="true" to your mandatory element in the type definition?

<mandatory enforced="true">true</mandatory>

When a property is set as mandatory, that indicates to Alfresco that the property is required.  By default, this is not enforced.  Instead, Alfresco marks content items with empty mandatory properties with the aspect sys:incomplete.  This is done so that you can create items in Alfresco that have mandatory properties even if the value of the property is not known at the time of content creation, while still indicating that the property is required (eventually).  If you want to enforce the mandatory constraint at the time the content is created, set enforced="true" as in the example above.

tullo
Champ in-the-making
Champ in-the-making
Have you tried adding enforced="true" to your mandatory element in the type definition?
I've now added enforced="true" to all the mandatory properties. The result of this is - as expected - that I am no longer able to add test content of that document type via Alfresco Explorer interface. I haven't customized explorer forms to show custom properties.

But the Repository still gladly accepts the CMIS requests and creates the documents. I guess I have to address this with a OnCreateNodePolicy and do the checks myself.

Regards
Andreas

andy
Champ on-the-rise
Champ on-the-rise
Hi

The integrity checker will be invoked if the  "mandatoryness" is enforced.
Can you check what is set on the node via the node browser?
Is your property set? What value does it have?

Perhaps you are getting a default value set via the CMIS API (and the mapping of the dictionary definitions)

Andy