%META:TOPICINFO{author="WikiAdmin" date="1223887925" format="1.1" reprev="1.2" version="1.2"}%
%META:TOPICPARENT{name="TWikiPlugins"}%
---++ %TOPIC%

This is a *TESTLINK QUERY* which is used to connect to Testlink tool requirement/testcase database.

http://testlink.sourceforge.net/docs/testLink.php

---
 <font color="red" size="+1">THIS VERSION OF PLUGIN WORKS WITH TESTLINK 1.7.4</font> 
---

---+++ Syntax Rules
 <blockquote style="background-color: #f5f5f5">
   * =%<nop>TLQ{data="on" show="TC" id="1"}%=
   * =%<nop>TLQ{data="on" show="TC" title="SomeReqTitle"}%=
   * =%<nop>TLQ{data="on" show="REQ" id="1"}%=
   * =%<nop>TLQ{data="on" show="REQ" title="SomeTestcaseTitle"}%=
</blockquote>

---++++ Allowed attributes
 Attributes are named by some columns in 'requirements' and 'nodes_hierarchy' tables in DB. It means you can use attributes "id" and "title". I.e. if you want to search requirements that are connected to a testcase with id "tc1", use "REQ" in attribute show and "tc1" in attribute id.

There are these 'special' attributes:
   * *data* - if set to "on" you get directly data from database
   * *format* - you can specify the output
   * *show* - you can decide whether to see requirements (if set to "REQ") or testcases (if set to "TC")

---++++ Syntax and variables in 'format' attribute
 If plugin is used to search for Requirements simply all the columns of the 'requirements' table can be used. Those are the following: id, srs_id, req_doc_id, title, scope, status, type, node_order, author_id, creation_ts, modifier_id and modification_ts.

*an use the same naming conventions as for attributes and put before it the character '$'. If you are listing test cases, also attribute "summary" can be used.
<blockquote style="background-color: #f5f5f5"> Examples:

   * format="| $id | $title | $summary |"
| 1 | testcase1 | text about testcase1 |
| 2 | testcase2 | text about testcase2 |
   * format="Testacase $title ($id): $summary"
Testcase 1 (testcase1): text about testcase1<br /> Testcase 2 (testcase2): text about testcase2<br /> </blockquote>

---+++ Examples

<literal>%TLQ{data="on" show="TC" title="ReqIdExample"}% %TLQ{data=&quot;on&quot;&nbsp;show=&quot;TC&quot;&nbsp;id=&quot;1&quot;}%

<pre>%TLQ{&quot;1&quot;}%</pre></literal>

---++ Settings adapted from normal Bugzilla query settings...

   * 
      * Set URL = https://nestdemo/ProjectTESTLINK
      * Set FORMAT_REQ = | $id | $title |
      * Set FORMAT_TC = | $id | $project | $testplan | $title | $summary |
      * Set SHORTDESCRIPTION = This plugin is useful to display links or data results from Testlink.
      * Set URL_REQ = /lib/req/reqSpecView.php
      * Set URL_TC = /lib/testcases/archiveData.php?edit=testcase
      * Set TESTLINK_DB_HOST = localhost
      * Set TESTLINK_DB_PORT = 3306
      * Set TESTLINK_DB_NAME = ProjectTESTLINK
      * Set TESTLINK_USER = ReportUser
      * Set TESTLINK_PASSWD = ReportUser
      * Set DEBUG = 0

---+++ Plugin Installation Instructions

Copy files according version

Files
   * *lib/TWiki/Plugins/TestlinkQueryPlugin.pm*
   * *data/TWiki/TestlinkQueryPlugin.txt*

---+++ Plugin Info
| Conversion: | |
|  Plugin Author: | Jan.Lapinkataja |
|  Plugin Version: | 1.0 |
|  Change History: | 30 Oct 2007: Testlink query ready |
|  Change History: | Original code base Bugzilla Query Plugin by Richard Bar |
|  CPAN Dependencies: | DBI |
|  Other Dependencies: | none |
|  Perl Version: | 5.0 |
|  Plugin Home: | |
|  Feedback: | |

__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins

%META:TOPICMOVED{by="WikiAdmin" date="1180919243" from="TWiki.RenamedBugzillaQueryPlugin" to="TWiki.BugzillaQueryPlugin"}%
