Jackrabbit的简单节点定义文件实例(OpenKM节点定义文件)

继上一篇说明Jackrabbit节点类型定义文件后,下面给出一个实例.
OpenKM是基于Jackrabbit的文档管理应用,将自己定义的节点类型放在其CustomNodes.config文件中.
CustomNodes.config
  1. <nt = 'http://www.jcp.org/jcr/nt/1.0'>
  2. <jcr = 'http://www.jcp.org/jcr/1.0'>
  3. <mix = 'http://www.jcp.org/jcr/mix/1.0'>
  4. <okm = 'http://www.openkm.org/1.0'>
  5. [mix:accessControlled]
  6. - okm:authUsersRead (string) multiple mandatory
  7. - okm:authUsersWrite (string) multiple mandatory
  8. - okm:authRolesRead (string) multiple mandatory
  9. - okm:authRolesWrite (string) multiple mandatory
  10. [okm:resource] > nt:resource, mix:versionable
  11. - okm:size (long) mandatory
  12. - okm:author (string) mandatory
  13. [okm:document] > nt:hierarchyNode, mix:referenceable, mix:lockable, mix:accessControlled
  14. - okm:author (string) mandatory
  15. - okm:name (string)
  16. - okm:language (string)
  17. - okm:keywords (string)
  18. - okm:notification (string) multiple
  19. + okm:content (okm:resource) primary mandatory
  20. [okm:folder] > nt:folder, mix:referenceable, mix:lockable, mix:accessControlled
  21. - okm:author (string) mandatory
  22. - okm:name (string)
  23. - okm:notification (string) multiple
  24. [okm:config] > nt:hierarchyNode, mix:accessControlled
  25. - okm:lockTokens (string) = '' multiple autocreated
  26. [okm:query] > nt:hierarchyNode, mix:accessControlled
  27. + * (nt:unstructured)

接着给出说明:
  文件定义了四个名域,其中三个为JCP保留的名域,一个是自己的,名字为okm
  文件定义了六个节点类型,其中一个增加了一个mix,其余的为自己的类型
  1. mix:accessControlled节点类型,该节点类型名字是mix:accessControlled,具有四个多值属性,属性类型都是字符串,而且都是强制性的,名字分别为okm:authUsersRead, okm:authUsersWrite,等
  2. okm:resource节点类型,继承了nt:resource类型和mix:versionable类型,同时具有两个属性, okm:size和okm:author,而且都是强制行的,类型分别是long和string, 这样OpenKM中的资源就是可以版本化的
  3. okm:document 节点类型.继承了 nt:hierachyNode, mix:referenceable, mix:lockable, mix:accessControlled节点类型,这样文档就可以被引用,锁定,层次化,和访问控制化. 这里okm:document节点类型依赖刚才定义的节点类型mix:accessControlled. okm:document定义了5个属性和一个子节点okm:content. 注意这个子节点的类型是刚才定义的okm:resource类型,并且是强制性的,和主要的. 注意这里有一个容易混淆的事情: okm:content指的是这个子节点的名字,而okm:resource指的是节点类型的名字,所以注意区分,有的okm:xxxx是指节点名字,而有的是指节点类型名字,这在JCR中非常容易搞混.

你可能感兴趣的:(open)