- 浏览: 883795 次
- 性别:
- 来自: 大连
文章分类
- 全部博客 (319)
- Thinking / 反思 (27)
- 我读的技术类图书 (3)
- 我读的非技术图书 (3)
- Java & Groovy (55)
- Ruby/Rails (9)
- Python (10)
- C/C++ (14)
- C# & .net (9)
- 互联网相关技术 (6)
- Database (6)
- Unix/Linux (6)
- WindowsDev (21)
- 工具使用 / Tips (62)
- 编程技术杂谈/咨讯 (6)
- 软工 / 敏捷 / 模式 (6)
- 易筋经 / 各种内功 (3)
- 充电 / 他学科知识 (6)
- 外语学习 (16)
- 我和宝宝的甜蜜生活 (24)
- 八卦 (3)
- 健康 (0)
- 无类别 (0)
- mTogether (4)
- 一页纸 (3)
- SAP (7)
- baby (2)
- abap (2)
- temp (1)
- network (1)
- 生活 (1)
最新评论
-
daliang1215:
收藏一下,好东西。 xp 的快捷键用的非常爽,到win7缺没有 ...
Windows7: 右键任务栏上的一个窗口, 用快捷键c关闭它 -
Alice南京:
感谢
Java GC 监视方法与工具 -
wjason:
今天在excel 2010上面写了一些代码,果然lookup有 ...
Excel 公式: 根据一个单元格的用户输入值, 自动设置另一个单元格的值 -
wjason:
因式分解:http://zh.wikipedia.org/wi ...
教孩子学编程: 数学题1 -
bbls:
不错 找了好久了
VS2010: 在Solution Explorer中,自动关联当前正在编辑的文件
写在前面
如果使用Mantis来管理bug, 项目比较小, 项目比较少的情况下,项目的bug状况还是一目了然,
但对于我们公司来说, 现在运行中的mantis有上百个项目, 1W余件bug,
在这种情况下, mantis提供管理功能就稍显薄弱,
比如, Mantis提供的能帮助管理层把握全局的功能比较少, 对bug数据的分析功能也比较少.
为此我们希望能够针对mantis做一些自己的工具,
一来,希望能够对上面的功能做一个补充,
二来,也希望透过这个工具, 让所有人都能够, 更方便的了解到他们应该知道的,以及他们想知道的bug信息.
我打了一个比方, 这个工具更像是我们的一个朋友, 或者一个很贴心的秘书.
针对bug的各种各样的问题, 我们都可以把答案交给他/她来办~
这些问题包括: 日常的, 例行的, 统计起来枯燥繁琐的, 还有一些靠我们自己不太好办到的....
明确了目标, 接下来是调查工作
为了办到上面的事情, 首先面临的第一步就是如何从mantis中,把bug数据取出来.
我们的做法正如标题那样:
使用Java调用Mantis提供的webservice, 获得Mantis数据
在MantisBT Frequently Asked Questions 上面, 有下面这样的介绍.
See the MantisConnect project which provides a PHP webservice that can be used from any language that supports SOAP webservices. MantisConnect also includes client libraries for .NET, Java and Cocoa.
MantisConnect also includes sample applications that uses the provided client libraries to provide useful tools. This includes an Eclipse plug-in written in Java, a NAnt task to submit MantisBT issues written in .NET, and many others.
MantisConnect now comes as part of the standard MantisBT installation package and can be found under the ‘{$mantis_install_dir}/api/soap’ directory. To see what functionality is currently provided via MantisConnect, check the WSDL available here.
就是说,有一个项目叫做MantisConnect, 他可以在server端, 为我们提供webservice服务. 而且这个项目现在已经默认集成到了mantis的安装包中. 也就是这些webservices会随mantis安装自带. 另外这个项目还未我们提供了client端, 方便我们连接这些webservice借口, 包括java, .net, 还有cocoa的.
我们来到了MantisConnect 这个项目, 查看了他的许可 , 如下:
■Professional - This license allows distributing an application with MantisConnect client libraries as part of it. It also allows installation of MantisConnect web service on a single website.
■Standard - This license allows the use of MantisConnect client libraries and an installation of the web service on a single website. This license doesn't allow distributing MantisConnect outside the licensed company.
■Free for Open Source - This license allows free usage of MantisConnect client libraries and web service for Mantis instances that ONLY host open source or freeware applications.
看来在公司内部使用, 只要不发布他, 没有问题.
所以下面上来的就是demo
下载MantisConnect client的source包的时候, 里面有对应的单元测试文件.
这个demo及时我参照单元测试抽出来的.
import java.math.BigInteger; import java.net.URL; import org.mantisbt.connect.axis.AccountData; import org.mantisbt.connect.axis.IssueData; import org.mantisbt.connect.axis.IssueHeaderData; import org.mantisbt.connect.axis.MantisConnectLocator; import org.mantisbt.connect.axis.MantisConnectPortType; /** * see the following links for the document of APIs. * http://www.mantisforge.org/dev/phpxref/api/soap/index.html * http://www.mantisforge.org/dev/phpxref/nav.html?api/soap/mc_project_api.php.html * http://www.mantisforge.org/dev/phpxref/nav.html?api/soap/mc_issue_api.php.html */ public class GetDataFromMantisDemo { public static void main(String[] args) throws Exception { String user = "administrator"; String pwd = "mypassword"; URL url = new URL("http://localhost/mantis/api/soap/mantisconnect.php"); MantisConnectLocator mcl = new MantisConnectLocator(); MantisConnectPortType portType = mcl.getMantisConnectPort(url); BigInteger project_id = new BigInteger("1030"); // demo 01 // get a bug by bug_id IssueData aIssueData = portType.mc_issue_get(user, pwd, new BigInteger("13547")); System.out.println(aIssueData.getId()); System.out.println(aIssueData.getSummary()); // demo 02 // get the account of a project. AccountData[] users = portType.mc_project_get_users(user, pwd,project_id, new BigInteger("90")); for (AccountData ad : users) { System.out.println(ad.getName()); } // demo 03 // get the issue headers of a project. IssueHeaderData[] headers = portType.mc_project_get_issue_headers(user,pwd, project_id, BigInteger.valueOf(1), BigInteger.valueOf(50)); for (IssueHeaderData header : headers) { System.out.println(header.getId() + "\t" + header.getSummary()); } //demo 04 // get the issues of a project. IssueData[] issues = portType.mc_project_get_issues(user, pwd, project_id, BigInteger.valueOf(1), BigInteger.valueOf(10)); for (IssueData issueData : issues) { System.out.println(issueData.getId() + "\t"+ issueData.getStatus().getName() + "\t"+ issueData.getSummary()); } } }
最后上的是trouble shooting.
在调上面的程序的时候, 我的确遇到了很多trouble(都是些让人郁闷的问题), 下面说说怎么解决的.
首先要确定我们的用户名密码还有url写的没错.
关于url, 我下载的客户端中的build.properties.sample文件里是这样配置的:
http://localhost:8080/mantis-1.1.1/api/soap/mantisconnect.php
但是很多公司的端口可能不是8080,
使用的url名字也很可能不是mantis-1.1.1, 而是形如<mycompanyname><myprojectname>这样的名字.
接下来就要搞懂各个函数的参数的意义, 确保你给各个函数传递了正确的参数.
关于参数的意义, 比较遗憾的是: 下载的javadoc中不够详细.
不过还好, 我们可以求助下面的链接.
http://www.mantisforge.org/dev/phpxref/api/soap/index.html
http://www.mantisforge.org/dev/phpxref/nav.html?api/soap/mc_project_api.php.html
http://www.mantisforge.org/dev/phpxref/nav.html?api/soap/mc_issue_api.php.html
这些文档是webservices的server端php代码.
因为java client端在包装这些代码的时候使用了相同的方法名字,所以我们可以很容易确认到服务器端对应的php source.
比如下面这段:
No description
从上面的信息一看, mc_project_get_issues的参数意义就一目了然了.
参数的类型就交给编译器,
通过上面方法可以找到你想要的函数, 如果需要上面函数的示例, 参见对应函数的单元测试代码.
通常情况下, 故事到这里就差不多该结束了.
因为一般情况下通过上面的步骤, client端的代码应该就没有问题,
而server端的代码是随安装过程自带的, 而且理论上你也应该没有动过他, 所以他也应该没有问题.
但是我的情况没有那么幸运,
因为我们的mantis已经被前仆后继的定制过了.
(如果一个mantis达到了我前面提到的规模, 很多重量级人物必然都知道了他的存在, 然后大家就会提出很多关怀性质的改善意见, 然后自己定制mantis的过程就开始了.....)
其中便有两处改动影响到了mc_project_get_issues和mc_project_get_issue_headers这两个方法.
使其不能正常运行, 抛出了很深的异常(如果我把它贴上来, 我想你一定会因为太长而感到郁闷 ^_^).
因为我用java调用mc_project_get_users和mc_issue_get这些方法都没有问题.
所以我确定,
一定是server端的mc_project_get_issues和mc_project_get_issue_headers这两个函数对应的代码出了问题.
我的解决办法是参照服务器端调试PHP程序 这篇blog, 配置好debug环境,
然后找个入口, 直接debug服务器端对应的php函数, 这些php函数调通了.
webservices调用的异常也自然跟着修正了.
评论
当我把用于连接soap的账号的语言设置改成中文的时候,soap无法成功
改回英文,便又成功了.
继续把语言改成日语, 成功
再把语言改成bulgarian(据字典说这叫保加利亚语),依然成功
我们在定制mantis的时候,平时主要注重的是英语和日语,简体中文对应和确认都不全
其他语言从来没有对应过.
问题很明显, 出现在简体中文的语言文件上面,
把问题写在这里, 希望对做类似事情的人有所帮助.
http://www.mantisbt.org/bugs/api/soap/mantisconnect.php#
http://www.mantisbt.org/bugs/api/soap/mantisconnect.php?wsdl
发表评论
-
批量替换,一个文件夹中, 所有文件中的某个特定字符串(For Lync Update)
2015-10-10 10:31 1912因为Office升级, 需要对所有的脚本内容, 做如下字符 ... -
Snagit: "在截图中自动添加时间戳"功能的开启与关闭
2015-07-21 16:27 1576Snagit有这样一个功能 - "在截图中自动添 ... -
网易公开课 - 让我们教孩子编码吧
2014-01-05 15:44 1315看了这个网易公开课. http://v.163.com/m ... -
Alias for Command Parameter for Bash
2013-12-30 12:25 1400bash的alias(别名)不直接支持$1,$2,$3,这 ... -
grep tools on windows
2013-12-28 19:52 1323最开始一直使用这个工具. FileLocator Lit ... -
VIM: 编写自己的“高亮显示syntax文件"
2013-10-13 08:52 899The following link is very use ... -
AutoHotKey: 从资源管理器中,获取被选择的文件的路径(及文件夹)的API
2013-10-12 11:49 7063从下面的URL中,获得了这个Library. Ge ... -
Everything Command Line Option
2013-09-14 10:56 1244Run "everything --help&q ... -
Links
2013-07-27 21:03 1116Reference Card DZone refc ... -
Wireshark Filters
2013-06-23 16:18 1660Wireshark是一款非常好用的网络抓包工具: htt ... -
在linux的VMware虚拟机中, 无法访问VMware的Shared Folders
2013-06-11 21:41 2371在一个VMware虚拟机的Setting中可以设置Shar ... -
Excel条件格式: 根据某一列单元格的值, highlight整行
2013-06-11 10:43 13739[追记 about excel Conditional F ... -
VIM: 查看log文件时的一些技巧, 关于如何展示搜索结果
2013-05-25 08:21 2203最近的学习工作中, 查看log文件需求特别多, 于是我对 ... -
Vim: Windows7中, 通过右键菜单加快捷键v, 快速启动vim
2013-05-22 14:39 3569在xp时代, 安装了vim之 ... -
Windows7: 右键任务栏上的一个窗口, 用快捷键c关闭它
2013-05-10 21:34 3374右键任务栏上的一个窗口, 在弹出菜单之后, 按下字母c, ... -
Windows 7: 单显示器, 窗口布局快捷键
2013-05-09 17:24 1656使用但显示器, 尤其是使用笔记本的用户, 应该有过这样的感 ... -
下述PDF文件无法保存解决办法: There was a problem reading this document(135)
2013-04-15 08:38 4774手头有一个PDF文档, 是加密的. 所以无法对他进行编辑和 ... -
Windows命令行中, 类似于linux的history命令
2012-10-31 09:43 7876在写这篇博客的时候: ImageMagick: 图像处理工具包 ... -
VS2010: 在Solution Explorer中,自动关联当前正在编辑的文件
2012-09-01 14:03 2787在Eclipse中有这样的功能:Link with edit ... -
AutoHotkey:使用快捷键,在双显示器间,移动最大化的窗口
2012-07-11 11:09 4392无意间看了我以前写的一篇博客:VC++: 在双显示器间,移动最 ...
相关推荐
Mantis_使用说明 Mantis_使用说明 Mantis_使用说明 Mantis_使用说明 Mantis_使用说明 Mantis_使用说明
BUG_Mantis使用手册BUG_Mantis使用手册BUG_Mantis使用手册BUG_Mantis使用手册BUG_Mantis使用手册BUG_Mantis使用手册BUG_Mantis使用手册
mantis 简单使用说明 pdf 文档
mantis简介及使用方法总结
Mantis详细使用教程
testlink的使用过程及mantis使用过程
资源名称: 需要大于10个字符 *关键字(Tag): 多个关键字请用空格分隔,最多填写5个。点击右侧Tag快速添加
mantis基本使用教程,非管理员设置教程。
使用开源软件 Mantis 实施缺陷跟踪的成功实践
mantis安装经验
Mantis经典教程 详细讲述了Mantis的配置,使用
mantisbt-1.2.17和EasyPHP-12.1_with_PHP-5.4.6-setup.exe安装心得体会,以及一些修改配置文件的方法和注意事项。对安装配置mantis缺陷管理体统,有一定的参考价值。希望可以能帮助到你。
mantis安装配置文档_mantis操作使用相关文档
资源,直接解压就可以使用,需要配置环境。
借助XAMPP安装Mantis(Mantis for Windows)_最简单适用 1.安装之前,下载下列软件 XAMPP --->Apache,php,MySQL架设包 1.7.1 Mantis-1.1.6 2.安装xampp 执行刚下载的执行档即可 3.建立MySQL的使用者账号 利用xampp...
mantis问题处理完成度:1未处理,2已修正,3重新打开,4无法重现,5无法修复,6重复问题,7不必改8稍后处理9不做修改
mantis中文使用指南,具体使用过程都可以了解
Mantis缺陷管理系统,针对不同角色讲解有哪些操作项以及具体的使用步骤