public interface BaseCloudwordsAPI
Modifier and Type | Method and Description |
---|---|
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 |
downloadFileFromMetadata(CloudwordsFile metadata)
Convenience method to download the binary content of a
CloudwordsFile as an
InputStream , provided that the contentPath inside the metadata is valid. |
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 . |
CloudwordsFile |
getChangeOrderAttachment(int projectId,
int changeOrderId)
Gets the
CustomerChangeOrder attachment metadata, if it exists. |
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<Project> |
getClosedProjects()
Deprecated.
|
CloudwordsFile |
getMasterProjectTranslatedFile(int projectId)
Get the current master
Project translation file metadata, including a contentPath for
downloading the actual binary file. |
List<Project> |
getOpenProjects()
Deprecated.
|
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(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 . |
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
getSourceDocuments(int) . |
List<SourceDocument> |
getSourceDocuments(int projectId)
Get the list of source documents currently attached to the project.
|
CloudwordsFile |
getTaskAttachment(int projectId,
int taskId)
Get the
Task attachment metadata, if it exists. |
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. |
TranslatedDocument |
replaceTranslatedDocument(int projectId,
Language language,
int documentId,
File file)
Replace a translated document.
|
Project |
updateProject(Project project)
|
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.
|
Project getProject(int projectId) throws CloudwordsClientException
projectId
- ID of the Project
to returnProject
resourceCloudwordsClientException
List<SourceDocument> getSourceDocuments(int projectId) throws CloudwordsClientException
projectId
- The ID of the projectCloudwordsClientException
SourceDocument getSourceDocument(int projectId, int documentId) throws CloudwordsClientException
getSourceDocuments(int)
.projectId
- The ID of the projectdocumentId
- The ID of the source documentCloudwordsClientException
InputStream downloadSourceDocumentFile(int projectId, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
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()
.projectId
- The ID of the projectdocumentId
- The ID of the documentCloudwordsClientException
IllegalStateException
IOException
InputStream downloadSourceDocumentXLIFF(int projectId, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
SourceDocument.getXliff()
.projectId
- The ID of the projectdocumentId
- The ID of the documentCloudwordsClientException
IllegalStateException
IOException
CloudwordsFile getProjectSource(int projectId) throws CloudwordsClientException
Project
's source material CloudwordsFile
resource for the specified
Cloudwords . The metadata will contain a contentPath for downloading the actual binary file.projectId
- ID of the Project
to return source materials forProject
source CloudwordsFile
resourceCloudwordsClientException
InputStream downloadSourceFile(int projectId) throws CloudwordsClientException
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.
projectId
- ID of Project
to download source forInputStream
if source file exists, null otherwiseCloudwordsClientException
List<CloudwordsFile> getProjectReferences(int projectId) throws CloudwordsClientException
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.projectId
- ID of the Project
to return reference materials forProject
reference material CloudwordsFile
resourcesCloudwordsClientException
CloudwordsFile getProjectReference(int projectId, int documentId) throws CloudwordsClientException
Project
reference material metadata. The metadata will contain a
contentPath for downloading the actual binary file.projectId
- ID of the Project
to get reference material fordocumentId
- ID of the specific reference material to returnCloudwordsFile
resourceCloudwordsClientException
InputStream downloadReferenceFile(int projectId, int documentId) throws CloudwordsClientException
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.
projectId
- ID of the Project
to download reference material fordocumentId
- ID of the specific reference material to downloadInputStream
if reference file exists, null otherwiseCloudwordsClientException
CloudwordsFile getMasterProjectTranslatedFile(int projectId) throws CloudwordsClientException
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
getProjectTranslatedFile(int, Language)
.projectId
- ID of the Project
to get the master file forCloudwordsFile
resourceCloudwordsClientException
List<CloudwordsLanguageFile> getProjectTranslatedFiles(int projectId) throws CloudwordsClientException
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.projectId
- ID of the Project
to get the translated files forProject
CloudwordsLanguageFile
resourcesCloudwordsClientException
CloudwordsLanguageFile getProjectTranslatedFile(int projectId, Language language) throws CloudwordsClientException
Project
file metadata for the specified Cloudwords
Project
and target Language
. The returned metadata will contain a contentPath
for downloading the actual binary files.projectId
- ID of the Project
to get the translated file forlanguage
- The specific languageProject
file for the specified Language
CloudwordsClientException
InputStream downloadMasterTranslatedFile(int projectId) throws CloudwordsClientException
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 downloadTranslatedFile(int, Language)
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
projectId
- ID of the Project
to download the master translated file forInputStream
if reference file exists, null otherwiseCloudwordsClientException
InputStream downloadTranslatedFile(int projectId, Language language) throws CloudwordsClientException
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.
projectId
- ID of the Project
to get the translated file forlanguage
- The specific Language
InputStream
if reference file exists, null otherwiseCloudwordsClientException
List<TranslatedDocument> getTranslatedDocuments(int projectId, Language language) throws CloudwordsClientException
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
CloudwordsClientException
TranslatedDocument getTranslatedDocument(int projectId, Language language, int documentId) throws CloudwordsClientException
getTranslatedDocuments(int, Language)
.projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
documentId
- The ID of the translated document to fetchCloudwordsClientException
TranslatedDocument updateTranslatedDocument(int projectId, Language language, TranslatedDocument document) throws CloudwordsClientException
projectId
- ID of the Project
to get the translated documents forlanguage
- The specific Language
document
- The document metadataCloudwordsClientException
List<TranslatedDocument> updateTranslatedDocuments(int projectId, Language language, List<TranslatedDocument> documents) throws CloudwordsClientException
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.projectId
- ID of the Project
to update the translated documents forlanguage
- The specific Language
documents
- The translated documentsCloudwordsClientException
TranslatedDocument addTranslatedDocument(int projectId, Language language, Integer sourceId, File file) throws CloudwordsClientException
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 getSourceDocuments(int)
).
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
TranslatedDocument replaceTranslatedDocument(int projectId, Language language, int documentId, File file) throws CloudwordsClientException
projectId
- The ID of the projectlanguage
- The language of the translated documentdocumentId
- The translated document IDfile
- The new translationCloudwordsClientException
InputStream downloadTranslatedDocumentFile(int projectId, Language language, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
TranslatedDocument.getFile()
.projectId
- The project IDlanguage
- The language of the translated documentdocumentId
- The ID of the translated documentCloudwordsClientException
IllegalStateException
IOException
InputStream downloadTranslatedDocumentXLIFF(int projectId, Language language, int documentId) throws CloudwordsClientException, IllegalStateException, IOException
TranslatedDocument.getXliff()
.projectId
- The project IDlanguage
- The language of the translated documentdocumentId
- The ID of the translated documentCloudwordsClientException
IllegalStateException
IOException
CloudwordsFile getProjectTranslationMemory(int projectId) throws CloudwordsClientException
Project
's translation memory CloudwordsFile
resource for the specified
Cloudwords. The metadata will contain a contentPath for downloading the actual binary file.projectId
- ID of the Project
to return translation memory forProject
translation memory CloudwordsFile
resourceCloudwordsClientException
InputStream downloadProjectTranslationMemory(int projectId) throws CloudwordsClientException
InputStream
, provided that such translated memory exists for the
Project
.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
projectId
- ID of the Project
to download the project translation memory file forInputStream
if translation memory file exists, null otherwiseCloudwordsClientException
CloudwordsLanguageFile approveTranslatedFile(int projectId, Language language) throws CloudwordsClientException
CloudwordsLanguageFile
for the specified Cloudwords
Project
and target Language
.projectId
- ID of the Project
to get the translated file forlanguage
- The specific languageProject
file for the specified Language
CloudwordsClientException
InputStream downloadFileFromMetadata(CloudwordsFile metadata) throws IllegalStateException, CloudwordsClientException, IOException
CloudwordsFile
as an
InputStream
, provided that the contentPath inside the metadata is valid.
NOTE: clients utilizing this method must handle the closing of InputStream
after use.
metadata
- The specific file to download content forInputStream
if the file exists, null otherwiseCloudwordsClientException
IllegalStateException
IOException
List<Project> getOpenProjects() throws CloudwordsClientException
getProjects(PagedProjectQuery)
Project
in Cloudwords.Project
resourcesCloudwordsClientException
List<Project> getClosedProjects() throws CloudwordsClientException
getProjects(PagedProjectQuery)
Project
in Cloudwords.Project
resourcesCloudwordsClientException
Project updateProject(Project project) throws CloudwordsClientException
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.project
- The Project
to updateProject
resourceseCloudwordsClientException
CloudwordsFile getTaskAttachment(int projectId, int taskId) throws CloudwordsClientException
Task
attachment metadata, if it exists.projectId
- ID of the Project
for the associated tasktaskId
- ID of the Task
to return an attachment metatdata forCloudwordsClientException
InputStream downloadTaskAttachment(int projectId, int taskId) throws CloudwordsClientException
Task
attachment, if it exists.taskId
- ID of the Task
to return an attachment forInputStream
if the file exists, null otherwiseCloudwordsClientException
CloudwordsFile getChangeOrderAttachment(int projectId, int changeOrderId) throws CloudwordsClientException
CustomerChangeOrder
attachment metadata, if it exists. Please refer to the API documentation for
more information.projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of the CustomerChangeOrder
to return an attachment metatdata forCloudwordsClientException
InputStream downloadChangeOrderFile(int projectId, int changeOrderId) throws CloudwordsClientException
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.
projectId
- ID of the Project
of the associated CustomerChangeOrder
changeOrderId
- ID of CustomerChangeOrder
to download source forInputStream
if source file exists, null otherwiseCloudwordsClientException
List<ProjectWorkflow> getProjectWorkflows(int projectId) throws CloudwordsClientException
ProjectWorkflow
s of the specified project. Workflows fetched through this method will have a
null value for ProjectWorkflowPhase.getPossibleAssignees()
projectId
- ID of the Project
to fetch workflows forCloudwordsClientException
ProjectWorkflow getProjectWorkflow(int projectId, String languageCode) throws CloudwordsClientException
projectId
- The ID of the project to get a workflow forlanguageCode
- The code of the target language to find a workflow forCloudwordsClientException
List<ChangeOrderProjectWorkflow> getChangeOrderProjectWorkflows(int projectId, int changeOrderId) throws CloudwordsClientException
ProjectWorkflowPhase.getPossibleAssignees()
projectId
- The ID of the projectchangeOrderId
- The ID of the change orderCloudwordsClientException
ChangeOrderProjectWorkflow getChangeOrderProjectWorkflow(int projectId, int changeOrderId, String languageCode) throws CloudwordsClientException
projectId
- The ID of the projectchangeOrderId
- The ID of the change orderlanguageCode
- The code of the language to fetch the workflow forCloudwordsClientException
Webhook createWebhook(String eventType, String uri, String entityType, Integer entityId, String contextType, String contextId) throws CloudwordsClientException
Webhook
. Please refer to the API
documentation for more information.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
Webhook createWebhook(String eventType, String uri, Project project) throws CloudwordsClientException
Webhook
. Please refer to the API
documentation for more information.eventType
- The eventType of the webhookuri
- The uri of the webhookproject
- The project for the webhookWebhook
created resourceCloudwordsClientException
Webhook createWebhook(String eventType, String uri, Project project, Language language) throws CloudwordsClientException
Webhook
. Please refer to the API
documentation for more information.eventType
- The eventType of the webhookuri
- The uri of the webhookproject
- The project for the webhooklanguage
- The language for the webhookWebhook
created resourceCloudwordsClientException
Webhook getWebhook(Integer webhookId) throws CloudwordsClientException
Webhook
. Please refer to the API
documentation for more information.webhookId
- ID of the Webhook
to retrieveWebhook
specified resourceCloudwordsClientException
void deleteWebhook(Integer webhookId) throws CloudwordsClientException
Webhook
. Please refer to the API
documentation for more information.webhookId
- ID of the Webhook
to deleteCloudwordsClientException
List<Webhook> getWebhooks() throws CloudwordsClientException
Webhook
s. Please refer to the API
documentation for more information.Webhook
sCloudwordsClientException
PagedResponse<Project> getProjects(PagedProjectQuery query) throws CloudwordsClientException
CloudwordsClientException
Copyright © 2016. All rights reserved.