public class CloudwordsVendorClient extends BaseCloudwordsClient implements CloudwordsVendorAPI
apiVersion, baseUrlWithVersion, connectionTimeoutMillis, CW_FILE_PARAM, CW_SOURCE_PARAM, JSON_CONTENT_TYPE, maxTotalConnections, socketTimeoutMillis, UTF_8, ZIP_CONTENT_TYPE
Constructor and Description |
---|
CloudwordsVendorClient(String baseAPIURL,
String version,
String authorizationToken)
Convenience constructor that provides default configuration.
|
CloudwordsVendorClient(String baseAPIURL,
String version,
String authorizationToken,
org.apache.http.client.HttpClient client)
Creates a new client that takes a user-provided instance of HttpClient.
|
CloudwordsVendorClient(String baseAPIURL,
String version,
String authorizationToken,
org.apache.http.HttpHost proxy,
org.apache.http.client.CredentialsProvider proxyCredentialsProvider)
Convenience constructor that provides default configuration.
|
CloudwordsVendorClient(String baseAPIURL,
String version,
String authorizationToken,
int connectionTimeoutMillis,
int socketTimeoutMillis,
int maxTotalConnections)
Base constructor.
|
CloudwordsVendorClient(String baseAPIURL,
String version,
String authorizationToken,
int connectionTimeoutMillis,
int socketTimeoutMillis,
int maxTotalConnections,
org.apache.http.HttpHost proxy,
org.apache.http.client.CredentialsProvider proxyCredentialsProvider)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
VendorBid |
acceptBid(int projectId)
|
ChangeOrder |
acceptChangeOrder(ChangeOrder changeOrder)
Updates the specified
ChangeOrder by accepting the ChangeOrder . |
VendorTranslationRequest |
acceptTranslationRequest(int projectId,
VendorTranslationRequest transRequest)
Updates the specified
VendorTranslationRequest by accepting the VendorTranslationRequest . |
TranslatedDocument |
addTranslatedDocument(int projectId,
Language language,
Integer sourceId,
File file)
Upload a new translated document.
|
CloudwordsLanguageFile |
approveTranslatedFile(int projectId,
Language language)
Approve the delivered
CloudwordsLanguageFile for the specified Cloudwords
Project and target Language . |
Webhook |
createWebhook(String eventType,
String uri,
Project project)
Creates a new Cloudwords
Webhook . |
Webhook |
createWebhook(String eventType,
String uri,
Project project,
Language language)
Creates a new Cloudwords
Webhook . |
Webhook |
createWebhook(String eventType,
String uri,
String entityType,
Integer entityId,
String contextType,
String contextId)
Creates a new Cloudwords
Webhook . |
void |
deleteWebhook(Integer webhookId)
Deletes an existing Cloudwords
Webhook . |
InputStream |
downloadChangeOrderFile(int projectId,
int changeOrderId)
Downloads the source material binary for the specified
CustomerChangeOrder as an InputStream ,
provided that a source material exists for the CustomerChangeOrder . |
InputStream |
downloadCustomerTMFile(int projectId)
Download the customer TM binary for the specified
Project as an
InputStream . |
InputStream |
downloadMasterTranslatedFile(int projectId)
Download the current master translated material binary for the specified Cloudwords project
as an
InputStream , provided that such translated material exists for the
Project . |
InputStream |
downloadProjectTranslationMemory(int projectId)
Download the current project translation memory for the specified Cloudwords project
as an
InputStream , provided that such translated memory exists for the
Project . |
InputStream |
downloadReferenceFile(int projectId,
int documentId)
Download the specified
Project reference material binary as an InputStream ,
provided that such reference material exists for the Project . |
InputStream |
downloadSourceDocumentFile(int projectId,
int documentId)
Download the content of a source document.
|
InputStream |
downloadSourceDocumentXLIFF(int projectId,
int documentId)
Download the XLIFF of a source document.
|
InputStream |
downloadSourceFile(int projectId)
Download the source material binary for the specified
Project as an
InputStream , provided that a source material exists for the Project . |
InputStream |
downloadTaskAttachment(int projectId,
int taskId)
Download the
Task attachment, if it exists. |
InputStream |
downloadTranslatedDocumentFile(int projectId,
Language language,
int documentId)
Downloads the file made available via
TranslatedDocument.getFile() . |
InputStream |
downloadTranslatedDocumentXLIFF(int projectId,
Language language,
int documentId)
Downloads the file made available via
TranslatedDocument.getXliff() . |
InputStream |
downloadTranslatedFile(int projectId,
Language language)
Download the specified translated material binary for the specified Cloudwords
Project and target Language as an InputStream , provided that such
translated material exists for the Project . |
protected String |
getAuthToken() |
VendorBid |
getBid(int projectId)
|
ChangeOrder |
getChangeOrder(int projectId,
int changeOrderId)
Gets the
ChangeOrder associated with the unique ChangeOrder ID. |
CloudwordsFile |
getChangeOrderAttachment(int projectId,
int changeOrderId)
Gets the
CustomerChangeOrder attachment metadata, if it exists. |
ChangeOrderBid |
getChangeOrderBid(int projectId,
int changeOrderId)
Gets the specified
ChangeOrderBid for the specified Cloudwords ChangeOrder . |
ChangeOrderProjectWorkflow |
getChangeOrderProjectWorkflow(int projectId,
int changeOrderId,
String languageCode)
Get a specific change order project workflow.
|
List<ChangeOrderProjectWorkflow> |
getChangeOrderProjectWorkflows(int projectId,
int changeOrderId)
Get the workflows for a change order.
|
List<ChangeOrder> |
getChangeOrders(int projectId)
Gets all
ChangeOrder s for a project. |
protected org.apache.http.client.HttpClient |
getClient() |
List<Project> |
getClosedProjects()
Get the list of closed
Project in Cloudwords. |
VendorTranslationRequest |
getCurrentTranslationRequestForProject(int projectId)
Get the current
VendorTranslationRequest for the specified Project . |
protected com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
CloudwordsFile |
getMasterProjectTranslatedFile(int projectId)
Get the current master
Project translation file metadata, including a contentPath for
downloading the actual binary file. |
List<Project> |
getOpenProjects()
Get the list of open
Project in Cloudwords. |
Project |
getProject(int projectId)
|
CloudwordsFile |
getProjectCustomerTM(int projectId)
Get the
Project 's customer TM data CloudwordsFile resource for the specified
Cloudwords . |
CloudwordsFile |
getProjectReference(int projectId,
int documentId)
Get the specified
Project reference material metadata. |
List<CloudwordsFile> |
getProjectReferences(int projectId)
|
PagedResponse<Project> |
getProjects(PagedProjectQuery query)
Search for projects and return them in a paged format.
|
CloudwordsFile |
getProjectSource(int projectId)
Get the
Project 's source material CloudwordsFile resource for the specified
Cloudwords . |
List<Task> |
getProjectTask(int projectId)
Get all
Task s for a project. |
List<Task> |
getProjectTaskByStatus(int projectId,
CodeAndDisplay taskStatus)
Get all
Task s for a project by status. |
CloudwordsLanguageFile |
getProjectTranslatedFile(int projectId,
Language language)
|
List<CloudwordsLanguageFile> |
getProjectTranslatedFiles(int projectId)
|
CloudwordsFile |
getProjectTranslationMemory(int projectId)
Get the
Project 's translation memory CloudwordsFile resource for the specified
Cloudwords. |
ProjectWorkflow |
getProjectWorkflow(int projectId,
String languageCode)
Get a specific project workflow.
|
List<ProjectWorkflow> |
getProjectWorkflows(int projectId)
Get the
ProjectWorkflow s of the specified project. |
SourceDocument |
getSourceDocument(int projectId,
int documentId)
Get an individual member of the list returned by
BaseCloudwordsAPI.getSourceDocuments(int) . |
List<SourceDocument> |
getSourceDocuments(int projectId)
Get the list of source documents currently attached to the project.
|
Task |
getTask(int projectId,
int taskId)
|
CloudwordsFile |
getTaskAttachment(int projectId,
int taskId)
Get the
Task attachment metadata, if it exists. |
List<Task> |
getTaskByStatus(CodeAndDisplay taskStatus)
Get all
Task s by status. |
List<Task> |
getTasks()
Get all
Task s available to the user. |
TranslatedDocument |
getTranslatedDocument(int projectId,
Language language,
int documentId)
Get the metadata for an individual translated document.
|
List<TranslatedDocument> |
getTranslatedDocuments(int projectId,
Language language)
Get the list of individual translated documents for a given language.
|
Webhook |
getWebhook(Integer webhookId)
Get a specific Cloudwords
Webhook . |
List<Webhook> |
getWebhooks()
Gets all Cloudwords
Webhook s. |
void |
rejectBid(int projectId)
|
ChangeOrder |
rejectChangeOrder(ChangeOrder changeOrder)
Updates the specified
ChangeOrder by rejecting the ChangeOrder . |
VendorTranslationRequest |
rejectTranslationRequest(int projectId,
VendorTranslationRequest transRequest)
Updates the specified
VendorTranslationRequest by rejecting the VendorTranslationRequest . |
TranslatedDocument |
replaceTranslatedDocument(int projectId,
Language language,
int documentId,
File file)
Replace a translated document.
|
VendorBid |
submitBid(int projectId,
VendorBid bid)
|
ChangeOrder |
submitChangeOrder(ChangeOrder changeOrder)
Updates the specified
ChangeOrder by submitting the ChangeOrder . |
VendorTranslationRequest |
submitTranslationRequest(int projectId,
VendorTranslationRequest transRequest)
Submit a
VendorTranslationRequest for the specified Cloudwords Project . |
ChangeOrderBid |
updateChangeOrderBid(int projectId,
int changeOrderId,
ChangeOrderBid changeOrderBid)
Updates the specified
ChangeOrderBid for the ChangeOrder before submitting. |
Project |
updateProject(Project project)
|
Task |
updateTask(Task task)
|
TranslatedDocument |
updateTranslatedDocument(int projectId,
Language language,
TranslatedDocument document)
Update the metadata of a translated document.
|
List<TranslatedDocument> |
updateTranslatedDocuments(int projectId,
Language language,
List<TranslatedDocument> documents)
Update the metadata for multiple translated documents simultaneously.
|
CloudwordsLanguageFile |
uploadProjectTranslatedFile(int projectId,
Language language,
File zipFile)
|
CloudwordsFile |
uploadProjectTranslationMemory(int projectId,
File zipFile)
Upload the translated memory for a given Cloudwords
Project . |
addZipEntry, buildQuery, delete, downloadFileFromMetadata, executeRequest, executeRequest, executeRequest, executeRequest, get, get, getFilename, getList, initObjectMapper, isErrorCodeMatched, isRequestSuccessful, postFile, postFile, put, putFile, putFile, putList, setBasicHeaders, streamFileFromPath, validateZipFile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
downloadFileFromMetadata
public CloudwordsVendorClient(String baseAPIURL, String version, String authorizationToken)
baseAPIURL
- The base domain of the Cloudwords APIversion
- The version of the Cloudwords API to useauthorizationToken
- The authorization token to validate identify when accessing the Cloudwords APIpublic CloudwordsVendorClient(String baseAPIURL, String version, String authorizationToken, org.apache.http.HttpHost proxy, org.apache.http.client.CredentialsProvider proxyCredentialsProvider)
baseAPIURL
- The base domain of the Cloudwords APIversion
- The version of the Cloudwords API to useauthorizationToken
- The authorization token to validate identify when accessing the Cloudwords APIproxy
- The proxy server to use for connectionsproxyCredentialsProvider
- The credentials provider to use with the proxy serverpublic CloudwordsVendorClient(String baseAPIURL, String version, String authorizationToken, int connectionTimeoutMillis, int socketTimeoutMillis, int maxTotalConnections, org.apache.http.HttpHost proxy, org.apache.http.client.CredentialsProvider proxyCredentialsProvider)
baseAPIURL
- The base domain of the Cloudwords APIversion
- The version of the Cloudwords API to useauthorizationToken
- The authorization token to validate identify when accessing the Cloudwords APIconnectionTimeoutMillis
- Determines the timeout in milliseconds until a connection is established. A
timeout value of zero is interpreted as an infinite timeout.socketTimeoutMillis
- Defines the socket timeout (SO_TIMEOUT
) in milliseconds, which is the
timeout for waiting for data or, put differently, a maximum period inactivity
between two consecutive data packets). A timeout value of zero is interpreted as
an infinite timeout.maxTotalConnections
- The max concurrent connections the client can establish against the Cloudwords APIpublic CloudwordsVendorClient(String baseAPIURL, String version, String authorizationToken, org.apache.http.client.HttpClient client)
HttpClientBuilder.create() .setDefaultSocketConfig(SocketConfig.custom().setSoTimeout(socketTimeoutMillis).build()) .setDefaultRequestConfig(RequestConfig.custom().setConnectTimeout(connectionTimeoutMillis).setSocketTimeout(socketTimeoutMillis).build()) .setMaxConnTotal(maxTotalConnections).build();
baseAPIURL
- The base domain of the Cloudwords APIversion
- The version of the Cloudwords API to useauthorizationToken
- The authorization token to validate identify when accessing the Cloudwords APIclient
- The HTTP Client instance to usepublic CloudwordsVendorClient(String baseAPIURL, String version, String authorizationToken, int connectionTimeoutMillis, int socketTimeoutMillis, int maxTotalConnections)
baseAPIURL
- The base domain of the Cloudwords APIversion
- The version of the Cloudwords API to useauthorizationToken
- The authorization token to validate identify when accessing the Cloudwords APIconnectionTimeoutMillis
- Determines the timeout in milliseconds until a connection is established. A
timeout value of zero is interpreted as an infinite timeout.socketTimeoutMillis
- Defines the socket timeout (SO_TIMEOUT
) in milliseconds, which is the
timeout for waiting for data or, put differently, a maximum period inactivity
between two consecutive data packets). A timeout value of zero is interpreted as
an infinite timeout.maxTotalConnections
- The max concurrent connections the client can establish against the Cloudwords APIpublic Project getProject(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
getProject
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to returnProject
resourceCloudwordsClientException
public CloudwordsFile getProjectSource(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
's source material CloudwordsFile
resource for the specified
Cloudwords . The metadata will contain a contentPath for downloading the actual binary file.getProjectSource
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to return source materials forProject
source CloudwordsFile
resourceCloudwordsClientException
public InputStream downloadSourceFile(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
as an
InputStream
, provided that a source material exists for the Project
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadSourceFile
in interface BaseCloudwordsAPI
projectId
- ID of Project
to download source forInputStream
if source file exists, null otherwiseCloudwordsClientException
public CloudwordsFile getProjectCustomerTM(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
Project
's customer TM data CloudwordsFile
resource for the specified
Cloudwords . The metadata will contain a contentPath for downloading the actual binary file.getProjectCustomerTM
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to returnTM data forProject
source CloudwordsFile
resourceCloudwordsClientException
public InputStream downloadCustomerTMFile(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
Project
as an
InputStream
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadCustomerTMFile
in interface CloudwordsVendorAPI
projectId
- ID of Project
to download TM forInputStream
if source file exists, null otherwiseCloudwordsClientException
public List<CloudwordsFile> getProjectReferences(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
reference material metadata for the specified Cloudwords
Project
. Each item in the returned list will contain a contentPath for downloading
the respective binary file.getProjectReferences
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to return reference materials forProject
reference material CloudwordsFile
resourcesCloudwordsClientException
public CloudwordsFile getProjectReference(int projectId, int documentId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
reference material metadata. The metadata will contain a
contentPath for downloading the actual binary file.getProjectReference
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get reference material fordocumentId
- ID of the specific reference material to returnCloudwordsFile
resourceCloudwordsClientException
public InputStream downloadReferenceFile(int projectId, int documentId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
reference material binary as an InputStream
,
provided that such reference material exists for the Project
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadReferenceFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to download reference material fordocumentId
- ID of the specific reference material to downloadInputStream
if reference file exists, null otherwiseCloudwordsClientException
public CloudwordsLanguageFile uploadProjectTranslatedFile(int projectId, Language language, File zipFile) throws CloudwordsClientException
CloudwordsVendorAPI
Project
Language
deliverable. The provided
file must be a zip file.
Please note that this Project
must already exists in Cloudwords, and the
Project
must be in a state where translated file can be uploaded for the specified Language
.
Please refer to the API documentation for more information.
uploadProjectTranslatedFile
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to upload reference materials forlanguage
- The Project
Language
deliverable to upload this file forzipFile
- A single zip file to be uploaded for this Project
CloudwordsFile
resourceCloudwordsClientException
public CloudwordsFile getMasterProjectTranslatedFile(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
translation file metadata, including a contentPath for
downloading the actual binary file. The master Project
translation file contains all
of the current Project
language(s) translations in one bundled zip. To get an
individual Language
translation file's metadata, use
BaseCloudwordsAPI.getProjectTranslatedFile(int, Language)
.getMasterProjectTranslatedFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the master file forCloudwordsFile
resourceCloudwordsClientException
public List<CloudwordsLanguageFile> getProjectTranslatedFiles(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
Language
translation files' metadata for the
specified Cloudwords Project
. Each metadata representation in the list will be
specific to a Project
target Language
and contain a contentPath for
downloading the respective binary file.getProjectTranslatedFiles
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated files forProject
CloudwordsLanguageFile
resourcesCloudwordsClientException
public CloudwordsLanguageFile getProjectTranslatedFile(int projectId, Language language) throws CloudwordsClientException
BaseCloudwordsAPI
Project
file metadata for the specified Cloudwords
Project
and target Language
. The returned metadata will contain a contentPath
for downloading the actual binary files.getProjectTranslatedFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated file forlanguage
- The specific languageProject
file for the specified Language
CloudwordsClientException
public InputStream downloadMasterTranslatedFile(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
InputStream
, provided that such translated material exists for the
Project
. The master Project
translation file contains all of the current
Project
language(s) translation in one bundled zip. To download an individual
Language
translation file, use BaseCloudwordsAPI.downloadTranslatedFile(int, Language)
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadMasterTranslatedFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to download the master translated file forInputStream
if reference file exists, null otherwiseCloudwordsClientException
public InputStream downloadTranslatedFile(int projectId, Language language) throws CloudwordsClientException
BaseCloudwordsAPI
Project
and target Language
as an InputStream
, provided that such
translated material exists for the Project
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadTranslatedFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated file forlanguage
- The specific Language
InputStream
if reference file exists, null otherwiseCloudwordsClientException
public CloudwordsFile uploadProjectTranslationMemory(int projectId, File zipFile) throws CloudwordsClientException
CloudwordsVendorAPI
Project
. The provided
file must be a zip file and it must contain a valid TMX file for the given Project
.
Please note that this Project
must already exists in Cloudwords, and the
Project
must be in a state where translated memory can be uploaded.
Please refer to the API documentation for more information.
uploadProjectTranslationMemory
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to upload reference materials forzipFile
- A single zip file to be uploaded for this Project
CloudwordsFile
resourceCloudwordsClientException
public CloudwordsFile getProjectTranslationMemory(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
Project
's translation memory CloudwordsFile
resource for the specified
Cloudwords. The metadata will contain a contentPath for downloading the actual binary file.getProjectTranslationMemory
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to return translation memory forProject
translation memory CloudwordsFile
resourceCloudwordsClientException
public InputStream downloadProjectTranslationMemory(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
InputStream
, provided that such translated memory exists for the
Project
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadProjectTranslationMemory
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to download the project translation memory file forInputStream
if translation memory file exists, null otherwiseCloudwordsClientException
public List<Project> getOpenProjects() throws CloudwordsClientException
BaseCloudwordsAPI
Project
in Cloudwords.getOpenProjects
in interface BaseCloudwordsAPI
Project
resourcesCloudwordsClientException
public List<Project> getClosedProjects() throws CloudwordsClientException
BaseCloudwordsAPI
Project
in Cloudwords.getClosedProjects
in interface BaseCloudwordsAPI
Project
resourcesCloudwordsClientException
protected org.apache.http.client.HttpClient getClient()
getClient
in class BaseCloudwordsClient
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
getMapper
in class BaseCloudwordsClient
protected String getAuthToken()
getAuthToken
in class BaseCloudwordsClient
public Task getTask(int projectId, int taskId) throws CloudwordsClientException
CloudwordsVendorAPI
getTask
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to get Task
fortaskId
- ID of the Task
to returnTask
resourceCloudwordsClientException
public List<Task> getTasks() throws CloudwordsClientException
CloudwordsVendorAPI
Task
s available to the user.getTasks
in interface CloudwordsVendorAPI
Task
sCloudwordsClientException
public List<Task> getTaskByStatus(CodeAndDisplay taskStatus) throws CloudwordsClientException
CloudwordsVendorAPI
Task
s by status.getTaskByStatus
in interface CloudwordsVendorAPI
taskStatus
- The Task
status to filter byTask
sCloudwordsClientException
public List<Task> getProjectTask(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
Task
s for a project.getProjectTask
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to get Task
s forTask
sCloudwordsClientException
public List<Task> getProjectTaskByStatus(int projectId, CodeAndDisplay taskStatus) throws CloudwordsClientException
CloudwordsVendorAPI
Task
s for a project by status.getProjectTaskByStatus
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to get Task
s fortaskStatus
- The Task
status to filter byTask
sCloudwordsClientException
public Task updateTask(Task task) throws CloudwordsClientException
CloudwordsVendorAPI
updateTask
in interface CloudwordsVendorAPI
task
- Task
to updateTask
CloudwordsClientException
public Project updateProject(Project project) throws CloudwordsClientException
BaseCloudwordsAPI
Project
specified in the input Project
id with the content
represented by the input. Please note that there are various restrictions as to what and when
a Project
can be updated in Cloudwords. Please refer to API documentation for more
detail.updateProject
in interface BaseCloudwordsAPI
project
- The Project
to updateProject
resourceseCloudwordsClientException
public CloudwordsFile getTaskAttachment(int projectId, int taskId) throws CloudwordsClientException
BaseCloudwordsAPI
Task
attachment metadata, if it exists.getTaskAttachment
in interface BaseCloudwordsAPI
projectId
- ID of the Project
for the associated tasktaskId
- ID of the Task
to return an attachment metatdata forCloudwordsClientException
public InputStream downloadTaskAttachment(int projectId, int taskId) throws CloudwordsClientException
BaseCloudwordsAPI
Task
attachment, if it exists.downloadTaskAttachment
in interface BaseCloudwordsAPI
taskId
- ID of the Task
to return an attachment forInputStream
if the file exists, null otherwiseCloudwordsClientException
public VendorBid getBid(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
getBid
in interface CloudwordsVendorAPI
Vendor
provided VendorBid
for the specified Cloudwords Project
.CloudwordsClientException
public VendorBid acceptBid(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
acceptBid
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to accept the bid forVendorBid
CloudwordsClientException
public void rejectBid(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
rejectBid
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to reject the bid forCloudwordsClientException
public VendorBid submitBid(int projectId, VendorBid bid) throws CloudwordsClientException
CloudwordsVendorAPI
submitBid
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to submit the bid forbid
- The bid to submitVendorBid
CloudwordsClientException
public ChangeOrder getChangeOrder(int projectId, int changeOrderId) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrder
associated with the unique ChangeOrder
ID. Please refer
to the API documentation for more information.getChangeOrder
in interface CloudwordsVendorAPI
projectId
- ID of the Project
of the associated ChangeOrder
changeOrderId
- ID of the ChangeOrder
to returnChangeOrder
resourceCloudwordsClientException
public List<ChangeOrder> getChangeOrders(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrder
s for a project. Please refer to the API documentation for more information.getChangeOrders
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to get ChangeOrder
s forChangeOrder
sCloudwordsClientException
public CloudwordsFile getChangeOrderAttachment(int projectId, int changeOrderId) throws CloudwordsClientException
BaseCloudwordsAPI
CustomerChangeOrder
attachment metadata, if it exists. Please refer to the API documentation for
more information.getChangeOrderAttachment
in interface BaseCloudwordsAPI
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of the CustomerChangeOrder
to return an attachment metatdata forCloudwordsClientException
public InputStream downloadChangeOrderFile(int projectId, int changeOrderId) throws CloudwordsClientException
BaseCloudwordsAPI
CustomerChangeOrder
as an InputStream
,
provided that a source material exists for the CustomerChangeOrder
. Please refer to the API documentation
for more information.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
downloadChangeOrderFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of CustomerChangeOrder
to download source forInputStream
if source file exists, null otherwiseCloudwordsClientException
public ChangeOrderBid getChangeOrderBid(int projectId, int changeOrderId) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrderBid
for the specified Cloudwords ChangeOrder
. Please refer to the
API documentation for more information.getChangeOrderBid
in interface CloudwordsVendorAPI
projectId
- ID of the Project
of the associated ChangeOrder
changeOrderId
- ID of ChangeOrder
to get the bid forChangeOrderBid
for the specified Cloudwords ChangeOrder
.CloudwordsClientException
public ChangeOrderBid updateChangeOrderBid(int projectId, int changeOrderId, ChangeOrderBid changeOrderBid) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrderBid
for the ChangeOrder
before submitting. The bid won't be
submitted until you submit the ChangeOrder
. You can update the update the ChangeOrderBid
as many
times as you want before doing the final ChangeOrder
. Please refer to the API documentation for more
information.updateChangeOrderBid
in interface CloudwordsVendorAPI
projectId
- ID of the Project
of the associated ChangeOrder
changeOrderId
- ID of ChangeOrder
of the associated ChangeOrderBid
changeOrderBid
- ChangeOrderBid
to to be updatedChangeOrderBid
for the specified Cloudwords ChangeOrder
.CloudwordsClientException
public ChangeOrder acceptChangeOrder(ChangeOrder changeOrder) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrder
by accepting the ChangeOrder
. Accepting the ChangeOrder
doesn't submit any ChangeOrderBid
to the customer. Please refer to the API documentation for more
information.acceptChangeOrder
in interface CloudwordsVendorAPI
changeOrder
- ChangeOrder
to updateChangeOrder
updated resourceCloudwordsClientException
public ChangeOrder rejectChangeOrder(ChangeOrder changeOrder) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrder
by rejecting the ChangeOrder
. Once you reject a
ChangeOrder
, you can no longer view/submit any existing/new ChangeOrderBid
to the customer.
Please refer to the API documentation for more information.rejectChangeOrder
in interface CloudwordsVendorAPI
changeOrder
- ChangeOrder
to updateChangeOrder
updated resourceCloudwordsClientException
public ChangeOrder submitChangeOrder(ChangeOrder changeOrder) throws CloudwordsClientException
CloudwordsVendorAPI
ChangeOrder
by submitting the ChangeOrder
. This action shall cause the
ChangeOrderBid
associated with the ChangeOrder
to be submitted to the customer. Please refer to
the API documentation for more information.submitChangeOrder
in interface CloudwordsVendorAPI
changeOrder
- ChangeOrder
to updateChangeOrder
updated resourceCloudwordsClientException
public List<ProjectWorkflow> getProjectWorkflows(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
ProjectWorkflow
s of the specified project. Workflows fetched through this method will have a
null value for ProjectWorkflowPhase.getPossibleAssignees()
getProjectWorkflows
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to fetch workflows forCloudwordsClientException
public ProjectWorkflow getProjectWorkflow(int projectId, String languageCode) throws CloudwordsClientException
BaseCloudwordsAPI
getProjectWorkflow
in interface BaseCloudwordsAPI
projectId
- The ID of the project to get a workflow forlanguageCode
- The code of the target language to find a workflow forCloudwordsClientException
public List<ChangeOrderProjectWorkflow> getChangeOrderProjectWorkflows(int projectId, int changeOrderId) throws CloudwordsClientException
BaseCloudwordsAPI
ProjectWorkflowPhase.getPossibleAssignees()
getChangeOrderProjectWorkflows
in interface BaseCloudwordsAPI
projectId
- The ID of the projectchangeOrderId
- The ID of the change orderCloudwordsClientException
public ChangeOrderProjectWorkflow getChangeOrderProjectWorkflow(int projectId, int changeOrderId, String languageCode) throws CloudwordsClientException
BaseCloudwordsAPI
getChangeOrderProjectWorkflow
in interface BaseCloudwordsAPI
projectId
- The ID of the projectchangeOrderId
- The ID of the change orderlanguageCode
- The code of the language to fetch the workflow forCloudwordsClientException
public List<SourceDocument> getSourceDocuments(int projectId) throws CloudwordsClientException
BaseCloudwordsAPI
getSourceDocuments
in interface BaseCloudwordsAPI
projectId
- The ID of the projectCloudwordsClientException
public SourceDocument getSourceDocument(int projectId, int documentId) throws CloudwordsClientException
BaseCloudwordsAPI
BaseCloudwordsAPI.getSourceDocuments(int)
.getSourceDocument
in interface BaseCloudwordsAPI
projectId
- The ID of the projectdocumentId
- The ID of the source documentCloudwordsClientException
public InputStream downloadSourceDocumentFile(int projectId, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
BaseCloudwordsAPI
BaseCloudwordsAPI.downloadSourceDocumentXLIFF(int, int)
instead. In some cases, Cloudwords may extract XLIFF from other types of files, in which case this method will return
the original content, and the XLIFF method will return the extracted XLIFF. The metadata for the file returned by this method
is available via SourceDocument.getFile()
.downloadSourceDocumentFile
in interface BaseCloudwordsAPI
projectId
- The ID of the projectdocumentId
- The ID of the documentCloudwordsClientException
IllegalStateException
IOException
public InputStream downloadSourceDocumentXLIFF(int projectId, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
BaseCloudwordsAPI
SourceDocument.getXliff()
.downloadSourceDocumentXLIFF
in interface BaseCloudwordsAPI
projectId
- The ID of the projectdocumentId
- The ID of the documentCloudwordsClientException
IllegalStateException
IOException
public List<TranslatedDocument> getTranslatedDocuments(int projectId, Language language) throws CloudwordsClientException
BaseCloudwordsAPI
getTranslatedDocuments
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
CloudwordsClientException
public TranslatedDocument getTranslatedDocument(int projectId, Language language, int documentId) throws CloudwordsClientException
BaseCloudwordsAPI
BaseCloudwordsAPI.getTranslatedDocuments(int, Language)
.getTranslatedDocument
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
documentId
- The ID of the translated document to fetchCloudwordsClientException
public TranslatedDocument updateTranslatedDocument(int projectId, Language language, TranslatedDocument document) throws CloudwordsClientException
BaseCloudwordsAPI
updateTranslatedDocument
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
document
- The document metadataCloudwordsClientException
public TranslatedDocument addTranslatedDocument(int projectId, Language language, Integer sourceId, File file) throws CloudwordsClientException
BaseCloudwordsAPI
Upload a new translated document. In almost all cases, sourceId should be specified. However, certain projects may
have additional deliverables that are not the translation for a source document. In those cases, it is expected sourceId
will be null. The source ID should be derived from SourceDocument.getId()
(SourceDocument is obtained by calling BaseCloudwordsAPI.getSourceDocuments(int)
).
addTranslatedDocument
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
sourceId
- The ID of the source documentfile
- The translation to uploadCloudwordsClientException
public TranslatedDocument replaceTranslatedDocument(int projectId, Language language, int documentId, File file) throws CloudwordsClientException
BaseCloudwordsAPI
replaceTranslatedDocument
in interface BaseCloudwordsAPI
projectId
- The ID of the projectlanguage
- The language of the translated documentdocumentId
- The translated document IDfile
- The new translationCloudwordsClientException
public InputStream downloadTranslatedDocumentFile(int projectId, Language language, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
BaseCloudwordsAPI
TranslatedDocument.getFile()
.downloadTranslatedDocumentFile
in interface BaseCloudwordsAPI
projectId
- The project IDlanguage
- The language of the translated documentdocumentId
- The ID of the translated documentCloudwordsClientException
IllegalStateException
IOException
public InputStream downloadTranslatedDocumentXLIFF(int projectId, Language language, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
BaseCloudwordsAPI
TranslatedDocument.getXliff()
.downloadTranslatedDocumentXLIFF
in interface BaseCloudwordsAPI
projectId
- The project IDlanguage
- The language of the translated documentdocumentId
- The ID of the translated documentCloudwordsClientException
IllegalStateException
IOException
public CloudwordsLanguageFile approveTranslatedFile(int projectId, Language language) throws CloudwordsClientException
BaseCloudwordsAPI
CloudwordsLanguageFile
for the specified Cloudwords
Project
and target Language
.approveTranslatedFile
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to get the translated file forlanguage
- The specific languageProject
file for the specified Language
CloudwordsClientException
public List<TranslatedDocument> updateTranslatedDocuments(int projectId, Language language, List<TranslatedDocument> documents) throws CloudwordsClientException
BaseCloudwordsAPI
BaseCloudwordsAPI.updateTranslatedDocument(int, Language, TranslatedDocument)
.
Only documents with a status different from the server-side status will be affected. It is not required that all translated documents on the server be included.updateTranslatedDocuments
in interface BaseCloudwordsAPI
projectId
- ID of the Project
to update the translated documents forlanguage
- The specific Language
documents
- The translated documentsCloudwordsClientException
public Webhook createWebhook(String eventType, String uri, Project project) throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
. Please refer to the API
documentation for more information.createWebhook
in interface BaseCloudwordsAPI
eventType
- The eventType of the webhookuri
- The uri of the webhookproject
- The project for the webhookWebhook
created resourceCloudwordsClientException
public Webhook createWebhook(String eventType, String uri, Project project, Language language) throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
. Please refer to the API
documentation for more information.createWebhook
in interface BaseCloudwordsAPI
eventType
- The eventType of the webhookuri
- The uri of the webhookproject
- The project for the webhooklanguage
- The language for the webhookWebhook
created resourceCloudwordsClientException
public Webhook createWebhook(String eventType, String uri, String entityType, Integer entityId, String contextType, String contextId) throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
. Please refer to the API
documentation for more information.createWebhook
in interface BaseCloudwordsAPI
eventType
- The eventType of the webhookuri
- The uri of the webhookentityType
- The entity type of the supplied entityIdentityId
- The entity ID for the webhookcontextType
- The context type of the supplied contextIdcontextId
- The context ID for the webhook.Webhook
created resourceCloudwordsClientException
public Webhook getWebhook(Integer webhookId) throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
. Please refer to the API
documentation for more information.getWebhook
in interface BaseCloudwordsAPI
webhookId
- ID of the Webhook
to retrieveWebhook
specified resourceCloudwordsClientException
public void deleteWebhook(Integer webhookId) throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
. Please refer to the API
documentation for more information.deleteWebhook
in interface BaseCloudwordsAPI
webhookId
- ID of the Webhook
to deleteCloudwordsClientException
public List<Webhook> getWebhooks() throws CloudwordsClientException
BaseCloudwordsAPI
Webhook
s. Please refer to the API
documentation for more information.getWebhooks
in interface BaseCloudwordsAPI
Webhook
sCloudwordsClientException
public VendorTranslationRequest getCurrentTranslationRequestForProject(int projectId) throws CloudwordsClientException
CloudwordsVendorAPI
VendorTranslationRequest
for the specified Project
.getCurrentTranslationRequestForProject
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to get the VendorTranslationRequest
forVendorTranslationRequest
resource for the Project
if requests have already been
requested for this Project
CloudwordsClientException
public VendorTranslationRequest acceptTranslationRequest(int projectId, VendorTranslationRequest transRequest) throws CloudwordsClientException
CloudwordsVendorAPI
VendorTranslationRequest
by accepting the VendorTranslationRequest
.
Please refer to the API documentation for more information.acceptTranslationRequest
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to request translation fortransRequest
- A VendorTranslationRequest
s to acceptCloudwordsClientException
public VendorTranslationRequest rejectTranslationRequest(int projectId, VendorTranslationRequest transRequest) throws CloudwordsClientException
CloudwordsVendorAPI
VendorTranslationRequest
by rejecting the VendorTranslationRequest
.
Please refer to the API documentation for more information.rejectTranslationRequest
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to request translation fortransRequest
- A VendorTranslationRequest
s to rejectCloudwordsClientException
public VendorTranslationRequest submitTranslationRequest(int projectId, VendorTranslationRequest transRequest) throws CloudwordsClientException
CloudwordsVendorAPI
VendorTranslationRequest
for the specified Cloudwords Project
.submitTranslationRequest
in interface CloudwordsVendorAPI
projectId
- ID of the Project
to submit the bid fortransRequest
- A VendorTranslationRequest
s containing the bid to submitVendorTranslationRequest
CloudwordsClientException
public PagedResponse<Project> getProjects(PagedProjectQuery query) throws CloudwordsClientException
BaseCloudwordsAPI
getProjects
in interface BaseCloudwordsAPI
CloudwordsClientException
Copyright © 2016. All rights reserved.