当前位置: 首页 > 工具软件 > eXo JCR > 使用案例 >

eXo ECM中关于Node type的定义

钮高朗
2023-12-01

在ECM的exo-tomcat/common/lib/exo-ecm.services.cms.impl-1.0.jar压缩包中有两个文件定义节点类型(Node type),分别为conf/nodetypes-config.xml和conf/nodetypes-extended-config.xml,关于这两个文件的DTD请见http://www.exoplatform.org/documents/exo-jcr.site/ntdefinition.html

其中nodetypes-config.xml文件:

<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">

 <!-- org.exoplatform.services.cms.actions.* types -->
 
    <nodeType name="exo:action" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>nt:base</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:name" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
         <propertyDefinition name="exo:description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="false" multiple="false"/>
   <propertyDefinition name="exo:lifecyclePhase" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false">
    <defaultValues>
                 <defaultValue>add</defaultValue>
             </defaultValues>
   </propertyDefinition>
   <propertyDefinition name="exo:roles" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="true">
    <defaultValues>
                 <defaultValue>*</defaultValue>
             </defaultValues>
   </propertyDefinition>
        </propertyDefinitions>
    </nodeType>
 
 <nodeType name="exo:businessProcessAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:action</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:businessProcess" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
        </propertyDefinitions>
    </nodeType>

 <nodeType name="exo:scriptAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:action</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:script" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
        </propertyDefinitions>
    </nodeType>
  
 <nodeType name="exo:ruleAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:action</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:rule" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
        </propertyDefinitions>
    </nodeType>

 <nodeType name="exo:actionable" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>nt:base</supertype>
        </supertypes>
     <childNodeDefinitions>
         <childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="true">
             <requiredPrimaryTypes>
                 <requiredPrimaryType>exo:action</requiredPrimaryType>
             </requiredPrimaryTypes>
         </childNodeDefinition>
        </childNodeDefinitions>
    </nodeType> 

    <nodeType name="exo:move" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>nt:base</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:destWorkspace" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
         <propertyDefinition name="exo:destPath" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>   
        </propertyDefinitions>
    </nodeType> 

 <!-- org.exoplatform.services.cms.scripts.* types -->  
 
</nodeTypes>

nodetypes-extended-config.xml文件:

<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">

 <!-- org.exoplatform.services.cms.scripts.* types --> 
 
    <nodeType name="exo:sendMailAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:scriptAction</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:script" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false">
    <defaultValues>
                 <defaultValue>SendMailScript.groovy</defaultValue>
             </defaultValues>
   </propertyDefinition>
   <propertyDefinition name="exo:to" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
        </propertyDefinitions>
    </nodeType>
 
 <nodeType name="exo:transformBinaryToTextAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:scriptAction</supertype>
        </supertypes>
  <propertyDefinitions>
         <propertyDefinition name="exo:script" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false">
    <defaultValues>
                 <defaultValue>TransformBinaryChildrenToTextScript.groovy</defaultValue>
             </defaultValues>
   </propertyDefinition>
        </propertyDefinitions>
    </nodeType>

 <!-- org.exoplatform.services.cms.workflow.* -->

    <nodeType name="exo:workflowAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:businessProcessAction</supertype>
        </supertypes>
  <propertyDefinitions>   
         <propertyDefinition name="exo:validator" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
   <propertyDefinition name="exo:businessProcess" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false"> 
    <defaultValues>
                 <defaultValue>content-validation</defaultValue>
             </defaultValues>
   </propertyDefinition>
        </propertyDefinitions>
    </nodeType>
 
    <nodeType name="exo:backupAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>exo:businessProcessAction</supertype>
        </supertypes>
  <propertyDefinitions>   
   <propertyDefinition name="exo:businessProcess" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false"> 
    <defaultValues>
                 <defaultValue>content-backup</defaultValue>
             </defaultValues>
   </propertyDefinition>
        </propertyDefinitions>
    </nodeType>
 
 <!-- org.exoplatform.services.cms.publications.impl.* -->
 
    <nodeType name="exo:article" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>nt:base</supertype>
        </supertypes>
  <propertyDefinitions>   
         <propertyDefinition name="exo:title" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="exo:summary" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="exo:text" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>   
        </propertyDefinitions>
        <childNodeDefinitions>
         <childNodeDefinition name="exo:image" defaultPrimaryType="nt:resource" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="false">
             <requiredPrimaryTypes>
                 <requiredPrimaryType>nt:resource</requiredPrimaryType>
             </requiredPrimaryTypes>
         </childNodeDefinition>
        </childNodeDefinitions>
    </nodeType>
 
    <nodeType name="exo:published" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
  <propertyDefinitions>   
         <propertyDefinition name="exo:startPublication" requiredType="Date" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="exo:endPublication" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
        </propertyDefinitions>
    </nodeType>
 
 <!-- org.exoplatform.services.cms.categories.* -->
 
    <nodeType name="exo:categorized" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
  <propertyDefinitions>   
         <propertyDefinition name="exo:category" requiredType="Reference" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="true"/>
        </propertyDefinitions>
    </nodeType>

 <!-- org.exoplatform.services.cms.templates.impl.* -->
   
    <nodeType name="exo:template" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
  <supertypes>
            <supertype>nt:base</supertype>
        </supertypes>
  <propertyDefinitions>   
         <propertyDefinition name="exo:templateFile" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="false"/>
   <propertyDefinition name="exo:roles" requiredType="String" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="false" multiple="true"> 
    <defaultValues>
                 <defaultValue>*</defaultValue>
             </defaultValues>
   </propertyDefinition>
        </propertyDefinitions>
    </nodeType>
 
</nodeTypes>

 类似资料: