Hi,
We want to import/create document using existing custom TBO and SBO code from Advanced Extensibility in Documentum REST
Hi William Zhou
Please advice how to call custom SBO code for import document in Rest API
When you specify your TBO type (i.e. ct_biz_card) in REST new document request, the TBO & SBO will be auto triggered by the server.
{
"properties": {"r_object_type":"ct_biz_card", "object_name": "Sample Business Card"}
}
One exception we found so far is the content download. If your TBO/SBO has customized the content binary output. The TBO content download won't be triggered by the out-of-the-box REST content media resource. This is because Documentum REST uses DFC streaming API to get contents, but a TBO isn't allowed to customize the streaming API.
At any time, if you want to have full control of the service behavior, you can implement a custom document resource to override the default.
Thanks William.
I'm looking into other way to get content and properties into multipart controller class from there I will call SBO (internally we are triggering TBO code.. etc)
So, how to call multipart controller class from along with properties and file content from JSON or Java client.
Hi William,
I have written Java client to send multi-part data and content to muilti-part controller class and getting the below error.
http-nio-8080-exec-4] WARN com.emc.documentum.res
t.error.RestErrorBuilder - LogId: fcb5f8e7-5ce5-4c3e-9bad-ed6761a1bb8e, Status:
415, code: E_UNSUPPORTED_MEDIA_TYPE, message: The specified media type multipar
t/form-data;boundary=QpxzbkijJQT4bBH-m-VDnuMUTADS64SKb4jb8F;charset=UTF-8 is not
supported. Supported media types: [application/vnd.emc.documentum+json, applica
tion/vnd.emc.documentum+xml].
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multip
art/form-data;boundary=QpxzbkijJQT4bBH-m-VDnuMUTADS64SKb4jb8F;charset=UTF-8' not
supported
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessage
ConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConvert
Please advice how to resolve this issue.
Thanks,
Sai
Hi , please see my comment at .
When your resource controller accepts a ContentfulObject or DocumentObject (which extends from ContentfulObject) as @RequestBody, the resource will be able to handle the multipart request. You can also create a custom REST model class extending from ContentfulObject. Here is the flow:
I'll write a tutorial to explain this next week if it's not too late for you.
I have written code as you mentioned above.
Model class
============
public testimport extends ContentfulObject {
---------
Controller class
@Controller("cs#testimport")
@RequestMapping("/repositories/{repositoryName}/import")
public class TestImportController extends AbstractController{
@RequestMapping(method = RequestMethod.POST,
produces = {
SupportedMediaTypes.APPLICATION_VND_DCTM_JSON_STRING,
SupportedMediaTypes.APPLICATION_VND_DCTM_XML_STRING,
MediaType.APPLICATION_JSON_VALUE,
MediaType.APPLICATION_XML_VALUE
} )
@ResponseBody
@ResponseStatus(HttpStatus.OK)
public void getImport(
//The repositoryName PathVariable resolves repository name from the request path
@PathVariable("repositoryName") final String repositoryName,
@RequestBody final TestImport testImport,
//The request UriInfo, including information about uri, and format extension
@RequestUri final UriInfo uriInfo) throws Exception {
System.out.println("Has Content..." + testImport.hasContent());
while(tlsImport.hasContent()){
ContentDataSource dataSource = tlsImport.nextContent();
System.out.println("dataSource size.."+dataSource.getSize());
System.out.println("data format.."+dataSource.getFormat());
//InputStream inputfile = dataSource.getData().getInputStream();
//System.out.println("name of the object.."+dataSource.getData().getName());
But I'm not able to get content and getting below error
==================================================
Has Content...true
dataSource size..0
data format..null
2017-07-07 00:50:24,330 553370 [http-nio-8080-exec-3] WARN com.emc.documentum.r
est.error.RestErrorBuilder - LogId: 935fad94-e86c-48a2-968d-ec997dcf0ac9, Statu
s: 400, code: E_INPUT_ILLEGAL_ARGUMENTS_PARAM, message: Illegal argument content
-count provided with value 0.
com.emc.documentum.rest.error.IllegalParameterException
at com.emc.documentum.rest.model.ContentfulObject$PartDataSource.findPar
t(ContentfulObject.java:154)
at com.emc.documentum.rest.model.ContentfulObject$PartDataSource.getName
(ContentfulObject.java:178)
========================
Please any inputs ??
Thanks your support William . It is working fine and able to get the content from client request into Controller.