public class CloudwordsCustomerClient extends BaseCloudwordsClient implements CloudwordsCustomerAPI
apiVersion, baseUrlWithVersion, connectionTimeoutMillis, CW_FILE_PARAM, CW_SOURCE_PARAM, JSON_CONTENT_TYPE, maxTotalConnections, socketTimeoutMillis, UTF_8, ZIP_CONTENT_TYPE
Constructor and Description |
---|
CloudwordsCustomerClient(String baseAPIURL,
String version,
String authorizationToken)
Convenience constructor that provides default configuration.
|
CloudwordsCustomerClient(String baseAPIURL,
String version,
String authorizationToken,
org.apache.http.client.HttpClient client)
Creates a new client that takes a user-provided instance of HttpClient.
|
CloudwordsCustomerClient(String baseAPIURL,
String version,
String authorizationToken,
org.apache.http.HttpHost proxy,
org.apache.http.client.CredentialsProvider proxyCredentialsProvider)
Convenience constructor that provides default configuration.
|
CloudwordsCustomerClient(String baseAPIURL,
String version,
String authorizationToken,
int connectionTimeoutMillis,
int socketTimeoutMillis,
int maxTotalConnections)
Base constructor.
|
CloudwordsCustomerClient(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 |
---|---|
CustomerChangeOrder |
acceptChangeOrder(CustomerChangeOrder customerChangeOrder)
Updates the specified
CustomerChangeOrder by accepting the CustomerChangeOrderBid submitted by
the vendor. |
SourceDocument |
addSourceDocument(int projectId,
File file)
Add an individual source document.
|
void |
addSourceDocumentPreview(int projectId,
Integer sourceDocumentId,
File file)
Upload a new source document preview.
|
TranslatedDocument |
addTranslatedDocument(int projectId,
Language language,
Integer sourceId,
File file)
Upload a new translated document.
|
void |
addTranslatedDocumentPreview(int projectId,
Language language,
Integer translatedDocumentId,
File file)
Upload a new translated document preview.
|
CloudwordsLanguageFile |
approveTranslatedFile(int projectId,
Language language)
Approve the delivered
CloudwordsLanguageFile for the specified Cloudwords
Project and target Language . |
CustomerChangeOrder |
cancelChangeOrder(CustomerChangeOrder customerChangeOrder)
Updates the specified
CustomerChangeOrder by canceling the
CustomerChangeOrder . |
CustomerChangeOrder |
createChangeOrder(int projectId,
CustomerChangeOrder customerChangeOrder)
Creates a new Cloudwords
CustomerChangeOrder within a Project . |
Department |
createDepartment(Department department)
Create a
Department with the given name |
Project |
createProject(Project project)
Create a new Cloudwords
Project . |
ReviewerInstructions |
createReviewerInstructions(int projectId,
String languageCode,
ReviewerInstructions reviewerInstructions)
Add the specified
ReviewerInstructions . |
CustomerTask |
createTask(CustomerTask task)
|
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 |
deleteReviewerInstructions(int riId)
Delete the specified
ReviewerInstructions . |
void |
deleteSourceDocument(int projectId,
int documentId)
Delete a source document on a project.
|
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 |
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() |
List<User> |
getAvailableFollowers()
For accounts which do not have departments enabled, this returns a list of users available to follow projects.
|
List<User> |
getAvailableFollowers(Department department)
This retrieves a list of users who are available to follow projects in the specified
Department . |
List<User> |
getAvailableProjectOwners()
For accounts which do not have departments enabled, this returns a list of users which can be assoicated as a project owner
For accounts which do have departments enabled, this returns a list of users available as a project owner in the Unassigned department.
|
List<User> |
getAvailableProjectOwners(Department department)
This retrieves a list of users who are available to follow projects in the specified
Department . |
List<WorkflowTemplate> |
getAvailableWorkflowTemplates(int projectId)
Get the list of available workflow templates for the project.
|
CustomerBid |
getBid(int projectId,
int bidId)
Get the specified
CustomerBid for the specified Cloudwords Project . |
List<CustomerBid> |
getBids(int projectId)
Get the list of
CustomerBid s for the specified Cloudwords Project . |
CustomerChangeOrder |
getChangeOrder(int projectId,
int changeOrderId)
Gets the Cloudwords
CustomerChangeOrder associated with the unique Cloudwords CustomerChangeOrder
ID. |
CloudwordsFile |
getChangeOrderAttachment(int projectId,
int changeOrderId)
Gets the
CustomerChangeOrder attachment metadata, if it exists. |
CustomerChangeOrderBid |
getChangeOrderBid(int projectId,
int changeOrderId)
Gets the specified
CustomerChangeOrderBid submitted by the vendor for the specified Cloudwords
CustomerChangeOrder . |
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<CustomerChangeOrder> |
getChangeOrders(int projectId)
Gets all
CustomerChangeOrder s for a project. |
protected org.apache.http.client.HttpClient |
getClient() |
List<Project> |
getClosedProjects()
Get the list of closed
Project in Cloudwords. |
List<Project> |
getClosedProjects(Department department) |
BidRequest |
getCurrentBidRequestForProject(int projectId)
Get the current
BidRequest for the specified Project . |
CustomerTranslationRequest |
getCurrentTranslationRequestForProject(int projectId)
Get the current
TranslationRequest for the specified Project . |
User |
getCurrentUser()
Get the
User which matches the API token in use. |
List<Department> |
getDepartments()
Get all accessible
Department s by the user. |
List<IntendedUse> |
getIntendedUses()
Get the list of target
IntendedUse s currently configured in Cloudwords. |
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. |
List<Project> |
getOpenProjects(Department department) |
List<Vendor> |
getPreferredVendors()
Get the list of preferred
Vendor s currently configured in Cloudwords. |
List<Vendor> |
getPreferredVendors(Department department)
Get the list of preferred
Vendor s currently configured in Cloudwords. |
Project |
getProject(int projectId)
|
CloudwordsFile |
getProjectReference(int projectId,
int documentId)
Get the specified
Project reference material metadata. |
List<CloudwordsFile> |
getProjectReferences(int projectId)
|
PagedResponse<Project> |
getProjects(Department department,
PagedProjectQuery query)
Search for projects in a department and return them in a paged format.
|
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<CustomerTask> |
getProjectTask(int projectId)
Get all
Task s for a project. |
List<CustomerTask> |
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. |
ReviewerInstructions |
getReviewerInstructions(int riId)
Get the specified
ReviewerInstructions metadata. |
ReviewerInstructions |
getReviewerInstructions(int projectId,
String languageCode)
Get the specified
ReviewerInstructions metadata. |
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.
|
List<Language> |
getSourceLanguages()
Get the list of source
Language s currently configured in Cloudwords. |
List<Language> |
getTargetLanguages()
Get the list of target
Language s currently configured in Cloudwords. |
CustomerTask |
getTask(int projectId,
int taskId)
|
CloudwordsFile |
getTaskAttachment(int projectId,
int taskId)
Get the
Task attachment metadata, if it exists. |
List<CustomerTask> |
getTaskByStatus(CodeAndDisplay taskStatus)
Get all
Task s by status. |
List<CustomerTask> |
getTaskByStatus(CodeAndDisplay taskStatus,
Department department) |
List<CustomerTask> |
getTasks()
Get all
Task s available to the user. |
List<CustomerTask> |
getTasks(Department department) |
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.
|
List<User> |
getUsers()
Get a list of all
User s in all Department s the user is a member of. |
List<User> |
getUsers(Department department)
Get a list of
User s in the specified Department . |
Vendor |
getVendor(int vendorId)
Get the Cloudwords
Vendor by the unique Cloudwords vendor ID. |
Webhook |
getWebhook(Integer webhookId)
Get a specific Cloudwords
Webhook . |
List<Webhook> |
getWebhooks()
Gets all Cloudwords
Webhook s. |
WorkflowTemplate |
getWorkflowTemplate(int projectId,
int templateId)
Get a specific template that is available on a project by ID.
|
SourceDocument |
replaceSourceDocument(int projectId,
int documentId,
File file)
Replace the content of a source document that is already attached to the project.
|
TranslatedDocument |
replaceTranslatedDocument(int projectId,
Language language,
int documentId,
File file)
Replace a translated document.
|
BidRequest |
requestBidsForProject(int projectId,
List<Vendor> preferredVendors,
boolean doLetCloudwordsChoose,
boolean doAutoSelectBidFromVendor)
Request bids for the specified
Project . |
CustomerTranslationRequest |
requestTranslationRequestForProject(int projectId,
CustomerTranslationRequest transRequest)
Request translation request for the specified
Project . |
List<ProjectWorkflow> |
selectProjectWorkflow(int projectId,
int templateId)
Change the template workflow to use for a project.
|
BidRequest |
selectWinningBid(int projectId,
int bidId)
Select the winning
CustomerBid for the specified Cloudwords Project . |
CustomerTranslationRequest |
selectWinningTranslationRequest(int projectId,
int bidId)
Select the winning
CustomerBid for the specified Cloudwords Project . |
CustomerChangeOrder |
submitChangeOrder(CustomerChangeOrder customerChangeOrder)
Updates the specified
CustomerChangeOrder by submitting the
CustomerChangeOrder to the vendor. |
ChangeOrderProjectWorkflow |
updateChangeOrderProjectWorkflow(int projectId,
int changeOrderId,
ChangeOrderProjectWorkflow workflow)
Update a change order project workflow, this allows the phase due dates and assignees to be changed.
|
Project |
updateProject(Project project)
|
CloudwordsFile |
updateProjectReference(int projectId,
int documentId,
File zipFile)
|
ProjectWorkflow |
updateProjectWorkflow(int projectId,
ProjectWorkflow workflow)
Update a project workflow, this allows the phase due dates and assignees to be changed.
|
ReviewerInstructions |
updateReviewerInstructions(ReviewerInstructions reviewerInstructions)
Update the specified
ReviewerInstructions . |
CustomerTask |
updateTask(CustomerTask 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.
|
CloudwordsFile |
uploadChangeOrderFile(int projectId,
int changeOrderId,
File file)
Uploads the source material for a given Cloudwords
CustomerChangeOrder . |
CloudwordsFile |
uploadProjectReference(int projectId,
File zipFile)
Upload and add a new reference material for a given Cloudwords
Project . |
CloudwordsFile |
uploadProjectSource(int projectId,
File zipFile)
Upload the source material for a given Cloudwords
Project . |
CloudwordsFile |
uploadTaskAttachment(int projectId,
int taskId,
File file)
Upload a
Task attachment. |
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 CloudwordsCustomerClient(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 CloudwordsCustomerClient(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 CloudwordsCustomerClient(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 APIproxy
- The proxy server to use for connectionsproxyCredentialsProvider
- The credentials provider to use with the proxy serverpublic CloudwordsCustomerClient(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 CloudwordsCustomerClient(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 Project createProject(Project project) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
. Please refer to the API documentation for more
information.createProject
in interface CloudwordsCustomerAPI
project
- Project
to be createdProject
resourceCloudwordsClientException
public CloudwordsFile uploadProjectSource(int projectId, File zipFile) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
. 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 source material can be uploaded. If source material
for this Project
already exists, then this operation will overwrite the source
material associated with the Project
. Please refer to the API documentation for more
information.
uploadProjectSource
in interface CloudwordsCustomerAPI
projectId
- ID of Project
to upload source forzipFile
- A single zip file to be uploaded for this Project
CloudwordsFile
resourceCloudwordsClientException
public BidRequest requestBidsForProject(int projectId, List<Vendor> preferredVendors, boolean doLetCloudwordsChoose, boolean doAutoSelectBidFromVendor) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
. In order to request a bid for a
Project
, a source material must be already uploaded for the Project
, and the
Project
must be in a state where requesting bids is allowed.
Additionally, you must either specify the list of Cloudwords preferred Vendor
(s) to
request bids from or to allow Cloudwords to automatically find Vendor
s that best
match the Project
requirements, or both.
requestBidsForProject
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to request bids forpreferredVendors
- The list of Vendor
s to request bids fromdoLetCloudwordsChoose
- Allow Cloudwords to find Vendor
that best match the Project
doAutoSelectBidFromVendor
- Whether to automatically select the bid provided by the Vendor
for this
BidRequest
BidRequest
resourceCloudwordsClientException
public BidRequest getCurrentBidRequestForProject(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
BidRequest
for the specified Project
.getCurrentBidRequestForProject
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get the BidRequest
forBidRequest
resource for the Project
if bids have already been
requested for this Project
CloudwordsClientException
public List<CustomerBid> getBids(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerBid
s for the specified Cloudwords Project
.getBids
in interface CloudwordsCustomerAPI
CustomerBid
s for the specified Cloudwords Project
.CloudwordsClientException
public CustomerBid getBid(int projectId, int bidId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerBid
for the specified Cloudwords Project
.getBid
in interface CloudwordsCustomerAPI
CustomerBid
for the specified Cloudwords Project
.CloudwordsClientException
public BidRequest selectWinningBid(int projectId, int bidId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerBid
for the specified Cloudwords Project
.selectWinningBid
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to select a winning bid forbidId
- ID of the CustomerBid
that is being selectedBidRequest
resource for the Project
CloudwordsClientException
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 List<Vendor> getPreferredVendors() throws CloudwordsClientException
CloudwordsCustomerAPI
Vendor
s currently configured in Cloudwords.getPreferredVendors
in interface CloudwordsCustomerAPI
Vendor
resourcesCloudwordsClientException
public List<Vendor> getPreferredVendors(Department department) throws CloudwordsClientException
CloudwordsCustomerAPI
Vendor
s currently configured in Cloudwords. This method retrieves
vendors that are preferred by a specific department. This version should always be used in accounts
with more than 0 departments.getPreferredVendors
in interface CloudwordsCustomerAPI
department
- the department to get vendors forVendor
resourcesCloudwordsClientException
public List<Language> getSourceLanguages() throws CloudwordsClientException
CloudwordsCustomerAPI
Language
s currently configured in Cloudwords.getSourceLanguages
in interface CloudwordsCustomerAPI
Language
resourcesCloudwordsClientException
public List<Language> getTargetLanguages() throws CloudwordsClientException
CloudwordsCustomerAPI
Language
s currently configured in Cloudwords.getTargetLanguages
in interface CloudwordsCustomerAPI
Language
resourcesCloudwordsClientException
public List<IntendedUse> getIntendedUses() throws CloudwordsClientException
CloudwordsCustomerAPI
IntendedUse
s currently configured in Cloudwords.getIntendedUses
in interface CloudwordsCustomerAPI
IntendedUse
resourcesCloudwordsClientException
public Vendor getVendor(int vendorId) throws CloudwordsClientException
CloudwordsCustomerAPI
Vendor
by the unique Cloudwords vendor ID.getVendor
in interface CloudwordsCustomerAPI
vendorId
- ID of the to Vendor
returnVendor
CloudwordsClientException
public List<Project> getOpenProjects() throws CloudwordsClientException
BaseCloudwordsAPI
Project
in Cloudwords.getOpenProjects
in interface BaseCloudwordsAPI
Project
resourcesCloudwordsClientException
public List<Project> getOpenProjects(Department department) throws CloudwordsClientException
getOpenProjects
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<Project> getClosedProjects() throws CloudwordsClientException
BaseCloudwordsAPI
Project
in Cloudwords.getClosedProjects
in interface BaseCloudwordsAPI
Project
resourcesCloudwordsClientException
public List<Project> getClosedProjects(Department department) throws CloudwordsClientException
getClosedProjects
in interface CloudwordsCustomerAPI
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 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 CloudwordsFile uploadProjectReference(int projectId, File zipFile) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
. 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 reference material can be uploaded. Please refer to
the API documentation for more information.
uploadProjectReference
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to upload reference materials forzipFile
- A single zip file to be uploaded for this Project
CloudwordsFile
resourceCloudwordsClientException
public CloudwordsFile updateProjectReference(int projectId, int documentId, File zipFile) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
reference material for the specified Cloudwords
Project
and specific reference material. 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 reference material can be uploaded. Please refer to
the API documentation for more information.
updateProjectReference
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
whose reference materials are to be updateddocumentId
- ID of the specific reference material to updatezipFile
- A single zip file to be uploaded for this Project
CloudwordsFile
resourceCloudwordsClientException
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 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 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 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
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 CustomerTask getTask(int projectId, int taskId) throws CloudwordsClientException
CloudwordsCustomerAPI
getTask
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get Task
fortaskId
- ID of the Task
to returnTask
resourceCloudwordsClientException
public List<CustomerTask> getTasks() throws CloudwordsClientException
CloudwordsCustomerAPI
Task
s available to the user.getTasks
in interface CloudwordsCustomerAPI
Task
sCloudwordsClientException
public List<CustomerTask> getTasks(Department department) throws CloudwordsClientException
getTasks
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<CustomerTask> getTaskByStatus(CodeAndDisplay taskStatus) throws CloudwordsClientException
CloudwordsCustomerAPI
Task
s by status.getTaskByStatus
in interface CloudwordsCustomerAPI
taskStatus
- The Task
status to filter byTask
sCloudwordsClientException
public List<CustomerTask> getTaskByStatus(CodeAndDisplay taskStatus, Department department) throws CloudwordsClientException
getTaskByStatus
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<CustomerTask> getProjectTask(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
Task
s for a project.getProjectTask
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get Task
s forTask
sCloudwordsClientException
public List<CustomerTask> getProjectTaskByStatus(int projectId, CodeAndDisplay taskStatus) throws CloudwordsClientException
CloudwordsCustomerAPI
Task
s for a project by status.getProjectTaskByStatus
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get Task
s fortaskStatus
- The Task
status to filter byTask
sCloudwordsClientException
public CustomerTask createTask(CustomerTask task) throws CloudwordsClientException
CloudwordsCustomerAPI
createTask
in interface CloudwordsCustomerAPI
task
- Task
to createTask
CloudwordsClientException
public CustomerTask updateTask(CustomerTask task) throws CloudwordsClientException
CloudwordsCustomerAPI
updateTask
in interface CloudwordsCustomerAPI
task
- Task
to updateTask
CloudwordsClientException
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 CloudwordsFile uploadTaskAttachment(int projectId, int taskId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
Task
attachment. UPLOAD CAN ONLY BE DONE ONCE, once a Task
has an
attachment, it can not be changed.uploadTaskAttachment
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
for the associated tasktaskId
- ID of the Task
to upload againstCloudwordsClientException
public List<Department> getDepartments() throws CloudwordsClientException
CloudwordsCustomerAPI
Department
s by the user.getDepartments
in interface CloudwordsCustomerAPI
Department
sCloudwordsClientException
public Department createDepartment(Department department) throws CloudwordsClientException
CloudwordsCustomerAPI
Department
with the given namecreateDepartment
in interface CloudwordsCustomerAPI
CloudwordsClientException
public User getCurrentUser() throws CloudwordsClientException
CloudwordsCustomerAPI
User
which matches the API token in use.getCurrentUser
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<User> getUsers() throws CloudwordsClientException
CloudwordsCustomerAPI
User
s in all Department
s the user is a member of. If departments are not enabled,
all users are returned.getUsers
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<User> getUsers(Department department) throws CloudwordsClientException
CloudwordsCustomerAPI
User
s in the specified Department
.getUsers
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<User> getAvailableFollowers() throws CloudwordsClientException
CloudwordsCustomerAPI
getAvailableFollowers
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<User> getAvailableFollowers(Department department) throws CloudwordsClientException
CloudwordsCustomerAPI
Department
.getAvailableFollowers
in interface CloudwordsCustomerAPI
CloudwordsClientException
public ReviewerInstructions getReviewerInstructions(int projectId, String languageCode) throws CloudwordsClientException
CloudwordsCustomerAPI
ReviewerInstructions
metadata.getReviewerInstructions
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get ReviewerInstructions
forlanguageCode
- Language
code of the ReviewerInstructions
to returnReviewerInstructions
resourceCloudwordsClientException
public ReviewerInstructions getReviewerInstructions(int riId) throws CloudwordsClientException
CloudwordsCustomerAPI
ReviewerInstructions
metadata.getReviewerInstructions
in interface CloudwordsCustomerAPI
riId
- ID of the ReviewerInstructions
to getReviewerInstructions
resourceCloudwordsClientException
public ReviewerInstructions createReviewerInstructions(int projectId, String languageCode, ReviewerInstructions reviewerInstructions) throws CloudwordsClientException
CloudwordsCustomerAPI
ReviewerInstructions
.createReviewerInstructions
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to add ReviewerInstructions
forlanguageCode
- Language
code to add ReviewerInstructions
forreviewerInstructions
- ReviewerInstructions
to addReviewerInstructions
created resourceCloudwordsClientException
public ReviewerInstructions updateReviewerInstructions(ReviewerInstructions reviewerInstructions) throws CloudwordsClientException
CloudwordsCustomerAPI
ReviewerInstructions
.updateReviewerInstructions
in interface CloudwordsCustomerAPI
reviewerInstructions
- ReviewerInstructions
to updateReviewerInstructions
updated resourceCloudwordsClientException
public void deleteReviewerInstructions(int riId) throws CloudwordsClientException
CloudwordsCustomerAPI
ReviewerInstructions
.deleteReviewerInstructions
in interface CloudwordsCustomerAPI
riId
- ID of the ReviewerInstructions
to getCloudwordsClientException
public CustomerChangeOrder createChangeOrder(int projectId, CustomerChangeOrder customerChangeOrder) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
within a Project
. Please refer to the API
documentation for more information.createChangeOrder
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to add CustomerChangeOrder
forcustomerChangeOrder
- CustomerChangeOrder
to addCustomerChangeOrder
created resourceCloudwordsClientException
public CustomerChangeOrder getChangeOrder(int projectId, int changeOrderId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
associated with the unique Cloudwords CustomerChangeOrder
ID. Please refer to the API documentation for more information.getChangeOrder
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of the CustomerChangeOrder
to returnCustomerChangeOrder
resourceCloudwordsClientException
public List<CustomerChangeOrder> getChangeOrders(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
s for a project. Please refer to the API documentation for more information.getChangeOrders
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get CustomerChangeOrder
s forCustomerChangeOrder
sCloudwordsClientException
public CustomerChangeOrder cancelChangeOrder(CustomerChangeOrder customerChangeOrder) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
by canceling the
CustomerChangeOrder
. Please refer to the API documentation for more information.cancelChangeOrder
in interface CloudwordsCustomerAPI
customerChangeOrder
- CustomerChangeOrder
to updateCustomerChangeOrder
updated resourceCloudwordsClientException
public CustomerChangeOrder submitChangeOrder(CustomerChangeOrder customerChangeOrder) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
by submitting the
CustomerChangeOrder
to the vendor. Please refer to the API documentation for more information.submitChangeOrder
in interface CloudwordsCustomerAPI
customerChangeOrder
- CustomerChangeOrder
to updateCustomerChangeOrder
updated resourceCloudwordsClientException
public CustomerChangeOrder acceptChangeOrder(CustomerChangeOrder customerChangeOrder) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
by accepting the CustomerChangeOrderBid
submitted by
the vendor. The project state will be changed to include any new languages, and the document of the primary
project will have a new version using the files of the change order. Please refer to the API documentation for
more information.acceptChangeOrder
in interface CloudwordsCustomerAPI
customerChangeOrder
- CustomerChangeOrder
to updateCustomerChangeOrder
updated resourceCloudwordsClientException
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 CloudwordsFile uploadChangeOrderFile(int projectId, int changeOrderId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrder
.
Please note that this CustomerChangeOrder
must already exists in Cloudwords, and the
CustomerChangeOrder
must be in a state where source material can be uploaded. If source material for this
CustomerChangeOrder
already exists, then this operation will overwrite the source material associated
with the CustomerChangeOrder
. Please refer to the API documentation for more information.
uploadChangeOrderFile
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of CustomerChangeOrder
to upload source forfile
- A single file to be uploaded for this CustomerChangeOrder
CloudwordsFile
resource metadataCloudwordsClientException
public CustomerChangeOrderBid getChangeOrderBid(int projectId, int changeOrderId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerChangeOrderBid
submitted by the vendor for the specified Cloudwords
CustomerChangeOrder
. Please refer to the API documentation for more information.getChangeOrderBid
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of CustomerChangeOrder
to get the bid forCustomerChangeOrderBid
for the specified Cloudwords CustomerChangeOrder
.CloudwordsClientException
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 ProjectWorkflow updateProjectWorkflow(int projectId, ProjectWorkflow workflow) throws CloudwordsClientException
CloudwordsCustomerAPI
updateProjectWorkflow
in interface CloudwordsCustomerAPI
projectId
- The project ID that the workflow belongs toworkflow
- The workflow to updateCloudwordsClientException
public List<ProjectWorkflow> selectProjectWorkflow(int projectId, int templateId) throws CloudwordsClientException
CloudwordsCustomerAPI
selectProjectWorkflow
in interface CloudwordsCustomerAPI
projectId
- The ID of the projecttemplateId
- The ID of the template (derived from getAvailableWorkflowTemplates)CloudwordsClientException
public List<WorkflowTemplate> getAvailableWorkflowTemplates(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
getAvailableWorkflowTemplates
in interface CloudwordsCustomerAPI
projectId
- The ID of the projectCloudwordsClientException
public WorkflowTemplate getWorkflowTemplate(int projectId, int templateId) throws CloudwordsClientException
CloudwordsCustomerAPI
getWorkflowTemplate
in interface CloudwordsCustomerAPI
projectId
- the ID of the projecttemplateId
- The ID of the template to fetchCloudwordsClientException
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 ChangeOrderProjectWorkflow updateChangeOrderProjectWorkflow(int projectId, int changeOrderId, ChangeOrderProjectWorkflow workflow) throws CloudwordsClientException
CloudwordsCustomerAPI
updateChangeOrderProjectWorkflow
in interface CloudwordsCustomerAPI
projectId
- The ID of the projectchangeOrderId
- The ID of the change orderworkflow
- The workflow to updateCloudwordsClientException
public SourceDocument addSourceDocument(int projectId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
addSourceDocument
in interface CloudwordsCustomerAPI
projectId
- The ID of the projectfile
- The file to be translatedCloudwordsClientException
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 SourceDocument replaceSourceDocument(int projectId, int documentId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
replaceSourceDocument
in interface CloudwordsCustomerAPI
projectId
- The project IDdocumentId
- The document IDfile
- The new contentCloudwordsClientException
public void deleteSourceDocument(int projectId, int documentId) throws CloudwordsClientException
CloudwordsCustomerAPI
deleteSourceDocument
in interface CloudwordsCustomerAPI
CloudwordsClientException
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 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 void addTranslatedDocumentPreview(int projectId, Language language, Integer translatedDocumentId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
Upload a new translated document preview. The translated document ID should be derived from TranslatedDocument.getId()
.
addTranslatedDocumentPreview
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to upload the translated document preview forlanguage
- The specific Language
translatedDocumentId
- The ID of the translated documentfile
- The translation preview to upload. This should be a zip file containing a single html file and all referenced assets (images, css, js). All paths should be relative.CloudwordsClientException
public void addSourceDocumentPreview(int projectId, Integer sourceDocumentId, File file) throws CloudwordsClientException
CloudwordsCustomerAPI
Upload a new source document preview. The source document ID should be derived from SourceDocument.getId()
.
addSourceDocumentPreview
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to upload the translated document preview forsourceDocumentId
- The ID of the source documentfile
- The source preview to upload. This should be a zip file containing a single html file and all referenced assets (images, css, js). All paths should be relative.CloudwordsClientException
public List<User> getAvailableProjectOwners() throws CloudwordsClientException
CloudwordsCustomerAPI
getAvailableProjectOwners
in interface CloudwordsCustomerAPI
CloudwordsClientException
public List<User> getAvailableProjectOwners(Department department) throws CloudwordsClientException
CloudwordsCustomerAPI
Department
.getAvailableProjectOwners
in interface CloudwordsCustomerAPI
CloudwordsClientException
public CustomerTranslationRequest getCurrentTranslationRequestForProject(int projectId) throws CloudwordsClientException
CloudwordsCustomerAPI
TranslationRequest
for the specified Project
.getCurrentTranslationRequestForProject
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to get the TranslationRequest
forTranslationRequest
resource for the Project
if requests have already been
requested for this Project
CloudwordsClientException
public CustomerTranslationRequest requestTranslationRequestForProject(int projectId, CustomerTranslationRequest transRequest) throws CloudwordsClientException
CloudwordsCustomerAPI
Project
. In order to request a translation for a
Project
, a source material must be already uploaded for the Project
, and the
Project
must be in a state where requesting bids is allowed. A translation request must be
sent to a preferred Vendor
configured to recieve bidless translation requests.
Please refer to the API documentation for more information.requestTranslationRequestForProject
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to request translation fortransRequest
- A CustomerTranslationRequest
s to sendCloudwordsClientException
public CustomerTranslationRequest selectWinningTranslationRequest(int projectId, int bidId) throws CloudwordsClientException
CloudwordsCustomerAPI
CustomerBid
for the specified Cloudwords Project
.selectWinningTranslationRequest
in interface CloudwordsCustomerAPI
projectId
- ID of the Project
to select a winning bid forbidId
- ID of the CustomerBid
that is being selectedCustomerTranslationRequest
resource for the Project
CloudwordsClientException
public PagedResponse<Project> getProjects(PagedProjectQuery query) throws CloudwordsClientException
BaseCloudwordsAPI
getProjects
in interface BaseCloudwordsAPI
CloudwordsClientException
public PagedResponse<Project> getProjects(Department department, PagedProjectQuery query) throws CloudwordsClientException
CloudwordsCustomerAPI
getProjects
in interface CloudwordsCustomerAPI
CloudwordsClientException
Copyright © 2016. All rights reserved.