1 / 21

Domino 代码检测

Domino 代码检测. 目录. 第一部分:需求分析部分. 第二部分:软件设计部分. 第三部分:核心代码部分. 第四部分:心得体会. 题目需求. 用户需求 :. 代码规范检测工具. 具体功能需求 :. 检查代理注释量 ; 检查表单域名规范 ;. 域名规范检查实现很容易 , 因时间原因本次不作为实现需求. 2. 需求背后. 根据我对软件工程质量管理的理解 :. 可查阅统计 NSF 库的设计元素及代理的代码内容. User:. 质量管理人员 ; 开发经理 ; 进度 / 质量经理 (PSP). CodeReview. include.

junior
Télécharger la présentation

Domino 代码检测

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Domino代码检测

  2. 目录 第一部分:需求分析部分 第二部分:软件设计部分 第三部分:核心代码部分 第四部分:心得体会

  3. 题目需求 用户需求: 代码规范检测工具 具体功能需求: 检查代理注释量; 检查表单域名规范; 域名规范检查实现很容易,因时间原因本次不作为实现需求. 2

  4. 需求背后 根据我对软件工程质量管理的理解: 可查阅统计NSF库的设计元素及代理的代码内容 User: 质量管理人员;开发经理;进度/质量经理(PSP) CodeReview include 可对代理中代码行数统计,注释及所占比例统计…….. 质量管理 代码规范检测 include 可对代理中代码进行版本存储,比较,修改后,可录回到NSF库 代码基线管理版本比较and so on….. include 3

  5. 目录 第一部分:需求分析部分 第二部分:软件设计部分 第三部分:核心代码部分 第四部分:心得体会

  6. 选型 开发周期: 只有1人天 BS: 用户操作性:BS的好处每本教科书都有 DXL:nnotes.dll需封装一遍C API,在LS或JAVA 中调用,开发时间来不及. CS: 5

  7. 选型 选定BS,获取设计元素使用DXL, 风险点:DXL没接触,搞不定可以直接结束 6

  8. 设计:一半是海洋,一半是火焰 7

  9. 难点:DXL解析 出路在于:能获取到单个设计元素的XML. 8

  10. 目录 第一部分:需求分析部分 第二部分:软件设计部分 第三部分:核心代码部分 第四部分:心得体会

  11. 1、获取所有设计元素的Doc Database db = agentContext.getCurrentDatabase(); NoteCollection nc = db.createNoteCollection(false); nc.selectAllDesignElements(true); nc.buildCollection(); if (nc.getCount() > 0) { String id = nc.getFirstNoteID(); while (id.length() > 0) { String idZap = id; id = nc.getNextNoteID(id); Document doc = db.getDocumentByID(idZap); if(!doc.getItemValueString("$Flags").equals(null)) { } } } 10

  12. 2、判断doc文档代表何种设计元素 通过调试代码遍历doc中所有的item,查看到doc中的各项域值: $Flags:设计元素的类别。fL3为LS代理 fjJ3为java代理,””为表单 $Title:设计元素名称 根据类别显示设计元素: if(!doc.getItemValueString("$Flags").equals(null)) { if(doc.getItemValueString("$Flags").equalsIgnoreCase("fL3")) { pw.print("<tr><td>"+idZap+"</td><td>LS代理</a></td><td><a href='1?openform&docid="+idZap+"' target=_blank>"+doc.getItemValueString("$Title")+"</a></td></tr>"); } } 11

  13. 2、判断doc文档代表何种设计元素 根据类别显示设计元素:截图 12

  14. 3、获取单个设计元素DXL NoteCollection nc = db.createNoteCollection(false); nc.buildCollection(); String content=doc.getItemValueString("Query_String_Decoded"); String noteId=content.substring(content.indexOf("=")+1); lotus.domino.Document sdoc = db.getDocumentByID(noteId); nc.add(sdoc); DxlExporter exporter = session.createDxlExporter(); exporter.setOutputDOCTYPE(false); RichTextItem body= (RichTextItem)doc.getFirstItem("F_Body"); body.appendText(exporter.exportDxl(nc)); 将单个设计元素的DXL以XML格式获取到,并输出到页面 13

  15. 4、解析XML,得到代码实现CodeReview java.io.InputStream is=new java.io.ByteArrayInputStream(exporter.exportDxl(nc).getBytes("UTF-8")); org.w3c.dom.Document domDoc=dombuilder.parse(is); org.w3c.dom.NodeList itemLst=domDoc.getElementsByTagName("code"); for(int i=0;i<itemLst.getLength();i++) { if(itemLst.item(i).getAttributes().item(0).getNodeValue().equalsIgnoreCase("options")) { body= (RichTextItem)doc.getFirstItem("F_Options"); } 14

  16. 4、解析XML,得到代码实现CodeReview 15

  17. 5、代码及变量检测 16

  18. 6、代码基线管理,版本比较等 凌晨2点了zzzZZZZZ 核心功能已实现 大家发挥想象力扩展吧. 17

  19. 目录 第一部分:需求分析部分 第二部分:软件设计部分 第三部分:核心代码部分 第四部分:心得体会

  20. 心得体会 天上客户们的轰炸机! 地下自己人的地雷阵! 面对没接触过的DXL和英文帮助,大脑以220公里的时速夺命狂飙,8小时以内完成任务 很有成就感! 19

  21. Thanks! 20

More Related