@Path(value="/projects/p/{projectSlug:[a-zA-Z0-9]+([a-zA-Z0-9_\\-{.}]*[a-zA-Z0-9]+)?}/iterations/i/{iterationSlug:[a-zA-Z0-9]+([a-zA-Z0-9_\\-{.}]*[a-zA-Z0-9]+)?}/r") public class MockSourceDocResource extends Object implements SourceDocResource
RESOURCE_NAME_REGEX, RESOURCE_SLUG_REGEX, RESOURCE_SLUG_TEMPLATE, SERVICE_PATH
Constructor and Description |
---|
MockSourceDocResource() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
deleteResource(String idNoSlash)
Delete a source Document.
|
javax.ws.rs.core.Response |
get(Set<String> extensions)
Retrieve the List of Documents (Resources) belonging to a Project
iteration.
|
javax.ws.rs.core.Response |
getResource(String idNoSlash,
Set<String> extensions)
Retrieves information for a source Document.
|
javax.ws.rs.core.Response |
getResourceMeta(String idNoSlash,
Set<String> extensions)
Retrieves meta-data information for a source Document.
|
javax.ws.rs.core.Response |
head()
Returns header information for a Project's iteration source strings.
|
javax.ws.rs.core.Response |
post(Resource resource,
Set<String> extensions,
boolean copyTrans)
Creates a new source Document.
|
javax.ws.rs.core.Response |
putResource(String idNoSlash,
Resource resource,
Set<String> extensions,
boolean copyTrans)
Creates or modifies a source Document.
|
javax.ws.rs.core.Response |
putResourceMeta(String idNoSlash,
ResourceMeta resourceMeta,
Set<String> extensions)
Modifies an existing source document's meta-data.
|
public javax.ws.rs.core.Response head()
SourceDocResource
head
in interface SourceDocResource
public javax.ws.rs.core.Response get(Set<String> extensions)
SourceDocResource
get
in interface SourceDocResource
extensions
- The document extensions to fetch along with the documents
(e.g. "gettext", "comment"). This parameter allows multiple
values e.g. "ext=gettext&ext=comment".public javax.ws.rs.core.Response post(Resource resource, Set<String> extensions, @DefaultValue(value="true") boolean copyTrans)
SourceDocResource
post
in interface SourceDocResource
resource
- The document information.extensions
- The document extensions to save with the new document (e.g.
"gettext", "comment"). This parameter allows multiple values
e.g. "ext=gettext&ext=comment".copyTrans
- Boolean value that indicates whether reasonably close
translations from other projects should be found to initially
populate this document's translations.public javax.ws.rs.core.Response getResource(String idNoSlash, Set<String> extensions)
SourceDocResource
getResource
in interface SourceDocResource
idNoSlash
- The document identifier. Some document ids could have forward
slashes ('/') in them which would cause conflicts with the
browser's own url interpreter. For this reason, the supplied
id must have all its '/' characters replaced with commas
(',').extensions
- The document extensions to fetch along with the document (e.g.
"gettext", "comment"). This parameter allows multiple values
e.g. "ext=gettext&ext=comment".public javax.ws.rs.core.Response putResource(String idNoSlash, Resource resource, Set<String> extensions, @DefaultValue(value="true") boolean copyTrans)
SourceDocResource
putResource
in interface SourceDocResource
idNoSlash
- The document identifier. Some document ids could have forward
slashes ('/') in them which would cause conflicts with the
browser's own url interpreter. For this reason, the supplied
id must have all its '/' characters replaced with commas
(',').resource
- The document information.extensions
- The document extensions to save with the document (e.g.
"gettext", "comment"). This parameter allows multiple values
e.g. "ext=gettext&ext=comment".copyTrans
- Boolean value that indicates whether reasonably close
translations from other projects should be found to initially
populate this document's translations.public javax.ws.rs.core.Response deleteResource(String idNoSlash)
SourceDocResource
deleteResource
in interface SourceDocResource
idNoSlash
- The document identifier. Some document ids could have forward
slashes ('/') in them which would cause conflicts with the
browser's own url interpreter. For this reason, the supplied
id must have all its '/' characters replaced with commas
(',').public javax.ws.rs.core.Response getResourceMeta(String idNoSlash, Set<String> extensions)
SourceDocResource
getResourceMeta
in interface SourceDocResource
idNoSlash
- The document identifier. Some document ids could have forward
slashes ('/') in them which would cause conflicts with the
browser's own url interpreter. For this reason, the supplied
id must have all its '/' characters replaced with commas
(',').extensions
- The document extensions to retrieve with the document's
meta-data (e.g. "gettext", "comment"). This parameter allows
multiple values e.g. "ext=gettext&ext=comment".public javax.ws.rs.core.Response putResourceMeta(String idNoSlash, ResourceMeta resourceMeta, Set<String> extensions)
SourceDocResource
putResourceMeta
in interface SourceDocResource
idNoSlash
- The document identifier. Some document ids could have forward
slashes ('/') in them which would cause conflicts with the
browser's own url interpreter. For this reason, the supplied
id must have all its '/' characters replaced with commas
(',').resourceMeta
- The document's meta-data.extensions
- The document extensions to save with the document (e.g.
"gettext", "comment"). This parameter allows multiple values
e.g. "ext=gettext&ext=comment".Copyright © 2017 Zanata Project. All rights reserved.