不能使用CIS API中的setReleaseDate方法为UCM目录登记设置版本发布日期的秒数。_Tomcat, WebLogic及J2EE讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Tomcat, WebLogic及J2EE讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 4364 | 回复: 0   主题: 不能使用CIS API中的setReleaseDate方法为UCM目录登记设置版本发布日期的秒数。        下一篇 
lxk
注册用户
等级:上尉
经验:547
发帖:109
精华:0
注册:2011-8-18
状态:离线
发送短消息息给lxk 加好友    发送短消息息给lxk 发消息
发表于: IP:您无权察看 2011-11-28 9:05:18 | [全部帖] [楼主帖] 楼主

Cannot Set Seconds on ReleaseDate for UCM Content CheckIn from CIS API Using setReleaseDate Method
Applies to:
Oracle Universal Content Management - Version: 10.1.3.5.0 and later [Release: 10gR3 and later ]
Information in this document applies to any platform.
Symptoms
Using CIS API to checkin a document to content server, the seconds are always set to 00 for a custom date field or ReleaseDate field using the following code:
content.setProperty("xModifyTime", new SimpleDateFormat("yyyy-M-dd HH:mm:ss").parse("2012-7-21 14:21:23"));
content.setReleaseDate(new Date());
content.setProperty("xModifyTime", new SimpleDateFormat("yyyy-M-dd HH:mm:ss").parse("2012-7-21 14:21:23"));
content.setReleaseDate(new Date());
Cause
Passing a java.util.Date object to the Content Server Binder does not produce the granularity to the second; only minutes.
The parse method of the SimpleDateFormat Class also produces java.util.Date object.
On the content server interface the Release Date is taken in the form of a string.
Using the setProperty method, if the date is passed as a String, it passes the exact time in the same form to the binder and so content server can handle the timestamp conversion in the usual manner.
The only thing to consider here is that time passed from CIS API will always be in GMT and hence some custom code may be required to handle that time difference.
Solution
1. Change the code to use setProperty method instead of setReleaseDate method of the ISCSContent class.
eg.
content.setProperty("dInDate","12/31/2010 9:32:42 PM");
2. Recompile and retest the CIS program.
NOTE: Custom code may be required to handle the time difference since time from CIS program is always in GMT. Assisting with custom coding is outsite the realm of Oracle Support.
Content Server, in general, doesn't care about seconds unless it's something that requires it (i.e. tracing, indexing, etc). The document's release and indexing happens during a subject manager thread, which will only pick up on the change when it runs. Add to that any indexing and conversion of the document, and it would be quite common for the document to actually get released well outside the accuracy of one second. That's why even the check-in page has the times set to the precision of a single minute.


不能使用CIS API中的setReleaseDate方法为UCM目录登记设置版本发布日期的秒数。

应用于:

Oracle统一目录管理-版本:10.1.3.5及以后版本[发行:10gR3及以后版本]

这个文件的信息使用于任何平台。

同样的

使用CIS API登记一个文件到目录服务器,时间的秒数总是显示为00或者客户端时间或者是使用下列代码设置的发布时间。

产生原因:

向目录服务器的绑定者传递一个java.util.Date 参数不能产生以秒为计数的时间,最小只能到分钟。

解析方法SimpleDateFormat类也可以产生java.util.Date类型。

在目录服务器接口中,发布日期接收一个字符串形式的参数。

如果日期以字符串的形式传递,使用setProperty方法,它可以用同样的形式准确的传递时间,目录服务器可以正常的处理时间戳的更改。

惟一需要考虑的是从CIS API 传递的时间也会在GMT中,所以需要写一些客户端的代码来处理时间的不同。

解决方法

1.    改变代码,用setProperty方法代替ISCSContent类中的setReleaseDate方法。例如:

content.setProperty("dInDate","12/31/2010 9:32:42 PM");


2.    重新编译和测试CIS程序

注意:CIS程序中处理时间不一致的客户端代码也会出现在GMT中。至于客户端代码的编写并不在Oracle支持的范畴。一般地,目录服务器并不关心秒数除非有特殊的要求(例如:记录,索引等)。文件的发布和标定指数发生在一个管理线程中,这个线程只捕捉当它运行时的更改的信息。增加标定指数和更改文件在文件发布后是常有的事,但都会耗费超过一秒的时间,这也是在登记界面只精确到分钟的原因。




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论