Teamsite, JAVA and Form submission

Options
Hello Folks,

We are in the process of migrating from Teamsite 6.7 to Teamsite 7.3.2. As a result of which, we are also looking to convert our custom scripts written in PERL to JAVA CSSDK.

I've started looking at the CSSDK API and also the Sample Servlets provided by Autonomy. My plan is to have a WAR file that consists of Servlet and Custom JAVA Class. Using the Servlet, I should be able to get the CSClient object.

My question is what is the mechanism to obtain the submitted information from the user, for e.g in this case the user will select a list of files from the User Interface and then select a Custom Menu Item to invoke the Servlet.

I'd really appreciate your help!!!!

Thanks,
Shaibaz

Comments

  • I haven't seen a implementation where a user is selecting files from teamsite gui but not creating a workflow job using out of the box wizard. I'm not sure what are your current requirements or previous implementation where you have the need of such. It will be helpful for everyone if you can explain what will you be doing in a servlet.

    Generally in custom code once you have the CSClient object to create a workflow you can call this method
    [php]
    csworkflowEngine = CSClient.getWorkflowEngine();
    // here create a workflow object using your workflow .cfg file
    CSWorkflow workflow = csworkflowEngine.createWorkflow(String workflow_cfg_file);
    [/php]

    But if you are using cssdk in one of the workflow task you can retrieve list of files from the workflow object and this class must implement CSExternalTask to overwrite execute() method.
    for ex: [php]
    CSWorkflow job = currentTask.getWorkflow();
    CSTask[] workflowTasks = job.getTasks();
    [/php]

    If there is something else do let us know.
  • Thank you so much for your quick response!

    Let me describe the problem and see if it makes sense to you.

    The process in a nutshell is that when the user selects a list of files from GUI, we are invoking a PERL script, this PERL script uses the Teamsite's CGI Library and parses the form data, that helps in getting all the files that were selected by the user. Then the script does a bunch of processing and copies these files to another workarea within teamsite.

    Once that is done, there is a Push/Pull connector (running as a cron job) that pulls the files from this workarea and submits to SDL World Server ( another product) for translation. The files are translated in different languages such as Spanish, Portuguese, etc. The translated files are brought back to Teamsite when the translation is completed by the user on SDL World Server.

    So I was wondering, if there is a way to get all the form data in JAVA world like we have it in PERL today.

    I hope this helps in understanding the problem.

    Here are some of the sample key-value pairs that I get from after calling the parse data.

    area_name : ---> dev1
    directory_name : ---> testFolder
    path_0 : ---> /.iwmnt/default/main/testBranch/WORKAREA/dev1/testFolder/testFile.jsp
  • My plan is to have a WAR file that consists of Servlet and Custom JAVA Class.
    Do you have a good reason for putting your code in a separate webapp entirely? It would be easier just to deploy your code in the UITK, even if you compile your Java outside of TS.
    The process in a nutshell is that when the user selects a list of files from GUI, we are invoking a PERL script, this PERL script uses the Teamsite's CGI Library and parses the form data, that helps in getting all the files that were selected by the user. Then the script does a bunch of processing and copies these files to another workarea within teamsite.
    So this has nothing to do with workflow then..

    The UI will pass the list of vpaths as multiple arguments named 'vpath'. That must've been how you were retrieving them in your CGI. Same thing in Java, except the syntax is different (and has nothing to do with the CSSDK). The CSSDK gets involved when you want to resolve those paths to TeamSite objects and execute the copy. Here's a couple things to look at:
    [PHP]HttpServletRequest#getParameter(String)
    CSClient#getFile(CSVPath)
    CSClient#getWorkarea(CSVPath, boolean)
    CSWorkarea#createSimpleFile(CSAreaRelativePath)[/PHP]
    Note that there's no "copy to" in the CSSDK. You have to create the new file in the target area, and then copy the contents using I/O streams. You also have to explicitly copy the EAs and Associations if you care for those.
  • Yes, I'm reading Teamsite 7.3 Interface Customization Guide and it talks about UITK so that is the route that I will take.

    I will keep you guys posted. Once again thank you so much!!!
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs