diff --git a/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java b/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java index 96f2fb4f30..d2f660793a 100644 --- a/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java +++ b/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java @@ -23,4 +23,9 @@ public interface ContentServiceSoapPort extends java.rmi.Remote { * Clears content from the repository. */ public org.alfresco.repo.webservice.content.Content[] clear(org.alfresco.repo.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.repo.webservice.content.ContentFault; + + /** + * Transforms content from one mimetype to another. + */ + public org.alfresco.repo.webservice.content.Content transform(org.alfresco.repo.webservice.types.Reference source, java.lang.String property, org.alfresco.repo.webservice.types.Reference destinationReference, java.lang.String destinationProperty, org.alfresco.repo.webservice.types.ContentFormat destinationFormat) throws java.rmi.RemoteException, org.alfresco.repo.webservice.content.ContentFault; } diff --git a/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd b/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd index 3a83b0edda..4dc373ee9b 100644 --- a/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd +++ b/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd @@ -37,7 +37,15 @@ - + + + + + + + + + callback = new RetryingTransactionCallback() + { + public Content execute() throws Throwable + { + // Get the nodes and property qname's + NodeRef sourceNodeRef = Utils.convertToNodeRef(source, ContentWebService.this.nodeService, ContentWebService.this.searchService, ContentWebService.this.namespaceService); + NodeRef destinationNodeRef = Utils.convertToNodeRef(destinationReference, ContentWebService.this.nodeService, ContentWebService.this.searchService, ContentWebService.this.namespaceService); + QName sourceQName = QName.createQName(property); + QName destinationQName = QName.createQName(destinationProperty); + + // Get the content reader + ContentReader contentReader = ContentWebService.this.contentService.getReader(sourceNodeRef, sourceQName); + if (contentReader == null) + { + throw new AlfrescoRuntimeException("Source content does not exist. Transform could not take place."); + } + + // Get the content writer + ContentWriter contentWriter = ContentWebService.this.contentService.getWriter(destinationNodeRef, destinationQName, true); + contentWriter.setEncoding(destinationFormat.getEncoding()); + contentWriter.setMimetype(destinationFormat.getMimetype()); + + // Transform the content + ContentWebService.this.contentService.transform(contentReader, contentWriter); + + // Return the content object to the user + return createContent(destinationNodeRef, destinationProperty); + } + }; + return Utils.getRetryingTransactionHelper(MessageContext.getCurrentContext()).doInTransaction(callback); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + throw new ContentFault(0, e.getMessage()); + } + + } } diff --git a/source/web/WEB-INF/server-config.wsdd b/source/web/WEB-INF/server-config.wsdd index cc178f82cf..a4ffdc0a1f 100644 --- a/source/web/WEB-INF/server-config.wsdd +++ b/source/web/WEB-INF/server-config.wsdd @@ -903,7 +903,15 @@ - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + @@ -122,6 +142,14 @@ + + + + + + + + @@ -144,6 +172,12 @@ + + + Transforms content from one mimetype to another. + + + @@ -186,7 +220,20 @@ - + + + Transforms content from one mimetype to another. + + + + + + + + + + +