欢迎您来到 数字平台。 您尚未登录。[登录] [注册新用户]
当前位置: 论坛首页 / 栏目 文档与手册 / 文章 68

点击:1339

[回复顶层(需要先登录)] [表状] [详细]
[回复(需要先登录)] [引用(需要先登录)]普通文章跟帖
文章id: 68
日志文件的格式(不断校订补充中...)

作者: xietao


日志文件的格式(不断校订补充中...)

以下是目前dp2Library服务器日志文件中日志XML记录的格式汇总解释。

可能不全,需要我们这一段集中精力检测和补充完整。

对于每个具体的日志记录格式,我们都要采用实证的方法来进行观察研究:列出前端软件的哪些操作能导致创建这样的日志记录,具体使用了格式中的哪些结构和元素类型。可能囿于前端软件和具体环境因素,某些设计好的日志记录结构无法或者很难用实际的例子来证实,那么我们可以采用检查软件源代码的方法,来确认所关注的结构是存在的并运作良好。

这里也涉及到一个话题,就是我们所开发出来的软件,是不是需要具备一些设施,不是为了直接满足用户的具体功能需求,而是仅仅为了满足测试和验证的需要。这些辅助设施会方便我们的工作。如果需要,我将增添这些设施。

 

===
borrow 借阅(续借)

API: Borrow()

<root>
  <operation>borrow</operation> 操作类型
  <action>...</action> 具体动作 有borrow renew两种。如果<action>元素缺省,则表示borrow
  <readerBarcode>R0000002</readerBarcode> 读者证条码号
  <itemBarcode>0000001</itemBarcode>  册条码号
  <borrowDate>Fri, 08 Dec 2006 04:17:31 GMT</borrowDate> 借阅日期
  <borrowPeriod>30day</borrowPeriod> 借阅期限
  <no>0</no> 续借次数。0为首次普通借阅,1开始为续借
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:31 GMT</operTime> 操作时间
  <confirmItemRecPath>...</confirmItemRecPath> 辅助判断用的册记录路径
 
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
  <itemRecord recPath='...'>...</itemRecord> 最新册记录
</root>

===
return 还回

API: Return()

<root>
  <operation>return</operation> 操作类型
  <action>...</action> 具体动作 有return lost两种
  <itemBarcode>0000001</itemBarcode> 册条码号
  <readerBarcode>R0000002</readerBarcode> 读者证条码号
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:45 GMT</operTime> 操作时间
  <overdues>...</overdues> 超期或丢失赔款信息 通常内容为一个字符串,为一个或多个<overdue>元素XML文本片断
 
  <confirmItemRecPath>...</confirmItemRecPath> 辅助判断用的册记录路径
 
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
  <itemRecord recPath='...'>...</itemRecord> 最新册记录
  <lostComment>...</lostComment> 关于丢失情况的附注(追加写入册记录<comment>的信息)
</root>

===
changeReaderPassword 修改读者密码

API: ChangeReaderPassword()

<root>
  <operation>changeReaderPassword</operation>
  <readerBarcode>...</readerBarcode> 读者证条码号
  <newPassword>5npAUJ67/y3aOvdC0r+Dj7SeXGE=</newPassword>
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 09:01:38 GMT</operTime>
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
 
</root>

注:如果用工作人员身份调用ChangeReaderPassword() API,则并不检查原密码是否匹配。

===
setReaderInfo 读者信息管理

API: SetReaderInfo()

<root>
 <operation>setReaderInfo</operation> 操作类型
 <action>...</action> 具体动作。有new change delete 3种
 <record recPath='...'>...</record> 新记录
    <oldRecord recPath='...'>...</oldRecord> 被覆盖或者删除的记录 动作为change和delete时具备此元素
 <operator>test</operator> 操作者
 <operTime>Fri, 08 Dec 2006 09:01:38 GMT</operTime> 操作时间
</root>

注: new 的时候只有<record>元素,delete的时候只有<oldRecord>元素,change的时候两者都有

===
reservation 预约

API: Reservation()

<root>
  <operation>reservation</operation> 操作类型
  <action>new</action> 具体动作。有new delete merge split
  <readerBarcode>R0000001</readerBarcode> 读者证条码号
  <itemBarcodeList>0000003</itemBarcodeList> 册条码号列表。用逗号分割
  <operator>R0000001</operator> 操作者 如果<operator>和<readerBarcode>内容一致,表示为读者直接自行预约。
  <operTime>Tue, 12 Dec 2006 09:20:12 GMT</operTime> 操作时间
</root>

===

amerce 交费

API: Amerce()

<root>
  <operation>amerce</operation> 操作类型
  <action>amerce</action> 具体动作。有amerce undo modifyprice expire
  <readerBarcode>...</readerBarcode> 读者证条码号
  <!-- <idList>...<idList> ID列表,逗号间隔 已废止 -->
  <amerceItems>
 <amerceItem id="..." newPrice="..." newComment="..." /> newComment中内容追加或替换原来的注释内容。到底是追加还是覆盖,取决于第一个字符是否为'>'还是'<',前者为追加(这时第一个字符不被当作内容)。如果第一个字符不是这两者之一,则默认为追加
 ...
  </amerceItems>
  <amerceRecord recPath='...'><root><itemBarcode>0000001</itemBarcode><readerBarcode>R0000002</readerBarcode><state>amerced</state><id>632958375041543888-1</id><over>31day</over><borrowDate>Sat, 07 Oct 2006 09:04:28 GMT</borrowDate><borrowPeriod>30day</borrowPeriod><returnDate>Thu, 07 Dec 2006 09:04:27 GMT</returnDate><returnOperator>test</returnOperator></root></amerceRecord> 在罚款库中创建的新记录。注意<amerceRecord>元素可以重复。<amerceRecord>元素内容里面的<itemBarcode><readerBarcode><id>等具备了足够的信息。
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 10:09:36 GMT</operTime> 操作时间
 
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
</root>

<root>
  <operation>amerce</operation>
  <action>undo</action>
  <readerBarcode>...</readerBarcode> 读者证条码号
  <!-- <idList>...<idList> ID列表,逗号间隔 已废止 -->
  <amerceItems>
 <amerceItem id="..." newPrice="..."/>
 ...
  </amerceItems>
  <amerceRecord recPath='...'><root><itemBarcode>0000001</itemBarcode><readerBarcode>R0000002</readerBarcode><state>amerced</state><id>632958375041543888-1</id><over>31day</over><borrowDate>Sat, 07 Oct 2006 09:04:28 GMT</borrowDate><borrowPeriod>30day</borrowPeriod><returnDate>Thu, 07 Dec 2006 09:04:27 GMT</returnDate><returnOperator>test</returnOperator></root></amerceRecord> Undo所去掉的罚款库记录
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
 
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录

</root>

<root>
  <operation>amerce</operation>
  <action>modifyprice</action>
  <readerBarcode>...</readerBarcode> 读者证条码号
  <amerceItems>
 <amerceItem id="..." newPrice="..." newComment="..."/> newComment中内容追加或替换原来的注释内容。到底是追加还是覆盖,取决于第一个字符是否为'>'还是'<',前者为追加(这时第一个字符不被当作内容)。如果第一个字符不是这两者之一,则默认为追加
 ...
  </amerceItems>
  <!-- modifyprice操作时不产生<amerceRecord>元素 -->
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
 
  <oldReaderRecord recPath='...'>...</oldReaderRecord> 操作前旧的读者记录。<oldReaderRecord>元素是modifyprice操作时特有的元素
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录

</root>

2007/12/18 new add
<root>
  <operation>amerce</operation> 操作类型
  <action>expire</action> 以停代金到期
  <readerBarcode>...</readerBarcode> 读者证条码号
  <expiredOverdues> 已经到期的若干<overdue>元素
 <overdue ... />
 ...
  </expiredOverdues>
  <operator>test</operator> 操作者 如果为#readersMonitor,表示为后台线程
  <operTime>Fri, 08 Dec 2006 10:09:36 GMT</operTime> 操作时间
 
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
</root>

2008/6/20 new add
<root>
  <operation>amerce</operation>
  <action>modifycomment</action>
  <readerBarcode>...</readerBarcode> 读者证条码号
  <amerceItems>
 <amerceItem id="..." newComment="..."/> newComment中内容追加或替换原来的注释内容。到底是追加还是覆盖,取决于第一个字符是否为'>'还是'<',前者为追加(这时第一个字符不被当作内容)。如果第一个字符不是这两者之一,则默认为追加
 ...
  </amerceItems>
  <!-- modifycomment操作时不产生<amerceRecord>元素 -->
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
 
  <oldReaderRecord recPath='...'>...</oldReaderRecord> 操作前旧的读者记录。<oldReaderRecord>元素是modifycomment操作时特有的元素
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
</root>


===
devolveReaderInfo 转移读者(借还、超期)信息

API: DevolveReaderInfo()

<root>
  <operation>devolveReaderInfo</operation>
  <sourceReaderBarcode>...</sourceReaderBarcode> 源读者证条码号
  <targetReaderBarcode>...</targetReaderBarcode> 目标读者证条码号
  <borrows>...</borrows> 移动过去的<borrows>内容,下级为<borrow>元素
  <overdues>...</overdues> 移动过去的<overdue>内容,下级为<overdue>元素
  <sourceReaderRecord recPath='...'>...</sourceReaderRecord> 最新源读者记录
  <targetReaderRecord recPath='...'>...</targetReaderRecord> 最新目标读者记录
  <changedEntityRecord recPath='...' attahchmentIndex='.'>...</changedEntityRecord> 所牵连到的发生了修改的实体记录。此元素的文本即是记录体,但注意为不透明的字符串(HtmlEncoding后的记录字符串)。如果存在attachmentIndex属性,则表明实体记录不在此元素文本中,而在日志记录的附件中
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
</root>

===
repairBorrowInfo 修复借阅信息

API: RepairBorrowInfo()

<root>
  <operation>repairBorrowInfo</operation>
  <action>...</action> 具体动作 有 repairreaderside repairitemside
  <readerBarcode>...</readerBarcode>
  <itemBarcode>...</itemBarcode>
  <confirmItemRecPath>...</confirmItemRecPath> 辅助判断用的册记录路径
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
</root>

===
setBiblioInfo 设置书目信息

API: SetBiblioInfo() 和 CopyBiblioInfo()

<root>
  <operation>setBiblioInfo</operation>
  <action>...</action> 具体动作 有 new/change/delete/onlydeletebiblio 和 onlycopybiblio/onlymovebiblio/copy/move
  <record recPath='中文图书/3'>...</record> 记录体 动作为new/change/ *move* / *copy* 时具有此元素(即delete时没有此元素)
  <oldRecord recPath='中文图书/3'>...</oldRecord> 被覆盖、删除或者移动的记录 动作为change/ *delete* / *move* / *copy* 时具备此元素
  <deletedEntityRecords> 被删除的实体记录(容器)。只有当<action>为delete时才有这个元素。
   <record recPath='中文图书实体/100'>...</record> 这个元素可以重复。注意元素内文本内容目前为空。
   ...
  </deletedEntityRecords>
  <copyEntityRecords> 被复制的实体记录(容器)。只有当<action>为*copy*时才有这个元素。
   <record recPath='中文图书实体/100' targetRecPath='中文图书实体/110'>...</record> 这个元素可以重复。注意元素内文本内容目前为空。recPath属性为源记录路径,targetRecPath为目标记录路径
   ...
  </copyEntityRecords>
  <moveEntityRecords> 被移动的实体记录(容器)。只有当<action>为*move*时才有这个元素。
   <record recPath='中文图书实体/100' targetRecPath='中文图书实体/110'>...</record> 这个元素可以重复。注意元素内文本内容目前为空。recPath属性为源记录路径,targetRecPath为目标记录路径
   ...
  </moveEntityRecords>
  <copyOrderRecords /> <moveOrderRecords />
  <copyIssueRecords /> <moveIssueRecords />
  <copyCommentRecords /> <moveCommentRecords />
  <operator>test</operator>
  <operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
</root>

逻辑恢复delete操作的时候,检索出全部下属的实体记录删除。
快照恢复的时候,可以根据operlogdom直接删除记录了path的那些实体记录

===
hire 创建租金记录

API: Hire()

<root>
  <operation>hire</operation> 操作类型
  <action>...</action> 具体动作 有hire hirelate两种
  <readerBarcode>R0000002</readerBarcode> 读者证条码号
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:45 GMT</operTime> 操作时间
  <overdues>...</overdues> 租金信息 通常内容为一个字符串,为一个或多个<overdue>元素XML文本片断
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
</root>

===
settlement 结算费用

API: Settlement()

<root>
  <operation>settlement</operation> 操作类型
  <action>...</action> 具体动作 有settlement undosettlement delete 3种
  <id>1234567-1</id> ID
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:45 GMT</operTime> 操作时间
 
  <oldAmerceRecord recPath='...'>...</oldAmerceRecord> 旧违约金记录
  <amerceRecord recPath='...'>...</amerceRecord> 新违约金记录 delete操作无此元素
</root>


===
passgate 入馆登记

API: PassGate()

<root>
  <operation>passgate</operation> 操作类型
  <readerBarcode>...</readerBarcode> 读者证条码号
  <gateName>...</gateName> 门名字
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:45 GMT</operTime> 操作时间
</root>

===
foregift 创建押金记录

API: Foregift()

<root>
  <operation>foregift</operation> 操作类型
  <action>...</action> 具体动作 目前有foregift return (注: return操作时,overdue元素里面的price属性,可以使用宏 %return_foregift_price% 表示当前剩余的押金额)
  <readerBarcode>R0000002</readerBarcode> 读者证条码号
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 04:17:45 GMT</operTime> 操作时间
  <overdues>...</overdues> 押金信息 通常内容为一个字符串,为一个或多个<overdue>元素XML文本片断
  <readerRecord recPath='...'>...</readerRecord> 最新读者记录
</root>

===
setEntity 设置册记录

API: SetEntities

<root>
  <operation>setEntity</operation> 操作类型
  <action>new</action> 具体动作。有new change delete move 4种
  <style>...</style> 风格。有force nocheckdup noeventlog 3种
  <record recPath='中文图书实体/3'><root><parent>2</parent><barcode>0000003</barcode><state>状态2</state><location>阅览室</location><price></price><bookType>教学参考</bookType><registerNo></registerNo><comment>test</comment><mergeComment></mergeComment><batchNo>111</batchNo><borrower></borrower><borrowDate></borrowDate><borrowPeriod></borrowPeriod></root></record> 记录体
  <oldRecord recPath='中文图书实体/3'>...</oldRecord> 被覆盖或者删除、移动的记录 动作为change、delete和move时具备此元素
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 08:41:46 GMT</operTime> 操作时间
</root>

注:1) 当<action>为delete时,没有<record>元素。为new时,没有<oldRecord>元素。
 2) <record>中的内容, 涉及到流通的<borrower><borrowDate><borrowPeriod>等, 在日志恢复阶段, 都应当无效, 这几个内容应当从当前位置库中记录获取, 和<record>中其他内容合并后, 再写入数据库
 3) 一次SetEntities()API调用, 可能创建多条日志记录。
 
===
setOrder 设置订购记录

API: SetOrders()

<root>
  <operation>setOrder</operation> 操作类型
  <action>new</action> 具体动作。有new change delete 3种
  <style>...</style> 风格。有force nocheckdup noeventlog 3种
  <record recPath='中文图书订购/3'><root>...</root></record> 记录体
  <oldRecord recPath='中文图书订购/3'>...</oldRecord> 被覆盖或者删除的记录 动作为change和delete时具备此元素
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 08:41:46 GMT</operTime> 操作时间
</root>

注:1) 当<action>为delete时,没有<record>元素。为new时,没有<oldRecord>元素。
 2) 一次SetOrders()API调用, 可能创建多条日志记录。
 
===
setIssue 设置期记录

API: SetIssues()

<root>
  <operation>setIssue</operation> 操作类型
  <action>new</action> 具体动作。有new change delete 3种
  <style>...</style> 风格。有force nocheckdup noeventlog 3种
  <record recPath='中文期刊期/3'><root>...</root></record> 记录体
  <oldRecord recPath='中文期刊期/3'>...</oldRecord> 被覆盖或者删除的记录 动作为change和delete时具备此元素
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 08:41:46 GMT</operTime> 操作时间
</root>

注:1) 当<action>为delete时,没有<record>元素。为new时,没有<oldRecord>元素。
 2) 一次SetIssues()API调用, 可能创建多条日志记录。

===
setComment 设置评注记录

API: SetComments()

<root>
  <operation>setComment</operation> 操作类型
  <action>new</action> 具体动作。有new change delete 3种
  <style>...</style> 风格。有force nocheckdup noeventlog 3种
  <record recPath='中文图书评注/3'>...</record> 记录体
  <oldRecord recPath='中文图书评注/3'>...</oldRecord> 被覆盖或者删除的记录 动作为change和delete时具备此元素
  <operator>test</operator> 操作者
  <operTime>Fri, 08 Dec 2006 08:41:46 GMT</operTime> 操作时间
</root>

注:1) 当<action>为delete时,没有<record>元素。为new时,没有<oldRecord>元素。
 2) 一次SetComments()API调用, 可能创建多条日志记录。

===
writeRes 写入对象资源

API: WriteRes()

<root>
<operation>writeRes</operation>
<requestResPath>...</requestResPath> 资源路径参数。也就是请求API是的strResPath参数值。可能在路径中的记录ID部分包含问号,表示要追加创建新的记录
<resPath>...</resPath> 资源路径。资源的确定路径。
<ranges>...</ranges> 字节范围
<totalLength>...</totalLength> 总长度
<metadata>...</metadata> 此元素的文本即是记录体,但注意为不透明的字符串(HtmlEncoding后的记录字符串)。
<style>...</style>
<operator>test</operator>
<operTime>Fri, 08 Dec 2006 10:12:20 GMT</operTime>
</root>

注:日志记录可能会有一个attachment(附件) 

 



发表时间: 2011-11-03 12:05:05
最后修改时间: 2011-11-03 19:15:46



  • 普通文章 二次开发系列之一:日志统计窗 xietao 2011-11-03 11:30:19[点击:17019]
  • 普通文章 编目工作量统计是一个很好的实际的例子 xietao 2011-11-03 11:40:53 (ID:66) [点击:1028]
  • 普通文章 _ xietao 2011-11-03 11:52:47 (ID:67) [点击:989]
  • 普通文章 日志文件的格式(不断校订补充中...) xietao 2011-11-03 12:05:05 (ID:68) [点击:1339]
  •  

    在线用户
    访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客 (我自己)   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客   访客访客
    当前栏目在线用户数 27, 总在线用户数 75