Uploading documents from Webreport using RESTCLIENT Subtag from One Content Server to another

Options

I am doing a research on uploading a document from one content server to another via Webreports using RESTCLIENT.

I was able to make other calls like to get node details, search etc and cannot able to upload documents from one content server instance to another.

Wondering if anyone out there tried this approach.

thanks for your feedback.

Mahesh

Comments

  • Your approach will work if you work in this fashion.

    • Request Handler to Server A, OTDS Token Issued, Rest Client executing within WR, File Downloaded not to the server but computer executing WR.
    • Request Handler to Server B, OTDS Token Issued, Rest Client executing within WR, File Uploaded from the previous computer.

    Your approach will be similar to what one would do in an Enterprise Connect Client, imagine if you had two nodes one for Production and one for Test and you are uploading, downloading from one instance to another.

    Unless you or your organization is fine with the RH chatter and are sized correctly you may run into network and LL thread issues.

    I would probably write a custom Oscript routine to see if I can bypass a lot of network systems, even SOAP may have lesser overhead as its file streaming is done through probably better methods that are not OT made but relying on WCF and JAX-WS. I have nothing to back that but just a stray thought :)

    In any case I don't have any idea how you run WR in One context to deliver to another....

  • Hi Appu,
    Thanks for your thoughts. I am looking for more like a backend job so there is no user interaction. so when the WR is ran, doc is downloaded onto temp folder on server and it uploads to another env.

    I have attached the sample webreport that I was playing around. it works if you are creating a folder in Staging Env from running a WR in DEV.

    But this doesn't work with uploading documents. Not sure if its even possible to upload content.

  • What is the advantage of a WR in this ? Once you are in REST you are already using a industry standard API ...
  • so you can invoke it from a workflow...this is just thought/research looking for possibilities.

  • OT had at a time server based XML WF Extensions. Probably they have it now as well also a product that might have been discontinued called XML WF Interchange .
    Will be curious to find what comes out of your research as I have not used WF with WR maybe WR or REST Gurus could probably help you than me
  • Depending on the volume of documents you intend to migrate from A to B and the use cases around it, take a look at what CS Syndication does. It will natively call RESTful APIs to mirror documents, versions, metadata, permissions, RM and will continue to support more objects as the product matures.

  • we are still on 16.2.5.

    I have looked into OScript's RESTClient PostFile method which is supposed to post documents .But I am unable to make that to work. I was getting "Could not process object, invalid action 'create'"

    Wondering if anyone out there played with this method.

  • Apparently Mahesh created a Java class to execute the REST client as a work around. Mahesh, if you have any details, please post.

  • It looks like the OScript's RESTClient.PostFile method doesn't have a way to pass additional parameters in the body. May be OT can add support in future versions.
    The idea is to create a custom subtag and Invoke Java methods...

    I have attached the sample Java code. This is strictly research purposes and not to be meant for Production usage.

    I have different methods to createfolder, adddocument, addversion.

    Hope this helps.

  • Thanks so much Mahesh. By the way, you can make feature requests in Knowledge Center here: https://support.opentext.com/portal/site/css?customView=newTicketTechnical

  • We have almost the same problem with Mahesh's.

    In our case, our user need to send a document from OT Content Server to 3rd party system via a workflow in the otcs. The 3rd party system provided an API to accept the file upload using http's POST method. We've build a workflow to use Webreports features which use the tag: LL_WEBREPORT_RESTCLIENT. But we still have problem, we don't know how to use the tag for upload a document from otcs. There is lack of documentation about how to put a parameter with "file" type into the @PARMS or @BODY of the tag.

    Our flow in general:

    User execute a workflow -> user select & attach a document from the otcs to the workflow -> the workflow execute a webreport -> the webreport send the selected/attached file to 3rd party system (using tag LL_WEBREPORT_RESTCLIENT or other tag??) -> the webreport receive a response from the 3rd party system -> and so on..

    Please advice, how to do the file post from the otcs?

    Thank you.

  • Hi Zefry,

    I believe I submit a feature request to support file uploads in LL_WEBREPORT_RESTCLIENT tag. May be you can submit another one too to get some attention.

    I think a couple of options like you can create a custom subtag to make it more generalized that supports file uploads or if it's a specific requirement to your application, you can write Callback Event scripts.

    Thanks,

    Mahesh

  • Hi,

    Just to let you know we have a feature request logged for this with reference LLWR-14655. This is tracked via https://knowledge.opentext.com/knowledge/llisapi.dll/kcs/kbarticle/view/KB17044483.

    This is definitely on the list as a feature we hope to implement in the near future.

    Cheers

    Ian

  • just following up on @Ian_Whitfield's post, the RESTClient OScript package does not have the limitation, just the WebReport tag, so you can either add a new SubTag, or use an OScript block in the WebReport in the meantime.