Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 96463 invoked from network); 10 Jan 2006 17:52:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Jan 2006 17:52:41 -0000 Received: (qmail 5145 invoked by uid 500); 10 Jan 2006 17:52:40 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 5072 invoked by uid 500); 10 Jan 2006 17:52:39 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 5015 invoked by uid 99); 10 Jan 2006 17:52:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jan 2006 09:52:38 -0800 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 10 Jan 2006 09:52:37 -0800 Received: (qmail 96289 invoked by uid 65534); 10 Jan 2006 17:52:16 -0000 Message-ID: <20060110175216.96288.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r367705 - in /maven/maven-1/plugins/trunk/jira: plugin.jelly plugin.properties src/main/org/apache/maven/jira/JiraDownloader.java src/plugin-resources/jira.jsl xdocs/changes.xml xdocs/properties.xml Date: Tue, 10 Jan 2006 17:52:15 -0000 To: commits@maven.apache.org From: ltheussl@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ltheussl Date: Tue Jan 10 09:52:11 2006 New Revision: 367705 URL: http://svn.apache.org/viewcvs?rev=367705&view=rev Log: Add a jira-roadmap report. Modified: maven/maven-1/plugins/trunk/jira/plugin.jelly maven/maven-1/plugins/trunk/jira/plugin.properties maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java maven/maven-1/plugins/trunk/jira/src/plugin-resources/jira.jsl maven/maven-1/plugins/trunk/jira/xdocs/changes.xml maven/maven-1/plugins/trunk/jira/xdocs/properties.xml Modified: maven/maven-1/plugins/trunk/jira/plugin.jelly URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/plugin.jelly?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/plugin.jelly (original) +++ maven/maven-1/plugins/trunk/jira/plugin.jelly Tue Jan 10 09:52:11 2006 @@ -32,10 +32,19 @@ pluginName="maven-jira-plugin" link="jira" description="Report all issues defined in Jira."/> + + + + @@ -50,7 +59,7 @@ name="maven-jira-plugin:report" description="Generate report with all entries defined in Jira"> - + + + + + + - + + + + + + + + + + + + + + + + + + + Error: unable to parse jira results due to an error: ${parseresult.message}. Jira roadmap report will not be generated + + + + + + + + + + + + + Modified: maven/maven-1/plugins/trunk/jira/plugin.properties URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/plugin.properties?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/plugin.properties (original) +++ maven/maven-1/plugins/trunk/jira/plugin.properties Tue Jan 10 09:52:11 2006 @@ -27,3 +27,4 @@ maven.jira.resolution=Unresolved maven.jira.priority= maven.jira.component= +maven.jira.roadmap=true \ No newline at end of file Modified: maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java (original) +++ maven/maven-1/plugins/trunk/jira/src/main/org/apache/maven/jira/JiraDownloader.java Tue Jan 10 09:52:11 2006 @@ -90,6 +90,10 @@ /** The maven project. */ private Project project; + /** Include a Jira roadmap. */ + private boolean roadmap; + + /** Mapping containing all JIRA status values. */ private static Map statusMap = new HashMap(); @@ -212,7 +216,7 @@ if (pos >= 0) { // url id = url.substring(url.lastIndexOf("=") + 1); - } + } String jiraUrl = url.substring(0, url.lastIndexOf("/")); if (jiraUrl.endsWith("secure") || jiraUrl.endsWith("browse")) { @@ -220,26 +224,37 @@ } log.info("Jira lives at: " + jiraUrl); doAuthentication(cl, jiraUrl); - - if (id == null) { - GetMethod gm = new GetMethod(url); - log.info("Jira URL " + url + " doesn't include a pid, trying to get it"); - try { + String projectPage = ""; + + if ( id == null || roadmap) + { + GetMethod gm = new GetMethod( url + "?report=com.atlassian.jira.plugin.system.project:roadmap-panel" ); + try + { cl.executeMethod(gm); log.info("Succesfully reached JIRA."); } - catch (Exception e) { - if (log.isDebugEnabled()) { + catch (Exception e) + { + if (log.isDebugEnabled()) + { log.error("Unable to reach JIRA project page:", e); } - else { + else + { log.error("Unable to reach JIRA project page. Cause is: " + e.getLocalizedMessage()); } } - String projectPage = gm.getResponseBodyAsString(); + projectPage = gm.getResponseBodyAsString(); + } + + if ( id == null ) + { + log.info("Jira URL " + url + " doesn't include a pid, trying to get it"); int pidIndex = projectPage.indexOf("pid="); // @todo, a safer way to get the PID - if (pidIndex == -1) { + if (pidIndex == -1) + { // fail log.error("Unable to get JIRA pid using url " + project.getIssueTrackingUrl()); return; @@ -249,7 +264,6 @@ Number pidNumber = nf.parse(projectPage, new ParsePosition(pidIndex + 4)); id = Integer.toString(pidNumber.intValue()); } - // create the URL for getting the proper iussues from JIRA String fullURL = jiraUrl + "/secure/IssueNavigator.jspa?view=rss&pid=" + id; @@ -257,7 +271,33 @@ fullURL += "&tempMax=" + nbEntriesMax + "&reset=true&decorator=none"; // execute the GET - download(cl, fullURL); + download(cl, fullURL, output); + + if ( roadmap ) + { + int fixforIndex = projectPage.indexOf("fixfor="); // @todo, a safer way to get the PID + + if (fixforIndex == -1) + { + // fail + log.error("Unable to get JIRA roadmap using url " + project.getIssueTrackingUrl()); + return; + } + + NumberFormat nf = NumberFormat.getInstance(); + Number fixforNumber = nf.parse(projectPage, new ParsePosition(fixforIndex + 7)); + String fixfor = Integer.toString(fixforNumber.intValue()); + setFilter("&&fixfor=" + fixfor + "&sorter/field=status&sorter/order=ASC"); + fullURL = jiraUrl + "/secure/IssueNavigator.jspa?view=rss&pid=" + id; + fullURL += createFilter(); + fullURL += "&tempMax=" + nbEntriesMax + "&reset=true&decorator=none"; + String outFile = output.getAbsolutePath(); + int endIndex = outFile.lastIndexOf( '/' ); + outFile = outFile.substring( 0, endIndex ) + "/jira-roadmap.xml"; + // execute the GET + download(cl, fullURL, new File( outFile ) ); + } + } catch (Exception e) { log.error("Error accessing " + project.getIssueTrackingUrl(), e); } @@ -349,7 +389,7 @@ * the JiraUrl * @return */ - private void download(final HttpClient cl, final String link) { + private void download(final HttpClient cl, final String link, final File outFile) { try { GetMethod gm = new GetMethod(link); log.info("Downloading " + link); @@ -357,7 +397,7 @@ cl.executeMethod(gm); final String strGetResponseBody = gm.getResponseBodyAsString(); // write the reponse to file - PrintWriter pw = new PrintWriter(new FileWriter(output)); + PrintWriter pw = new PrintWriter(new FileWriter(outFile)); pw.print(strGetResponseBody); pw.close(); StatusLine sl = gm.getStatusLine(); @@ -374,7 +414,7 @@ } else { String newLink = locationHeader.getValue(); log.debug("Following redirect to " + newLink); - download(cl, newLink); + download(cl, newLink, outFile); } } @@ -514,6 +554,14 @@ */ public void setComponent(final String theseComponents) { this.component = theseComponents; + } + + /** + * Sets the roadmap property. + * @param thisRoadmap The roadmap. + */ + public void setRoadmap(final boolean thisRoadmap) { + this.roadmap = thisRoadmap; } } Modified: maven/maven-1/plugins/trunk/jira/src/plugin-resources/jira.jsl URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/src/plugin-resources/jira.jsl?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/src/plugin-resources/jira.jsl (original) +++ maven/maven-1/plugins/trunk/jira/src/plugin-resources/jira.jsl Tue Jan 10 09:52:11 2006 @@ -32,10 +32,17 @@ - Jira Report + ${title} -
+
+

+ ${description} + + For the latest list, please check the Jira + roadmap. + +

Modified: maven/maven-1/plugins/trunk/jira/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/xdocs/changes.xml?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/xdocs/changes.xml (original) +++ maven/maven-1/plugins/trunk/jira/xdocs/changes.xml Tue Jan 10 09:52:11 2006 @@ -24,6 +24,7 @@ + Add a jira-roadmap report. Layout changes: mimic default JIRA appearance, also show votes. Icons are corrupted (images are filtered during the copy). Modified: maven/maven-1/plugins/trunk/jira/xdocs/properties.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/jira/xdocs/properties.xml?rev=367705&r1=367704&r2=367705&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/jira/xdocs/properties.xml (original) +++ maven/maven-1/plugins/trunk/jira/xdocs/properties.xml Tue Jan 10 09:52:11 2006 @@ -164,6 +164,19 @@ + + + + + +
maven.jira.roadmapYes +

+ If set to true, a report on issues in the Jira + roadmap is generated. This includes issues + that are fixed in the current development version and issues + that are scheduled to be fixed in the next release. +

+

true