This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define endpoint for project-version locales.
I chose to stick with "Iteration" when naming the classes, to keep it consistent with the existing names. I do think we should change the names, but doing it piecemeal will just lead to confusion and will likely lead to a worse developer experience for an extended time compared with just sticking with the old terminology.
- Loading branch information
1 parent
b54c336
commit 0e8d1ef
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...a-common-api/src/main/java/org/zanata/rest/enunciate/ProjectIterationLocalesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2015, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This 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 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software 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 | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.zanata.rest.enunciate; | ||
|
||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Path(ProjectIterationLocalesResource.SERVICE_PATH) | ||
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) | ||
interface ProjectIterationLocalesResource extends | ||
org.zanata.rest.service.ProjectIterationLocalesResource { | ||
} |
55 changes: 55 additions & 0 deletions
55
zanata-common-api/src/main/java/org/zanata/rest/service/ProjectIterationLocalesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2015, Red Hat, Inc. and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This 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 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software 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 | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.zanata.rest.service; | ||
|
||
import org.codehaus.enunciate.jaxrs.TypeHint; | ||
import org.zanata.rest.MediaTypes; | ||
import org.zanata.rest.dto.LocaleDetails; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) | ||
public interface ProjectIterationLocalesResource { | ||
public static final String SERVICE_PATH = ProjectIterationResource.SERVICE_PATH | ||
+ "/locales"; | ||
|
||
/** | ||
* Returns list of active locales for a single project-version. | ||
* | ||
* This may be the list of locales inherited from the project. | ||
* | ||
* @return | ||
* OK 200 containing the list of LocaleDetails | ||
* NOT FOUND 404 if the project-version does not exist | ||
*/ | ||
@GET | ||
// workaround for enunciate, see note in org.zanata.rest.service.ProjectResource | ||
@TypeHint(LocaleDetails[].class) | ||
@Produces({ MediaTypes.APPLICATION_ZANATA_PROJECT_LOCALES_XML, | ||
MediaTypes.APPLICATION_ZANATA_PROJECT_LOCALES_JSON, | ||
MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) | ||
public Response get(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters