Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz1110627 - add REST endpoint for project config
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Aug 7, 2014
1 parent 35815bd commit 13992d6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -31,9 +31,9 @@
<gwteventservice.version>1.2.1</gwteventservice.version>
<okapi.version>0.22</okapi.version>

<zanata.api.version>3.3.1</zanata.api.version>
<zanata.api.version>3.4.0-SNAPSHOT</zanata.api.version>
<!-- This should always be the previous version of the used api version above (but only 3.0.1 or later will work) -->
<zanata.api.compat.version>3.3.0</zanata.api.compat.version>
<zanata.api.compat.version>3.3.1</zanata.api.compat.version>
<zanata.client.version>3.3.1</zanata.client.version>
<zanata.common.version>3.3.0</zanata.common.version>

Expand Down
Expand Up @@ -50,6 +50,7 @@
import org.zanata.model.HProject;
import org.zanata.model.HProjectIteration;
import org.zanata.rest.dto.ProjectIteration;
import org.zanata.service.ConfigurationService;

import com.google.common.base.Objects;

Expand Down Expand Up @@ -95,6 +96,9 @@ public class ProjectIterationService implements ProjectIterationResource {
@In
Identity identity;

@In
private ConfigurationService configurationServiceImpl;

@SuppressWarnings("null")
@Nonnull
public String getProjectSlug() {
Expand Down Expand Up @@ -134,6 +138,9 @@ public Response get() {
HProjectIteration hProjectIteration =
projectIterationDAO.getBySlug(getProjectSlug(),
getIterationSlug());
if (hProjectIteration == null) {
return Response.status(Status.NOT_FOUND).build();
}

ProjectIteration it = new ProjectIteration();
transfer(hProjectIteration, it);
Expand Down Expand Up @@ -310,4 +317,15 @@ public static void transfer(HProjectIteration from, ProjectIteration to) {
}
}

@Override
public Response sampleConfiguration() {
HProjectIteration iteration =
projectIterationDAO.getBySlug(projectSlug, iterationSlug);
if (iteration == null) {
return Response.status(Status.NOT_FOUND).build();
}
String generalConfig = configurationServiceImpl
.getGeneralConfig(projectSlug, iterationSlug);
return Response.ok().entity(generalConfig).build();
}
}

0 comments on commit 13992d6

Please sign in to comment.