Jredmine-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
July 2012
- 1 participants
- 62 discussions
Author: tchemit
Date: 2012-07-13 17:35:17 +0200 (Fri, 13 Jul 2012)
New Revision: 280
Url: http://nuiton.org/repositories/revision/jredmine/280
Log:
fixes #926: Use m-plugin-p 3 api
Modified:
trunk/jredmine-maven-plugin/pom.xml
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-13 15:35:06 UTC (rev 279)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 15:35:17 UTC (rev 280)
@@ -118,7 +118,13 @@
<artifactId>maven-artifact-manager</artifactId>
</dependency>
+ <!-- dependencies to mojo annotations -->
<dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
</dependency>
@@ -230,10 +236,14 @@
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
<executions>
<execution>
<goals>
<goal>helpmojo</goal>
+ <goal>descriptor</goal>
</goals>
</execution>
</executions>
1
0
r279 - in trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine: model plugin plugin/announcement plugin/report
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 17:35:06 +0200 (Fri, 13 Jul 2012)
New Revision: 279
Url: http://nuiton.org/repositories/revision/jredmine/279
Log:
fixes #926: Use m-plugin-p 3 api
Modified:
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/LoginMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java
trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -1,6 +1,6 @@
package org.nuiton.jredmine.model;
-import org.nuiton.jredmine.rest.RedmineRestClient;
+import org.nuiton.jredmine.v1_3_x.RedmineRequestFactoryImpl;
/**
* Un énumération pour connaitre l'ensemble des classes du modèle.
@@ -10,17 +10,17 @@
*/
public enum RedmineModelEnum {
- issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
- issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
- project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
- issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
- tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
- user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
- news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
- version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
- issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
- timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
- attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
+ issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST),
+ issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST),
+ project(Project.class, RedmineModelScope.none, RedmineRequestFactoryImpl.GET_PROJECT_LIST),
+ issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST),
+ tracker(Tracker.class, RedmineModelScope.project, RedmineRequestFactoryImpl.GET_TRACKER_LIST),
+ user(User.class, RedmineModelScope.project, RedmineRequestFactoryImpl.GET_USER_LIST),
+ news(News.class, RedmineModelScope.project, RedmineRequestFactoryImpl.GET_NEWS_LIST),
+ version(Version.class, RedmineModelScope.project, RedmineRequestFactoryImpl.GET_VERSION_LIST),
+ issue(Issue.class, RedmineModelScope.version, RedmineRequestFactoryImpl.GET_ISSUE_LIST),
+ timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRequestFactoryImpl.GET_ISSUE_TIME_ENTRY_LIST),
+ attachment(Attachment.class, RedmineModelScope.version, RedmineRequestFactoryImpl.GET_ATTACHMENTS_LIST);
private final Class<?> modelType;
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -27,6 +27,8 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.IssueManagement;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.nuiton.jredmine.RedmineService;
import org.nuiton.jredmine.RedmineServiceConfiguration;
@@ -46,8 +48,6 @@
* Abstract jredmine mojo.
*
* @author tchemit <chemit(a)codelutin.com>
- * @requiresOnline true
- * @requiresProject true
* @since 1.0.0
*/
public abstract class AbstractRedmineMojo extends AbstractPlugin implements RedmineServiceConfiguration {
@@ -57,11 +57,9 @@
/**
* Dependance du projet.
*
- * @parameter default-value="${project}"
- * @required
- * @readonly
* @since 1.0.0
*/
+ @Component
protected MavenProject project;
/**
@@ -69,9 +67,9 @@
* <p/>
* If no url is given, will use the issue management url.
*
- * @parameter expression="${redmine.url}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.url")
protected URL url;
/**
@@ -80,9 +78,9 @@
* <b>Note:</b> : this parameter is mandatory if you not use a {@code anonymous} service.
* configuration.
*
- * @parameter expression="${redmine.username}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.username")
protected String username;
/**
@@ -91,9 +89,9 @@
* <b>Note:</b> : this parameter is mandatory if you not use a {@code anonymous} service.
* configuration.
*
- * @parameter expression="${redmine.password}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.password")
protected String password;
/**
@@ -102,56 +100,54 @@
* <b>Note:</b> If nothing is filled here, we will use the system
* property {@code file.encoding}.
*
- * @parameter expression="${redmine.encoding}" default-value="${project.build.sourceEncoding}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.encoding", defaultValue = "${project.build.sourceEncoding}")
protected String encoding;
/**
* Redmine project name.
*
- * @parameter expression="${redmine.projectId}" default-value="${project.artifactId}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.projectId", defaultValue = "${project.artifactId}", required = true)
protected String projectId;
/**
* redmine version name.
*
- * @parameter expression="${redmine.versionId}" default-value="${project.version}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.versionId", defaultValue = "${project.version}")
protected String versionId;
/**
* Un flag pour activer le mode verbeux.
*
- * @parameter expression="${redmine.verbose}" default-value="${maven.verbose}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.verbose", defaultValue = "${maven.verbose}")
protected boolean verbose;
/**
* Un flag pour faire échouer le build si la configuration n'est pas ok.
*
- * @parameter expression="${redmine.safe}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.safe", defaultValue = "true")
protected boolean safe;
/**
- * @parameter expression="${session}"
- * @readonly
*/
+ @Component
protected MavenSession session;
/**
* Redmine service.
*
- * @component
* @since 1.0.0
*/
+ @Component
protected RedmineService service;
/** flag to load in init a required project using the {@link #projectId} name */
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -25,6 +25,8 @@
package org.nuiton.jredmine.plugin;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.nuiton.jredmine.RedmineServiceImplementor;
import org.nuiton.jredmine.model.I18nAble;
import org.nuiton.jredmine.model.IdAble;
@@ -44,9 +46,9 @@
* This goals requires no authentication to the server.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal display-data
* @since 1.0.0
*/
+@Mojo(name = "display-data", requiresOnline = true, requiresProject = true)
public class DisplayDataMojo extends AbstractRedmineMojo {
/**
@@ -62,19 +64,17 @@
* <p/>
* Note : you can specifiy several types separated by comma
*
- * @parameter expression="${types}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "types", required = true)
protected String types;
/**
* A flag to sort of not retrived data by id.
*
- * @parameter expression="${sortById}" default-value="true"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "sortById", defaultValue = "true", required = true)
protected boolean sortById;
/**
@@ -85,9 +85,9 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${anonymous}" default-value="true"
* @since 1.1.3
*/
+ @Parameter(property = "anonymous", defaultValue = "true")
protected boolean anonymous;
/** list of actions to perform */
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -25,6 +25,8 @@
package org.nuiton.jredmine.plugin;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.changes.model.Action;
import org.apache.maven.plugins.changes.model.Author;
import org.apache.maven.plugins.changes.model.Body;
@@ -59,9 +61,9 @@
* the annoncement mail at a release time.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal generate-changes
* @since 1.0.0
*/
+@Mojo(name = "generate-changes", requiresOnline = true, requiresProject = true)
public class GenerateChangesMojo extends AbstractRedmineMojo implements IssueCollectorConfiguration {
/** The actions understood by the changes.xml format. */
@@ -81,18 +83,17 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="true"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "true")
protected boolean anonymous;
/**
* The path of the <code>changes.xml</code> file that will be converted into an HTML report.
*
- * @parameter expression="${redmine.xmlPath}" default-value="${basedir}/src/changes/changes.xml"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.xmlPath", defaultValue = "${basedir}/src/changes/changes.xml", required = true)
protected File xmlPath;
/**
@@ -100,18 +101,17 @@
* <p/>
* <b>Note :</b> if not sets - will use the redmine version description (if exists).
*
- * @parameter expression="${releaseDescription}"
* @since 1.0.0
*/
+ @Parameter(property = "releaseDescription")
protected String releaseDescription;
/**
* The changes file title.
*
- * @parameter expression="${changesTitle}" default-value="${project.description}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "changesTitle", defaultValue = "${project.description}", required = true)
protected String changesTitle;
/**
@@ -119,9 +119,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersion;
/**
@@ -138,10 +138,9 @@
* fix:1, add:1
* </pre>
*
- * @parameter expression="${redmine.actionMapping}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.actionMapping", required = true)
protected String actionMapping;
/**
@@ -150,9 +149,9 @@
* <b>Note :</b> If a value is set to empty - that means to include all status.
* <p/>
*
- * @parameter expression="${redmine.statusIds}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.statusIds")
protected String statusIds;
/**
@@ -161,17 +160,17 @@
* <b>Note :</b> If a value is set to empty - that means to include all categories.
* <p/>
*
- * @parameter expression="${redmine.categoryIds}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.categoryIds")
protected String categoryIds;
/**
* A flag to skip the goal.
*
- * @parameter expression="${redmine.skipGenerateChanges}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipGenerateChanges", defaultValue = "false")
protected boolean skipGenerateChanges;
/**
@@ -181,9 +180,9 @@
* <p/>
* The default behaviour is to generate once to reduce calls to redmine
*
- * @parameter expression="${redmine.generateOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.generateOnce", defaultValue = "true")
protected boolean generateOnce;
/** le fichier deja genere */
@@ -265,7 +264,7 @@
getLog().warn("The goal is skip due to the skipGoal flag on");
return;
}
-
+
super.init();
if (!safe && !initOk) {
// we are in none safe mode but init is not ok...
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/LoginMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/LoginMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/LoginMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -26,6 +26,9 @@
import org.apache.maven.model.IssueManagement;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.nuiton.helper.plugin.ShareServerSecretPlugin;
@@ -41,23 +44,17 @@
* Obtain login for the redmine server to use.
*
* @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
- * @version $Revision$
- * <p/>
- * Mise a jour: $Date$ par :
- * $Author$
- * @goal login
* @since 1.2.1
*/
+@Mojo(name = "login", requiresOnline = true, requiresProject = true)
public class LoginMojo extends AbstractPlugin implements RedmineServiceConfiguration {
/**
* Dependance du projet.
*
- * @parameter default-value="${project}"
- * @required
- * @readonly
* @since 1.2.1
*/
+ @Component
protected MavenProject project;
/**
@@ -65,33 +62,33 @@
* <p/>
* If no url is given, will use the issue management url.
*
- * @parameter expression="${redmine.url}"
* @since 1.2.1
*/
+ @Parameter(property = "redmine.url")
protected URL url;
/**
* Un flag pour activer le mode verbeux.
*
- * @parameter expression="${redmine.verbose}" default-value="${maven.verbose}"
* @since 1.2.1
*/
+ @Parameter(property = "redmine.verbose", defaultValue = "${maven.verbose}")
protected boolean verbose;
/**
* Un flag pour verifier le login (effectue une connexion au serveur).
*
- * @parameter expression="${redmine.checkLogin}" default-value="false"
* @since 1.2.1
*/
+ @Parameter(property = "redmine.checkLogin", defaultValue = "false")
protected boolean checkLogin;
/**
* Un flag pour faire échouer le build si la configuration n'est pas ok.
*
- * @parameter expression="${redmine.safe}" default-value="true"
* @since 1.2.1
*/
+ @Parameter(property = "redmine.safe", defaultValue = "true")
protected boolean safe;
/**
@@ -99,28 +96,25 @@
* <p/>
* The server must be defined in your settings.xml file in servers section.
*
- * @parameter expression="${redmine.serverId}"
- * @required
* @since 1.2.1
*/
+ @Parameter(property = "redmine.serverId", required = true)
protected String serverId;
/**
- * Dependance du settings.
+ * Settings.
*
- * @parameter default-value="${settings}"
- * @required
- * @readonly
* @since 1.2.1
*/
+ @Component
protected Settings settings;
/**
- * password decypher
+ * password decypher.
*
- * @component roleHint="maven-helper-plugin"
* @since 1.2.1
*/
+ @Component(hint = "helper-maven-plugin")
protected SecDispatcher sec;
/**
@@ -129,6 +123,7 @@
* @component
* @since 1.2.1
*/
+ @Component
protected RedmineService service;
/**
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -25,6 +25,8 @@
package org.nuiton.jredmine.plugin;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.Version;
import org.nuiton.plugin.PluginHelper;
@@ -40,9 +42,9 @@
* <p/>
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal next-version
* @since 1.0.0
*/
+@Mojo(name = "next-version", requiresOnline = true, requiresProject = true)
public class NextVersionMojo extends AbstractRedmineMojo {
/**
@@ -51,9 +53,9 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="false"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "false")
protected boolean anonymous;
/**
@@ -61,9 +63,9 @@
* <p/>
* Note : if not set, no update of the description will be made.
*
- * @parameter expression="${redmine.versionDescription}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.versionDescription")
protected String versionDescription;
/**
@@ -74,9 +76,9 @@
* If not Set - will use current day date.
* flag is on.
*
- * @parameter expression="${redmine.effectiveDate}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.effectiveDate")
protected String effectiveDate;
/**
@@ -84,33 +86,33 @@
* <p/>
* If not Set - will not move any issues to the new version.
*
- * @parameter expression="${redmine.previousVersionName}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.previousVersionName")
protected String previousVersionName;
/**
* A flag to skip the goal.
*
- * @parameter expression="${redmine.skipNextVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipNextVersion", defaultValue = "false")
protected boolean skipNextVersion;
/**
* A flag to test plugin but send nothing to redmine.
*
- * @parameter expression="${redmine.dryRun}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.dryRun", defaultValue = "false")
protected boolean dryRun;
/**
* A flag to restirct only one run in a build (for multi-module context).
*
- * @parameter expression="${redmine.runOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.runOnce", defaultValue = "true")
protected boolean runOnce;
/** effective date to set */
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -26,6 +26,8 @@
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.nuiton.helper.plugin.CollectFilesMojo;
import org.nuiton.jredmine.model.Attachment;
import org.nuiton.plugin.PluginHelper;
@@ -41,9 +43,9 @@
* Publish files for a given project and version on redmine server.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal publish-attachments
* @since 1.0.0
*/
+@Mojo(name = "publish-attachments", requiresOnline = true, requiresProject = true)
public class PublishAttachmentsMojo extends AbstractRedmineMojo {
/**
* Flag to know if anonymùous connexion to redmine server is required.
@@ -51,9 +53,9 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="false"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "false")
protected boolean anonymous;
/**
@@ -65,9 +67,9 @@
* <p/>
* If no Set - will not use this source
*
- * @parameter expression="${redmine.filesFromProperties}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.filesFromProperties")
protected File filesFromProperties;
/**
@@ -75,33 +77,33 @@
* <p/>
* If no Set - will not use this source
*
- * @parameter expression="${redmine.files}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.files")
protected File[] files;
/**
* A flag to skip the goal.
*
- * @parameter expression="${redmine.skipCollectReleaseAttachments}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipCollectReleaseAttachments", defaultValue = "false")
protected boolean skipPublishAttachments;
/**
* A flag to test plugin but send nothing to redmine.
*
- * @parameter expression="${redmine.dryRun}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.dryRun", defaultValue = "false")
protected boolean dryRun;
/**
* A flag to restirct only one run in a build (for multi-module context).
*
- * @parameter expression="${redmine.runOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.runOnce", defaultValue = "true")
protected boolean runOnce;
/** files to deploy */
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -25,6 +25,8 @@
package org.nuiton.jredmine.plugin;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.nuiton.jredmine.model.News;
import org.nuiton.plugin.PluginHelper;
@@ -34,9 +36,9 @@
* Publish a news on redmine server.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal publish-news
* @since 1.0.0
*/
+@Mojo(name = "publish-news", requiresOnline = true, requiresProject = true)
public class PublishNewsMojo extends AbstractRedmineMojo {
/**
* Flag to know if anonymùous connexion to redmine server is required.
@@ -44,26 +46,25 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="false"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "false")
protected boolean anonymous;
/**
* The content file of the news.
*
- * @parameter expression="${redmine.newsContentFile}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.newsContentFile", required = true)
protected File newsContentFile;
/**
* Short description or introduction of the released artifact.
*
- * @parameter expression="${redmine.newsSummary}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.newsSummary")
protected String newsSummary;
/**
@@ -72,34 +73,33 @@
* <b>Note : </b> the size can not be more than 60 caracters (due to a
* redmine limitation).
*
- * @parameter expression="${redmine.newsTitle}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.newsTitle", required = true)
protected String newsTitle;
/**
* A flag to skip the goal.
*
- * @parameter expression="${redmine.skipPublishNews}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipPublishNews", defaultValue = "false")
protected boolean skipPublishNews;
/**
* A flag to test plugin but send nothing to redmine.
*
- * @parameter expression="${redmine.dryRun}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.dryRun", defaultValue = "false")
protected boolean dryRun;
/**
* A flag to restirct only one run in a build (for multi-module context).
*
- * @parameter expression="${redmine.runOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.runOnce", defaultValue = "true")
protected boolean runOnce;
public PublishNewsMojo() {
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -25,6 +25,8 @@
package org.nuiton.jredmine.plugin;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.StringUtils;
import org.nuiton.jredmine.model.ModelHelper;
import org.nuiton.jredmine.model.Version;
@@ -41,9 +43,9 @@
* Will add a the version if not existing, otherwise, will update the version.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal update-version
* @since 1.0.0
*/
+@Mojo(name = "update-version", requiresOnline = true, requiresProject = true)
public class UpdateVersionMojo extends AbstractRedmineMojo {
/**
* Flag to know if anonymùous connexion to redmine server is required.
@@ -51,9 +53,9 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="false"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "false")
protected boolean anonymous;
/**
@@ -61,9 +63,9 @@
* <p/>
* Note : if not set, no update of the description will be made.
*
- * @parameter expression="${redmine.versionDescription}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.versionDescription")
protected String versionDescription;
/**
@@ -71,9 +73,9 @@
* <p/>
* The status of the version will be setted to {@code closed} then.
*
- * @parameter expression="${redmine.closeVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.closeVersion", defaultValue = "false")
protected boolean closeVersion;
/**
@@ -84,9 +86,9 @@
* If not Set - will use current day date only if {@link #closeVersion}
* flag is on.
*
- * @parameter expression="${redmine.effectiveDate}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.effectiveDate")
protected String effectiveDate;
/**
@@ -95,33 +97,33 @@
* If not Set - will use the {@code closed} value only if
* {@link #closeVersion} flag is on.
*
- * @parameter expression="${redmine.versionStatus}"
* @since 1.2.1
*/
+ @Parameter(property = "redmine.versionStatus")
protected String versionStatus;
/**
* A flag to skip the goal.
*
- * @parameter expression="${redmine.skipUpdateVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipUpdateVersion", defaultValue = "false")
protected boolean skipUpdateVersion;
/**
* A flag to test plugin but send nothing to redmine.
*
- * @parameter expression="${redmine.dryRun}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.dryRun", defaultValue = "false")
protected boolean dryRun;
/**
* A flag to restirct only one run in a build (for multi-module context).
*
- * @parameter expression="${redmine.runOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.runOnce", defaultValue = "true")
protected boolean runOnce;
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -26,6 +26,8 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.changes.ChangesXML;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
import org.codehaus.plexus.util.ReaderFactory;
@@ -40,10 +42,7 @@
import java.util.List;
import java.util.Map;
-/**
- * @author tchemit <chemit(a)codelutin.com>
- * @requiresOnline true
- */
+/** @author tchemit <chemit(a)codelutin.com> */
public abstract class AbstractAnnouncementMojo extends AbstractRedmineMojo implements AnnouncementGeneratorConfiguration {
/**
@@ -54,27 +53,25 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="true"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "true")
protected boolean anonymous;
/**
* Directory where the template file will be generated.
*
- * @parameter expression="${redmine.templateOutputDirectory}" default-value="${project.build.directory}/generated-sources/announcement"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.templateOutputDirectory", defaultValue = "${project.build.directory}/generated-sources/announcement", required = true)
protected File templateOutputDirectory;
/**
* The path of the changes.xml file.
*
- * @parameter expression="${redmine.xmlPath}" default-value="${basedir}/src/changes/changes.xml"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.xmlPath", defaultValue = "${basedir}/src/changes/changes.xml", required = true)
protected File xmlPath;
/**
@@ -84,26 +81,25 @@
* <code>/src/main/resources/ or current project base directory</code>.
* </p>
*
- * @parameter expression="${redmine.templateDirectory}" default-value="org/nuiton/jredmine/plugin/announcement"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.templateDirectory", defaultValue = "org/nuiton/jredmine/plugin/announcement", required = true)
protected String templateDirectory = "org/nuiton/jredmine/plugin/announcement";
/**
* The template encoding.
*
- * @parameter expression="${redmine.templateEncoding}" default-value="${project.build.sourceEncoding}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.templateEncoding", defaultValue = "${project.build.sourceEncoding}")
protected String templateEncoding;
/**
* Map which will be pass to the velocity context
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, Object> announceParameters;
/**
@@ -115,59 +111,49 @@
* and everything that comes after it. <code>%FILE%</code>: this is the issue number.
* </p>
*
- * @parameter expression="${redmine.attachmentLinkTemplate}" default-value="%URL%/attachments/download/%FILE%"
* @since 1.0.0
*/
- protected String attachmentLinkTemplate ="%URL%/attachments/download/%FILE%";
+ @Parameter(property = "redmine.attachmentLinkTemplate", defaultValue = "%URL%/attachments/download/%FILE%")
+ protected String attachmentLinkTemplate = "%URL%/attachments/download/%FILE%";
- /**
- * @parameter expression="${project.groupId}"
- * @readonly
- * @since 1.0.0
- */
+ /** @since 1.0.0 */
+ @Parameter(property = "project.groupId", readonly = true)
protected String groupId;
- /**
- * @parameter expression="${project.artifactId}"
- * @readonly
- * @since 1.0.0
- */
+ /** @since 1.0.0 */
+ @Parameter(property = "project.artifactId", readonly = true)
protected String artifactId;
/**
* Distribution url of the artifact.
*
- * @parameter expression="${redmine.projectUrl}" default-value="${project.url}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.projectUrl", defaultValue = "${project.url}", required = true)
protected String projectUrl;
/**
* Packaging structure for the artifact.
*
- * @parameter expression="${project.packaging}"
- * @readonly
* @since 1.0.0
*/
+ @Parameter(property = "project.packaging", readonly = true)
protected String packaging;
/**
* The name of the artifact to be used in the announcement.
*
- * @parameter expression="${redmine.finalName}" default-value="${project.build.finalName}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.finalName", defaultValue = "${project.build.finalName}", required = true)
protected String finalName;
/**
* The current project base directory.
*
- * @parameter expression="${basedir}"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "basedir", required = true)
protected String basedir;
/**
@@ -177,50 +163,45 @@
* @parameter
* @since 1.0.0
*/
+ @Parameter
protected String urlDownload;
/**
* Name of the team that develops the artifact.
*
- * @parameter expression="${redmine.developmentTeam}" default-value="${project.name} team"
* @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.developmentTeam", defaultValue = "${project.name} team", required = true)
protected String developmentTeam;
/**
* Short description or introduction of the released artifact.
*
- * @parameter expression="${redmine.introduction}" default-value="${project.description}"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.introduction", defaultValue = "${project.description}")
protected String introduction;
/**
* A flag to restirct only one run in a build (for multi-module context).
*
- * @parameter expression="${redmine.runOnce}" default-value="true"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.runOnce", defaultValue = "true")
protected boolean runOnce;
- /**
- * @parameter expression="${redmine.artifactsFile}"
- * @since 1.2.1
- */
+ /** @since 1.2.1 */
+ @Parameter(property = "redmine.artifactsFile")
protected File artifactsFile;
/**
- * @parameter expression="${redmine.deploymentUrl}"
- * @readonly
*/
+ @Parameter(property = "redmine.deploymentUrl", readonly = true)
protected String deploymentUrl;
- /**
- * Velocity Component.
- *
- * @component roleHint="jredmine-maven-plugin"
- */
+ /** Velocity Component. */
+ @Component(hint = "jredmine-maven-plugin")
protected VelocityComponent velocity;
protected Attachment[] attachments;
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateEmailAnnouncementMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,30 +24,32 @@
*/
package org.nuiton.jredmine.plugin.announcement;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
/**
* Generate the content of the release email announcement.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal generate-email-announcement
* @since 1.0.0
*/
+@Mojo(name = "generate-email-announcement", requiresOnline = true, requiresProject = true)
public class GenerateEmailAnnouncementMojo extends AbstractAnnouncementMojo {
/**
* The Velocity template used to format the release email announcement.
*
- * @parameter expression="${redmine.emailAnnouncementTemplate}" default-value="release-email-announcement.vm"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.emailAnnouncementTemplate", defaultValue = "release-email-announcement.vm", required = true)
protected String emailAnnouncementTemplate = "release-email-announcement.vm";
/**
* A flag to enable or disable the goal.
*
- * @parameter expression="${changes.skipGenerateEmailAnnouncement}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "changes.skipGenerateEmailAnnouncement", defaultValue = "false")
protected boolean skipGenerateEmailAnnouncement;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/GenerateNewsAnnouncementMojo.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,30 +24,32 @@
*/
package org.nuiton.jredmine.plugin.announcement;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
/**
* Generate the content of the release announcement news for Redmine.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal generate-news-announcement
* @since 1.0.0
*/
+@Mojo(name = "generate-news-announcement", requiresOnline = true, requiresProject = true)
public class GenerateNewsAnnouncementMojo extends AbstractAnnouncementMojo {
/**
* The Velocity template used to format the redmine announcement.
*
- * @parameter expression="${redmine.newsAnnouncementTemplate}" default-value="release-news-announcement.vm"
- * @required
* @since 1.0.0
*/
+ @Parameter(property = "redmine.newsAnnouncementTemplate", defaultValue = "release-news-announcement.vm", required = true)
protected String newsAnnouncementTemplate = "release-news-announcement.vm";
/**
* A flag to enable or disable the goal.
*
- * @parameter expression="${redmine.skipGenerateNewsAnnouncement}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipGenerateNewsAnnouncement", defaultValue = "false")
protected boolean skipGenerateNewsAnnouncement;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -42,6 +42,7 @@
import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.reporting.MavenReport;
import org.apache.maven.reporting.MavenReportException;
import org.codehaus.plexus.i18n.I18N;
@@ -60,7 +61,6 @@
* Abstract redmine report mojo.
*
* @author tchemit <chemit(a)codelutin.com>
- * @requiresReports true
* @since 1.0.0
*/
public abstract class AbstractRedmineReport extends AbstractRedmineMojo implements MavenReport {
@@ -73,9 +73,9 @@
* <b>Note:</b> If set to {@code false}, you should fill {@link #username}
* and {@link #password} properties.
*
- * @parameter expression="${redmine.anonymous}" default-value="true"
* @since 1.1.3
*/
+ @Parameter(property = "redmine.anonymous", defaultValue = "true")
protected boolean anonymous;
/**
@@ -87,9 +87,9 @@
* and everything that comes after it. <code>%ISSUE%</code>: this is the issue number.
* </p>
*
- * @parameter expression="${redmine.issueLinkTemplate}" default-value="%URL%/issues/show/%ISSUE%"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.issueLinkTemplate", defaultValue = "%URL%/issues/show/%ISSUE%")
protected String issueLinkTemplate = "%URL%/issues/show/%ISSUE%";
/**
@@ -101,27 +101,21 @@
* and everything that comes after it. <code>%VERSION%</code>: this is the issue number.
* </p>
*
- * @parameter expression="${redmine.versionLinkTemplate}" default-value="%URL%/versions/show/%VERSION%"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.versionLinkTemplate", defaultValue = "%URL%/versions/show/%VERSION%")
protected String versionLinkTemplate = "%URL%/versions/show/%VERSION%";
- /**
- * Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
- */
+ /** Local Repository. */
+ @Parameter(property = "localRepository", required = true, readonly = true)
protected ArtifactRepository localRepository;
/**
* Report output directory. Note that this parameter is only relevant if the goal is run from the command line or
* from the default build lifecycle. If the goal is run indirectly as part of a site generation, the output
* directory configured in the Maven Site Plugin is used instead.
- *
- * @parameter default-value="${project.reporting.outputDirectory}"
*/
+ @Parameter(defaultValue = "${project.reporting.outputDirectory}")
protected File outputDirectory;
/** @component */
@@ -357,8 +351,8 @@
null);
resolver.resolveAlways(artifact,
- project.getRemoteArtifactRepositories(),
- localRepository);
+ project.getRemoteArtifactRepositories(),
+ localRepository);
} catch (InvalidVersionSpecificationException e) {
throw new MojoExecutionException(
"The skin version '" + version +
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report
* @since 1.0.0
*/
+@Mojo(name = "issues-report", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReport extends AbstractIssuesReport {
/**
@@ -43,6 +46,7 @@
* @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntries;
/**
@@ -50,9 +54,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersion;
/**
@@ -81,9 +85,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filters;
/**
@@ -98,9 +102,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNames;
/**
@@ -109,9 +113,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReport}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReport", defaultValue = "false")
protected boolean skipIssueReport;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by assignee.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-assignee
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-assignee", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByAssignee extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByAssignee;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByAssignee;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByAssignee;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByAssignee;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByAssignee}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByAssignee", defaultValue = "false")
protected boolean skipIssueReportByAssignee;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by category.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-category
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-category", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByCategory extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByCategory;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByCategory;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-data -Dtypes=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByCategory;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByCategory;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByCategory}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByCategory", defaultValue = "false")
protected boolean skipIssueReportByCategory;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by priority.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-priority
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-priority", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByPriority extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByPriority;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByPriority;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByPriority;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByPriority;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByPriority}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByPriority", defaultValue = "false")
protected boolean skipIssueReport;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by reporter.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-reporter
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-reporter", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByReporter extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByReporter;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByReporter;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByReporter;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByReporter;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByReporter}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByReporter", defaultValue = "false")
protected boolean skipIssueReportByReporter;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,6 +24,9 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
@@ -33,6 +36,7 @@
* @goal issues-report-by-status
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-status", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByStatus extends AbstractIssuesReport {
/**
@@ -40,9 +44,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByStatus;
/**
@@ -50,9 +54,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByStatus;
/**
@@ -81,9 +85,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByStatus;
/**
@@ -98,9 +102,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByStatus;
/**
@@ -109,9 +113,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByStatus}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByStatus", defaultValue = "false")
protected boolean skipIssueReportByStatus;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by tracker.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-tracker
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-tracker", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByTracker extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByTracker;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByTracker;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByTracker;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByTracker;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByTracker}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByTracker", defaultValue = "false")
protected boolean skipIssueReportByTracker;
@Override
Modified: trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java
===================================================================
--- trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2012-07-13 10:26:19 UTC (rev 278)
+++ trunk/jredmine-maven-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2012-07-13 15:35:06 UTC (rev 279)
@@ -24,15 +24,18 @@
*/
package org.nuiton.jredmine.plugin.report;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
import java.util.Map;
/**
* Generates a report for issues from Redmine's server group by version.
*
* @author tchemit <chemit(a)codelutin.com>
- * @goal issues-report-by-version
* @since 1.0.0
*/
+@Mojo(name = "issues-report-by-version", requiresOnline = true, requiresProject = true, requiresReports = true)
public class IssuesReportByVersion extends AbstractIssuesReport {
/**
@@ -40,9 +43,9 @@
* <p/>
* <b>Note:</b> use value 0 to have no limits
*
- * @parameter expression="${redmine.maxEntries}" default-value="100"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.maxEntries", defaultValue = "100")
protected int maxEntriesByVersion;
/**
@@ -50,9 +53,9 @@
* The current version being used is <code>${project.version}</code> minus
* any "-SNAPSHOT" suffix.
*
- * @parameter expression="${redmine.onlyCurrentVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.onlyCurrentVersion", defaultValue = "false")
protected boolean onlyCurrentVersionByVersion;
/**
@@ -81,9 +84,9 @@
* mvn redmine:display-ids -Dtype=<entry key>
* </pre>
*
- * @parameter
* @since 1.0.0
*/
+ @Parameter
protected Map<String, String> filtersByVersion;
/**
@@ -98,9 +101,9 @@
* <code>Updated</code>.
* </p>
*
- * @parameter expression="${redmine.columnNames}" default-value="Tracker,Category,Key,Summary,Status,Assignee,Version"
* @since 2.0
*/
+ @Parameter(property = "redmine.columnNames", defaultValue = "Tracker,Category,Key,Summary,Status,Assignee,Version")
protected String columnNamesByVersion;
/**
@@ -109,9 +112,9 @@
* This can be usefull since there is no way to skip a report from an
* inherited reportSet configuration.
*
- * @parameter expression="${redmine.skipIssueReportByVersion}" default-value="false"
* @since 1.0.0
*/
+ @Parameter(property = "redmine.skipIssueReportByVersion", defaultValue = "false")
protected boolean skipIssueReportByVersion;
@Override
1
0
r278 - in trunk: . jredmine-client-1.3.x jredmine-client-api jredmine-maven-plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 12:26:19 +0200 (Fri, 13 Jul 2012)
New Revision: 278
Url: http://nuiton.org/repositories/revision/jredmine/278
Log:
remove svn properties from pom
Modified:
trunk/jredmine-client-1.3.x/pom.xml
trunk/jredmine-client-api/pom.xml
trunk/jredmine-maven-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jredmine-client-1.3.x/pom.xml
===================================================================
--- trunk/jredmine-client-1.3.x/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
+++ trunk/jredmine-client-1.3.x/pom.xml 2012-07-13 10:26:19 UTC (rev 278)
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- JRedmine :: Client
-
- $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/pom.xml $
+ JRedmine :: Client 1.3.x
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
Modified: trunk/jredmine-client-api/pom.xml
===================================================================
--- trunk/jredmine-client-api/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
+++ trunk/jredmine-client-api/pom.xml 2012-07-13 10:26:19 UTC (rev 278)
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- JRedmine :: Client
-
- $HeadURL$
+ JRedmine :: Client Api
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 10:26:19 UTC (rev 278)
@@ -2,8 +2,6 @@
<!--
#%L
JRedmine :: Maven plugin
-
- $HeadURL$
%%
Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
%%
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
+++ trunk/pom.xml 2012-07-13 10:26:19 UTC (rev 278)
@@ -2,8 +2,6 @@
<!--
#%L
JRedmine
-
- $HeadURL$
%%
Copyright (C) 2009 - 2010 CodeLutin
%%
1
0
r277 - in trunk: . jredmine-client-1.3.x jredmine-client-api jredmine-maven-plugin
by tchemit@users.nuiton.org 13 Jul '12
by tchemit@users.nuiton.org 13 Jul '12
13 Jul '12
Author: tchemit
Date: 2012-07-13 12:21:59 +0200 (Fri, 13 Jul 2012)
New Revision: 277
Url: http://nuiton.org/repositories/revision/jredmine/277
Log:
rename jredmien-domain to jredmine-client-api
Added:
trunk/jredmine-client-api/
Removed:
trunk/jredmine-domain/
Modified:
trunk/jredmine-client-1.3.x/pom.xml
trunk/jredmine-client-api/pom.xml
trunk/jredmine-maven-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jredmine-client-1.3.x/pom.xml
===================================================================
--- trunk/jredmine-client-1.3.x/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
+++ trunk/jredmine-client-1.3.x/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
@@ -46,7 +46,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-domain</artifactId>
+ <artifactId>jredmine-client-api</artifactId>
<version>${project.version}</version>
</dependency>
Modified: trunk/jredmine-client-api/pom.xml
===================================================================
--- trunk/jredmine-domain/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
+++ trunk/jredmine-client-api/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
@@ -40,7 +40,7 @@
</parent>
<groupId>org.nuiton.jredmine</groupId>
- <artifactId>jredmine-domain</artifactId>
+ <artifactId>jredmine-client-api</artifactId>
<dependencies>
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
@@ -43,7 +43,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-domain</artifactId>
+ <artifactId>jredmine-client-api</artifactId>
<version>${project.version}</version>
</dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
+++ trunk/pom.xml 2012-07-13 10:21:59 UTC (rev 277)
@@ -42,7 +42,7 @@
<version>1.4-SNAPSHOT</version>
<modules>
- <module>jredmine-domain</module>
+ <module>jredmine-client-api</module>
<module>jredmine-client-1.3.x</module>
<module>jredmine-maven-plugin</module>
</modules>
1
0
r276 - in trunk: . jredmine-client-1.3.x jredmine-maven-plugin
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-13 01:39:36 +0200 (Fri, 13 Jul 2012)
New Revision: 276
Url: http://nuiton.org/repositories/revision/jredmine/276
Log:
optimize dependencies
Modified:
trunk/jredmine-client-1.3.x/pom.xml
trunk/jredmine-maven-plugin/pom.xml
trunk/pom.xml
Modified: trunk/jredmine-client-1.3.x/pom.xml
===================================================================
--- trunk/jredmine-client-1.3.x/pom.xml 2012-07-12 23:25:29 UTC (rev 275)
+++ trunk/jredmine-client-1.3.x/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
@@ -51,21 +51,6 @@
</dependency>
<dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-apache-client4</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.nuiton</groupId>
<artifactId>helper-maven-plugin</artifactId>
<scope>compile</scope>
@@ -99,11 +84,16 @@
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
Modified: trunk/jredmine-maven-plugin/pom.xml
===================================================================
--- trunk/jredmine-maven-plugin/pom.xml 2012-07-12 23:25:29 UTC (rev 275)
+++ trunk/jredmine-maven-plugin/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
@@ -43,16 +43,20 @@
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client</artifactId>
+ <artifactId>jredmine-domain</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
- <artifactId>jredmine-client</artifactId>
+ <artifactId>jredmine-client-1.3.x</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -101,7 +105,6 @@
<artifactId>maven-core</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
@@ -113,15 +116,15 @@
</dependency>
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact-manager</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
</dependency>
- <!--dependency>
- <groupId>org.apache.maven.reporting</groupId>
- <artifactId>maven-reporting-impl</artifactId>
- </dependency-->
-
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
@@ -166,6 +169,27 @@
<artifactId>doxia-sink-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </dependency>
+
<!-- tests dependencies -->
<dependency>
@@ -181,24 +205,25 @@
</dependency>
<dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
- <!-- ************************************************************* -->
- <!-- *** Project Information ************************************* -->
- <!-- ************************************************************* -->
<name>JRedmine :: Maven plugin</name>
- <description>JRedmine maven plugin to interacts with Redmine's server
+ <description>
+ JRedmine maven plugin to interacts with Redmine's server
</description>
- <!-- ************************************************************* -->
- <!-- *** Build Settings ****************************************** -->
- <!-- ************************************************************* -->
-
<packaging>maven-plugin</packaging>
<build>
@@ -220,10 +245,6 @@
</build>
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
-
<profiles>
<!-- reports only at release time -->
@@ -246,6 +267,7 @@
</plugins>
</reporting>
</profile>
+
<profile>
<id>run-its</id>
<!--activation>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-12 23:25:29 UTC (rev 275)
+++ trunk/pom.xml 2012-07-12 23:39:36 UTC (rev 276)
@@ -258,17 +258,25 @@
</dependency>
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact-manager</artifactId>
+ <version>${mavenVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
- <!--dependency>
- <groupId>org.apache.maven.reporting</groupId>
- <artifactId>maven-reporting-impl</artifactId>
- <version>2.2</version>
- </dependency-->
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <version>1.0-alpha-9-stable-1</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
1
0
Author: tchemit
Date: 2012-07-13 01:25:29 +0200 (Fri, 13 Jul 2012)
New Revision: 275
Url: http://nuiton.org/repositories/revision/jredmine/275
Log:
clean pom
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-07-12 23:25:15 UTC (rev 274)
+++ trunk/pom.xml 2012-07-12 23:25:29 UTC (rev 275)
@@ -22,7 +22,9 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -33,14 +35,15 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.3.2</version>
+ <version>3.3.4</version>
</parent>
<artifactId>jredmine</artifactId>
<version>1.4-SNAPSHOT</version>
<modules>
- <module>jredmine-client</module>
+ <module>jredmine-domain</module>
+ <module>jredmine-client-1.3.x</module>
<module>jredmine-maven-plugin</module>
</modules>
@@ -71,12 +74,23 @@
</dependency>
<dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>4.1.2</version>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>helper-maven-plugin</artifactId>
<version>${helperPluginVersion}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+
+ <exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</exclusion>
@@ -344,7 +358,7 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
- <exclusion>
+ <exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
@@ -375,7 +389,7 @@
<version>2.6</version>
<exclusions>
<exclusion>
- <groupId>org.codehaus.plexus</groupId>
+ <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-velocity</artifactId>
</exclusion>
<exclusion>
@@ -390,7 +404,7 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-mail-sender-javamail</artifactId>
</exclusion>
- <exclusion>
+ <exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
@@ -513,7 +527,7 @@
<id>tchemit</id>
<email>chemit at codelutin dot com</email>
<organization>CodeLutin</organization>
- <timezone>+2</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Developer</role>
</roles>
@@ -523,7 +537,7 @@
<id>ymartel</id>
<email>ymartel at codelutin dot com</email>
<organization>CodeLutin</organization>
- <timezone>+2</timezone>
+ <timezone>Europe/Paris</timezone>
<roles>
<role>Developer</role>
</roles>
@@ -544,20 +558,18 @@
<!-- must be on a fixed version, not on the snapshot to make possible release -->
<jredminePluginVersion>1.3</jredminePluginVersion>
- <doxiaVersion>1.2</doxiaVersion>
+ <doxiaVersion>1.3</doxiaVersion>
<helperPluginVersion>1.5-SNAPSHOT</helperPluginVersion>
+ <license.addJavaLicenseAfterPackage>
+ true
+ </license.addJavaLicenseAfterPackage>
+
<!-- documentation is in apt -->
<siteSourcesType>apt</siteSourcesType>
- <!-- test config -->
- <test.redmineUrl>http://www.mynuiton.org</test.redmineUrl>
- <test.redmineUsername>chemit</test.redmineUsername>
- <test.redminePassword>azer</test.redminePassword>
- <test.verbose>false</test.verbose>
- <test.encoding>UTF-8</test.encoding>
-
+ <jredmine-test.server>true</jredmine-test.server>
</properties>
<build>
@@ -570,11 +582,15 @@
<configuration>
<environmentVariables>
<test.redmineUrl>${test.redmineUrl}</test.redmineUrl>
- <test.redmineUsername>${test.redmineUsername}
- </test.redmineUsername>
- <test.redminePassword>${test.redminePassword}
- </test.redminePassword>
- <test.verbose>${test.verbose}</test.verbose>
+ <jredmine-test.login>
+ ${jredmine-test.login}
+ </jredmine-test.login>
+ <jredmine-test.password>
+ ${jredmine-test.password}
+ </jredmine-test.password>
+ <jredmine-test.verbose>
+ ${jredmine-test.verbose}
+ </jredmine-test.verbose>
</environmentVariables>
</configuration>
</plugin>
1
0
r274 - trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-13 01:25:15 +0200 (Fri, 13 Jul 2012)
New Revision: 274
Url: http://nuiton.org/repositories/revision/jredmine/274
Log:
tests should not be so verbose
Modified:
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
Modified: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java 2012-07-12 23:17:10 UTC (rev 273)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java 2012-07-12 23:25:15 UTC (rev 274)
@@ -52,7 +52,6 @@
@Override
protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
- conf.setVerbose(true);
return conf;
}
};
Modified: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-12 23:17:10 UTC (rev 273)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-12 23:25:15 UTC (rev 274)
@@ -53,7 +53,6 @@
@Override
protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
- conf.setVerbose(true);
return conf;
}
};
Modified: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java 2012-07-12 23:17:10 UTC (rev 273)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java 2012-07-12 23:25:15 UTC (rev 274)
@@ -53,7 +53,6 @@
@Override
protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
RedmineServiceConfiguration conf = fixture.newLogguedConfiguration();
- conf.setVerbose(true);
return conf;
}
};
1
0
Author: tchemit
Date: 2012-07-13 01:17:10 +0200 (Fri, 13 Jul 2012)
New Revision: 273
Url: http://nuiton.org/repositories/revision/jredmine/273
Log:
add redmine 1.3.x client
Added:
trunk/jredmine-client-1.3.x/
trunk/jredmine-client-1.3.x/LICENSE.txt
trunk/jredmine-client-1.3.x/README.txt
trunk/jredmine-client-1.3.x/changelog.txt
trunk/jredmine-client-1.3.x/pom.xml
trunk/jredmine-client-1.3.x/src/
trunk/jredmine-client-1.3.x/src/license/
trunk/jredmine-client-1.3.x/src/main/
trunk/jredmine-client-1.3.x/src/main/assembly/
trunk/jredmine-client-1.3.x/src/main/assembly/jredmine_rails-1.3.x.xml
trunk/jredmine-client-1.3.x/src/main/java/
trunk/jredmine-client-1.3.x/src/main/java/org/
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
trunk/jredmine-client-1.3.x/src/main/redmine/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/README.rdoc
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/helpers/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/models/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/views/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/assets/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/assets/images/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/assets/javascripts/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/assets/stylesheets/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/routes.rb
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/db/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/db/migrate/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/init.rb
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lang/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lang/en.yml
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lib/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lib/tasks/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/test/
trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/test/functional/
trunk/jredmine-client-1.3.x/src/main/resources/
trunk/jredmine-client-1.3.x/src/site/
trunk/jredmine-client-1.3.x/src/site/apt/
trunk/jredmine-client-1.3.x/src/site/apt/index.apt
trunk/jredmine-client-1.3.x/src/site/apt/rails_api.apt
trunk/jredmine-client-1.3.x/src/site/apt/redmine_service.apt
trunk/jredmine-client-1.3.x/src/site/site_fr.xml
trunk/jredmine-client-1.3.x/src/test/
trunk/jredmine-client-1.3.x/src/test/java/
trunk/jredmine-client-1.3.x/src/test/java/org/
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
trunk/jredmine-client-1.3.x/src/test/resources/
trunk/jredmine-client-1.3.x/src/test/resources/log4j.properties
trunk/jredmine-client-1.3.x/src/test/resources/test-config.properties
Property changes on: trunk/jredmine-client-1.3.x
___________________________________________________________________
Added: svn:ignore
+ target
*.ipr
*.iws
*.iml
.idea
.project
.classpath
.settings
Added: trunk/jredmine-client-1.3.x/LICENSE.txt
===================================================================
--- trunk/jredmine-client-1.3.x/LICENSE.txt (rev 0)
+++ trunk/jredmine-client-1.3.x/LICENSE.txt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Property changes on: trunk/jredmine-client-1.3.x/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/README.txt
===================================================================
--- trunk/jredmine-client-1.3.x/README.txt (rev 0)
+++ trunk/jredmine-client-1.3.x/README.txt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,2 @@
+To deploy new version of pom: mvn deploy
+To install localy: mvn install
Property changes on: trunk/jredmine-client-1.3.x/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/changelog.txt
===================================================================
--- trunk/jredmine-client-1.3.x/changelog.txt (rev 0)
+++ trunk/jredmine-client-1.3.x/changelog.txt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,5 @@
+maven-redmine-plugin (1.0.0-SNAPSHOT) stable; urgency=low
+
+ * //TODO_FILL_ME
+
+ -- author -- date -R
Property changes on: trunk/jredmine-client-1.3.x/changelog.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/pom.xml
===================================================================
--- trunk/jredmine-client-1.3.x/pom.xml (rev 0)
+++ trunk/jredmine-client-1.3.x/pom.xml 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/pom.xml $
+ %%
+ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>jredmine</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>jredmine-client-1.3.x</artifactId>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jredmine-domain</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-apache-client4</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-multipart</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>helper-maven-plugin</artifactId>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <name>JRedmine :: Client 1.3.x</name>
+ <description>The JRedmine client for redmine 1.3.x series</description>
+
+ <properties>
+ <!-- extra files to include in release -->
+ <redmine.releaseFiles>
+ target/${project.artifactId}-${project.version}-jredmine_rails-1.3.x.zip,
+ ${redmine.libReleaseFiles}
+ </redmine.releaseFiles>
+ </properties>
+
+ <build>
+
+ <plugins>
+ <!-- expose new plexus components -->
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ </reporting>
+
+ <profiles>
+
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <version>${plexusPluginVersion}</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>${coberturaPluginVersion}</version>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ </profile>
+ <profile>
+ <id>release-assembly-profile</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <!-- launch in a release the assembly, but not attach it to project -->
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-assemblies</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <attach>false</attach>
+ <descriptorRefs>
+ <descriptorRef>deps</descriptorRef>
+ <descriptorRef>full</descriptorRef>
+ </descriptorRefs>
+ <descriptors>
+ <descriptor>src/main/assembly/jredmine_rails-1.3.x.xml
+ </descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+ </profile>
+
+ </profiles>
+
+</project>
Property changes on: trunk/jredmine-client-1.3.x/pom.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/main/assembly/jredmine_rails-1.3.x.xml
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/assembly/jredmine_rails-1.3.x.xml (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/assembly/jredmine_rails-1.3.x.xml 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,40 @@
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id$
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/assembly/… $
+ %%
+ Copyright (C) 2009 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+<assembly>
+ <id>jredmine_rails-1.3.x</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/redmine/jredmine</directory>
+ <outputDirectory>jredmine</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
Property changes on: trunk/jredmine-client-1.3.x/src/main/assembly/jredmine_rails-1.3.x.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceImpl.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,284 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineAnonymousService.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default implementation of {@link RedmineAnonymousService}.
+ * <p/>
+ * This implementation just make sure that the rest client is anonnymous.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineAnonymousService" role-hint="1.3.x"
+ * @see RedmineServiceConfiguration#isAnonymous()
+ * @since 1.0.3
+ */
+public class RedmineAnonymousServiceImpl implements RedmineServiceImplementor, RedmineAnonymousService {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(RedmineAnonymousServiceImpl.class);
+
+ /** @plexus.requirement role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x" */
+ protected RedmineServiceImplementor delegateImplementor;
+
+ public RedmineAnonymousServiceImpl() {
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineAnonymousService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_STATUS_LIST,
+ IssueStatus.class
+ );
+ }
+
+ @Override
+ public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_PRIORITY_LIST,
+ IssuePriority.class
+ );
+ }
+
+ @Override
+ public Project[] getProjects() throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_PROJECT_LIST, Project.class);
+ }
+
+ @Override
+ public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_CATEGORY_LIST,
+ IssueCategory.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Project getProject(String projectName) throws RedmineServiceException {
+ return getData(RedmineRequestFactoryImpl.GET_PROJECT,
+ Project.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_TRACKER_LIST,
+ Tracker.class,
+ projectName
+ );
+ }
+
+ @Override
+ public News[] getNews(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_NEWS_LIST,
+ News.class,
+ projectName
+ );
+ }
+
+ @Override
+ public User[] getProjectMembers(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_USER_LIST,
+ User.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version[] getVersions(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_VERSION_LIST,
+ Version.class,
+ projectName
+ );
+ }
+
+ @Override
+ public Version getVersion(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getData(RedmineRequestFactoryImpl.GET_VERSION,
+ Version.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Attachment[] getAttachments(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ATTACHMENTS_LIST,
+ Attachment.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName,
+ String versionName) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_LIST,
+ Issue.class,
+ projectName,
+ versionName
+ );
+ }
+
+ @Override
+ public TimeEntry[] getIssueTimeEntries(String projectName,
+ String issueId) throws RedmineServiceException {
+ return getDatas(RedmineRequestFactoryImpl.GET_ISSUE_TIME_ENTRY_LIST,
+ TimeEntry.class,
+ projectName,
+ issueId
+ );
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_ISSUES,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_OPENED_ISSUES,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ @Override
+ public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRequestFactoryImpl.GET_PROJECT_CLOSED_ISSUES,
+ Issue.class,
+ projectName
+ );
+ return result;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ // Force to not be loggued
+ configuration.setAnonymous(true);
+ if (log.isDebugEnabled()) {
+ log.debug("init configuration for " + this);
+ }
+ return delegateImplementor.init(configuration);
+ }
+
+ @Override
+ public int ping() {
+ return delegateImplementor.ping();
+ }
+
+ @Override
+ public void login() throws RedmineServiceLoginException {
+ delegateImplementor.login();
+ }
+
+ @Override
+ public void logout() throws RedmineServiceLoginException {
+ delegateImplementor.logout();
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.getDatas(requestName, type, args);
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendDatas(requestName, type, args);
+ }
+
+ @Override
+ public boolean isInit() {
+ return delegateImplementor.isInit();
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return delegateImplementor.isLoggued();
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkLoggued();
+ }
+
+}
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRequestFactoryImpl.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,271 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import com.google.common.base.Strings;
+import org.nuiton.io.rest.AbstractRequestFactory;
+import org.nuiton.io.rest.RestMethod;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+import org.nuiton.jredmine.request.DefaultRedmineRequestBuilder;
+import org.nuiton.jredmine.request.IssueScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.ProjectScopeRedmineRequestBuilder;
+import org.nuiton.jredmine.request.VersionScopeRedmineRequestBuilder;
+
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Factory of {@link RestRequest}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
+ * @since 1.4
+ */
+public class RedmineRequestFactoryImpl extends AbstractRequestFactory {
+
+ public static final String GET_ISSUE_LIST = Issue.class.getName() + "list";
+
+ public static final String GET_ISSUE_STATUS_LIST = IssueStatus.class.getName() + "list";
+
+ public static final String GET_ISSUE_PRIORITY_LIST = IssuePriority.class.getName() + "list";
+
+ public static final String GET_ISSUE_CATEGORY_LIST = IssueCategory.class.getName() + "list";
+
+ public static final String GET_ISSUE_TIME_ENTRY_LIST = TimeEntry.class.getName() + "list";
+
+ public static final String GET_PROJECT_LIST = Project.class.getName() + "list";
+
+ public static final String GET_PROJECT_ISSUES = Project.class.getName() + "issues";
+
+ public static final String GET_PROJECT_OPENED_ISSUES = Project.class.getName() + "opened-issues";
+
+ public static final String GET_PROJECT_CLOSED_ISSUES = Project.class.getName() + "closed-issues";
+
+ public static final String GET_USER_PROJECTS = Project.class.getName() + "forUser";
+
+ public static final String GET_PROJECT = Project.class.getName() + "detail";
+
+ public static final String GET_VERSION_LIST = Version.class.getName() + "list";
+
+ public static final String GET_TRACKER_LIST = Tracker.class.getName() + "list";
+
+ public static final String GET_ATTACHMENTS_LIST = Attachment.class.getName() + "list";
+
+ public static final String GET_USER_LIST = User.class.getName() + "list";
+
+ public static final String GET_NEWS_LIST = News.class.getName() + "list";
+
+ public static final String GET_VERSION = Version.class.getName() + "detail";
+
+ public static final String ADD_VERSION = Version.class.getName() + "add";
+
+ public static final String UPDATE_VERSION = Version.class.getName() + "update";
+
+ public static final String NEXT_VERSION = Version.class.getName() + "next";
+
+ public static final String ADD_NEWS = News.class.getName() + "add";
+
+ public static final String ADD_ATTACHMENT = Attachment.class.getName() + "add";
+
+ public static final String ADD_ISSUE_TIME_ENTRY = TimeEntry.class.getName() + "add";
+
+ public static final String LOGIN = "login";
+
+ public static final String LOGOUT = "logout";
+
+ public static final String PING = "ping";
+
+ @Override
+ public void addDefaultRequests() {
+
+ // misc requests
+
+// addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "jredmine", "ping"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(PING, RestMethod.GET, "projects"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(LOGOUT, RestMethod.GET, "jredmine", "logout"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "login") {
+// addRequestBuilder(new DefaultRedmineRequestBuilder(LOGIN, RestMethod.POST, "jredmine", "login") {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String login = (String) args[0];
+ String password = (String) args[1];
+ return new String[]{"username", login, "password", password};
+ }
+ });
+
+ // data with no scope requests
+
+// addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, "jredmine", "get_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(GET_PROJECT_LIST, RestMethod.GET, "projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(GET_USER_PROJECTS, RestMethod.GET, "jredmine", "get_user_projects.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_STATUS_LIST, RestMethod.GET, "jredmine", "get_issue_statuses.xml"));
+ addRequestBuilder(new DefaultRedmineRequestBuilder(GET_ISSUE_PRIORITY_LIST, RestMethod.GET, "jredmine", "get_issue_priorities.xml"));
+
+ // data with project scope requests
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT, RestMethod.GET, "jredmine", "get_project.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_ISSUES, RestMethod.GET, "jredmine", "get_project_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_OPENED_ISSUES, RestMethod.GET, "jredmine", "get_project_opened_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_PROJECT_CLOSED_ISSUES, RestMethod.GET, "jredmine", "get_project_closed_issues.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_VERSION_LIST, RestMethod.GET, "jredmine", "get_project_versions.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_ISSUE_CATEGORY_LIST, RestMethod.GET, "jredmine", "get_issue_categories.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_TRACKER_LIST, RestMethod.GET, "jredmine", "get_project_trackers.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_USER_LIST, RestMethod.GET, "jredmine", "get_project_users.xml"));
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(GET_NEWS_LIST, RestMethod.GET, "jredmine", "get_project_news.xml"));
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_VERSION, RestMethod.POST, "jredmine", "add_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(UPDATE_VERSION, RestMethod.POST, "jredmine", "update_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ return new String[]{
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(NEXT_VERSION, RestMethod.POST, "jredmine", "next_version.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+
+
+ Version version = (Version) args[1];
+ String date = getVersionEffectiveDate(version);
+ String status = getVersionStatus(version);
+ String oldVersionName = (String) args[2];
+ return new String[]{
+ "oldVersionName", oldVersionName,
+ "version[name]", version.getName(),
+ "version[description]", version.getDescription(),
+ "version[effective_date]", date,
+ "version[status]", status
+ };
+ }
+ });
+
+ addRequestBuilder(new ProjectScopeRedmineRequestBuilder(ADD_NEWS, RestMethod.POST, "jredmine", "add_news.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ News news = (News) args[1];
+ return new String[]{
+ "news[title]", news.getTitle(),
+ "news[summary]", news.getSummary(),
+ "news[description]", news.getDescription()
+ };
+ }
+ });
+
+ // version scope requests
+
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_VERSION, RestMethod.GET, "jredmine", "get_version.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ISSUE_LIST, RestMethod.GET, "jredmine", "get_version_issues.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(GET_ATTACHMENTS_LIST, RestMethod.GET, "jredmine", "get_version_attachments.xml"));
+ addRequestBuilder(new VersionScopeRedmineRequestBuilder(ADD_ATTACHMENT, RestMethod.POST, "jredmine", "add_version_attachment.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String versionId = (String) args[1];
+ Attachment attachment = (Attachment) args[2];
+ return new String[]{
+ "version_name", versionId,
+ "attachment[description]", attachment.getDescription()
+ };
+ }
+
+ @Override
+ public Map<String, File> getAttachments(Object... args) {
+ Map<String, File> upload = new HashMap<String, File>();
+ Attachment attachment = (Attachment) args[2];
+ upload.put("attachment[file]", attachment.getToUpload());
+ return upload;
+ }
+ });
+
+ // issue scope requests
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(GET_ISSUE_TIME_ENTRY_LIST, RestMethod.GET, "jredmine", "get_issue_times.xml"));
+
+ addRequestBuilder(new IssueScopeRedmineRequestBuilder(ADD_ISSUE_TIME_ENTRY, RestMethod.POST, "jredmine", "add_issue_time.xml") {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public String[] getParameters(Object... args) {
+ String issueId = (String) args[1];
+ TimeEntry timeEntry = (TimeEntry) args[2];
+ Date d = timeEntry.getSpentOn();
+ if (d == null) {
+ d = new Date();
+ }
+ String date = DATE_FORMAT.format(d);
+ return new String[]{
+ "issue_id", issueId,
+ //"timeEntry[issue_id]", issueId,
+ "time_entry[activity_id]", timeEntry.getActivityId() + "",
+ "time_entry[spent_on]", date,
+ "time_entry[hours]", timeEntry.getHours() + "",
+ "time_entry[comments]", timeEntry.getComments() == null ? "" : timeEntry.getComments()
+ };
+ }
+ });
+ }
+
+ protected static String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (Strings.isNullOrEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected static String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+
+
+}
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineRestClient.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,181 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: RedmineRestClient.java 211 2011-06-04 17:01:31Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.StatusLine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.nuiton.io.rest.RequestFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.io.rest.RestSession;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.VersionStatusEnum;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * Implementation of a {@link RestClient} to access a Redmine server via the
+ * {@code redmine_rest} rails plugin.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
+ * @since 1.0.0
+ */
+public class RedmineRestClient extends RestClient {
+
+ private static final Log log = LogFactory.getLog(RedmineRestClient.class);
+
+ /**
+ * To obtain redmine requests.
+ *
+ * @plexus.requirement role="org.nuiton.io.rest.RequestFactory" role-hint="1.3.x"
+ * @since 1.4
+ */
+ protected RequestFactory requestFactory;
+
+ public final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
+
+ public RedmineRestClient() {
+ }
+
+ public RedmineRestClient(RestClientConfiguration configuration) {
+ super(configuration);
+ }
+
+ @Override
+ public RequestFactory getRequestFactory() {
+ return requestFactory;
+ }
+
+ @Override
+ protected void open(RestSession session) throws IOException {
+
+ ping(session);
+
+ if (!configuration.isAnonymous()) {
+ login(session);
+ }
+ }
+
+ @Override
+ protected void close(RestSession session) throws IOException {
+
+ if (session != null) {
+
+ try {
+ RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGOUT);
+ session.setOpen(false);
+ session.doRequest(request);
+ } finally {
+ session.close();
+ }
+ }
+ }
+
+ public int ping(RestSession session) throws IOException {
+
+ try {
+
+ RestRequest request = getRequest(RedmineRequestFactoryImpl.PING);
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+// String content = gm.getResponseBodyAsString();
+//
+// boolean ok = "ping".equals(content);
+// if (!ok) {
+// throw new IOException(
+// "can not connect to " + configuration.getRestUrl());
+// }
+ return statusCode;
+ } catch (IOException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new IOException(
+ "could not ping " + configuration.getRestUrl() +
+ " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ public void login(RestSession session) throws IOException {
+
+ RestRequest request = getRequest(RedmineRequestFactoryImpl.LOGIN,
+ configuration.getRestUsername(),
+ configuration.getRestPassword());
+
+ HttpMethod gm = session.doRequest(request);
+
+ StatusLine sl = gm.getStatusLine();
+ int statusCode = sl.getStatusCode();
+ if (log.isDebugEnabled()) {
+ log.debug("status code " + statusCode + " for " + gm.getPath());
+ }
+
+ if (statusCode != HttpStatus.SC_OK &&
+ statusCode!= HttpStatus.SC_MOVED_TEMPORARILY) {
+ gm.releaseConnection();
+ throw new IOException(
+ "Got error code <" + statusCode + ":" +
+ sl.getReasonPhrase() + "> on " + gm.getPath());
+ }
+
+ // ok session is logged in
+
+ }
+
+ protected String getVersionStatus(Version version) {
+ String status = version.getStatus();
+ if (StringUtils.isEmpty(status)) {
+
+ // use default open status
+ status = VersionStatusEnum.open.name();
+ }
+ return status;
+ }
+
+ protected String getVersionEffectiveDate(Version version) {
+ return version.getEffectiveDate() == null ? "" :
+ DATE_FORMAT.format(version.getEffectiveDate());
+ }
+}
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImpl.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,152 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineService.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+
+/**
+ * Default {@link RedmineService} implementation based on a {@link RestClient}
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineService" role-hint="1.3.x"
+ * @since 1.0.0
+ */
+public class RedmineServiceImpl extends RedmineAnonymousServiceImpl implements RedmineService {
+
+ protected static final Log log = LogFactory.getLog(RedmineServiceImpl.class);
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ return delegateImplementor.init(configuration);
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineLogguedService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public Project[] getUserProjects() throws RedmineServiceException {
+ checkLoggued();
+ Project[] result = getDatas(RedmineRequestFactoryImpl.GET_USER_PROJECTS, Project.class);
+ return result;
+ }
+
+ @Override
+ public Version addVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain created version
+ Version result = sendData(RedmineRequestFactoryImpl.ADD_VERSION,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version updateVersion(String projectName,
+ Version version) throws RedmineServiceException {
+
+ // send data and obtain updated version
+ Version result = sendData(RedmineRequestFactoryImpl.UPDATE_VERSION,
+ Version.class,
+ projectName,
+ version
+ );
+ return result;
+ }
+
+ @Override
+ public Version nextVersion(String projectName,
+ String oldVersionName,
+ Version newVersion) throws RedmineServiceException {
+
+ // send data and obtain updated or created new version
+ Version result = sendData(RedmineRequestFactoryImpl.NEXT_VERSION,
+ Version.class,
+ projectName,
+ newVersion,
+ oldVersionName
+ );
+ return result;
+ }
+
+ @Override
+ public Attachment addAttachment(String projectName,
+ String versionName,
+ Attachment attachement) throws RedmineServiceException {
+
+ // send data and obtain created attachment
+ Attachment result = sendData(RedmineRequestFactoryImpl.ADD_ATTACHMENT,
+ Attachment.class,
+ projectName,
+ versionName,
+ attachement
+ );
+ return result;
+ }
+
+ @Override
+ public News addNews(String projectName,
+ News news) throws RedmineServiceException {
+ // send data and obtain created news
+ News result = sendData(RedmineRequestFactoryImpl.ADD_NEWS,
+ News.class,
+ projectName,
+ news
+ );
+ return result;
+ }
+
+ @Override
+ public TimeEntry addIssueTimeEntry(String projectName,
+ String issueId,
+ TimeEntry entry) throws RedmineServiceException {
+ // send data and obtain updated version
+ TimeEntry result = sendData(RedmineRequestFactoryImpl.ADD_ISSUE_TIME_ENTRY,
+ TimeEntry.class,
+ projectName,
+ issueId,
+ entry
+ );
+ return result;
+ }
+}
Added: trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/java/org/nuiton/jredmine/v1_3_x/RedmineServiceImplementorImpl.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,321 @@
+/*
+ * #%L
+ * JRedmine :: Client
+ *
+ * $Id: DefaultRedmineServiceImplementor.java 257 2012-03-25 15:48:53Z tchemit $
+ * $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/java/org/… $
+ * %%
+ * Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestException;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Default Redmine technical service implementation.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="1.3.x"
+ * @see RedmineServiceImplementor
+ * @since 1.0.3
+ */
+public class RedmineServiceImplementorImpl implements RedmineServiceImplementor {
+
+ /** Logger */
+ private static final Log log =
+ LogFactory.getLog(RedmineServiceImplementorImpl.class);
+
+ /**
+ * Client Rest.
+ *
+ * @plexus.requirement role="org.nuiton.io.rest.RestClient" role-hint="1.3.x"
+ */
+ protected RedmineRestClient session;
+
+ /**
+ * xpp3 xpp3Helper to transform xml stream to pojo.
+ *
+ * @plexus.requirement role="org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper" role-hint="default"
+ */
+ protected RedmineXpp3Helper xpp3Helper;
+
+ /** internal state to known if service was init */
+ protected boolean init;
+
+ /** internal state to known if service was opened */
+ protected boolean open;
+
+ public RedmineServiceImplementorImpl() {
+ if (log.isDebugEnabled()) {
+ log.debug("new " + this);
+ }
+ session = new RedmineRestClient();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public boolean isLoggued() {
+ return session.isOpen();
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException {
+ session.setConfiguration(configuration);
+ session.requestFactory.addDefaultRequests();
+ RedmineServiceImplementor result = init(session);
+ return result;
+ }
+
+ public RedmineServiceImplementor init(RedmineRestClient session) throws RedmineServiceException {
+ if (open) {
+ throw new IllegalStateException(
+ "the client " + this + " was already opened!");
+ }
+ try {
+ this.session = session;
+
+ if (!session.isOpen()) {
+ session.open();
+ }
+
+ init = true;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not init service for reason " + e.getMessage(), e);
+ }
+ return this;
+ }
+
+ @Override
+ public int ping() {
+
+ try {
+ return session.ping(session.getSession());
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Could not ping ", e);
+ }
+ return -1;
+ }
+ }
+
+ @Override
+ public void login() {
+ }
+
+ @Override
+ public void logout() {
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ checkInit();
+ try {
+ if (session.isOpen()) {
+ try {
+ session.close();
+ } catch (RestException ex) {
+ throw new RedmineServiceException(
+ "has problem while closing Rest client " +
+ ex.getMessage(), ex);
+ }
+ }
+ } finally {
+ // can't remove the reference since plexus injects it
+// if (session != null) {
+// session = null;
+// }
+ init = false;
+ }
+ }
+
+ @Override
+ public <T> T getData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T sendData(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName,
+ Class<T> type,
+ Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException(
+ "can not access this service in anonymous mode");
+ }
+ }
+
+ protected InputStream askDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.askData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not obtain data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream sendDataStream(String requestName,
+ Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.sendData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not send data stream for request " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected RestRequest getRequest(String requestName,
+ Object... args) throws RedmineServiceException {
+ RestRequest r;
+ try {
+ r = session.getRequest(requestName, args);
+ } catch (Exception e) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName +
+ " for reason " + e.getMessage(), e);
+ }
+ if (r == null) {
+ throw new RedmineServiceException(
+ "could not find the request named " + requestName);
+ }
+ return r;
+ }
+
+ protected <T> T getDataFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+
+ try {
+ T result = xpp3Helper.readObject(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected <T> T[] getDatasFromStream(Class<T> type,
+ InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ T[] result = xpp3Helper.readObjects(type, stream, true);
+ return result;
+ } catch (Exception ex) {
+ throw new RedmineServiceException(
+ "could not obtain datas of type " + type + " for reason " +
+ ex.getMessage(), ex);
+ }
+ }
+
+ protected void checkInit() throws IllegalStateException {
+ if (!init) {
+ throw new IllegalStateException(
+ "the client " + this + " is not init!");
+ }
+ }
+
+ protected void checkSessionNotNull(RestClient session) {
+ if (session == null) {
+ throw new NullPointerException("session can not be null");
+ }
+ }
+
+ protected void checkSessionConfigurationNotNull(RestClient session) {
+ if (session.getConfiguration() == null) {
+ throw new NullPointerException(
+ "session configuration can not be null");
+ }
+ }
+}
Added: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/README.rdoc
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/README.rdoc (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/README.rdoc 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,38 @@
+= rest
+
+This plugin expose some services via a the REST protocol:
+
+jredmine/get_projects
+jredmine/get_issue_statuses
+jredmine/get_issue_priorities
+
+jredmine/get_project/X
+
+jredmine/get_project_trackers/X
+jredmine/get_project_issue_categories/X
+jredmine/get_project_users/X
+jredmine/get_project_versions/X
+
+jredmine/get_version/X?version_name=Y
+jredmine/get_version_issues/X?version_name=Y
+jredmine/get_version_attachements/X?version_name=Y
+
+jredmine/add_version/X?version_name=Y
+jredmine/update_version/X?version_name=Y
+
+jredmine/add_news/X?version_name=Y
+jredmine/add_attachment/X?version_name=Y
+
+where X is a project identifier and Y a version name
+
+= install
+
+To install the plugin, just put it in the vendor/plugins directory and restart the redmine (or apache)
+
+= configure
+
+Once the plugin is available in the forge, you can configure for each project
+if you want to expose jredmine service.
+
+
+
Added: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,585 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/redmine/j… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+class JredmineController < ActionController::Base
+
+ # post request
+ #before_filter :check_post, :only => [:add_version, :update_version, :next_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
+ before_filter :check_post, :only => [:add_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time]
+
+ # put request
+ before_filter :check_post, :only => [:update_version, :next_version, :update_issue_time]
+
+ # find user (after login)
+ before_filter :find_user, :only => [:get_user_projects, :add_version, :update_version, :next_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
+
+ # find project and check permission
+ before_filter :find_project, :except => [:ping, :login, :logout, :get_projects, :get_user_projects, :get_issue_statuses, :get_issue_priorities, :get_enumeration]
+
+ # find project's version
+ before_filter :find_version, :only => [:get_version, :get_version_issues, :get_version_opened_issues, :get_version_attachments, :add_version_attachment]
+
+ # check version definition is ok in request
+ before_filter :check_version_definition, :only => [:add_version, :update_version, :next_version]
+
+ # find project's issue
+ before_filter :find_issue, :only => [:get_issue_times, :add_issue_time, :update_time_issue]
+
+ # ping service (just to test if service is reachable)
+ def ping
+ render :text => "ping", :status => 200
+ end
+
+ # Login request and validation
+ def login
+ if !request.post?
+ # Logout user : get method not possible
+ self.logged_user = nil
+ render_status 405, "POST method required"
+ else
+ # Authenticate user
+ user = User.try_to_login(params[:username], params[:password])
+ if user.nil?
+ # Invalid credentials
+ render_status 401, "Invalid credentials"
+ elsif user.new_record?
+ # Onthefly creation failed,
+ render_status 401, "User not activated"
+ else
+ # Valid user
+ self.logged_user = user
+ # always generate a key and set autologin cookie
+ token = Token.create(:user => user, :action => 'autologin')
+ cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
+ render_status 200, "User logged in"
+ end
+ end
+ end
+
+ # Log out current user and redirect to welcome page
+ def logout
+ cookies.delete :autologin
+ Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged?
+ # user is no more connected
+ self.logged_user = nil
+ render_status 200, "User logged out"
+ end
+
+ # recuperation des projets
+ def get_projects
+ @projects = Project.find(:all)
+ render_array_result @projects, "projects"
+ end
+
+ # recuperation des projets dont l'utilisateur connecte est membre
+ def get_user_projects
+ projectsIds = User.current.memberships.collect{|m| m.project_id}
+ result = []
+ for id in projectsIds
+ p = @project = Project.find(id)
+ result << p
+ end
+ render_array_result result, "projects"
+ end
+
+ # recuperation des priorities d'issues
+ def get_issue_priorities
+ get_enumeration "IssuePriority"
+ end
+
+ # recuperation des differentes categories d'issues
+ def get_issue_categories
+ @issue_categories = @project.issue_categories.find(:all)
+ render_array_result @issue_categories, "issue-categories"
+ end
+
+ # recuperation des differentes statuts d'issues
+ def get_issue_statuses
+ @issue_status = IssueStatus.find(:all)
+ render_array_result @issue_status, "issue-statuses"
+ end
+ # recuperation du projet
+ def get_project
+ render_result @project
+ end
+
+ # recuperation de tous les membres d'un projet
+ def get_project_users
+ @members = @project.members.find(:all)
+ @r = []
+ for m in @members
+ u = User.find(m[:user_id])
+ u[:role_id] = m[:role_id]
+ u[:member_id] = m[:id]
+ #TODO - should remove the hashed password ?
+ @r << u
+ end
+ render_array_result @r, "users"
+ end
+
+ # recuperation de toutes les annonces d'un projet
+ def get_project_news
+ @news = @project.news.find(:all)
+ render_array_result @news, "news"
+ end
+
+ # recuperation des trakers d'un projet
+ def get_project_trackers
+ @trackers = @project.trackers.find(:all)
+ render_array_result @trackers, "trackers"
+ end
+
+ # recuperation des versions d'un projet
+ def get_project_versions
+ @versions = @project.versions.find(:all)
+ render_array_result @versions, "versions"
+ end
+
+ # recuperation de toutes les issues d'un projet
+ def get_project_issues
+ r =@project.issues.find(:all)
+ render_array_result r, "issues"
+ end
+
+ # recuperation de toutes les issues ouvertes d'un projet
+ def get_project_opened_issues
+ r = []
+ for i in @project.issues.find(:all)
+ if !i.closed? && i.status_id != 3
+ r << i
+ end
+ end
+ render_array_result r, "issues"
+ end
+
+ # recuperation de toutes les issues fermees d'un projet
+ def get_project_closed_issues
+ r = []
+ for i in @project.issues.find(:all)
+ if i.closed? || i.status_id == 3
+ r << i
+ end
+ end
+ render_array_result r, "issues"
+ end
+
+ # recuperation des temps d'une issue
+ def get_issue_times
+ render_array_result @issue.time_entries, "time-entries"
+ end
+
+ # recuperation de la version d'un projet
+ def get_version
+ render_result @version
+ end
+
+ # recuperation des issues d'un projet pour une version donnee
+ def get_version_issues
+ @issues = @version.fixed_issues.find(:all)
+ render_array_result @issues, "issues"
+ end
+
+ # recuperation des issues ouvertes d'un projet pour une version donnee
+ def get_version_opened_issues
+ issues = @version.fixed_issues.find(:all)
+ result = []
+ issues.each do |issue|
+ if !issue.closed? && issue.status_id != 3
+ result << issue
+ end
+ end
+ render_array_result result, "issues"
+ end
+
+ # recuperation des pieces jointes d'un projet pour une version donnee
+ def get_version_attachments
+ @files = @version.attachments.find(:all)
+ render_array_result @files, "attachments"
+ end
+
+ def show_permissions
+ allowed_permissions
+ render_result @allowed_permissions
+ end
+
+ def show_actions
+ allowed_actions
+ render_result @allowed_actions
+ end
+
+ # add a new version for a given project
+ def add_version(version = params["version"])
+ @version = @project.versions.find_by_name(version[:name])
+ if @version
+ # version already exists
+ render_status 505, "Version #{(a)version.name} already exists for project #{(a)project.name}, can not create it"
+ return false
+ end
+ allowed = User.current.allowed_to?(:manage_versions, @project)
+ if !allowed
+ render_status 401, "No permission to add a version in project #{(a)project.name}"
+ return false
+ end
+
+ # create the new version
+ @version = Version.create(:project => @project, :name => version[:name])
+
+ # do update the version
+ if !update_version0(version)
+ # something was wrong
+ return false
+ end
+ render_result @version
+ end
+
+ # update a existing version for a given project
+ def update_version(version=params["version"])
+ # get version
+ @version = @project.versions.find_by_name(version[:name])
+ if !@version
+ render_status 404, "#{version['name']} is not a version for project #{(a)project.name}"
+ return false
+ end
+ # check permissions
+ allowed = User.current.allowed_to?({:controller => 'versions', :action => "edit"}, @project)
+ if !allowed
+ render_status 401, "No permission to edit a version on project #{(a)project.name}"
+ return false
+ end
+ # do update the version
+ if !update_version0(version)
+ # something was wrong
+ return false
+ end
+ render_result @version
+ end
+
+ # add or update a new version for a given project and move all opened issue
+ # to next version from a preivous version
+ def next_version(version = params["version"],old_version_name=params[:oldVersionName])
+ # get version
+ @version = @project.versions.find_by_name(version[:name])
+ if !@version
+ # version does does exists
+ allowed = User.current.allowed_to?(:manage_versions, @project)
+ if !allowed
+ render_status 401, "No permission to add a version on project #{(a)project.name}"
+ return false
+ end
+
+ # create the new version
+ @version = Version.create(:project => @project, :name => version[:name])
+ end
+
+ # check update permission
+ allowed = User.current.allowed_to?({:controller => 'versions', :action => "edit"}, @project)
+ if !allowed
+ render_status 401, "No permission to edit a version on project #{(a)project.name}"
+ return false
+ end
+
+ # do update the version
+ if !update_version0(version)
+
+ # something was wrong while updating the version
+ return false
+ end
+
+ if old_version_name
+ old_version = @project.versions.find_by_name(old_version_name)
+ if !old_version
+ render_status 505, "Could not find old version #{old_version_name} for project #{(a)project.name}"
+ return false
+ end
+ old_issues = old_version.fixed_issues.find(:all)
+ old_issues.each do |issue|
+ sid = issue.status_id
+ if !issue.closed? || ( sid == 1 || sid == 2 )
+ journal = issue.init_journal(User.current, params[:notes])
+
+ # move to new version
+ issue.fixed_version_id = @version[:id]
+ issue.save
+ #Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
+ end
+ end
+ end
+ render_result @version
+ end
+
+ # add a new news for a given project
+ def add_news(news = params["news"])
+ if !request.post?
+ render_status 405, "POST method required for action add_news"
+ return false
+ end
+ allowed = User.current.allowed_to?({:controller => 'news', :action => "new"}, @project)
+ if !allowed
+ msg = "No permission to add a news on project "+ @project.name
+ render_status 401, msg
+ else
+ @news = News.new(:project => @project, :author => User.current)
+ @news.attributes = news
+ if @news.save
+ Mailer.deliver_news_added(@news) if Setting.notified_events.include?('news_added')
+ render_result @news
+ else
+ render_status 505, "Could not add the news..."
+ end
+ end
+ end
+
+ def add_version_attachment
+ add_attachment
+ end
+
+ def add_attachment(attachment = params["attachment"])
+ if !request.post?
+ render_status 405, "POST method required for action add_attachment"
+ return false
+ end
+ container = !@version ? @project : @version
+ if attachment
+ file = attachment['file']
+ next unless file && file.size > 0
+ a = Attachment.new(:container => container,
+ :file => file,
+ :description => attachment['description'].to_s.strip,
+ :author => User.current)
+ end
+ if a.save
+ if Setting.notified_events.include?('file_added')
+ array =[]
+ array << a
+ Mailer.deliver_attachments_added(array)
+ end
+ else
+ render_status 505, "Could not save the file " + a
+ end
+ render_result a
+ end
+
+ def add_issue_time(timeEntry = params["time_entry"])
+ if !request.post?
+ render_status 405, "POST method required for action add_issue_time"
+ return false
+ end
+ allowed = User.current.allowed_to?(:log_time, @project)
+ if !allowed
+ msg = "No permission to add a issue time entry on project "+ @project.name
+ render_status 401, msg
+ end
+ @notes = params[:notes]
+ journal = @issue.init_journal(User.current, @notes)
+ @time_entry = TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
+ @time_entry.attributes = timeEntry
+
+ call_hook(:controller_issues_edit_before_save, { :params => params, :issue => @issue, :time_entry => @time_entry, :journal => journal})
+
+ if (@time_entry.hours.nil? || @time_entry.valid?) && @issue.save
+ # Log spend time
+ @time_entry.save
+ else
+ render_status 505, "Could not save the time entry " + @time_entry
+ end
+ if !journal.new_record?
+ # Only send notification if something was actually changed
+ Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
+ end
+ render_result @time_entry
+ end
+
+ def update_issue_time(timeEntry = params["time_entry"])
+ if !request.post?
+ render_status 405, "POST method required for action update_issue_time"
+ return false
+ end
+
+ end
+
+ # recuperation des valeurs d'une enumeration
+ def get_enumeration(type = params[:type])
+ #@result = Enumeration.get_values(type)
+ @result = Enumeration.find(:all, :conditions =>["type = :sqlParamType", {:sqlParamType => type}])
+ render_array_result @result, "enumerations"
+ end
+
+ private
+
+ # Checks that action is using post method
+ def check_post
+ if !request.post?
+ render_status 405, "POST method required for action #{params[:action]}"
+ end
+ end
+
+ # Checks that action is using put method
+ def check_put
+ if !request.put?
+ render_status 405, "PUT method required for action #{params[:action]}"
+ end
+ end
+
+ # Checks that action is using delete method
+ def check_delete
+ if !request.delete?
+ render_status 405, "DELETE method required for action #{params[:action]}"
+ end
+ end
+
+ # Checks that request has a version[name] attribute
+ def check_version_definition(version = params[:version])
+ if version.nil?
+ render_status 404, "No version definition in request"
+ else
+ if version[:name].nil?
+ render_status 404, "No version name given in request"
+ end
+ end
+ end
+
+ def find_user
+ # Check the settings cache for each request
+ Setting.check_cache
+ # Find the current user
+ User.current = find_current_user
+ if !session[:user_id]
+ render_status 401, "Not connected"
+ end
+ end
+
+ # Returns the current user or nil if no user is logged in
+ def find_current_user
+ if session[:user_id]
+ # existing session
+ (User.active.find(session[:user_id]) rescue nil)
+ elsif cookies[:autologin]
+ # auto-login feature
+ User.find_by_autologin_key(cookies[:autologin])
+ end
+ end
+
+ def find_project( pid = params[:pid] )
+ begin
+ @project = Project.find(pid)
+ allowed = User.current.allowed_to?({:controller => 'jredmine', :action => "allow_jredmine"}, @project)
+ if !allowed
+ render_status 401, "No permission to access project #{pid} nor jredmine service configured for this project"
+ end
+ rescue ActiveRecord::RecordNotFound
+ render_status 404, "#{pid} is not a project"
+ return false
+ end
+ end
+
+ def check_edit
+ # check if user can edit the project
+ allowed = User.current.allowed_to?({:controller => 'projects', :action => "edit"}, @project)
+ if !allowed
+ render_status 401, "No permission to edit the project"
+ end
+ end
+
+ def find_version(version = params[:version_name])
+ if version.nil?
+ render_status 404, "No version name given in request"
+ else
+ @version = @project.versions.find_by_name(version)
+ if !@version
+ render_status 404, "#{version} is not a version for project #{(a)project.name}"
+ end
+ end
+ end
+
+ def find_issue(issue = params[:issue_id])
+ @issue = @project.issues.find(issue)
+ if !@issue
+ render_status 404, "#{issue} is not an issue for project #{(a)project.name}"
+ end
+ end
+
+ # Update the version with the pa given in parameters.
+ # To use this method the @project and @version must defined
+ def update_version0(version)
+ attributes = version.dup
+ attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
+ begin
+ valid = @version.update_attributes(attributes)
+ if !valid
+ render_status 505, "Could not update the version #{(a)version.name} on project #{(a)project.name} for unknown reason..."
+ end
+ rescue => msg
+ valid = false
+ render_status 505, "Could not update the version #{(a)version.name} on project #{(a)project.name} for reason #{msg}"
+ end
+ valid
+ end
+
+ def render_status(code,message)
+ render :text => message, :status => code
+ end
+
+ def render_array_result(result,tag)
+ if !result.any?
+ respond_to do |format|
+ format.json { render :text => "[]" }
+ format.xml { render :text => "<"+tag+"></"+tag+">" }
+ end
+ else
+ respond_to do |format|
+ format.json { render :text => result.to_json }
+ format.xml { render :text => result.to_xml }
+ end
+ end
+ end
+
+ def render_result(result)
+ respond_to do |format|
+ format.json { render :text => result.to_json }
+ format.xml { render :text => result.to_xml }
+ end
+ end
+
+ def logged_user=(user)
+ if user && user.is_a?(User)
+ User.current = user
+ session[:user_id] = user.id
+ else
+ User.current = User.anonymous
+ session[:user_id] = nil
+ end
+ end
+
+ def allowed_permissions
+ @allowed_permissions ||= begin
+ module_names = @project.enabled_modules.collect {|m| m.name}
+ Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
+ end
+ end
+
+ def allowed_actions
+ @allowed_actions ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten
+ end
+
+end
Property changes on: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/routes.rb
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/routes.rb (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/routes.rb 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,48 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/redmine/j… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+ActionController::Routing::Routes.draw do |map|
+
+ map.with_options :controller => 'jredmine' do |red|
+
+ # jredmine : actions with no project context
+ red.connect 'jredmine/:action.xml' , :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml'
+ red.connect 'jredmine/:action.json', :action => ['get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'json'
+ red.connect 'jredmine/:action' , :action => ['ping', 'login', 'logout', 'get_projects', 'get_user_projects', 'get_issue_statuses', 'get_issue_priorities', 'get_enumeration'], :format => 'xml'
+
+ # jredmine/action/:pid : actions with project context
+ red.connect 'jredmine/:action.xml/:pid' , :pid => /.+/, :format => 'xml'
+ red.connect 'jredmine/:action.json/:pid', :pid => /.+/, :format => 'json'
+ red.connect 'jredmine/:action/:pid' , :pid => /.+/, :format => 'xml'
+
+ end
+
+ # jredmine: ping, login , logout, with no project context...
+ #map.connect 'jredmine/:action', :controller => 'jredmine' ,:action => ['ping', 'login', 'logout', 'get_projects', 'get_issue_statuses', 'get_issue_priorities']
+ #map.connect 'jredmine/:action.:format', :controller => 'jredmine' ,:action => ['get_projects', 'get_issue_statuses', 'get_issue_priorities'], :format => ['xml', 'json']
+
+ # jredmine/action/?? (:project_id)
+ #map.connect 'jredmine/:action/:project_id', :controller => 'jredmine'
+ #map.connect 'jredmine/:action.:format/:project_id', :controller => 'jredmine', :format => ['xml', 'json']
+end
\ No newline at end of file
Property changes on: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/config/routes.rb
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/init.rb
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/init.rb (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/init.rb 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,35 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/main/redmine/j… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+require 'redmine'
+
+Redmine::Plugin.register :jredmine do
+ name 'JRedmine Rails plugin'
+ author 'Tony Chemit'
+ description 'A plugin to expose projects in REST protocol'
+ version '0.0.1'
+ project_module :jredmine do
+ permission :allow_jredmine, :jredmine => :allow_jredmine
+ end
+end
Property changes on: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/init.rb
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lang/en.yml
===================================================================
--- trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lang/en.yml (rev 0)
+++ trunk/jredmine-client-1.3.x/src/main/redmine/jredmine/lang/en.yml 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,2 @@
+# English strings go here
+my_label: "My label"
Added: trunk/jredmine-client-1.3.x/src/site/apt/index.apt
===================================================================
--- trunk/jredmine-client-1.3.x/src/site/apt/index.apt (rev 0)
+++ trunk/jredmine-client-1.3.x/src/site/apt/index.apt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,122 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/index… $
+~~ %%
+~~ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+~~ %%
+~~ This program is free software: you can redistribute it and/or modify
+~~ it under the terms of the GNU Lesser General Public License as
+~~ published by the Free Software Foundation, either version 3 of the
+~~ License, or (at your option) any later version.
+~~
+~~ This program is distributed in the hope that it will be useful,
+~~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+~~ GNU General Lesser Public License for more details.
+~~
+~~ You should have received a copy of the GNU General Lesser Public
+~~ License along with this program. If not, see
+~~ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+~~ #L%
+~~~
+----
+JRedmine-client
+----
+----
+2009-09-15
+----
+
+ Ce module contient un plugin <rails> qui permet d'ouvrir l'api de redmine au
+ protocole <REST>, ainsi q'un client <Java> pour interroger les services <REST>.
+
+
+Plugin <rails> JRedmine
+
+ Le but de ce plugin est de pouvoir accéder aux données d'un serveur Redmine en
+ utilisant le protocole <REST>, mais aussi d'effectuer des tâches de
+ maintenance sur le serveur.
+
+ La page {{{./rails_api.html}API}} détaille l'ensemble des services disponibles
+ depuis le serveur Redmine.
+
+* Source du plugin
+
+ Les sources du plugin <rails> sont sont dans le répertoire <<src/main/redmine>>
+
+--------------------------------------------------------------------------------
+
+src/main/redmine/
+`-- jredmine
+ |-- README.rdoc
+ |-- app
+ | |-- controllers
+ | | `-- jredmine_controller.rb
+ | |-- helpers
+ | |-- models
+ | `-- views
+ |-- assets
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ |-- config
+ | `-- routes.rb
+ |-- db
+ | `-- migrate
+ |-- init.rb
+ |-- lang
+ | `-- en.yml
+ |-- lib
+ | `-- tasks
+ `-- test
+ `-- functional
+--------------------------------------------------------------------------------
+
+* Récupération d'une version packagée
+
+ Il est possible de récupérer une version zippée du plugin (voir la section des
+ téléchargements).
+
+* Installation du plugin sur le serveur Redmine
+
+ * récupération du zip du plugin
+
+ * dézippage dans le répertoire vendor/plugins
+
+ * relancer votre instance de redmine (ou apache).
+
+* Configuration des permissions du plugin dans le serveur Redmine
+
+ Le plugin est activable par projet et par rôle.
+
+ Pour rendre accessible le plugin pour un projet donné, il faut donc ajouter
+ le module JRedmine sur le projet dans l'onglet de configuration des modules
+ du projet.
+
+ Pour rendre accessible le plugin pour un rôle, il faut lui ajouter la
+ permission <<allow_jredmine>> dans la page des permissions du rôle.
+
+* Tester le plugin
+
+ Une fois la configuration des permissions réalisées, vous pouvez tester le
+ plugin dans un navigateur web.
+
+ Pour cela, loggez-vous en web sur redmine, puis lancer (dans un autre onglet)
+ l'url suivante : (remplacer <XX> par le chemin d'accès à votre redmine
+ et <YY> par le nom d'un de vos projet).
+
+--------------------------------------------------------------------------------
+http://XX/jredmine/get_project/YY
+--------------------------------------------------------------------------------
+
+ Vous devez obtenir en retour la description xml du projet demandé.
+
+Client java
+
+ Le client java qui interroge le plugin rails se base sur l'api du plugin rails
+ et transforme les données retournées en xml en objets java.
+
+ La {{{./redmine_service.html}page suivante}} détaille les services disponibles
+ en java.
Property changes on: trunk/jredmine-client-1.3.x/src/site/apt/index.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/site/apt/rails_api.apt
===================================================================
--- trunk/jredmine-client-1.3.x/src/site/apt/rails_api.apt (rev 0)
+++ trunk/jredmine-client-1.3.x/src/site/apt/rails_api.apt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,503 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/rails… $
+~~ %%
+~~ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+~~ %%
+~~ This program is free software: you can redistribute it and/or modify
+~~ it under the terms of the GNU Lesser General Public License as
+~~ published by the Free Software Foundation, either version 3 of the
+~~ License, or (at your option) any later version.
+~~
+~~ This program is distributed in the hope that it will be useful,
+~~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+~~ GNU General Lesser Public License for more details.
+~~
+~~ You should have received a copy of the GNU General Lesser Public
+~~ License along with this program. If not, see
+~~ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+~~ #L%
+~~~
+----
+API du plugin rails JRedmine
+----
+----
+2009-09-20
+----
+
+Introduction
+
+ Ce document décrit l'API du plugin rails.
+
+
+ Toutes les actions REST sont préfixés par <<jredmine/>>.
+
+ Par exemple, si votre serveur redmine accessible sur <http://myredmine>,
+ les appels sur redmine seront de type <http://myredmine/jredmine/XXX>.
+
+ On distingue donc trois types d'API :
+
+ * API de login : pour gérer la connexion au serveur Redmine : une connexion
+ authentifié est requise pour pouvoir récupérer des données ou effectuer des
+ actions sur le serveur.
+
+ * API de lecture : pour récupérer des données du serveur.
+
+ * API d'actions : pour effecuter des actions de maintenance sur le serveur.
+
+ Toutes les données en sortie du plugin sont au format <xml>, ou <json>.
+
+API de login
+
+*-----------*-----------------------------------------------+
+| <action> | <description> |
+*-----------*-----------------------------------------------+
+| <<ping>> | un service de ping qui retourne le mot <ping> |
+*-----------*-----------------------------------------------+
+| <<login>> | pour connecter l'utilisateur au serveur |
+*-----------*-----------------------------------------------+
+| <<logout>>| pour déconnecter l'utilisateur du serveur |
+*-----------*-----------------------------------------------+
+
+* ping
+
+ Ce service ne requiert pas de paramètre.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/ping
+--------------------------------------------------------------------------------
+
+* login
+
+ Ce service nécessite deux paramètres :
+
+ * <<username>>
+
+ * <<password>>
+
+ <<Note:>> Cette requête ne peut être exécutée qu'en <<POST>>.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/login
+--------------------------------------------------------------------------------
+
+* logout
+
+ Ce service ne requiert pas de paramètre.
+
+ Requète :
+
+--------------------------------------------------------------------------------
+jredmine/logout
+--------------------------------------------------------------------------------
+
+API de lecture
+
+ On distingue quatre niveaux de données récupérables :
+
+ * les données qui ne dépendent pas d'un projet
+
+ * les données qui dépendent d'un projet
+
+ * les données qui dépendent d'une version d'un projet
+
+ * les données qui dépendent d'une issued'un projet
+
+* Services des données indépendantes
+
+*--------------------------*-----------------------------------+
+| <action[.xml\|.json]> | <données récupérées> |
+*--------------------------*-----------------------------------+
+| <<get_projects>> | tous les projets |
+*--------------------------*-----------------------------------+
+| <<get_user_projects>> | tous les projets dont l'utilisateur connecté est membre |
+*--------------------------*-----------------------------------+
+| <<get_issue_statuses>> | tous les status de demandes |
+*--------------------------*-----------------------------------+
+| <<get_issue_priorities>> | toutes les prioritiés de demandes |
+*--------------------------*-----------------------------------+
+
+** get_projects
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_projects.xml
+jredmine/get_projects.json
+--------------------------------------------------------------------------------
+
+** get_user_projects
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_user_projects.xml
+jredmine/get_user_projects.json
+--------------------------------------------------------------------------------
+
+** get_issue_statuses
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_statuses.xml
+jredmine/get_issue_statuses.json
+--------------------------------------------------------------------------------
+
+** get_issue_priorities
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_priorities.xml
+jredmine/get_issue_priorities.json
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'un projet
+
+*-------------------------------*---------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour un projet> |
+*-------------------------------*---------------------------------------+
+| <<get_projet>> | le projet |
+*-------------------------------*---------------------------------------+
+| <<get_issue_categories>> | touts les catégories de demande |
+*-------------------------------*---------------------------------------+
+| <<get_project_users>> | tous les membres du projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_trackers>> | tous les types de tracker |
+*-------------------------------*---------------------------------------+
+| <<get_project_versions>> | toutes les versions d'un projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_issues>> | toutes les issues d'un projet |
+*-------------------------------*---------------------------------------+
+| <<get_project_opened_issues>> | toutes les issues ouvertes d'un projet|
+*-------------------------------*---------------------------------------+
+| <<get_project_closed_issues>> | toutes les issues fermées d'un projet |
+*-------------------------------*---------------------------------------+
+
+** get_projet
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_projet.xml/myProject
+jredmine/get_projet.json/myProject
+--------------------------------------------------------------------------------
+
+** get_issue_categories
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_categories.xml/myProject
+jredmine/get_issue_categories.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_users
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_users.xml/myProject
+jredmine/get_project_users.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_trackers
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_trackers.xml/myProject
+jredmine/get_project_trackers.json/myProject
+--------------------------------------------------------------------------------
+
+** get_project_versions
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_versions.xml/myProject
+jredmine/get_project_versions.json/myProject
+--------------------------------------------------------------------------------
+
+** get_issues
+
+ Ce service ne requiert pas de paramètre.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_project_issues.xml/myProject
+jredmine/get_project_issues.json/myProject
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'une version d'un projet
+
+*------------------------------*-----------------------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour une version d'un projet> |
+*------------------------------*-----------------------------------------------------+
+| <<get_version>> | la version |
+*------------------------------*-----------------------------------------------------+
+| <<get_version_issues>> | touts les catégories de demande |
+*------------------------------*-----------------------------------------------------+
+| <<get_versions_attachments>> | tous les membres du projet |
+*------------------------------*-----------------------------------------------------+
+
+** get_version
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_version.xml/myProject?version_name=myVersion
+jredmine/get_version.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+** get_version_issues
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_version_issues.xml/myProject?version_name=myVersion
+jredmine/get_version_issues.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+** get_versions_attachments
+
+ Ce service requiert un paramètre :
+
+ * <<version_name>> le nom de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_versions_attachments.xml/myProject?version_name=myVersion
+jredmine/get_versions_attachments.json/myProject?version_name=myVersion
+--------------------------------------------------------------------------------
+
+* Services des données dépendantes d'une issue d'un projet
+
+*--------------------------*---------------------------------------------------+
+| <action[.xml\|.json]> | <données récupérées pour une issue d'un projet> |
+*--------------------------*---------------------------------------------------+
+| <<get_issue_times>> | les temps de l'issue |
+*--------------------------*---------------------------------------------------+
+
+** get_issue_times
+
+ Ce service requiert un paramètre :
+
+ * <<issue_id>> l'id de l'issue
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/get_issue_time.xml/myProject?issue_id=myIssueId
+jredmine/get_issue_time.json/myProject?issue_id=myIssueId
+--------------------------------------------------------------------------------
+
+API d'actions
+
+*----------------------------*-----------------------------------------------+
+| <action> | <description> |
+*----------------------------*-----------------------------------------------+
+| <<add_version>> | ajouter une version à un projet |
+*----------------------------*-----------------------------------------------+
+| <<update_version>> | mettre à jour une version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<next_version>> | préparer la prochaine version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_attachment>> | ajouter un fichier à un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_version_attachment>> | ajouter un fichier à une version d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_news>> | ajouter une annonce à un projet |
+*----------------------------*-----------------------------------------------+
+| <<add_issue_time>> | ajouter un temps à une issue d'un projet |
+*----------------------------*-----------------------------------------------+
+| <<update_issue_time>> | mettre à jour le temps d'une issue d'un projet|
+*----------------------------*-----------------------------------------------+
+
+ <<Note:>> Toutes ces opérations doivent obligatoirement être exécutées
+ par une méthod http <<POST>> (donc pas réalisable via un navigateur).
+
+* add_version
+
+ Ce service requiert trois paramètres :
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_version.xml/myProject
+jredmine/add_version.json/myProject
+--------------------------------------------------------------------------------
+
+* update_version
+
+ Ce service requiert trois paramètres :
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/update_version.xml/myProject
+jredmine/update_version.json/myProject
+--------------------------------------------------------------------------------
+
+* next_version
+
+ Ce service requiert quatre paramètres :
+
+ * <<previousVersionName>> le nom de la version précédente
+
+ * <<version[name]>> le nom de la version
+
+ * <<version[description]>> la description de la version
+
+ * <<version[effective_date]>> la date effective de la version
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/next_version.xml/myProject
+jredmine/next_version.json/myProject
+--------------------------------------------------------------------------------
+
+* add_attachment
+
+ Ce service requiert deux paramètres :
+
+ * <<attachment[description]>> la description de la pièce jointe
+
+ * <<attachment[file]>> la pièce-jointe
+
+ <<Note:>> La requète est de type <<multi-part>>.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_attachment.xml/myProject
+jredmine/add_attachment.json/myProject
+--------------------------------------------------------------------------------
+
+* add_version_attachment
+
+ Ce service requiert trois paramètres :
+
+ * <<version_name>> le nom de la version
+
+ * <<attachment[description]>> la description de la pièce jointe
+
+ * <<attachment[file]>> la pièce-jointe
+
+ <<Note:>> La requète est de type <<multi-part>>.
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_version_attachment.xml/myProject
+jredmine/add_version_attachment.json/myProject
+--------------------------------------------------------------------------------
+
+* add_news
+
+ Ce service requiert trois paramètres :
+
+ * <<news[title]>> le titre de de la version
+
+ * <<news[summary]>> la description de l'annonce
+
+ * <<news[description]>> le contenu de l'annonce
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_news.xml/myProject
+jredmine/add_news.json/myProject
+--------------------------------------------------------------------------------
+
+** add_issue_time
+
+ Ce service requiert cinq paramètres :
+
+ * <<issue_id>> l'id de l'issue
+
+ * <<time_entry[activity_id]>> l'id de l'activité du temps à ajouter
+
+ * <<time_entry[hours]>> le nombre d'heures du temps à ajouter
+
+ * <<time_entry[spent_on]>> la date du temps à ajouter (si null, on prend la date du jour)
+
+ * <<time_entry[comments]>> commentaire du temps à ajouter
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/add_issue_time.xml/myProject
+jredmine/add_issue_time.json/myProject
+--------------------------------------------------------------------------------
+
+** update_issue_time
+
+ Ce service requiert cinq paramètres :
+
+ * <<issue_id>> l'id de l'issue
+
+ * <<time_entry[activity_id]>> l'id de l'activité du temps à mettre à jour
+
+ * <<time_entry[hours]>> le nombre d'heures du temps à mettre à jour
+
+ * <<time_entry[spent_on]>> la date du temps à mettre à jour (si null, on prend la date du jour)
+
+ * <<time_entry[comments]>> commentaire du temps à mettre à jour
+
+ Requètes :
+
+--------------------------------------------------------------------------------
+jredmine/update_issue_time.xml/myProject
+jredmine/update_issue_time.json/myProject
+--------------------------------------------------------------------------------
Property changes on: trunk/jredmine-client-1.3.x/src/site/apt/rails_api.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/site/apt/redmine_service.apt
===================================================================
--- trunk/jredmine-client-1.3.x/src/site/apt/redmine_service.apt (rev 0)
+++ trunk/jredmine-client-1.3.x/src/site/apt/redmine_service.apt 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,71 @@
+~~~
+~~ #%L
+~~ JRedmine :: Client
+~~
+~~ $Id$
+~~ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/apt/redmi… $
+~~ %%
+~~ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+~~ %%
+~~ This program is free software: you can redistribute it and/or modify
+~~ it under the terms of the GNU Lesser General Public License as
+~~ published by the Free Software Foundation, either version 3 of the
+~~ License, or (at your option) any later version.
+~~
+~~ This program is distributed in the hope that it will be useful,
+~~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+~~ GNU General Lesser Public License for more details.
+~~
+~~ You should have received a copy of the GNU General Lesser Public
+~~ License along with this program. If not, see
+~~ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+~~ #L%
+~~~
+----
+RedmineService
+----
+----
+2009-09-15
+----
+
+Les contrats de service
+
+ L'api java sépare depuis la version 1.0.3 les services publiques et privés.
+
+* org.nuiton.jredmine.RedmineAnonymousService
+
+ Ce contrat permet d'exécuter les services publiques (services anonymes).
+
+* org.nuiton.jredmine.RedmineLogguedService
+
+ Ce contrat permet d'exécuter les services privés (services avec login).
+
+* org.nuiton.jredmine.RedmineService
+
+ Ce contrat regroupe les deux précédents et constitue l'ensemble des services
+ connus par redmine.
+
+
+Les implentations de service
+
+ L'api offre deux implentations de service.
+
+* org.nuiton.jredmine.DefaultRedmineAnonymousService
+
+ Ce service peut-être appelé pour tout opération publique, la session
+ sous-jacente au service (RedmineRestClient) n'établiera pas d'authentification
+ vers les serveur redmine.
+
+* org.nuiton.jredmine.DefaultRedmineService
+
+ Ce service peut-être appelé pour toute opération vers le serveur redmine.
+
+ Si la configuration requièrt un login (propriété anonymous à false), une
+ authentification sera effectuée.
+
+ A noter que si on utilise ce service en anonyme et que l'on tente d'appeler
+ une méthode de service privé, une exception sera remontée indiquant qu'il faut
+ être authentifié pour effectuer cette opération.
+
+ <Pour plus de détails, consulter la javadoc du module.>
Property changes on: trunk/jredmine-client-1.3.x/src/site/apt/redmine_service.apt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/site/site_fr.xml
===================================================================
--- trunk/jredmine-client-1.3.x/src/site/site_fr.xml (rev 0)
+++ trunk/jredmine-client-1.3.x/src/site/site_fr.xml 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ JRedmine :: Client
+
+ $Id$
+ $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/site/site_fr.x… $
+ %%
+ Copyright (C) 2009 - 2010 Tony Chemit, CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <bannerRight>
+ <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
+ <href>http://www.codelutin.com</href>
+ </bannerRight>
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-fluido-skin</artifactId>
+ <version>1.2.1</version>
+ </skin>
+
+ <custom>
+ <fluidoSkin>
+ <topBarEnabled>true</topBarEnabled>
+ <googleSearch/>
+ <sideBarEnabled>false</sideBarEnabled>
+ <searchEnabled>true</searchEnabled>
+ <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
+ </fluidoSkin>
+ </custom>
+
+ <publishDate position="right" format="dd/MM/yyyy"/>
+ <version position="right"/>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <links>
+ <item name="nuiton.org" href="http://www.nuiton.org"/>
+ <item name="CodeLutin" href="http://codelutin.com"/>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ </links>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="JRedmine rails API" href="rails_api.html"/>
+ <item name="JRedmine java service" href="redmine_service.html"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="http://nuiton.org/projects/list_files/jredmine" name="Sources bundles"/>
+
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
+ name="Test Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
+ name="Test Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
+ name="Test Sources (jar)"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ <footer>
+
+ <script type="text/javascript"
+ src="http://maven-site.nuiton.org/public/js/maven-site-nuiton.org.js">
+ </script>
+
+ <div id='projectMetas'
+ projectversion='${project.version}'
+ platform='${project.platform}'
+ projectid='${project.projectId}'
+ scm='${project.scm.connection}'
+ scmwebeditorenabled='${project.scmwebeditorEnabled}'
+ scmwebeditorurl='${project.scmwebeditorUrl}'
+ siteSourcesType='${project.siteSourcesType}'
+ piwikEnabled='${project.piwikEnabled}'
+ piwikId='${project.piwikId}'>
+ </div>
+ </footer>
+
+ </body>
+</project>
Property changes on: trunk/jredmine-client-1.3.x/src/site/site_fr.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineAnonymousServiceTest.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,164 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineAnonymousServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineAnonymousService> server = createNewServer(fixtures);
+
+ protected RedmineAnonymousService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineAnonymousService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineAnonymousService>(fixtures) {
+
+ @Override
+ protected RedmineAnonymousService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineAnonymousService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ conf.setVerbose(true);
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineAnonymousService> newServer =
+ new RedmineAnonymousServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+}
Added: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineFixtures.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,811 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import com.google.common.base.Charsets;
+import com.google.common.collect.ArrayListMultimap;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.jredmine.RedmineAnonymousService;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.model.io.xpp3.DefaultRedmineXpp3Helper;
+import org.nuiton.jredmine.model.io.xpp3.RedmineDataConverter;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * fixtures of redmine model.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public class RedmineFixtures {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineFixtures.class);
+
+ public static final String FILE_TO_UPLOAD_CONTENT = "Fichier à uploader";
+
+ public static final String PROJECT_NAME = "jredmine";
+
+ public static final String VERSION_NAME = "1.3";
+
+ public static final String ISSUE_ID = "2030";
+
+ private Project JRedmineProject;
+
+ private ArrayListMultimap<Class<?>, Object> model;
+
+ private RedmineServiceConfiguration anonymousConfiguration;
+
+ private RedmineServiceConfiguration logguedConfiguration;
+
+ public String projectName() {
+ return PROJECT_NAME;
+ }
+
+ public String versionName() {
+ return VERSION_NAME;
+ }
+
+ public String issueId() {
+ return ISSUE_ID;
+ }
+
+ public RedmineServiceConfiguration newAnonymousConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getAnonymousConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineServiceConfiguration newLogguedConfiguration()
+ throws IOException {
+ RedmineServiceConfiguration conf = new FakeRedmineServiceConfiguration();
+ copyConfiguration(getLogguedConfiguration(), conf);
+ return conf;
+ }
+
+ public RedmineAnonymousService newRedmineAnonymousService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineAnonymousServiceImpl service = new RedmineAnonymousServiceImpl();
+ RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
+ RedmineRestClient restClient = new RedmineRestClient();
+ restClient.requestFactory = new RedmineRequestFactoryImpl();
+ implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
+ implementor.session = restClient;
+ service.delegateImplementor = implementor;
+ service.init(configuration);
+ return service;
+ }
+
+ public RedmineService newRedmineService(RedmineServiceConfiguration configuration)
+ throws IOException, RedmineServiceException {
+ RedmineServiceImpl service = new RedmineServiceImpl();
+ RedmineServiceImplementorImpl implementor = new RedmineServiceImplementorImpl();
+ RedmineRestClient restClient = new RedmineRestClient();
+ restClient.requestFactory = new RedmineRequestFactoryImpl();
+ implementor.session = restClient;
+ implementor.xpp3Helper = new DefaultRedmineXpp3Helper();
+ service.delegateImplementor = implementor;
+ service.init(configuration);
+ return service;
+ }
+
+ protected RedmineServiceConfiguration getAnonymousConfiguration()
+ throws IOException {
+ if (anonymousConfiguration == null) {
+
+ Properties props = new Properties();
+
+ InputStream inputStream = null;
+ try {
+ String jredmineConfiguration = System.getenv("jredmine-test.properties");
+ if (jredmineConfiguration == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not find environement variable " +
+ "'jredmine-test.properties' will use " +
+ "default test configuration");
+ }
+
+ inputStream = getClass().getResourceAsStream("/test-config.properties");
+ } else {
+
+ File file = new File(jredmineConfiguration);
+
+ if (!file.exists()) {
+ throw new IllegalStateException("Could not find " + jredmineConfiguration +
+ " file");
+ }
+ inputStream = FileUtils.openInputStream(file);
+ }
+ props.load(inputStream);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ anonymousConfiguration = new FakeRedmineServiceConfiguration();
+
+ String url = props.getProperty("test.redmineUrl");
+ anonymousConfiguration.setRestUrl(new URL(url));
+
+ String e = props.getProperty("test.encoding");
+ anonymousConfiguration.setEncoding(e);
+
+ String verbose = props.getProperty("test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+ anonymousConfiguration.setEncoding(Charsets.UTF_8.name());
+ anonymousConfiguration.setAnonymous(true);
+
+ verbose = System.getenv("jredmine-test.verbose");
+ if (StringUtils.isNotEmpty(verbose)) {
+ anonymousConfiguration.setVerbose(Boolean.valueOf(verbose));
+ }
+
+ }
+ return anonymousConfiguration;
+ }
+
+ protected RedmineServiceConfiguration getLogguedConfiguration()
+ throws IOException {
+ if (logguedConfiguration == null) {
+
+ // use anonymous configuration
+
+ RedmineServiceConfiguration anoConf = getAnonymousConfiguration();
+ if (anoConf != null) {
+ logguedConfiguration = new FakeRedmineServiceConfiguration();
+ copyConfiguration(anoConf, logguedConfiguration);
+
+ // get system login password from env
+ String login = System.getenv("jredmine-test.login");
+ String password = System.getenv("jredmine-test.password");
+ if (!"null".equals(login)) {
+ logguedConfiguration.setRestUsername(login);
+ }
+ if (!"null".equals(password)) {
+ logguedConfiguration.setRestPassword(password);
+ }
+ logguedConfiguration.setAnonymous(false);
+ }
+ }
+ return logguedConfiguration;
+ }
+
+ protected void copyConfiguration(RedmineServiceConfiguration src,
+ RedmineServiceConfiguration dst) {
+ dst.setRestUrl(src.getRestUrl());
+ dst.setRestUsername(src.getRestUsername());
+ dst.setRestPassword(src.getRestPassword());
+ dst.setEncoding(src.getEncoding());
+ dst.setVerbose(src.isVerbose());
+ dst.setAnonymous(src.isAnonymous());
+ }
+
+ public List<Attachment> getAttachments() {
+ return get(Attachment.class);
+ }
+
+ public List<Issue> getIssues() {
+ return get(Issue.class);
+ }
+
+ public List<Project> getProjects() {
+ return get(Project.class);
+ }
+
+ public List<Tracker> getTrackers() {
+ return get(Tracker.class);
+ }
+
+ public List<User> getUsers() {
+ return get(User.class);
+ }
+
+ public List<Version> getVersions() {
+ return get(Version.class);
+ }
+
+ public <T> List<T> get(Class<T> modelType) {
+ if (model == null) {
+ try {
+ loadModel();
+ } catch (Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ return (List<T>) model.get(modelType);
+ }
+
+ public <T> T get(Class<T> type, int pos) {
+ List<T> ts = get(type);
+ return ts.get(pos);
+ }
+
+ public Project getJRedmineProject() {
+ if (JRedmineProject == null) {
+ JRedmineProject = new Project();
+ JRedmineProject.setName("jredmine");
+ JRedmineProject.setIdentifier("jredmine");
+ JRedmineProject.setIsPublic(true);
+ JRedmineProject.setHomepage("http://maven-site.nuiton.org/jredmine");
+ JRedmineProject.setDescription(
+ "Permet de communiquer en java avec un serveur " + "redmine qui a installé le plugin rails jredmine");
+ JRedmineProject.setId(36);
+ JRedmineProject.setStatus(1);
+ }
+ return JRedmineProject;
+ }
+
+
+ public static final String VERSION_TO_CREATE_NAME = "do_not_use_me";
+
+ public Version getVersion() {
+ Version version = new Version();
+ version.setName(VERSION_TO_CREATE_NAME);
+ version.setDescription("Une version créée par les tests de jredmine," +
+ " ne pas utiliser,et modifiée");
+ return version;
+ }
+
+ private void loadModel()
+ throws Exception {
+ model = ArrayListMultimap.create();
+
+ Attachment tempA;
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json"));
+ model.put(Attachment.class, tempA);
+ tempA = new Attachment();
+ tempA.setAuthorId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempA.setContainerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempA.setFilesize((Integer) RedmineDataConverter.Integer.convert("411"));
+ tempA.setDownloads((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempA.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T12:56:41+02:00"));
+ tempA.setContainerType((String) RedmineDataConverter.Text.convert("Version"));
+ tempA.setContentType((String) RedmineDataConverter.Text.convert("application/json"));
+ tempA.setDigest((String) RedmineDataConverter.Text.convert("6ea84342c7475c05fb077b4aca832f9a"));
+ tempA.setDiskFilename((String) RedmineDataConverter.Text.convert("090905125641_get_issue.json2"));
+ tempA.setFilename((String) RedmineDataConverter.Text.convert("get_issue.json2"));
+ model.put(Attachment.class, tempA);
+
+ Issue tempI;
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setParentId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setRootId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!"));
+ model.put(Issue.class, tempI);
+ tempI = new Issue();
+ tempI.setAuthorId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempI.setCategoryId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempI.setDoneRatio((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempI.setLockVersion((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempI.setPriorityId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setStatusId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempI.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setFixedVersionId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempI.setId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempI.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T20:11:52+02:00"));
+ tempI.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T00:37:40+02:00"));
+ tempI.setStartDate((Date) RedmineDataConverter.Date.convert("2009-09-04"));
+ tempI.setDescription((String) RedmineDataConverter.Text.convert("avec une description !2"));
+ tempI.setSubject((String) RedmineDataConverter.Text.convert("yes!2"));
+ model.put(Issue.class, tempI);
+
+ Project tempP;
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:11:54+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("one"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setLft((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setRgt((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ model.put(Project.class, tempP);
+ tempP = new Project();
+ tempP.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:14+02:00"));
+ tempP.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:22:29+02:00"));
+ tempP.setIdentifier((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setName((String) RedmineDataConverter.Text.convert("two"));
+ tempP.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempP.setProjectsCount((Integer) RedmineDataConverter.Integer.convert("0"));
+ tempP.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempP.setIsPublic((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ model.put(Project.class, tempP);
+
+ Tracker tempT;
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Anomalie"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Evolution"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("2"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("2"));
+ model.put(Tracker.class, tempT);
+ tempT = new Tracker();
+ tempT.setId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setIsInChlog((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setIsInRoadmap((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempT.setName((String) RedmineDataConverter.Text.convert("Assistance"));
+ tempT.setPosition((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempT.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempT.setTrackerId((Integer) RedmineDataConverter.Integer.convert("3"));
+ model.put(Tracker.class, tempT);
+
+ User tempU;
+ tempU = new User();
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T17:24:46+02:00"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T01:23:59+02:00"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("Redmine"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("Admin"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("admin"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dummy(a)codelutin.com"));
+ tempU.setIdentityUrl((String) RedmineDataConverter.Text.convert("yo"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("true"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:02+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("tony"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("8aed1322e5450badb078e1fb60a817a1df25a2ca"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("chemit2"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("tchemit2"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("chemit(a)codelutin.com"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("3"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T19:49:38+02:00"));
+ model.put(User.class, tempU);
+ tempU = new User();
+ tempU.setAdmin((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T16:24:11+02:00"));
+ tempU.setFirstname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setHashedPassword(
+ (String) RedmineDataConverter.Text.convert("70c881d4a26984ddce795f6f71817c9cf4480e79"));
+ tempU.setId((Integer) RedmineDataConverter.Integer.convert("7"));
+ tempU.setLanguage((String) RedmineDataConverter.Text.convert("fr"));
+ tempU.setLastLoginOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ tempU.setLastname((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setLogin((String) RedmineDataConverter.Text.convert("dev"));
+ tempU.setMail((String) RedmineDataConverter.Text.convert("dev3(a)ynot-home.info"));
+ tempU.setMailNotification((Boolean) RedmineDataConverter.Boolean.convert("false"));
+ tempU.setMemberId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempU.setRoleId((Integer) RedmineDataConverter.Integer.convert("4"));
+ tempU.setStatus((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempU.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T16:34:39+02:00"));
+ model.put(User.class, tempU);
+
+ Version tempV;
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:47:39+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yo"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("9"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yor"));
+ tempV.setSharing((String) RedmineDataConverter.Text.convert("none"));
+ tempV.setStatus((String) RedmineDataConverter.Text.convert("open"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:49+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("13"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("rrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:09+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("15"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaauuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:07:58+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:12:25+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoyeppppppppppppppppp"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("16"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaau"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T04:13:20+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("14"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("aaaaaaaaaarrrrrrrrrouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:05:40+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("5"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("2"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-05T00:39:15+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("1.0.0"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-04T18:13:05+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("11"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("yaouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:12+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:50:59+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("yoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("10"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ya"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T02:54:16+02:00"));
+ model.put(Version.class, tempV);
+ tempV = new Version();
+ tempV.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:37+02:00"));
+ tempV.setDescription((String) RedmineDataConverter.Text.convert("ysssoye"));
+ tempV.setEffectiveDate((Date) RedmineDataConverter.Date.convert("2009-09-06"));
+ tempV.setId((Integer) RedmineDataConverter.Integer.convert("12"));
+ tempV.setName((String) RedmineDataConverter.Text.convert("ouuuuuua"));
+ tempV.setProjectId((Integer) RedmineDataConverter.Integer.convert("1"));
+ tempV.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-06T03:00:42+02:00"));
+ model.put(Version.class, tempV);
+
+ IssueStatus tempIS;
+ tempIS = new IssueStatus();
+ tempIS.setId(1);
+ tempIS.setName("Nouveau");
+ tempIS.setPosition(1);
+ tempIS.setDefaultDoneRatio(10);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(true);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(2);
+ tempIS.setName("Assigné");
+ tempIS.setPosition(2);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(3);
+ tempIS.setName("Résolu");
+ tempIS.setPosition(3);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(4);
+ tempIS.setName("Commentaire");
+ tempIS.setPosition(4);
+ tempIS.setIsClosed(false);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(5);
+ tempIS.setName("Fermé");
+ tempIS.setPosition(5);
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+ tempIS = new IssueStatus();
+ tempIS.setId(6);
+ tempIS.setPosition(6);
+ tempIS.setName("Rejeté");
+ tempIS.setIsClosed(true);
+ tempIS.setIsDefault(false);
+ model.put(IssueStatus.class, tempIS);
+
+ IssuePriority tempIP;
+ tempIP = new IssuePriority();
+ tempIP.setId(3);
+ tempIP.setParentId(1);
+ tempIP.setProjectId(2);
+ tempIP.setName("Bas");
+ tempIP.setPosition(1);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ tempIP.setActive(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(4);
+ tempIP.setName("Normal");
+ tempIP.setPosition(2);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(true);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(5);
+ tempIP.setName("Haut");
+ tempIP.setPosition(3);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(6);
+ tempIP.setName("Urgent");
+ tempIP.setPosition(4);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+ tempIP = new IssuePriority();
+ tempIP.setId(7);
+ tempIP.setName("Immédiat");
+ tempIP.setPosition(5);
+ tempIP.setOpt("IPRI");
+ tempIP.setIsDefault(false);
+ model.put(IssuePriority.class, tempIP);
+
+ IssueCategory tempIC;
+ tempIC = new IssueCategory();
+ tempIC.setId(1);
+ tempIC.setName("categorie one");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+ tempIC = new IssueCategory();
+ tempIC.setId(2);
+ tempIC.setName("categorie two");
+ tempIC.setProjectId(1);
+ model.put(IssueCategory.class, tempIC);
+
+ News tempN;
+ tempN = new News();
+ tempN.setId(85);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:50:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description");
+ tempN.setSummary("summary");
+ tempN.setTitle("title");
+ model.put(News.class, tempN);
+ tempN = new News();
+ tempN.setId(86);
+ tempN.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-09-17T21:55:26+02:00"));
+ tempN.setProjectId(1);
+ tempN.setAuthorId(4);
+ tempN.setCommentsCount(0);
+ tempN.setDescription("description2");
+ tempN.setSummary("summary2");
+ tempN.setTitle("title2");
+ model.put(News.class, tempN);
+
+ TimeEntry tempE;
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:02:02+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(1);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(8);
+
+ tempE.setHours(1);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("Test");
+ model.put(TimeEntry.class, tempE);
+
+ tempE = new TimeEntry();
+ tempE.setCreatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setUpdatedOn((Date) RedmineDataConverter.Datetime.convert("2009-12-31T23:10:01+01:00"));
+ tempE.setSpentOn((Date) RedmineDataConverter.Date.convert("2009-12-31"));
+ tempE.setId(2);
+ tempE.setProjectId(1);
+ tempE.setUserId(4);
+ tempE.setIssueId(6);
+ tempE.setActivityId(9);
+
+ tempE.setHours(2);
+ tempE.setTmonth(12);
+ tempE.setTyear(2009);
+ tempE.setTweek(53);
+ tempE.setComments("deuxième temps");
+ model.put(TimeEntry.class, tempE);
+ }
+
+
+ public Attachment getAttachment() {
+ Attachment result = new Attachment();
+ File fileToUpload = null;
+ try {
+ fileToUpload = File.createTempFile("toupload", ".txt");
+ FileUtils.write(fileToUpload, FILE_TO_UPLOAD_CONTENT);
+ result.setToUpload(fileToUpload);
+ result.setDescription("attachment description...");
+ return result;
+ } catch (IOException e) {
+ throw new RuntimeException("Could not create temp file", e);
+ }
+
+ }
+
+ /**
+ * Configuration of a redmine service for test purposes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+ public static class FakeRedmineServiceConfiguration implements RedmineServiceConfiguration {
+
+ URL restUrl;
+
+ String restUsername;
+
+ String restPassword;
+
+ boolean verbose;
+
+ boolean anonymous;
+
+ String encoding;
+
+ @Override
+ public String getEncoding() {
+ return encoding;
+ }
+
+ @Override
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ @Override
+ public String getRestPassword() {
+ return restPassword;
+ }
+
+ @Override
+ public void setRestPassword(String restPassword) {
+ this.restPassword = restPassword;
+ }
+
+ @Override
+ public URL getRestUrl() {
+ return restUrl;
+ }
+
+ @Override
+ public void setRestUrl(URL restUrl) {
+ this.restUrl = restUrl;
+ }
+
+ @Override
+ public String getRestUsername() {
+ return restUsername;
+ }
+
+ @Override
+ public void setRestUsername(String restUsername) {
+ this.restUsername = restUsername;
+ }
+
+ @Override
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ @Override
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ @Override
+ public boolean isAnonymous() {
+ return anonymous;
+ }
+
+ @Override
+ public void setAnonymous(boolean anonymous) {
+ this.anonymous = anonymous;
+ }
+
+ @Override
+ public String toString() {
+ ToStringBuilder b = new ToStringBuilder(this,
+ ToStringStyle.MULTI_LINE_STYLE
+ );
+ b.append("redmineUrl", restUrl);
+ if (anonymous) {
+ b.append("anonymous", true);
+ } else {
+ b.append("redmineUsername", restUsername);
+ b.append("redminePassword", "***");
+ }
+ b.append("encoding", encoding);
+ b.append("verbose", verbose);
+ return b.toString();
+ }
+ }
+}
Added: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServer.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,183 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.StringUtils;
+import org.junit.Assume;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceImplementor;
+
+import java.io.IOException;
+
+/**
+ * A redmine server usable by tests.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.4
+ */
+public abstract class RedmineServer<S> extends TestWatcher {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(RedmineServer.class);
+
+ /**
+ * Fixtures.
+ *
+ * @since 1.4
+ */
+ protected final RedmineFixtures fixtures;
+
+ /**
+ * Service configuration to use.
+ *
+ * @since 1.4
+ */
+ protected RedmineServiceConfiguration configuration;
+
+ /**
+ * Current service.
+ *
+ * @since 1.4
+ */
+ protected S service;
+
+ public RedmineServer(RedmineFixtures fixtures) {
+ this.fixtures = fixtures;
+ }
+
+ protected abstract S createService(RedmineFixtures fixtures,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException;
+
+ protected abstract RedmineServiceConfiguration createConfiguration(RedmineFixtures fixtures) throws IOException;
+
+ public RedmineFixtures getFixtures() {
+ return fixtures;
+ }
+
+ public RedmineServiceConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public S getService() {
+ return service;
+ }
+
+ @Override
+ protected void starting(Description description) {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ throw new IllegalStateException("Could not create service", e);
+ }
+ }
+
+ @Override
+ protected void finished(Description description) {
+
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service ", e);
+ }
+ }
+ }
+
+ protected void checkService() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Will check service...");
+ }
+
+ try {
+
+ try {
+ configuration = createConfiguration(fixtures);
+ } catch (IOException e) {
+
+ throw new IllegalStateException("Could not create configuration", e);
+ }
+
+ boolean anonymous = configuration.isAnonymous();
+ try {
+ configuration.setAnonymous(true);
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+
+ // could not init service
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since could not init service", e);
+ }
+ Assume.assumeTrue(false);
+ return;
+
+ } finally {
+
+ //push back initial flag value
+ configuration.setAnonymous(anonymous);
+ }
+
+ if (!anonymous) {
+
+ if (StringUtils.isBlank(configuration.getRestUsername())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not username was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+
+ if (StringUtils.isBlank(configuration.getRestPassword())) {
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since not password was given and loggued service is required");
+ }
+ Assume.assumeTrue(false);
+ return;
+ }
+
+ // recheck service (to test now login)
+ try {
+ service = createService(fixtures, configuration);
+ } catch (Exception e) {
+ // ping was not ok
+ if (log.isInfoEnabled()) {
+ log.info("Will skip test " +
+ RedmineServiceTest.class.getName() +
+ ", since login [" + configuration.getRestUsername() + "] was bad : " + e.getMessage(), e);
+ }
+
+ Assume.assumeTrue(false);
+ }
+ }
+ } finally {
+ if (log.isInfoEnabled()) {
+ log.info("Service checked...");
+ }
+ if (service != null) {
+ try {
+ ((RedmineServiceImplementor) service).destroy();
+ } catch (RedmineServiceException e) {
+ throw new IllegalStateException("Could not close service", e);
+ }
+ }
+ }
+ }
+}
Added: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceAsAnonymousTest.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,201 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.RedmineServiceLoginException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineServiceAsAnonymousTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newAnonymousConfiguration();
+ conf.setVerbose(true);
+ return conf;
+ }
+ };
+ }
+
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceAsAnonymousTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void getUserProjects() throws Exception {
+ getService().getUserProjects();
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addAttachment() throws Exception {
+ getService().addAttachment(fixtures.projectName(), fixtures.versionName(), new Attachment());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Added: trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/java/org/nuiton/jredmine/v1_3_x/RedmineServiceTest.java 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,214 @@
+package org.nuiton.jredmine.v1_3_x;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.nuiton.jredmine.RedmineService;
+import org.nuiton.jredmine.RedmineServiceConfiguration;
+import org.nuiton.jredmine.RedmineServiceException;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.Issue;
+import org.nuiton.jredmine.model.IssueCategory;
+import org.nuiton.jredmine.model.IssuePriority;
+import org.nuiton.jredmine.model.IssueStatus;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.Project;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Tracker;
+import org.nuiton.jredmine.model.User;
+import org.nuiton.jredmine.model.Version;
+
+import java.io.IOException;
+
+/**
+ * Tests the {@link RedmineAnonymousServiceImpl}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 1.5
+ */
+public class RedmineServiceTest {
+
+ protected static final RedmineFixtures fixtures = new RedmineFixtures();
+
+ @Rule
+ public final RedmineServer<RedmineService> server = createNewServer(fixtures);
+
+ protected RedmineService getService() {
+ return server.getService();
+ }
+
+
+ protected RedmineServer<RedmineService> createNewServer(RedmineFixtures fixtures) {
+ return new RedmineServer<RedmineService>(fixtures) {
+
+ @Override
+ protected RedmineService createService(
+ RedmineFixtures fixture,
+ RedmineServiceConfiguration configuration) throws IOException, RedmineServiceException {
+ return fixture.newRedmineService(configuration);
+ }
+
+ @Override
+ protected RedmineServiceConfiguration createConfiguration(RedmineFixtures fixture) throws IOException {
+ RedmineServiceConfiguration conf = fixture.newLogguedConfiguration();
+ conf.setVerbose(true);
+ return conf;
+ }
+ };
+ }
+
+ @BeforeClass
+ public static void beforeClass() {
+ RedmineServer<RedmineService> newServer =
+ new RedmineServiceTest().createNewServer(fixtures);
+ newServer.checkService();
+ }
+
+ @Test
+ public void getProjects() throws Exception {
+ Project[] projects = getService().getProjects();
+ Assert.assertNotNull(projects);
+ }
+
+ @Test
+ public void getIssuePriorities() throws Exception {
+ IssuePriority[] issuePriorities = getService().getIssuePriorities();
+ Assert.assertNotNull(issuePriorities);
+ }
+
+ @Test
+ public void getIssueStatuses() throws Exception {
+ IssueStatus[] issueStatuses = getService().getIssueStatuses();
+ Assert.assertNotNull(issueStatuses);
+ }
+
+ @Test
+ public void getProject() throws Exception {
+ Project project = getService().getProject(fixtures.projectName());
+ Assert.assertNotNull(project);
+ }
+
+ @Test
+ public void getIssueCategories() throws Exception {
+ IssueCategory[] issueCategories = getService().getIssueCategories(fixtures.projectName());
+ Assert.assertNotNull(issueCategories);
+ }
+
+ @Test
+ public void getTrackers() throws Exception {
+ Tracker[] trackers = getService().getTrackers(fixtures.projectName());
+ Assert.assertNotNull(trackers);
+ }
+
+ @Test
+ public void getNews() throws Exception {
+ News[] news = getService().getNews(fixtures.projectName());
+ Assert.assertNotNull(news);
+ }
+
+ @Test
+ public void getProjectMembers() throws Exception {
+ User[] users = getService().getProjectMembers(fixtures.projectName());
+ Assert.assertNotNull(users);
+ }
+
+ @Test
+ public void getProjectIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getVersions() throws Exception {
+ Version[] versions = getService().getVersions(fixtures.projectName());
+ Assert.assertNotNull(versions);
+ }
+
+ @Test
+ public void getVersion() throws Exception {
+ Version version = getService().getVersion(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(version);
+ }
+
+ @Test
+ public void getVersionIssues() throws Exception {
+ Issue[] issues = getService().getIssues(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getOpenedIssues() throws Exception {
+ Issue[] issues = getService().getOpenedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getClosedIssues() throws Exception {
+ Issue[] issues = getService().getClosedIssues(fixtures.projectName());
+ Assert.assertNotNull(issues);
+ }
+
+ @Test
+ public void getIssueTimeEntries() throws Exception {
+ TimeEntry[] timeEntries = getService().getIssueTimeEntries(fixtures.projectName(), fixtures.issueId());
+ Assert.assertNotNull(timeEntries);
+ }
+
+ @Test
+ public void getAttachments() throws Exception {
+ Attachment[] attachments = getService().getAttachments(fixtures.projectName(), fixtures.versionName());
+ Assert.assertNotNull(attachments);
+ }
+
+ @Test
+ public void getUserProjects() throws Exception {
+ Project[] userProjects = getService().getUserProjects();
+ Assert.assertNotNull(userProjects);
+ }
+
+ @Ignore
+ @Test
+ public void addVersion() throws Exception {
+ getService().addVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addAttachment() throws Exception {
+ Version version = fixtures.getVersion();
+ Attachment attachment = fixtures.getAttachment();
+ Attachment updatedAttachment = getService().addAttachment(
+ fixtures.projectName(),
+ version.getName(),
+ attachment
+ );
+ Assert.assertNotNull(updatedAttachment);
+ }
+
+ @Ignore
+ @Test
+ public void addNews() throws Exception {
+ getService().addNews(fixtures.projectName(), new News());
+ }
+
+ @Ignore
+ @Test
+ public void updateVersion() throws Exception {
+ getService().updateVersion(fixtures.projectName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void nextVersion() throws Exception {
+ getService().nextVersion(fixtures.projectName(), fixtures.versionName(), new Version());
+ }
+
+ @Ignore
+ @Test
+ public void addIssueTime() throws Exception {
+ getService().addIssueTimeEntry(fixtures.projectName(), fixtures.issueId(), new TimeEntry());
+ }
+
+}
Added: trunk/jredmine-client-1.3.x/src/test/resources/log4j.properties
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/resources/log4j.properties (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/resources/log4j.properties 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,51 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/resources… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootCategory=WARN, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] (%c{1}:%L) - %m%n
+
+log4j.logger.org.nuiton.jredmine=INFO
+log4j.logger.org.nuiton.io.rest=INFO
+#log4j.logger.org.nuiton.io.xpp3.Xpp3Helper=DEBUG
+log4j.logger.org.apache.commons.httpclient.HttpClient=INFO
Property changes on: trunk/jredmine-client-1.3.x/src/test/resources/log4j.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jredmine-client-1.3.x/src/test/resources/test-config.properties
===================================================================
--- trunk/jredmine-client-1.3.x/src/test/resources/test-config.properties (rev 0)
+++ trunk/jredmine-client-1.3.x/src/test/resources/test-config.properties 2012-07-12 23:17:10 UTC (rev 273)
@@ -0,0 +1,28 @@
+###
+# #%L
+# JRedmine :: Client
+#
+# $Id$
+# $HeadURL: http://svn.nuiton.org/svn/jredmine/trunk/jredmine-client/src/test/resources… $
+# %%
+# Copyright (C) 2009 - 2010 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+# default values for test configuration
+test.redmineUrl=http://nuiton.org
+test.encoding=UTF-8
+test.verbose=false
Property changes on: trunk/jredmine-client-1.3.x/src/test/resources/test-config.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
1
0
r272 - in trunk/jredmine-domain: . src/main/java/org/nuiton/jredmine src/main/java/org/nuiton/jredmine/request
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-13 01:01:25 +0200 (Fri, 13 Jul 2012)
New Revision: 272
Url: http://nuiton.org/repositories/revision/jredmine/272
Log:
- remove all the jersey code
- request can now have multiple action (to be able to use or not the jredmine plugin)
Modified:
trunk/jredmine-domain/pom.xml
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
Modified: trunk/jredmine-domain/pom.xml
===================================================================
--- trunk/jredmine-domain/pom.xml 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/pom.xml 2012-07-12 23:01:25 UTC (rev 272)
@@ -45,11 +45,6 @@
<dependencies>
<dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.nuiton</groupId>
<artifactId>helper-maven-plugin</artifactId>
<scope>compile</scope>
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2012-07-12 23:01:25 UTC (rev 272)
@@ -23,9 +23,6 @@
* #L%
*/
-import com.google.common.base.Preconditions;
-import com.sun.jersey.api.client.UniformInterface;
-
/**
* Technical contract to implements a redmine service (will box the transport
* layer).
@@ -37,36 +34,7 @@
*/
public interface RedmineServiceImplementor {
- /**
- * Usable Rest methods.
- *
- * @since 1.4
- */
- enum RestMethod {
- GET, POST, PUT, DELETE, HEAD;
- public <T> T execute(UniformInterface request,
- Class<T> type) {
-
- Preconditions.checkNotNull(request);
- Preconditions.checkNotNull(type);
- T response = request.method(name(), type);
-
- return response;
- }
-
- public <T> T execute(UniformInterface request,
- Class<T> type,
- Object o) {
- Preconditions.checkNotNull(request);
- Preconditions.checkNotNull(type);
- Preconditions.checkNotNull(o);
- T response;
- response = request.method(name(), type, o);
- return response;
- }
- }
-
/**
* Tests if the service is init (says method
* {@link #init(RedmineServiceConfiguration)} was invoked).
@@ -154,12 +122,10 @@
* @param requestName the name of the request used
* @param type the type of data to treate
* @param args the parameters of the request
- * @param method method used to send data
- * @param <T> the type of data to treate
* @return the updated data
* @throws RedmineServiceException if any pb
*/
- <T> T sendData(String requestName, Class<T> type, RestMethod method, Object... args) throws RedmineServiceException;
+ <T> T sendData(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
/**
@@ -168,13 +134,11 @@
*
* @param requestName the name of the request used
* @param type the type of data to treate
- * @param method method used to send data
* @param args the parameters of the request
- * @param <T> the type of data to treate
* @return the updated data
* @throws RedmineServiceException if any pb
*/
- <T> T[] sendDatas(String requestName, Class<T> type, RestMethod method, Object... args) throws RedmineServiceException;
+ <T> T[] sendDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
/**
* Checks if the current session is not a anonymous one.
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 23:01:25 UTC (rev 272)
@@ -25,11 +25,11 @@
import com.google.common.base.Joiner;
import org.apache.commons.lang3.ArrayUtils;
+import org.nuiton.io.rest.RestMethod;
import org.nuiton.io.rest.RestRequest;
import org.nuiton.io.rest.RestRequestBuilder;
import java.io.File;
-import java.net.URL;
import java.util.Map;
/**
@@ -46,11 +46,14 @@
protected final String name;
- protected final String action;
+ protected final String[] action;
- public DefaultRedmineRequestBuilder(String name, String action) {
+ protected final RestMethod method;
+
+ public DefaultRedmineRequestBuilder(String name, RestMethod method, String... action) {
this.name = name;
this.action = action;
+ this.method = method;
}
@Override
@@ -74,7 +77,7 @@
public String[] getPath(Object... args) {
// by default, path is action
- return new String[]{action};
+ return action;
}
public Map<String, File> getAttachments(Object... args) {
@@ -109,11 +112,16 @@
}
@Override
- public String toPath(URL redmineUrl) {
+ public String toPath(String redmineUrl) {
String result = redmineUrl + "/" +
Joiner.on('/').join(getPath());
return result;
}
+
+ @Override
+ public RestMethod getMethod() {
+ return method;
+ }
};
}
}
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 23:01:25 UTC (rev 272)
@@ -23,6 +23,8 @@
* #L%
*/
+import org.nuiton.io.rest.RestMethod;
+
/**
* To build request with a project and issue scope.
*
@@ -33,8 +35,8 @@
private static final long serialVersionUID = 1L;
- public IssueScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
+ public IssueScopeRedmineRequestBuilder(String name, RestMethod method, String... action) {
+ super(name, method, action);
}
@Override
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 23:01:25 UTC (rev 272)
@@ -23,6 +23,8 @@
* #L%
*/
+import org.nuiton.io.rest.RestMethod;
+
/**
* To build request with a project scope.
*
@@ -33,8 +35,8 @@
private static final long serialVersionUID = 1L;
- public ProjectScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
+ public ProjectScopeRedmineRequestBuilder(String name,RestMethod method, String... action) {
+ super(name,method, action);
}
@Override
@@ -44,9 +46,9 @@
String projectName = (String) args[0];
- return new String[]{
- action,
- projectName
- };
+ String[] result = new String[action.length+1];
+ System.arraycopy(action, 0, result, 0, action.length);
+ result[action.length] = projectName;
+ return result;
}
}
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 23:01:25 UTC (rev 272)
@@ -23,6 +23,8 @@
* #L%
*/
+import org.nuiton.io.rest.RestMethod;
+
/**
* To build request with a project and version scope.
*
@@ -33,8 +35,8 @@
private static final long serialVersionUID = 1L;
- public VersionScopeRedmineRequestBuilder(String name, String action) {
- super(name, action);
+ public VersionScopeRedmineRequestBuilder(String name,RestMethod method, String... action) {
+ super(name, method,action);
}
@Override
1
0
r271 - trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request
by tchemit@users.nuiton.org 12 Jul '12
by tchemit@users.nuiton.org 12 Jul '12
12 Jul '12
Author: tchemit
Date: 2012-07-12 19:59:35 +0200 (Thu, 12 Jul 2012)
New Revision: 271
Url: http://nuiton.org/repositories/revision/jredmine/271
Log:
fix constructors
Modified:
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/DefaultRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
@@ -48,10 +48,6 @@
protected final String action;
- public DefaultRedmineRequestBuilder(String action) {
- this(action, action);
- }
-
public DefaultRedmineRequestBuilder(String name, String action) {
this.name = name;
this.action = action;
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/IssueScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
@@ -33,8 +33,8 @@
private static final long serialVersionUID = 1L;
- public IssueScopeRedmineRequestBuilder(String action) {
- super(action);
+ public IssueScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
}
@Override
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/ProjectScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
@@ -33,8 +33,8 @@
private static final long serialVersionUID = 1L;
- public ProjectScopeRedmineRequestBuilder(String action) {
- super(action);
+ public ProjectScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
}
@Override
Modified: trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java
===================================================================
--- trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 17:31:22 UTC (rev 270)
+++ trunk/jredmine-domain/src/main/java/org/nuiton/jredmine/request/VersionScopeRedmineRequestBuilder.java 2012-07-12 17:59:35 UTC (rev 271)
@@ -33,8 +33,8 @@
private static final long serialVersionUID = 1L;
- public VersionScopeRedmineRequestBuilder(String action) {
- super(action);
+ public VersionScopeRedmineRequestBuilder(String name, String action) {
+ super(name, action);
}
@Override
1
0