jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r151075 [13/15] - in incubator/jackrabbit/site: ./ apidocs/ apidocs/org/apache/jackrabbit/core/ apidocs/org/apache/jackrabbit/core/class-use/ apidocs/org/apache/jackrabbit/core/state/ apidocs/org/apache/jackrabbit/core/state/mem/ apidocs/org/apache/jackrabbit/core/state/obj/ apidocs/org/apache/jackrabbit/core/state/xml/ apidocs/org/apache/jackrabbit/core/version/ apidocs/org/apache/jackrabbit/core/version/persistence/ apidocs/org/apache/jackrabbit/core/xml/ xref-test/ xref-test/org/apache/jackrabbit/test/ xref-test/org/apache/jackrabbit/test/api/ xref-test/org/apache/jackrabbit/test/api/version/ xref-test/org/apache/jackrabbit/test/observation/ xref-test/org/apache/jackrabbit/test/search/ xref/org/apache/jackrabbit/core/ xref/org/apache/jackrabbit/core/search/lucene/
Date Wed, 02 Feb 2005 22:41:19 GMT
Modified: incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html?view=diff&r1=151074&r2=151075
==============================================================================
--- incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html (original)
+++ incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html Wed Feb  2 14:40:59 2005
@@ -580,15 +580,15 @@
 <a name="571" href="#571">571</a>     }
 <a name="572" href="#572">572</a> 
 <a name="573" href="#573">573</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddNode(String relPath, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType)
-<a name="574" href="#574">574</a>             throws ItemExistsException, PathNotFoundException,
-<a name="575" href="#575">575</a>             ConstraintViolationException, RepositoryException {
+<a name="574" href="#574">574</a>             throws ItemExistsException, PathNotFoundException, VersionException,
+<a name="575" href="#575">575</a>             ConstraintViolationException, LockException, RepositoryException {
 <a name="576" href="#576">576</a>         <strong>return</strong> internalAddNode(relPath, nodeType, <strong>null</strong>);
 <a name="577" href="#577">577</a>     }
 <a name="578" href="#578">578</a> 
 <a name="579" href="#579">579</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddNode(String relPath, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType,
 <a name="580" href="#580">580</a>                                        String uuid)
-<a name="581" href="#581">581</a>             throws ItemExistsException, PathNotFoundException,
-<a name="582" href="#582">582</a>             ConstraintViolationException, RepositoryException {
+<a name="581" href="#581">581</a>             throws ItemExistsException, PathNotFoundException, VersionException,
+<a name="582" href="#582">582</a>             ConstraintViolationException, LockException, RepositoryException {
 <a name="583" href="#583">583</a>         <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> nodePath;
 <a name="584" href="#584">584</a>         <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName;
 <a name="585" href="#585">585</a>         <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> parentPath;
@@ -620,2842 +620,2844 @@
 <a name="611" href="#611">611</a>             <strong>throw</strong> <strong>new</strong> PathNotFoundException(relPath);
 <a name="612" href="#612">612</a>         }
 <a name="613" href="#613">613</a> 
-<a name="614" href="#614">614</a>         <em class="comment">// delegate the creation of the child node to the parent node</em>
-<a name="615" href="#615">615</a>         <strong>return</strong> parentNode.internalAddChildNode(nodeName, nodeType, uuid);
-<a name="616" href="#616">616</a>     }
-<a name="617" href="#617">617</a> 
-<a name="618" href="#618">618</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddChildNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType)
-<a name="619" href="#619">619</a>             throws ItemExistsException, ConstraintViolationException, RepositoryException {
-<a name="620" href="#620">620</a>         <strong>return</strong> internalAddChildNode(nodeName, nodeType, <strong>null</strong>);
-<a name="621" href="#621">621</a>     }
-<a name="622" href="#622">622</a> 
-<a name="623" href="#623">623</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddChildNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType, String uuid)
-<a name="624" href="#624">624</a>             throws ItemExistsException, ConstraintViolationException, RepositoryException {
-<a name="625" href="#625">625</a>         <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> nodePath;
-<a name="626" href="#626">626</a>         <strong>try</strong> {
-<a name="627" href="#627">627</a>             nodePath = Path.create(getPrimaryPath(), nodeName, <strong>true</strong>);
-<a name="628" href="#628">628</a>         } <strong>catch</strong> (MalformedPathException e) {
-<a name="629" href="#629">629</a>             <em class="comment">// should never happen</em>
-<a name="630" href="#630">630</a>             String msg = <span class="string">"internal error: invalid path "</span> + safeGetJCRPath();
-<a name="631" href="#631">631</a>             log.error(msg, e);
-<a name="632" href="#632">632</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, e);
-<a name="633" href="#633">633</a>         }
-<a name="634" href="#634">634</a> 
-<a name="635" href="#635">635</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeDefImpl.html">NodeDefImpl</a> def;
-<a name="636" href="#636">636</a>         <strong>try</strong> {
-<a name="637" href="#637">637</a>             def = getApplicableChildNodeDef(nodeName, nodeType == <strong>null</strong> ? <strong>null</strong> : nodeType.getQName());
-<a name="638" href="#638">638</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="639" href="#639">639</a>             String msg = <span class="string">"no definition found in parent node's node type for new node"</span>;
-<a name="640" href="#640">640</a>             log.error(msg, re);
-<a name="641" href="#641">641</a>             <strong>throw</strong> <strong>new</strong> ConstraintViolationException(msg, re);
-<a name="642" href="#642">642</a>         }
-<a name="643" href="#643">643</a>         <strong>if</strong> (nodeType == <strong>null</strong>) {
-<a name="644" href="#644">644</a>             <em class="comment">// use default node type</em>
-<a name="645" href="#645">645</a>             nodeType = (NodeTypeImpl) def.getDefaultPrimaryType();
-<a name="646" href="#646">646</a>         }
-<a name="647" href="#647">647</a> 
-<a name="648" href="#648">648</a>         <em class="comment">// check for name collisions</em>
-<a name="649" href="#649">649</a> <em class="comment">/*</em>
-<a name="650" href="#650">650</a> <em class="comment">        try {</em>
-<a name="651" href="#651">651</a> <em class="comment">            Item item = itemMgr.getItem(nodePath);</em>
-<a name="652" href="#652">652</a> <em class="comment">            if (!item.isNode()) {</em>
-<a name="653" href="#653">653</a> <em class="comment">                // there's already a property with that name</em>
-<a name="654" href="#654">654</a> <em class="comment">                throw new ItemExistsException(itemMgr.safeGetJCRPath(nodePath));</em>
-<a name="655" href="#655">655</a> <em class="comment">            } else {</em>
-<a name="656" href="#656">656</a> <em class="comment">                // there's already a node with that name</em>
-<a name="657" href="#657">657</a> <em class="comment">                // check same-name sibling setting of both new and existing node</em>
-<a name="658" href="#658">658</a> <em class="comment">                if (!def.allowSameNameSibs()</em>
-<a name="659" href="#659">659</a> <em class="comment">                        || !((NodeImpl) item).getDefinition().allowSameNameSibs()) {</em>
-<a name="660" href="#660">660</a> <em class="comment">                    throw new ItemExistsException(itemMgr.safeGetJCRPath(nodePath));</em>
-<a name="661" href="#661">661</a> <em class="comment">                }</em>
-<a name="662" href="#662">662</a> <em class="comment">            }</em>
-<a name="663" href="#663">663</a> <em class="comment">        } catch (PathNotFoundException pnfe) {</em>
-<a name="664" href="#664">664</a> <em class="comment">            // no name collision</em>
-<a name="665" href="#665">665</a> <em class="comment">        }</em>
-<a name="666" href="#666">666</a> <em class="comment">*/</em>
-<a name="667" href="#667">667</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="668" href="#668">668</a>         <strong>if</strong> (thisState.hasPropertyEntry(nodeName)) {
-<a name="669" href="#669">669</a>             <em class="comment">// there's already a property with that name</em>
-<a name="670" href="#670">670</a>             <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
-<a name="671" href="#671">671</a>         }
-<a name="672" href="#672">672</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(nodeName, 1);
-<a name="673" href="#673">673</a>         <strong>if</strong> (cne != <strong>null</strong>) {
-<a name="674" href="#674">674</a>             <em class="comment">// there's already a child node entry with that name;</em>
-<a name="675" href="#675">675</a>             <em class="comment">// check same-name sibling setting of new node</em>
-<a name="676" href="#676">676</a>             <strong>if</strong> (!def.allowSameNameSibs()) {
-<a name="677" href="#677">677</a>                 <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
-<a name="678" href="#678">678</a>             }
-<a name="679" href="#679">679</a>             <em class="comment">// check same-name sibling setting of existing node</em>
-<a name="680" href="#680">680</a>             <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> <strong>new</strong>Id = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
-<a name="681" href="#681">681</a>             <strong>if</strong> (!((NodeImpl) itemMgr.getItem(newId)).getDefinition().allowSameNameSibs()) {
-<a name="682" href="#682">682</a>                 <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
-<a name="683" href="#683">683</a>             }
-<a name="684" href="#684">684</a>         }
-<a name="685" href="#685">685</a> 
-<a name="686" href="#686">686</a>         <em class="comment">// check protected flag of parent (i.e. this) node</em>
-<a name="687" href="#687">687</a>         <strong>if</strong> (getDefinition().isProtected()) {
-<a name="688" href="#688">688</a>             String msg = safeGetJCRPath() + <span class="string">": cannot add a child to a protected node"</span>;
-<a name="689" href="#689">689</a>             log.error(msg);
-<a name="690" href="#690">690</a>             <strong>throw</strong> <strong>new</strong> ConstraintViolationException(msg);
+<a name="614" href="#614">614</a>         <em class="comment">// make sure that parent node is checked-out</em>
+<a name="615" href="#615">615</a>         <strong>if</strong> (!parentNode.internalIsCheckedOut()) {
+<a name="616" href="#616">616</a>             String msg = safeGetJCRPath() + <span class="string">": cannot add a child to a checked-in node"</span>;
+<a name="617" href="#617">617</a>             log.error(msg);
+<a name="618" href="#618">618</a>             <strong>throw</strong> <strong>new</strong> VersionException(msg);
+<a name="619" href="#619">619</a>         }
+<a name="620" href="#620">620</a> 
+<a name="621" href="#621">621</a>         <em class="comment">// delegate the creation of the child node to the parent node</em>
+<a name="622" href="#622">622</a>         <strong>return</strong> parentNode.internalAddChildNode(nodeName, nodeType, uuid);
+<a name="623" href="#623">623</a>     }
+<a name="624" href="#624">624</a> 
+<a name="625" href="#625">625</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddChildNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType)
+<a name="626" href="#626">626</a>             throws ItemExistsException, ConstraintViolationException, RepositoryException {
+<a name="627" href="#627">627</a>         <strong>return</strong> internalAddChildNode(nodeName, nodeType, <strong>null</strong>);
+<a name="628" href="#628">628</a>     }
+<a name="629" href="#629">629</a> 
+<a name="630" href="#630">630</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> internalAddChildNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nodeType, String uuid)
+<a name="631" href="#631">631</a>             throws ItemExistsException, ConstraintViolationException, RepositoryException {
+<a name="632" href="#632">632</a>         <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> nodePath;
+<a name="633" href="#633">633</a>         <strong>try</strong> {
+<a name="634" href="#634">634</a>             nodePath = Path.create(getPrimaryPath(), nodeName, <strong>true</strong>);
+<a name="635" href="#635">635</a>         } <strong>catch</strong> (MalformedPathException e) {
+<a name="636" href="#636">636</a>             <em class="comment">// should never happen</em>
+<a name="637" href="#637">637</a>             String msg = <span class="string">"internal error: invalid path "</span> + safeGetJCRPath();
+<a name="638" href="#638">638</a>             log.error(msg, e);
+<a name="639" href="#639">639</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, e);
+<a name="640" href="#640">640</a>         }
+<a name="641" href="#641">641</a> 
+<a name="642" href="#642">642</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeDefImpl.html">NodeDefImpl</a> def;
+<a name="643" href="#643">643</a>         <strong>try</strong> {
+<a name="644" href="#644">644</a>             def = getApplicableChildNodeDef(nodeName, nodeType == <strong>null</strong> ? <strong>null</strong> : nodeType.getQName());
+<a name="645" href="#645">645</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="646" href="#646">646</a>             String msg = <span class="string">"no definition found in parent node's node type for new node"</span>;
+<a name="647" href="#647">647</a>             log.error(msg, re);
+<a name="648" href="#648">648</a>             <strong>throw</strong> <strong>new</strong> ConstraintViolationException(msg, re);
+<a name="649" href="#649">649</a>         }
+<a name="650" href="#650">650</a>         <strong>if</strong> (nodeType == <strong>null</strong>) {
+<a name="651" href="#651">651</a>             <em class="comment">// use default node type</em>
+<a name="652" href="#652">652</a>             nodeType = (NodeTypeImpl) def.getDefaultPrimaryType();
+<a name="653" href="#653">653</a>         }
+<a name="654" href="#654">654</a> 
+<a name="655" href="#655">655</a>         <em class="comment">// check for name collisions</em>
+<a name="656" href="#656">656</a> <em class="comment">/*</em>
+<a name="657" href="#657">657</a> <em class="comment">        try {</em>
+<a name="658" href="#658">658</a> <em class="comment">            Item item = itemMgr.getItem(nodePath);</em>
+<a name="659" href="#659">659</a> <em class="comment">            if (!item.isNode()) {</em>
+<a name="660" href="#660">660</a> <em class="comment">                // there's already a property with that name</em>
+<a name="661" href="#661">661</a> <em class="comment">                throw new ItemExistsException(itemMgr.safeGetJCRPath(nodePath));</em>
+<a name="662" href="#662">662</a> <em class="comment">            } else {</em>
+<a name="663" href="#663">663</a> <em class="comment">                // there's already a node with that name</em>
+<a name="664" href="#664">664</a> <em class="comment">                // check same-name sibling setting of both new and existing node</em>
+<a name="665" href="#665">665</a> <em class="comment">                if (!def.allowSameNameSibs()</em>
+<a name="666" href="#666">666</a> <em class="comment">                        || !((NodeImpl) item).getDefinition().allowSameNameSibs()) {</em>
+<a name="667" href="#667">667</a> <em class="comment">                    throw new ItemExistsException(itemMgr.safeGetJCRPath(nodePath));</em>
+<a name="668" href="#668">668</a> <em class="comment">                }</em>
+<a name="669" href="#669">669</a> <em class="comment">            }</em>
+<a name="670" href="#670">670</a> <em class="comment">        } catch (PathNotFoundException pnfe) {</em>
+<a name="671" href="#671">671</a> <em class="comment">            // no name collision</em>
+<a name="672" href="#672">672</a> <em class="comment">        }</em>
+<a name="673" href="#673">673</a> <em class="comment">*/</em>
+<a name="674" href="#674">674</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="675" href="#675">675</a>         <strong>if</strong> (thisState.hasPropertyEntry(nodeName)) {
+<a name="676" href="#676">676</a>             <em class="comment">// there's already a property with that name</em>
+<a name="677" href="#677">677</a>             <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
+<a name="678" href="#678">678</a>         }
+<a name="679" href="#679">679</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(nodeName, 1);
+<a name="680" href="#680">680</a>         <strong>if</strong> (cne != <strong>null</strong>) {
+<a name="681" href="#681">681</a>             <em class="comment">// there's already a child node entry with that name;</em>
+<a name="682" href="#682">682</a>             <em class="comment">// check same-name sibling setting of new node</em>
+<a name="683" href="#683">683</a>             <strong>if</strong> (!def.allowSameNameSibs()) {
+<a name="684" href="#684">684</a>                 <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
+<a name="685" href="#685">685</a>             }
+<a name="686" href="#686">686</a>             <em class="comment">// check same-name sibling setting of existing node</em>
+<a name="687" href="#687">687</a>             <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> <strong>new</strong>Id = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
+<a name="688" href="#688">688</a>             <strong>if</strong> (!((NodeImpl) itemMgr.getItem(newId)).getDefinition().allowSameNameSibs()) {
+<a name="689" href="#689">689</a>                 <strong>throw</strong> <strong>new</strong> ItemExistsException(itemMgr.safeGetJCRPath(nodePath));
+<a name="690" href="#690">690</a>             }
 <a name="691" href="#691">691</a>         }
 <a name="692" href="#692">692</a> 
-<a name="693" href="#693">693</a>         <em class="comment">// now do create the child node</em>
-<a name="694" href="#694">694</a>         <strong>return</strong> createChildNode(nodeName, def, nodeType, uuid);
-<a name="695" href="#695">695</a>     }
-<a name="696" href="#696">696</a> 
-<a name="697" href="#697">697</a>     <strong>private</strong> <strong>void</strong> setMixinTypesProperty(Set mixinNames) throws RepositoryException {
-<a name="698" href="#698">698</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="699" href="#699">699</a>         <em class="comment">// get or create jcr:mixinTypes property</em>
-<a name="700" href="#700">700</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = <strong>null</strong>;
-<a name="701" href="#701">701</a>         <strong>if</strong> (thisState.hasPropertyEntry(PROPNAME_MIXINTYPES)) {
-<a name="702" href="#702">702</a>             prop = (PropertyImpl) itemMgr.getItem(<strong>new</strong> PropertyId(thisState.getUUID(), PROPNAME_MIXINTYPES));
-<a name="703" href="#703">703</a>         } <strong>else</strong> {
-<a name="704" href="#704">704</a>             <em class="comment">// find definition for the jcr:mixinTypes property and create property</em>
-<a name="705" href="#705">705</a>             <a href="../../../../org/apache/jackrabbit/core/nodetype/PropertyDefImpl.html">PropertyDefImpl</a> def = getApplicablePropertyDef(PROPNAME_MIXINTYPES, PropertyType.NAME, <strong>true</strong>);
-<a name="706" href="#706">706</a>             prop = createChildProperty(PROPNAME_MIXINTYPES, PropertyType.NAME, def);
-<a name="707" href="#707">707</a>         }
-<a name="708" href="#708">708</a> 
-<a name="709" href="#709">709</a>         <strong>if</strong> (mixinNames.isEmpty()) {
-<a name="710" href="#710">710</a>             <em class="comment">// purge empty jcr:mixinTypes property</em>
-<a name="711" href="#711">711</a>             removeChildProperty(PROPNAME_MIXINTYPES);
-<a name="712" href="#712">712</a>             <strong>return</strong>;
-<a name="713" href="#713">713</a>         }
-<a name="714" href="#714">714</a> 
-<a name="715" href="#715">715</a>         <em class="comment">// call internalSetValue for setting the jcr:mixinTypes property</em>
-<a name="716" href="#716">716</a>         <em class="comment">// to avoid checking of the 'protected' flag</em>
-<a name="717" href="#717">717</a>         <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] vals = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[mixinNames.size()];
-<a name="718" href="#718">718</a>         Iterator iter = mixinNames.iterator();
-<a name="719" href="#719">719</a>         <strong>int</strong> cnt = 0;
-<a name="720" href="#720">720</a>         <strong>while</strong> (iter.hasNext()) {
-<a name="721" href="#721">721</a>             vals[cnt++] = InternalValue.create((QName) iter.next());
-<a name="722" href="#722">722</a>         }
-<a name="723" href="#723">723</a>         prop.internalSetValue(vals, PropertyType.NAME);
-<a name="724" href="#724">724</a>     }
-<a name="725" href="#725">725</a> 
-<a name="726" href="#726">726</a>     <em>/**<em>*</em></em>
-<a name="727" href="#727">727</a> <em>     * Returns the effective (i.e. merged and resolved) node type representation</em>
-<a name="728" href="#728">728</a> <em>     * of this node's primary and mixin node types.</em>
-<a name="729" href="#729">729</a> <em>     *</em>
-<a name="730" href="#730">730</a> <em>     * @return the effective node type</em>
-<a name="731" href="#731">731</a> <em>     * @throws RepositoryException</em>
-<a name="732" href="#732">732</a> <em>     */</em>
-<a name="733" href="#733">733</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html">EffectiveNodeType</a> getEffectiveNodeType() throws RepositoryException {
-<a name="734" href="#734">734</a>         <em class="comment">// build effective node type of mixins &amp; primary type</em>
-<a name="735" href="#735">735</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html">NodeTypeRegistry</a> ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
-<a name="736" href="#736">736</a>         <em class="comment">// existing mixin's</em>
-<a name="737" href="#737">737</a>         HashSet set = <strong>new</strong> HashSet(((NodeState) state).getMixinTypeNames());
-<a name="738" href="#738">738</a>         <em class="comment">// primary type</em>
-<a name="739" href="#739">739</a>         set.add(nodeType.getQName());
-<a name="740" href="#740">740</a>         <strong>try</strong> {
-<a name="741" href="#741">741</a>             <strong>return</strong> ntReg.getEffectiveNodeType((QName[]) set.toArray(<strong>new</strong> QName[set.size()]));
-<a name="742" href="#742">742</a>         } <strong>catch</strong> (NodeTypeConflictException ntce) {
-<a name="743" href="#743">743</a>             String msg = <span class="string">"internal error: failed to build effective node type for node "</span> + safeGetJCRPath();
-<a name="744" href="#744">744</a>             log.error(msg, ntce);
-<a name="745" href="#745">745</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, ntce);
-<a name="746" href="#746">746</a>         }
-<a name="747" href="#747">747</a>     }
-<a name="748" href="#748">748</a> 
-<a name="749" href="#749">749</a>     <em>/**<em>*</em></em>
-<a name="750" href="#750">750</a> <em>     * Returns the applicable child node definition for a child node with the</em>
-<a name="751" href="#751">751</a> <em>     * specified name and node type.</em>
-<a name="752" href="#752">752</a> <em>     *</em>
-<a name="753" href="#753">753</a> <em>     * @param nodeName</em>
-<a name="754" href="#754">754</a> <em>     * @param nodeTypeName</em>
-<a name="755" href="#755">755</a> <em>     * @return</em>
-<a name="756" href="#756">756</a> <em>     * @throws RepositoryException if no applicable child node definition</em>
-<a name="757" href="#757">757</a> <em>     *                             could be found</em>
-<a name="758" href="#758">758</a> <em>     */</em>
-<a name="759" href="#759">759</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeDefImpl.html">NodeDefImpl</a> getApplicableChildNodeDef(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeTypeName)
-<a name="760" href="#760">760</a>             throws RepositoryException {
-<a name="761" href="#761">761</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/ChildNodeDef.html">ChildNodeDef</a> cnd = getEffectiveNodeType().getApplicableChildNodeDef(nodeName, nodeTypeName);
-<a name="762" href="#762">762</a>         <strong>return</strong> session.getNodeTypeManager().getNodeDef(<strong>new</strong> NodeDefId(cnd));
-<a name="763" href="#763">763</a>     }
-<a name="764" href="#764">764</a> 
-<a name="765" href="#765">765</a>     <em>/**<em>*</em></em>
-<a name="766" href="#766">766</a> <em>     * Returns the applicable property definition for a property with the</em>
-<a name="767" href="#767">767</a> <em>     * specified name and type.</em>
-<a name="768" href="#768">768</a> <em>     *</em>
-<a name="769" href="#769">769</a> <em>     * @param propertyName</em>
-<a name="770" href="#770">770</a> <em>     * @param type</em>
-<a name="771" href="#771">771</a> <em>     * @param multiValued</em>
-<a name="772" href="#772">772</a> <em>     * @return</em>
-<a name="773" href="#773">773</a> <em>     * @throws RepositoryException if no applicable property definition</em>
-<a name="774" href="#774">774</a> <em>     *                             could be found</em>
-<a name="775" href="#775">775</a> <em>     */</em>
-<a name="776" href="#776">776</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/PropertyDefImpl.html">PropertyDefImpl</a> getApplicablePropertyDef(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> propertyName,
-<a name="777" href="#777">777</a>                                                        <strong>int</strong> type, <strong>boolean</strong> multiValued)
-<a name="778" href="#778">778</a>             throws RepositoryException {
-<a name="779" href="#779">779</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/PropDef.html">PropDef</a> pd = getEffectiveNodeType().getApplicablePropertyDef(propertyName, type, multiValued);
-<a name="780" href="#780">780</a>         <strong>return</strong> session.getNodeTypeManager().getPropDef(<strong>new</strong> PropDefId(pd));
-<a name="781" href="#781">781</a>     }
-<a name="782" href="#782">782</a> 
-<a name="783" href="#783">783</a>     <strong>protected</strong> <strong>void</strong> makePersistent(<a href="../../../../org/apache/jackrabbit/core/state/UpdateOperation.html">UpdateOperation</a> update) {
-<a name="784" href="#784">784</a>         <strong>if</strong> (!isTransient()) {
-<a name="785" href="#785">785</a>             log.debug(safeGetJCRPath() + <span class="string">" ("</span> + id + <span class="string">"): there's no transient state to persist"</span>);
-<a name="786" href="#786">786</a>             <strong>return</strong>;
-<a name="787" href="#787">787</a>         }
-<a name="788" href="#788">788</a> 
-<a name="789" href="#789">789</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> transientState = (NodeState) state;
-<a name="790" href="#790">790</a> 
-<a name="791" href="#791">791</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> persistentState = (NodeState) transientState.getOverlayedState();
-<a name="792" href="#792">792</a>         <strong>if</strong> (persistentState == <strong>null</strong>) {
-<a name="793" href="#793">793</a>             <em class="comment">// this node is 'new'</em>
-<a name="794" href="#794">794</a>             persistentState = update.createNew(transientState.getUUID(),
-<a name="795" href="#795">795</a>                     transientState.getNodeTypeName(), transientState.getParentUUID());
-<a name="796" href="#796">796</a>         }
-<a name="797" href="#797">797</a>         <em class="comment">// copy state from transient state:</em>
-<a name="798" href="#798">798</a>         <em class="comment">// parent uuid's</em>
-<a name="799" href="#799">799</a>         persistentState.setParentUUID(transientState.getParentUUID());
-<a name="800" href="#800">800</a>         persistentState.setParentUUIDs(transientState.getParentUUIDs());
-<a name="801" href="#801">801</a>         <em class="comment">// mixin types</em>
-<a name="802" href="#802">802</a>         persistentState.setMixinTypeNames(transientState.getMixinTypeNames());
-<a name="803" href="#803">803</a>         <em class="comment">// id of definition</em>
-<a name="804" href="#804">804</a>         persistentState.setDefinitionId(transientState.getDefinitionId());
-<a name="805" href="#805">805</a>         <em class="comment">// child node entries</em>
-<a name="806" href="#806">806</a>         persistentState.setChildNodeEntries(transientState.getChildNodeEntries());
-<a name="807" href="#807">807</a>         <em class="comment">// property entries</em>
-<a name="808" href="#808">808</a>         persistentState.setPropertyEntries(transientState.getPropertyEntries());
-<a name="809" href="#809">809</a> 
-<a name="810" href="#810">810</a>         <em class="comment">// make state persistent</em>
-<a name="811" href="#811">811</a>         update.store(persistentState);
-<a name="812" href="#812">812</a>         <em class="comment">// remove listener from transient state</em>
-<a name="813" href="#813">813</a>         transientState.removeListener(<strong>this</strong>);
-<a name="814" href="#814">814</a>         <em class="comment">// add listener to persistent state</em>
-<a name="815" href="#815">815</a>         persistentState.addListener(<strong>this</strong>);
-<a name="816" href="#816">816</a>         <em class="comment">// swap transient state with persistent state</em>
-<a name="817" href="#817">817</a>         state = persistentState;
-<a name="818" href="#818">818</a>         <em class="comment">// reset status</em>
-<a name="819" href="#819">819</a>         status = STATUS_NORMAL;
-<a name="820" href="#820">820</a>     }
-<a name="821" href="#821">821</a> 
-<a name="822" href="#822">822</a>     <em>/**<em>*</em></em>
-<a name="823" href="#823">823</a> <em>     * Checks if this node is the root node.</em>
-<a name="824" href="#824">824</a> <em>     * todo: is this the root node of this workspace?</em>
-<a name="825" href="#825">825</a> <em>     *</em>
-<a name="826" href="#826">826</a> <em>     * @return</em>
-<a name="827" href="#827">827</a> <em>     */</em>
-<a name="828" href="#828">828</a>     <strong>protected</strong> <strong>boolean</strong> isRepositoryRoot() {
-<a name="829" href="#829">829</a>         <strong>return</strong> ((NodeState) state).getUUID().equals(rep.getRootNodeUUID());
-<a name="830" href="#830">830</a>     }
-<a name="831" href="#831">831</a> 
-<a name="832" href="#832">832</a>     <em>/**<em>*</em></em>
-<a name="833" href="#833">833</a> <em>     * Same as {@link Node#isNodeType(String)}, but takes a &lt;code>QName&lt;/code></em>
-<a name="834" href="#834">834</a> <em>     * instad of a &lt;code>String&lt;/code>.</em>
-<a name="835" href="#835">835</a> <em>     * @param ntName name of node type</em>
-<a name="836" href="#836">836</a> <em>     * @return &lt;code>true&lt;/code> if this node is of the specified node type;</em>
-<a name="837" href="#837">837</a> <em>     *         otherwise &lt;code>false&lt;/code></em>
-<a name="838" href="#838">838</a> <em>     */</em>
-<a name="839" href="#839">839</a>     <strong>public</strong> <strong>boolean</strong> isNodeType(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> ntName) throws RepositoryException {
-<a name="840" href="#840">840</a>         <em class="comment">// no need to perform sanity check; assume this has</em>
-<a name="841" href="#841">841</a>         <em class="comment">// already been done by calling method</em>
-<a name="842" href="#842">842</a> 
-<a name="843" href="#843">843</a>         <strong>if</strong> (ntName.equals(nodeType.getQName())) {
-<a name="844" href="#844">844</a>             <strong>return</strong> <strong>true</strong>;
-<a name="845" href="#845">845</a>         }
-<a name="846" href="#846">846</a> 
-<a name="847" href="#847">847</a>         <strong>if</strong> (nodeType.isDerivedFrom(ntName)) {
-<a name="848" href="#848">848</a>             <strong>return</strong> <strong>true</strong>;
-<a name="849" href="#849">849</a>         }
-<a name="850" href="#850">850</a> 
-<a name="851" href="#851">851</a>         <em class="comment">// check mixin types</em>
-<a name="852" href="#852">852</a>         Set mixinNames = ((NodeState) state).getMixinTypeNames();
-<a name="853" href="#853">853</a>         <strong>if</strong> (mixinNames.isEmpty()) {
-<a name="854" href="#854">854</a>             <strong>return</strong> false;
-<a name="855" href="#855">855</a>         }
-<a name="856" href="#856">856</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html">NodeTypeRegistry</a> ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
-<a name="857" href="#857">857</a>         <strong>try</strong> {
-<a name="858" href="#858">858</a>             <a href="../../../../org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html">EffectiveNodeType</a> ent = ntReg.getEffectiveNodeType((QName[]) mixinNames.toArray(<strong>new</strong> QName[mixinNames.size()]));
-<a name="859" href="#859">859</a>             <strong>return</strong> ent.includesNodeType(ntName);
-<a name="860" href="#860">860</a>         } <strong>catch</strong> (NodeTypeConflictException ntce) {
-<a name="861" href="#861">861</a>             String msg = <span class="string">"internal error: invalid mixin node type(s)"</span>;
-<a name="862" href="#862">862</a>             log.error(msg, ntce);
-<a name="863" href="#863">863</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, ntce);
-<a name="864" href="#864">864</a>         }
-<a name="865" href="#865">865</a>     }
-<a name="866" href="#866">866</a> 
-<a name="867" href="#867">867</a>     <em>/**<em>*</em></em>
-<a name="868" href="#868">868</a> <em>     * Returns the (internal) uuid of this node.</em>
-<a name="869" href="#869">869</a> <em>     * @return the uuid of this node</em>
-<a name="870" href="#870">870</a> <em>     */</em>
-<a name="871" href="#871">871</a>     <strong>public</strong> String internalGetUUID() {
-<a name="872" href="#872">872</a>         <strong>return</strong> ((NodeState) state).getUUID();
-<a name="873" href="#873">873</a>     }
-<a name="874" href="#874">874</a> 
-<a name="875" href="#875">875</a>     <em>/**<em>*</em></em>
-<a name="876" href="#876">876</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
-<a name="877" href="#877">877</a> <em>     * &lt;p/></em>
-<a name="878" href="#878">878</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
-<a name="879" href="#879">879</a> <em>     * responsibility to make sure that the type of the given value is compatible</em>
-<a name="880" href="#880">880</a> <em>     * with the specified property's definition.</em>
-<a name="881" href="#881">881</a> <em>     *</em>
-<a name="882" href="#882">882</a> <em>     * @param name</em>
-<a name="883" href="#883">883</a> <em>     * @param value</em>
-<a name="884" href="#884">884</a> <em>     * @return</em>
-<a name="885" href="#885">885</a> <em>     * @throws ValueFormatException</em>
-<a name="886" href="#886">886</a> <em>     * @throws RepositoryException</em>
-<a name="887" href="#887">887</a> <em>     */</em>
-<a name="888" href="#888">888</a>     <strong>public</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a> value)
-<a name="889" href="#889">889</a>             throws ValueFormatException, RepositoryException {
-<a name="890" href="#890">890</a>         <em class="comment">// check state of this instance</em>
-<a name="891" href="#891">891</a>         sanityCheck();
-<a name="892" href="#892">892</a> 
-<a name="893" href="#893">893</a>         <strong>int</strong> type;
-<a name="894" href="#894">894</a>         <strong>if</strong> (value == <strong>null</strong>) {
-<a name="895" href="#895">895</a>             type = PropertyType.STRING;
-<a name="896" href="#896">896</a>         } <strong>else</strong> {
-<a name="897" href="#897">897</a>             type = value.getType();
-<a name="898" href="#898">898</a>         }
-<a name="899" href="#899">899</a> 
-<a name="900" href="#900">900</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="901" href="#901">901</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
-<a name="902" href="#902">902</a>         <strong>try</strong> {
-<a name="903" href="#903">903</a>             <strong>if</strong> (value == <strong>null</strong>) {
-<a name="904" href="#904">904</a>                 prop.internalSetValue(<strong>null</strong>, type);
-<a name="905" href="#905">905</a>             } <strong>else</strong> {
-<a name="906" href="#906">906</a>                 prop.internalSetValue(<strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[]{value}, type);
-<a name="907" href="#907">907</a>             }
-<a name="908" href="#908">908</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="909" href="#909">909</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="910" href="#910">910</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="911" href="#911">911</a>                 removeChildProperty(name);
-<a name="912" href="#912">912</a>             }
-<a name="913" href="#913">913</a>             <em class="comment">// rethrow</em>
-<a name="914" href="#914">914</a>             <strong>throw</strong> re;
-<a name="915" href="#915">915</a>         }
-<a name="916" href="#916">916</a>         <strong>return</strong> prop;
-<a name="917" href="#917">917</a>     }
-<a name="918" href="#918">918</a> 
-<a name="919" href="#919">919</a>     <em>/**<em>*</em></em>
-<a name="920" href="#920">920</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
-<a name="921" href="#921">921</a> <em>     * &lt;p/></em>
-<a name="922" href="#922">922</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
-<a name="923" href="#923">923</a> <em>     * responsibility to make sure that the type of the given values is compatible</em>
-<a name="924" href="#924">924</a> <em>     * with the specified property's definition.</em>
-<a name="925" href="#925">925</a> <em>     *</em>
-<a name="926" href="#926">926</a> <em>     * @param name</em>
-<a name="927" href="#927">927</a> <em>     * @param values</em>
-<a name="928" href="#928">928</a> <em>     * @return</em>
-<a name="929" href="#929">929</a> <em>     * @throws ValueFormatException</em>
-<a name="930" href="#930">930</a> <em>     * @throws RepositoryException</em>
-<a name="931" href="#931">931</a> <em>     */</em>
-<a name="932" href="#932">932</a>     <strong>protected</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] values)
-<a name="933" href="#933">933</a>             throws ValueFormatException, RepositoryException {
-<a name="934" href="#934">934</a>         <em class="comment">// check state of this instance</em>
-<a name="935" href="#935">935</a>         sanityCheck();
-<a name="936" href="#936">936</a> 
-<a name="937" href="#937">937</a>         <strong>int</strong> type;
-<a name="938" href="#938">938</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
-<a name="939" href="#939">939</a>             type = PropertyType.STRING;
-<a name="940" href="#940">940</a>         } <strong>else</strong> {
-<a name="941" href="#941">941</a>             type = values[0].getType();
-<a name="942" href="#942">942</a>         }
-<a name="943" href="#943">943</a> 
-<a name="944" href="#944">944</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="945" href="#945">945</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
-<a name="946" href="#946">946</a>         <strong>try</strong> {
-<a name="947" href="#947">947</a>             prop.internalSetValue(values, type);
-<a name="948" href="#948">948</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="949" href="#949">949</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="950" href="#950">950</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="951" href="#951">951</a>                 removeChildProperty(name);
-<a name="952" href="#952">952</a>             }
-<a name="953" href="#953">953</a>             <em class="comment">// rethrow</em>
-<a name="954" href="#954">954</a>             <strong>throw</strong> re;
-<a name="955" href="#955">955</a>         }
-<a name="956" href="#956">956</a>         <strong>return</strong> prop;
-<a name="957" href="#957">957</a>     }
-<a name="958" href="#958">958</a> 
-<a name="959" href="#959">959</a>     <em>/**<em>*</em></em>
-<a name="960" href="#960">960</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
-<a name="961" href="#961">961</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="962" href="#962">962</a> <em>     *</em>
-<a name="963" href="#963">963</a> <em>     * @param name The qualified name of the child node to retrieve.</em>
-<a name="964" href="#964">964</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
-<a name="965" href="#965">965</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
-<a name="966" href="#966">966</a> <em>     *                               specified name.</em>
-<a name="967" href="#967">967</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="968" href="#968">968</a> <em>     */</em>
-<a name="969" href="#969">969</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws ItemNotFoundException, RepositoryException {
-<a name="970" href="#970">970</a>         <strong>return</strong> getNode(name, 1);
-<a name="971" href="#971">971</a>     }
-<a name="972" href="#972">972</a> 
-<a name="973" href="#973">973</a>     <em>/**<em>*</em></em>
-<a name="974" href="#974">974</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
-<a name="975" href="#975">975</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="976" href="#976">976</a> <em>     *</em>
-<a name="977" href="#977">977</a> <em>     * @param name  The qualified name of the child node to retrieve.</em>
-<a name="978" href="#978">978</a> <em>     * @param index The index of the child node to retrieve (in the case of same-name siblings).</em>
-<a name="979" href="#979">979</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
-<a name="980" href="#980">980</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
-<a name="981" href="#981">981</a> <em>     *                               specified name.</em>
-<a name="982" href="#982">982</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="983" href="#983">983</a> <em>     */</em>
-<a name="984" href="#984">984</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index)
-<a name="985" href="#985">985</a>             throws ItemNotFoundException, RepositoryException {
-<a name="986" href="#986">986</a>         <em class="comment">// check state of this instance</em>
-<a name="987" href="#987">987</a>         sanityCheck();
-<a name="988" href="#988">988</a> 
-<a name="989" href="#989">989</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="990" href="#990">990</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
-<a name="991" href="#991">991</a>         <strong>if</strong> (cne == <strong>null</strong>) {
-<a name="992" href="#992">992</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
-<a name="993" href="#993">993</a>         }
-<a name="994" href="#994">994</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
-<a name="995" href="#995">995</a>         <strong>try</strong> {
-<a name="996" href="#996">996</a>             <strong>return</strong> (NodeImpl) itemMgr.getItem(nodeId);
-<a name="997" href="#997">997</a>         } <strong>catch</strong> (AccessDeniedException ade) {
-<a name="998" href="#998">998</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
-<a name="999" href="#999">999</a>         }
-<a name="1000" href="#1000">1000</a>     }
-<a name="1001" href="#1001">1001</a> 
-<a name="1002" href="#1002">1002</a>     <em>/**<em>*</em></em>
-<a name="1003" href="#1003">1003</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="1004" href="#1004">1004</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
-<a name="1005" href="#1005">1005</a> <em>     * otherwise.</em>
-<a name="1006" href="#1006">1006</a> <em>     *</em>
-<a name="1007" href="#1007">1007</a> <em>     * @param name The qualified name of the child node.</em>
-<a name="1008" href="#1008">1008</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="1009" href="#1009">1009</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="1010" href="#1010">1010</a> <em>     */</em>
-<a name="1011" href="#1011">1011</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
-<a name="1012" href="#1012">1012</a>         <strong>return</strong> hasNode(name, 1);
-<a name="1013" href="#1013">1013</a>     }
-<a name="1014" href="#1014">1014</a> 
-<a name="1015" href="#1015">1015</a>     <em>/**<em>*</em></em>
-<a name="1016" href="#1016">1016</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="1017" href="#1017">1017</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
-<a name="1018" href="#1018">1018</a> <em>     * otherwise.</em>
-<a name="1019" href="#1019">1019</a> <em>     *</em>
-<a name="1020" href="#1020">1020</a> <em>     * @param name  The qualified name of the child node.</em>
-<a name="1021" href="#1021">1021</a> <em>     * @param index The index of the child node (in the case of same-name siblings).</em>
-<a name="1022" href="#1022">1022</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="1023" href="#1023">1023</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="1024" href="#1024">1024</a> <em>     */</em>
-<a name="1025" href="#1025">1025</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index) throws RepositoryException {
-<a name="1026" href="#1026">1026</a>         <em class="comment">// check state of this instance</em>
-<a name="1027" href="#1027">1027</a>         sanityCheck();
-<a name="1028" href="#1028">1028</a> 
-<a name="1029" href="#1029">1029</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1030" href="#1030">1030</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
-<a name="1031" href="#1031">1031</a>         <strong>if</strong> (cne == <strong>null</strong>) {
-<a name="1032" href="#1032">1032</a>             <strong>return</strong> false;
-<a name="1033" href="#1033">1033</a>         }
-<a name="1034" href="#1034">1034</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
-<a name="1035" href="#1035">1035</a> 
-<a name="1036" href="#1036">1036</a>         <strong>return</strong> itemMgr.itemExists(nodeId);
-<a name="1037" href="#1037">1037</a>     }
-<a name="1038" href="#1038">1038</a> 
-<a name="1039" href="#1039">1039</a>     <em>/**<em>*</em></em>
-<a name="1040" href="#1040">1040</a> <em>     * Returns the property of &lt;code>this&lt;/code> node with the specified</em>
-<a name="1041" href="#1041">1041</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="1042" href="#1042">1042</a> <em>     *</em>
-<a name="1043" href="#1043">1043</a> <em>     * @param name The qualified name of the property to retrieve.</em>
-<a name="1044" href="#1044">1044</a> <em>     * @return The property with the specified &lt;code>name&lt;/code>.</em>
-<a name="1045" href="#1045">1045</a> <em>     * @throws ItemNotFoundException If no property exists with the</em>
-<a name="1046" href="#1046">1046</a> <em>     *                               specified name.</em>
-<a name="1047" href="#1047">1047</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="1048" href="#1048">1048</a> <em>     */</em>
-<a name="1049" href="#1049">1049</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> getProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name)
-<a name="1050" href="#1050">1050</a>             throws ItemNotFoundException, RepositoryException {
-<a name="1051" href="#1051">1051</a>         <em class="comment">// check state of this instance</em>
-<a name="1052" href="#1052">1052</a>         sanityCheck();
-<a name="1053" href="#1053">1053</a> 
-<a name="1054" href="#1054">1054</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1055" href="#1055">1055</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
-<a name="1056" href="#1056">1056</a>         <strong>try</strong> {
-<a name="1057" href="#1057">1057</a>             <strong>return</strong> (PropertyImpl) itemMgr.getItem(propId);
-<a name="1058" href="#1058">1058</a>         } <strong>catch</strong> (AccessDeniedException ade) {
-<a name="1059" href="#1059">1059</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException(name.toString());
-<a name="1060" href="#1060">1060</a>         }
-<a name="1061" href="#1061">1061</a>     }
-<a name="1062" href="#1062">1062</a> 
-<a name="1063" href="#1063">1063</a>     <em>/**<em>*</em></em>
-<a name="1064" href="#1064">1064</a> <em>     * Indicates whether a property with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="1065" href="#1065">1065</a> <em>     * Returns &lt;code>true&lt;/code> if the property exists and &lt;code>false&lt;/code></em>
-<a name="1066" href="#1066">1066</a> <em>     * otherwise.</em>
-<a name="1067" href="#1067">1067</a> <em>     *</em>
-<a name="1068" href="#1068">1068</a> <em>     * @param name The qualified name of the property.</em>
-<a name="1069" href="#1069">1069</a> <em>     * @return &lt;code>true&lt;/code> if the property exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="1070" href="#1070">1070</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="1071" href="#1071">1071</a> <em>     */</em>
-<a name="1072" href="#1072">1072</a>     <strong>public</strong> <strong>boolean</strong> hasProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
-<a name="1073" href="#1073">1073</a>         <em class="comment">// check state of this instance</em>
-<a name="1074" href="#1074">1074</a>         sanityCheck();
-<a name="1075" href="#1075">1075</a> 
-<a name="1076" href="#1076">1076</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1077" href="#1077">1077</a>         <strong>if</strong> (!thisState.hasPropertyEntry(name)) {
-<a name="1078" href="#1078">1078</a>             <strong>return</strong> false;
-<a name="1079" href="#1079">1079</a>         }
-<a name="1080" href="#1080">1080</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
-<a name="1081" href="#1081">1081</a> 
-<a name="1082" href="#1082">1082</a>         <strong>return</strong> itemMgr.itemExists(propId);
-<a name="1083" href="#1083">1083</a>     }
-<a name="1084" href="#1084">1084</a> 
-<a name="1085" href="#1085">1085</a>     <em>/**<em>*</em></em>
-<a name="1086" href="#1086">1086</a> <em>     * @see Node#addNode(String)</em>
-<a name="1087" href="#1087">1087</a> <em>     */</em>
-<a name="1088" href="#1088">1088</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName)
-<a name="1089" href="#1089">1089</a>             throws ItemExistsException, ConstraintViolationException,
-<a name="1090" href="#1090">1090</a>             RepositoryException {
-<a name="1091" href="#1091">1091</a>         <em class="comment">// check state of this instance</em>
-<a name="1092" href="#1092">1092</a>         sanityCheck();
-<a name="1093" href="#1093">1093</a> 
-<a name="1094" href="#1094">1094</a>         <strong>return</strong> internalAddChildNode(nodeName, <strong>null</strong>);
-<a name="1095" href="#1095">1095</a>     }
-<a name="1096" href="#1096">1096</a> 
-<a name="1097" href="#1097">1097</a>     <em>/**<em>*</em></em>
-<a name="1098" href="#1098">1098</a> <em>     * @see Node#addNode(String, String)</em>
-<a name="1099" href="#1099">1099</a> <em>     */</em>
-<a name="1100" href="#1100">1100</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeTypeName)
-<a name="1101" href="#1101">1101</a>             throws ItemExistsException, NoSuchNodeTypeException,
-<a name="1102" href="#1102">1102</a>             ConstraintViolationException, RepositoryException {
-<a name="1103" href="#1103">1103</a>         <em class="comment">// check state of this instance</em>
-<a name="1104" href="#1104">1104</a>         sanityCheck();
-<a name="1105" href="#1105">1105</a> 
-<a name="1106" href="#1106">1106</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nt = session.getNodeTypeManager().getNodeType(nodeTypeName);
-<a name="1107" href="#1107">1107</a>         <strong>return</strong> internalAddChildNode(nodeName, nt);
-<a name="1108" href="#1108">1108</a>     }
-<a name="1109" href="#1109">1109</a> 
-<a name="1110" href="#1110">1110</a>     <em>/**<em>*</em></em>
-<a name="1111" href="#1111">1111</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String)}&lt;/code> except that</em>
-<a name="1112" href="#1112">1112</a> <em>     * this method takes a &lt;code>QName&lt;/code> instead of a &lt;code>String&lt;/code></em>
-<a name="1113" href="#1113">1113</a> <em>     * value.</em>
-<a name="1114" href="#1114">1114</a> <em>     *</em>
-<a name="1115" href="#1115">1115</a> <em>     * @param name</em>
-<a name="1116" href="#1116">1116</a> <em>     * @param value</em>
-<a name="1117" href="#1117">1117</a> <em>     * @return</em>
-<a name="1118" href="#1118">1118</a> <em>     * @throws ValueFormatException</em>
-<a name="1119" href="#1119">1119</a> <em>     * @throws RepositoryException</em>
-<a name="1120" href="#1120">1120</a> <em>     */</em>
-<a name="1121" href="#1121">1121</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> value) throws ValueFormatException, RepositoryException {
-<a name="1122" href="#1122">1122</a>         <em class="comment">// check state of this instance</em>
-<a name="1123" href="#1123">1123</a>         sanityCheck();
-<a name="1124" href="#1124">1124</a> 
-<a name="1125" href="#1125">1125</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="1126" href="#1126">1126</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, PropertyType.NAME, false, status);
-<a name="1127" href="#1127">1127</a>         <strong>try</strong> {
-<a name="1128" href="#1128">1128</a>             prop.setValue(value);
-<a name="1129" href="#1129">1129</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="1130" href="#1130">1130</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="1131" href="#1131">1131</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="1132" href="#1132">1132</a>                 removeChildProperty(name);
-<a name="1133" href="#1133">1133</a>             }
-<a name="1134" href="#1134">1134</a>             <em class="comment">// rethrow</em>
-<a name="1135" href="#1135">1135</a>             <strong>throw</strong> re;
-<a name="1136" href="#1136">1136</a>         }
-<a name="1137" href="#1137">1137</a>         <strong>return</strong> prop;
-<a name="1138" href="#1138">1138</a>     }
-<a name="1139" href="#1139">1139</a> 
-<a name="1140" href="#1140">1140</a>     <em>/**<em>*</em></em>
-<a name="1141" href="#1141">1141</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String[])}&lt;/code> except that</em>
-<a name="1142" href="#1142">1142</a> <em>     * this method takes an array of  &lt;code>QName&lt;/code> instead of a</em>
-<a name="1143" href="#1143">1143</a> <em>     * &lt;code>String&lt;/code> values.</em>
-<a name="1144" href="#1144">1144</a> <em>     *</em>
-<a name="1145" href="#1145">1145</a> <em>     * @param name</em>
-<a name="1146" href="#1146">1146</a> <em>     * @param values</em>
-<a name="1147" href="#1147">1147</a> <em>     * @return</em>
-<a name="1148" href="#1148">1148</a> <em>     * @throws ValueFormatException</em>
-<a name="1149" href="#1149">1149</a> <em>     * @throws RepositoryException</em>
-<a name="1150" href="#1150">1150</a> <em>     */</em>
-<a name="1151" href="#1151">1151</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a>[] values) throws ValueFormatException, RepositoryException {
+<a name="693" href="#693">693</a>         <em class="comment">// check protected flag of parent (i.e. this) node</em>
+<a name="694" href="#694">694</a>         <strong>if</strong> (getDefinition().isProtected()) {
+<a name="695" href="#695">695</a>             String msg = safeGetJCRPath() + <span class="string">": cannot add a child to a protected node"</span>;
+<a name="696" href="#696">696</a>             log.error(msg);
+<a name="697" href="#697">697</a>             <strong>throw</strong> <strong>new</strong> ConstraintViolationException(msg);
+<a name="698" href="#698">698</a>         }
+<a name="699" href="#699">699</a> 
+<a name="700" href="#700">700</a>         <em class="comment">// now do create the child node</em>
+<a name="701" href="#701">701</a>         <strong>return</strong> createChildNode(nodeName, def, nodeType, uuid);
+<a name="702" href="#702">702</a>     }
+<a name="703" href="#703">703</a> 
+<a name="704" href="#704">704</a>     <strong>private</strong> <strong>void</strong> setMixinTypesProperty(Set mixinNames) throws RepositoryException {
+<a name="705" href="#705">705</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="706" href="#706">706</a>         <em class="comment">// get or create jcr:mixinTypes property</em>
+<a name="707" href="#707">707</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = <strong>null</strong>;
+<a name="708" href="#708">708</a>         <strong>if</strong> (thisState.hasPropertyEntry(PROPNAME_MIXINTYPES)) {
+<a name="709" href="#709">709</a>             prop = (PropertyImpl) itemMgr.getItem(<strong>new</strong> PropertyId(thisState.getUUID(), PROPNAME_MIXINTYPES));
+<a name="710" href="#710">710</a>         } <strong>else</strong> {
+<a name="711" href="#711">711</a>             <em class="comment">// find definition for the jcr:mixinTypes property and create property</em>
+<a name="712" href="#712">712</a>             <a href="../../../../org/apache/jackrabbit/core/nodetype/PropertyDefImpl.html">PropertyDefImpl</a> def = getApplicablePropertyDef(PROPNAME_MIXINTYPES, PropertyType.NAME, <strong>true</strong>);
+<a name="713" href="#713">713</a>             prop = createChildProperty(PROPNAME_MIXINTYPES, PropertyType.NAME, def);
+<a name="714" href="#714">714</a>         }
+<a name="715" href="#715">715</a> 
+<a name="716" href="#716">716</a>         <strong>if</strong> (mixinNames.isEmpty()) {
+<a name="717" href="#717">717</a>             <em class="comment">// purge empty jcr:mixinTypes property</em>
+<a name="718" href="#718">718</a>             removeChildProperty(PROPNAME_MIXINTYPES);
+<a name="719" href="#719">719</a>             <strong>return</strong>;
+<a name="720" href="#720">720</a>         }
+<a name="721" href="#721">721</a> 
+<a name="722" href="#722">722</a>         <em class="comment">// call internalSetValue for setting the jcr:mixinTypes property</em>
+<a name="723" href="#723">723</a>         <em class="comment">// to avoid checking of the 'protected' flag</em>
+<a name="724" href="#724">724</a>         <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] vals = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[mixinNames.size()];
+<a name="725" href="#725">725</a>         Iterator iter = mixinNames.iterator();
+<a name="726" href="#726">726</a>         <strong>int</strong> cnt = 0;
+<a name="727" href="#727">727</a>         <strong>while</strong> (iter.hasNext()) {
+<a name="728" href="#728">728</a>             vals[cnt++] = InternalValue.create((QName) iter.next());
+<a name="729" href="#729">729</a>         }
+<a name="730" href="#730">730</a>         prop.internalSetValue(vals, PropertyType.NAME);
+<a name="731" href="#731">731</a>     }
+<a name="732" href="#732">732</a> 
+<a name="733" href="#733">733</a>     <em>/**<em>*</em></em>
+<a name="734" href="#734">734</a> <em>     * Returns the effective (i.e. merged and resolved) node type representation</em>
+<a name="735" href="#735">735</a> <em>     * of this node's primary and mixin node types.</em>
+<a name="736" href="#736">736</a> <em>     *</em>
+<a name="737" href="#737">737</a> <em>     * @return the effective node type</em>
+<a name="738" href="#738">738</a> <em>     * @throws RepositoryException</em>
+<a name="739" href="#739">739</a> <em>     */</em>
+<a name="740" href="#740">740</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html">EffectiveNodeType</a> getEffectiveNodeType() throws RepositoryException {
+<a name="741" href="#741">741</a>         <em class="comment">// build effective node type of mixins &amp; primary type</em>
+<a name="742" href="#742">742</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html">NodeTypeRegistry</a> ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
+<a name="743" href="#743">743</a>         <em class="comment">// existing mixin's</em>
+<a name="744" href="#744">744</a>         HashSet set = <strong>new</strong> HashSet(((NodeState) state).getMixinTypeNames());
+<a name="745" href="#745">745</a>         <em class="comment">// primary type</em>
+<a name="746" href="#746">746</a>         set.add(nodeType.getQName());
+<a name="747" href="#747">747</a>         <strong>try</strong> {
+<a name="748" href="#748">748</a>             <strong>return</strong> ntReg.getEffectiveNodeType((QName[]) set.toArray(<strong>new</strong> QName[set.size()]));
+<a name="749" href="#749">749</a>         } <strong>catch</strong> (NodeTypeConflictException ntce) {
+<a name="750" href="#750">750</a>             String msg = <span class="string">"internal error: failed to build effective node type for node "</span> + safeGetJCRPath();
+<a name="751" href="#751">751</a>             log.error(msg, ntce);
+<a name="752" href="#752">752</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, ntce);
+<a name="753" href="#753">753</a>         }
+<a name="754" href="#754">754</a>     }
+<a name="755" href="#755">755</a> 
+<a name="756" href="#756">756</a>     <em>/**<em>*</em></em>
+<a name="757" href="#757">757</a> <em>     * Returns the applicable child node definition for a child node with the</em>
+<a name="758" href="#758">758</a> <em>     * specified name and node type.</em>
+<a name="759" href="#759">759</a> <em>     *</em>
+<a name="760" href="#760">760</a> <em>     * @param nodeName</em>
+<a name="761" href="#761">761</a> <em>     * @param nodeTypeName</em>
+<a name="762" href="#762">762</a> <em>     * @return</em>
+<a name="763" href="#763">763</a> <em>     * @throws RepositoryException if no applicable child node definition</em>
+<a name="764" href="#764">764</a> <em>     *                             could be found</em>
+<a name="765" href="#765">765</a> <em>     */</em>
+<a name="766" href="#766">766</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeDefImpl.html">NodeDefImpl</a> getApplicableChildNodeDef(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeTypeName)
+<a name="767" href="#767">767</a>             throws RepositoryException {
+<a name="768" href="#768">768</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/ChildNodeDef.html">ChildNodeDef</a> cnd = getEffectiveNodeType().getApplicableChildNodeDef(nodeName, nodeTypeName);
+<a name="769" href="#769">769</a>         <strong>return</strong> session.getNodeTypeManager().getNodeDef(<strong>new</strong> NodeDefId(cnd));
+<a name="770" href="#770">770</a>     }
+<a name="771" href="#771">771</a> 
+<a name="772" href="#772">772</a>     <em>/**<em>*</em></em>
+<a name="773" href="#773">773</a> <em>     * Returns the applicable property definition for a property with the</em>
+<a name="774" href="#774">774</a> <em>     * specified name and type.</em>
+<a name="775" href="#775">775</a> <em>     *</em>
+<a name="776" href="#776">776</a> <em>     * @param propertyName</em>
+<a name="777" href="#777">777</a> <em>     * @param type</em>
+<a name="778" href="#778">778</a> <em>     * @param multiValued</em>
+<a name="779" href="#779">779</a> <em>     * @return</em>
+<a name="780" href="#780">780</a> <em>     * @throws RepositoryException if no applicable property definition</em>
+<a name="781" href="#781">781</a> <em>     *                             could be found</em>
+<a name="782" href="#782">782</a> <em>     */</em>
+<a name="783" href="#783">783</a>     <strong>protected</strong> <a href="../../../../org/apache/jackrabbit/core/nodetype/PropertyDefImpl.html">PropertyDefImpl</a> getApplicablePropertyDef(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> propertyName,
+<a name="784" href="#784">784</a>                                                        <strong>int</strong> type, <strong>boolean</strong> multiValued)
+<a name="785" href="#785">785</a>             throws RepositoryException {
+<a name="786" href="#786">786</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/PropDef.html">PropDef</a> pd = getEffectiveNodeType().getApplicablePropertyDef(propertyName, type, multiValued);
+<a name="787" href="#787">787</a>         <strong>return</strong> session.getNodeTypeManager().getPropDef(<strong>new</strong> PropDefId(pd));
+<a name="788" href="#788">788</a>     }
+<a name="789" href="#789">789</a> 
+<a name="790" href="#790">790</a>     <strong>protected</strong> <strong>void</strong> makePersistent(<a href="../../../../org/apache/jackrabbit/core/state/UpdateOperation.html">UpdateOperation</a> update) {
+<a name="791" href="#791">791</a>         <strong>if</strong> (!isTransient()) {
+<a name="792" href="#792">792</a>             log.debug(safeGetJCRPath() + <span class="string">" ("</span> + id + <span class="string">"): there's no transient state to persist"</span>);
+<a name="793" href="#793">793</a>             <strong>return</strong>;
+<a name="794" href="#794">794</a>         }
+<a name="795" href="#795">795</a> 
+<a name="796" href="#796">796</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> transientState = (NodeState) state;
+<a name="797" href="#797">797</a> 
+<a name="798" href="#798">798</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> persistentState = (NodeState) transientState.getOverlayedState();
+<a name="799" href="#799">799</a>         <strong>if</strong> (persistentState == <strong>null</strong>) {
+<a name="800" href="#800">800</a>             <em class="comment">// this node is 'new'</em>
+<a name="801" href="#801">801</a>             persistentState = update.createNew(transientState.getUUID(),
+<a name="802" href="#802">802</a>                     transientState.getNodeTypeName(), transientState.getParentUUID());
+<a name="803" href="#803">803</a>         }
+<a name="804" href="#804">804</a>         <em class="comment">// copy state from transient state:</em>
+<a name="805" href="#805">805</a>         <em class="comment">// parent uuid's</em>
+<a name="806" href="#806">806</a>         persistentState.setParentUUID(transientState.getParentUUID());
+<a name="807" href="#807">807</a>         persistentState.setParentUUIDs(transientState.getParentUUIDs());
+<a name="808" href="#808">808</a>         <em class="comment">// mixin types</em>
+<a name="809" href="#809">809</a>         persistentState.setMixinTypeNames(transientState.getMixinTypeNames());
+<a name="810" href="#810">810</a>         <em class="comment">// id of definition</em>
+<a name="811" href="#811">811</a>         persistentState.setDefinitionId(transientState.getDefinitionId());
+<a name="812" href="#812">812</a>         <em class="comment">// child node entries</em>
+<a name="813" href="#813">813</a>         persistentState.setChildNodeEntries(transientState.getChildNodeEntries());
+<a name="814" href="#814">814</a>         <em class="comment">// property entries</em>
+<a name="815" href="#815">815</a>         persistentState.setPropertyEntries(transientState.getPropertyEntries());
+<a name="816" href="#816">816</a> 
+<a name="817" href="#817">817</a>         <em class="comment">// make state persistent</em>
+<a name="818" href="#818">818</a>         update.store(persistentState);
+<a name="819" href="#819">819</a>         <em class="comment">// remove listener from transient state</em>
+<a name="820" href="#820">820</a>         transientState.removeListener(<strong>this</strong>);
+<a name="821" href="#821">821</a>         <em class="comment">// add listener to persistent state</em>
+<a name="822" href="#822">822</a>         persistentState.addListener(<strong>this</strong>);
+<a name="823" href="#823">823</a>         <em class="comment">// swap transient state with persistent state</em>
+<a name="824" href="#824">824</a>         state = persistentState;
+<a name="825" href="#825">825</a>         <em class="comment">// reset status</em>
+<a name="826" href="#826">826</a>         status = STATUS_NORMAL;
+<a name="827" href="#827">827</a>     }
+<a name="828" href="#828">828</a> 
+<a name="829" href="#829">829</a>     <em>/**<em>*</em></em>
+<a name="830" href="#830">830</a> <em>     * Checks if this node is the root node.</em>
+<a name="831" href="#831">831</a> <em>     * todo: is this the root node of this workspace?</em>
+<a name="832" href="#832">832</a> <em>     *</em>
+<a name="833" href="#833">833</a> <em>     * @return</em>
+<a name="834" href="#834">834</a> <em>     */</em>
+<a name="835" href="#835">835</a>     <strong>protected</strong> <strong>boolean</strong> isRepositoryRoot() {
+<a name="836" href="#836">836</a>         <strong>return</strong> ((NodeState) state).getUUID().equals(rep.getRootNodeUUID());
+<a name="837" href="#837">837</a>     }
+<a name="838" href="#838">838</a> 
+<a name="839" href="#839">839</a>     <em>/**<em>*</em></em>
+<a name="840" href="#840">840</a> <em>     * Same as {@link Node#isNodeType(String)}, but takes a &lt;code>QName&lt;/code></em>
+<a name="841" href="#841">841</a> <em>     * instad of a &lt;code>String&lt;/code>.</em>
+<a name="842" href="#842">842</a> <em>     * @param ntName name of node type</em>
+<a name="843" href="#843">843</a> <em>     * @return &lt;code>true&lt;/code> if this node is of the specified node type;</em>
+<a name="844" href="#844">844</a> <em>     *         otherwise &lt;code>false&lt;/code></em>
+<a name="845" href="#845">845</a> <em>     */</em>
+<a name="846" href="#846">846</a>     <strong>public</strong> <strong>boolean</strong> isNodeType(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> ntName) throws RepositoryException {
+<a name="847" href="#847">847</a>         <em class="comment">// no need to perform sanity check; assume this has</em>
+<a name="848" href="#848">848</a>         <em class="comment">// already been done by calling method</em>
+<a name="849" href="#849">849</a> 
+<a name="850" href="#850">850</a>         <strong>if</strong> (ntName.equals(nodeType.getQName())) {
+<a name="851" href="#851">851</a>             <strong>return</strong> <strong>true</strong>;
+<a name="852" href="#852">852</a>         }
+<a name="853" href="#853">853</a> 
+<a name="854" href="#854">854</a>         <strong>if</strong> (nodeType.isDerivedFrom(ntName)) {
+<a name="855" href="#855">855</a>             <strong>return</strong> <strong>true</strong>;
+<a name="856" href="#856">856</a>         }
+<a name="857" href="#857">857</a> 
+<a name="858" href="#858">858</a>         <em class="comment">// check mixin types</em>
+<a name="859" href="#859">859</a>         Set mixinNames = ((NodeState) state).getMixinTypeNames();
+<a name="860" href="#860">860</a>         <strong>if</strong> (mixinNames.isEmpty()) {
+<a name="861" href="#861">861</a>             <strong>return</strong> false;
+<a name="862" href="#862">862</a>         }
+<a name="863" href="#863">863</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html">NodeTypeRegistry</a> ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
+<a name="864" href="#864">864</a>         <strong>try</strong> {
+<a name="865" href="#865">865</a>             <a href="../../../../org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html">EffectiveNodeType</a> ent = ntReg.getEffectiveNodeType((QName[]) mixinNames.toArray(<strong>new</strong> QName[mixinNames.size()]));
+<a name="866" href="#866">866</a>             <strong>return</strong> ent.includesNodeType(ntName);
+<a name="867" href="#867">867</a>         } <strong>catch</strong> (NodeTypeConflictException ntce) {
+<a name="868" href="#868">868</a>             String msg = <span class="string">"internal error: invalid mixin node type(s)"</span>;
+<a name="869" href="#869">869</a>             log.error(msg, ntce);
+<a name="870" href="#870">870</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, ntce);
+<a name="871" href="#871">871</a>         }
+<a name="872" href="#872">872</a>     }
+<a name="873" href="#873">873</a> 
+<a name="874" href="#874">874</a>     <em>/**<em>*</em></em>
+<a name="875" href="#875">875</a> <em>     * Returns the (internal) uuid of this node.</em>
+<a name="876" href="#876">876</a> <em>     * @return the uuid of this node</em>
+<a name="877" href="#877">877</a> <em>     */</em>
+<a name="878" href="#878">878</a>     <strong>public</strong> String internalGetUUID() {
+<a name="879" href="#879">879</a>         <strong>return</strong> ((NodeState) state).getUUID();
+<a name="880" href="#880">880</a>     }
+<a name="881" href="#881">881</a> 
+<a name="882" href="#882">882</a>     <em>/**<em>*</em></em>
+<a name="883" href="#883">883</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
+<a name="884" href="#884">884</a> <em>     * &lt;p/></em>
+<a name="885" href="#885">885</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
+<a name="886" href="#886">886</a> <em>     * responsibility to make sure that the type of the given value is compatible</em>
+<a name="887" href="#887">887</a> <em>     * with the specified property's definition.</em>
+<a name="888" href="#888">888</a> <em>     *</em>
+<a name="889" href="#889">889</a> <em>     * @param name</em>
+<a name="890" href="#890">890</a> <em>     * @param value</em>
+<a name="891" href="#891">891</a> <em>     * @return</em>
+<a name="892" href="#892">892</a> <em>     * @throws ValueFormatException</em>
+<a name="893" href="#893">893</a> <em>     * @throws RepositoryException</em>
+<a name="894" href="#894">894</a> <em>     */</em>
+<a name="895" href="#895">895</a>     <strong>public</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a> value)
+<a name="896" href="#896">896</a>             throws ValueFormatException, RepositoryException {
+<a name="897" href="#897">897</a>         <strong>int</strong> type;
+<a name="898" href="#898">898</a>         <strong>if</strong> (value == <strong>null</strong>) {
+<a name="899" href="#899">899</a>             type = PropertyType.UNDEFINED;
+<a name="900" href="#900">900</a>         } <strong>else</strong> {
+<a name="901" href="#901">901</a>             type = value.getType();
+<a name="902" href="#902">902</a>         }
+<a name="903" href="#903">903</a> 
+<a name="904" href="#904">904</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="905" href="#905">905</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
+<a name="906" href="#906">906</a>         <strong>try</strong> {
+<a name="907" href="#907">907</a>             <strong>if</strong> (value == <strong>null</strong>) {
+<a name="908" href="#908">908</a>                 prop.internalSetValue(<strong>null</strong>, type);
+<a name="909" href="#909">909</a>             } <strong>else</strong> {
+<a name="910" href="#910">910</a>                 prop.internalSetValue(<strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[]{value}, type);
+<a name="911" href="#911">911</a>             }
+<a name="912" href="#912">912</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="913" href="#913">913</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="914" href="#914">914</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="915" href="#915">915</a>                 removeChildProperty(name);
+<a name="916" href="#916">916</a>             }
+<a name="917" href="#917">917</a>             <em class="comment">// rethrow</em>
+<a name="918" href="#918">918</a>             <strong>throw</strong> re;
+<a name="919" href="#919">919</a>         }
+<a name="920" href="#920">920</a>         <strong>return</strong> prop;
+<a name="921" href="#921">921</a>     }
+<a name="922" href="#922">922</a> 
+<a name="923" href="#923">923</a>     <em>/**<em>*</em></em>
+<a name="924" href="#924">924</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
+<a name="925" href="#925">925</a> <em>     * &lt;p/></em>
+<a name="926" href="#926">926</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
+<a name="927" href="#927">927</a> <em>     * responsibility to make sure that the type of the given values is compatible</em>
+<a name="928" href="#928">928</a> <em>     * with the specified property's definition.</em>
+<a name="929" href="#929">929</a> <em>     *</em>
+<a name="930" href="#930">930</a> <em>     * @param name</em>
+<a name="931" href="#931">931</a> <em>     * @param values</em>
+<a name="932" href="#932">932</a> <em>     * @return</em>
+<a name="933" href="#933">933</a> <em>     * @throws ValueFormatException</em>
+<a name="934" href="#934">934</a> <em>     * @throws RepositoryException</em>
+<a name="935" href="#935">935</a> <em>     */</em>
+<a name="936" href="#936">936</a>     <strong>protected</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] values)
+<a name="937" href="#937">937</a>             throws ValueFormatException, RepositoryException {
+<a name="938" href="#938">938</a>         <strong>int</strong> type;
+<a name="939" href="#939">939</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
+<a name="940" href="#940">940</a>             type = PropertyType.UNDEFINED;
+<a name="941" href="#941">941</a>         } <strong>else</strong> {
+<a name="942" href="#942">942</a>             type = values[0].getType();
+<a name="943" href="#943">943</a>         }
+<a name="944" href="#944">944</a>         <strong>return</strong> internalSetProperty(name, values, type);
+<a name="945" href="#945">945</a>     }
+<a name="946" href="#946">946</a> 
+<a name="947" href="#947">947</a>     <em>/**<em>*</em></em>
+<a name="948" href="#948">948</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
+<a name="949" href="#949">949</a> <em>     * &lt;p/></em>
+<a name="950" href="#950">950</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
+<a name="951" href="#951">951</a> <em>     * responsibility to make sure that the type of the given values is compatible</em>
+<a name="952" href="#952">952</a> <em>     * with the specified property's definition.</em>
+<a name="953" href="#953">953</a> <em>     *</em>
+<a name="954" href="#954">954</a> <em>     * @param name</em>
+<a name="955" href="#955">955</a> <em>     * @param values</em>
+<a name="956" href="#956">956</a> <em>     * @param type</em>
+<a name="957" href="#957">957</a> <em>     * @return</em>
+<a name="958" href="#958">958</a> <em>     * @throws ValueFormatException</em>
+<a name="959" href="#959">959</a> <em>     * @throws RepositoryException</em>
+<a name="960" href="#960">960</a> <em>     */</em>
+<a name="961" href="#961">961</a>     <strong>protected</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] values,
+<a name="962" href="#962">962</a>                                            <strong>int</strong> type)
+<a name="963" href="#963">963</a>             throws ValueFormatException, RepositoryException {
+<a name="964" href="#964">964</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="965" href="#965">965</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
+<a name="966" href="#966">966</a>         <strong>try</strong> {
+<a name="967" href="#967">967</a>             prop.internalSetValue(values, type);
+<a name="968" href="#968">968</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="969" href="#969">969</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="970" href="#970">970</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="971" href="#971">971</a>                 removeChildProperty(name);
+<a name="972" href="#972">972</a>             }
+<a name="973" href="#973">973</a>             <em class="comment">// rethrow</em>
+<a name="974" href="#974">974</a>             <strong>throw</strong> re;
+<a name="975" href="#975">975</a>         }
+<a name="976" href="#976">976</a>         <strong>return</strong> prop;
+<a name="977" href="#977">977</a>     }
+<a name="978" href="#978">978</a> 
+<a name="979" href="#979">979</a>     <em>/**<em>*</em></em>
+<a name="980" href="#980">980</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
+<a name="981" href="#981">981</a> <em>     * &lt;code>name&lt;/code>.</em>
+<a name="982" href="#982">982</a> <em>     *</em>
+<a name="983" href="#983">983</a> <em>     * @param name The qualified name of the child node to retrieve.</em>
+<a name="984" href="#984">984</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
+<a name="985" href="#985">985</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
+<a name="986" href="#986">986</a> <em>     *                               specified name.</em>
+<a name="987" href="#987">987</a> <em>     * @throws RepositoryException   If another error occurs.</em>
+<a name="988" href="#988">988</a> <em>     */</em>
+<a name="989" href="#989">989</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws ItemNotFoundException, RepositoryException {

[... 4750 lines stripped ...]


Mime
View raw message