Content Management and Capture

 View Only
  • 1.  EDS Service - How to get active searchTemplateID/Name ?

    Posted Wed February 15, 2023 12:31 PM

    Hi Comnty, Wokring with search templates in ICN. I had to get active search template name or id to do certain operations. I get Entry template naem and id when I open Entry Template, but I dont get search Template Name/id consistently all the time. Please advice.

    Entry Template: Working

    ------------------------------------------------

    clientContext = (JSONObject) request.get("clientContext");

    entryTemplateId = (String) clientContext.get("entryTemplateId");
    entryTemplateVsId = (String) clientContext.get("entryTemplateVsId");
    entryTemplateName = (String) clientContext.get("entryTemplateName");

    Search Template - not working:

    ------------------------------------------

    clientContext = (JSONObject) request.get("clientContext");

    searchTemplateId = (String) clientContext.get("searchTemplateId");
    searchTemplateVsId = (String) clientContext.get("searchTemplateId");
    searchTemplateName = (String) clientContext.get("searchTemplateName");



    ------------------------------
    Sudheer Amireddy
    ------------------------------


  • 2.  RE: EDS Service - How to get active searchTemplateID/Name ?

    Posted Thu February 16, 2023 12:57 PM

    Please see this EDS sample -> ibm-content-navigator-samples/UpdateObjectTypeAPI.java at master · ibm-ecm/ibm-content-navigator-samples · GitHub

    ET ID, ET name are returned in the clientContext but not searchTemplate ID, name.

    Searches are not 'tied' to EDS the way ETs are.

    Is EDS involved in your use case?



    ------------------------------
    Nanda Pilaka
    IBM Content Navigator Support
    ------------------------------



  • 3.  RE: EDS Service - How to get active searchTemplateID/Name ?

    Posted Fri February 17, 2023 10:40 AM

    Yes. We are upgrading. We have to load values in a dropdown for a property from an external data source ( a DB table in my case), which are Search Template Specific. So it's crucial for me to get active ST name or ID. 

    Some times I see this service call /p8/getDependentAttributeInfo in the logs and that's when I see the active ST name and ID. and the request type is "InProgressChanges". But That is not called each time. Any Idea how to achieve this in the same EDS Service that I am using now ?



    ------------------------------
    Sudheer Amireddy
    ------------------------------



  • 4.  RE: EDS Service - How to get active searchTemplateID/Name ?

    Posted Fri February 17, 2023 12:52 PM

    We will assist you via your case TS012126074.

    thank you.



    ------------------------------
    Nanda Pilaka
    IBM Content Navigator Support
    ------------------------------



  • 5.  RE: EDS Service - How to get active searchTemplateID/Name ?

    Posted Mon March 13, 2023 01:42 PM

    Hi Nanda,

    I am Ravi. I have the same requirement. I need the search template name in the EDS to set custom lookup. Could you please let me know how to do it.



    ------------------------------
    RAVI KUMAR
    ------------------------------



  • 6.  RE: EDS Service - How to get active searchTemplateID/Name ?

    Posted Tue March 14, 2023 01:54 AM

    Ravi, Looks like EDS directly doesn't support it. There is a work around, it's multi step process though. Please refer following red book - Section 7.5.2 and Page 255.

    https://www.redbooks.ibm.com/redbooks/pdfs/sg248055.pdf

    Each Search Template mainly goes through two types of request modes in it's request payload. initialNewObject & InitialExistingObject. We dont get search template name during those modes.

    To get search template name, we got to "induce" a dependent choicelist property, as shown in the above example. The dependent property need not be a real one - could be a dummy property as well.

    STEP1:

    Implemented two tables: Example ( Data from the above URL ): ICN_EDS_CHOICES & ICN_EDS:

    STEP2: place Claim document class in the ObjectTypes.json

    [    {"symbolicName": "Claim"} ]

    STEP 3: Check for request mode and get the search template name in updateObjectTypeServlet.java

    if( request.get("requestMode").toString().equals("initialNewObject") || request.get("requestMode").toString().equals("initialExistingObject") || request.get("requestMode").toString().equals("inProgressChnages"){

    JSONObject clCtx = (JSONObject) request.get("clientContext");

    String stName = (String) clCtx.get("searchTemplateName");

    }

    Explanation:

    It would first go either initialNewObject or initialExistingObject request modes, then finds "hasdependantProperty=true", then enters into "inProgressChanges" request mode, that's when we get search template name. we can also query searchTemplateId.

    It's easy to implement a separate webapp or plugin instead of EDSService, if you have some time.

    Hope this helps.



    ------------------------------
    Sudheer Amireddy
    ------------------------------