jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guo Du <mrdu...@gmail.com>
Subject Re: David's Model question : nt:unstructured and SNS
Date Fri, 13 Nov 2009 22:06:07 GMT
2009/11/13 Fran├žois Cassistat <f@maya-systems.com>:
> Is there an easy way to disallow SNS other than defining a new node type and setting
all new nodes in this type, so I can get ItemExistException on save to prevent SNS from happening?

The nt:folder doesn't allow SNS. If your application doesn't like
nt:folder, you may create a custom node type like following sample.
It's the same as nt:unstructured except the SNS validation.

	<nodeType name="nt:nosamesiblings"
		  isMixin="false"
		  hasOrderableChildNodes="true">
	    <supertypes>
		<supertype>nt:base</supertype>
	    </supertypes>
	    <childNodeDefinition name="*"
		          defaultPrimaryType="nt:xunstructured" sameNameSiblings="false"
		          autoCreated="false" mandatory="true"
		          onParentVersion="IGNORE" protected="false"/>
	    <propertyDefinition name="*"
		                requiredType="undefined"
		                autoCreated="false"
		                mandatory="false"
		                onParentVersion="COPY"
		                protected="false"
		                multiple="false"/>
	    <propertyDefinition name="*"
		                requiredType="undefined"
		                autoCreated="false"
		                mandatory="false"
		                onParentVersion="COPY"
		                protected="false"
		                multiple="true"/>
	</nodeType>

As this node type could be interesting for some people, it might be
good to provide by default.

-Guo

Mime
View raw message