JSR 170:Java内容仓库(Java Content Repository,JCR)API

JCR试图定义一组内容管理的标准接口,以便标准化内容管理器模块。如果所有的内容管理器都以同样的API提供服务,那么各种内容管理器产品之间将具有可互换性。JCR规范分为两个level。level 1定义了一组基本的内容仓库操作,包括内容的读、写、删除、搜索、内容元素的序列化等等;level 2提供了高级的功能,例如事务管理、版本控制、内容观察、访问控制、内容锁定等。
JCR定义的内容仓库模型是一个树状结构,树上的元素(Item)分为两类:节点(node)和属性(property)。整棵树具有单根结构。从根开始,内容元素的定位采用UNIX文件系统风格,例如“/A/B/ccc”(根下面A节点的B子节点的ccc属性),相对定位符(“.”和“..”)也是可用的。每个属性有且仅有一个父节点,不能有子元素。每个节点可以有一个或多个父节点(根节点无父节点),也可以有任意多个子节点或属性。注意,节点可以有多个父节点,也就是说可以从不同的路径导航获得同一内容,这是网站常见的一个需求(来自不同栏目的两个链接指向同一篇文章)。
除了Node和Property之外,API中还有几个重要的对象。Repository代表整个内容仓库,Credentials代表一个用户身份,Ticket代表进入该内容仓库的门票。获得内容根节点的代码大致如下:
Repository repository = (Repository)java.rmi.Naming.lookup("MyRepo");
Credentials credentials = new SimpleCredentials("MyName", "MyPassword".toCharArray());
Ticket myTicket = repository.login(credentials, "MyWorkspace");
Node root = myTicket.getRootNode();
从root节点就可以遍历访问整课内容树。Ticket对象也支持通过绝对路径或者UUID直接获得某一内容元素(节点或属性)。
照我的理解,现在我们的内容管理器产品已经具备了兼容level 1的功能。但是这个标准API对于我们设计内容管理器有多大程度的帮助?这个问题要去问魔之眼。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Day Management AG, Switzerland 11-May-2005 Release note Product: Specification for Content Repository for Java(tm) Technology API 1.0 Version: 1.0 Type: Full Release ====================================================================== 0. Index ---------------------------------------------------------------------- 1. Introduction 2. Release Contents 3. Copyright Notice 1. Introduction ---------------------------------------------------------------------- This Package contains the Specification for the Content Repository for Java(tm) Technology API. For questions or comments feel free to use jsr-170-comments@jcp.org Further information about JSR 170 can be found at http://www.jcp.org/en/jsr/detail?id=170 The Reference Implementation (RI) and the Technology Compatibility Kit (TCK) and the Specification Changelog may be downloaded from http://www.day.com/content/en/product/jsr_170.html 2. Release Contents ---------------------------------------------------------------------- All paths listed are relative to the installation directory of the ZIP file. This package consists of the following components: /docs generated Javadoc /lib pre-built API .jar-file /license Applicable License /spec Specification documents /src API Source code 3. Copyright notice ---------------------------------------------------------------------- Copyright ? 1993-2005 Day Management AG, Switzerland. All rights reserved. DAY, the DAY logo, Communiqu? ContentBus and CRX Content Repository Extreme are registered trademarks and service marks, or are trademarks and service marks, of Day Management AG, in various countries around the world. All other product names and company logos mentioned in the information, documents or other items provided or available herein may be the trademarks of their respective owners.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值