Content Management and Capture

Content Management and Capture

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

ICN EDS - Search Template Field Required Flag ON/OFF Not Working

  • 1.  ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Mon January 18, 2021 03:47 PM

    Hi All,

    Background: I'm using IBM Content Navigator. I have a search template S1 which has two search criteria fields called P1 and P2. These two fields P1 and P2 are defined as mandatory while creating search templates. At document class level these two fields are not defined as mandatory.

    Requirement: If the user enters value in P1, then P2 should not be mandatory(required=false). vice versa.

    What I have done so far:

    1.I have defined the document class name in ObjectTypes.json.

    2.I have created PropertyData.json and defined P1 and P2. Below is the sample.

    [{

    "symbolicName": "P1",

    "hasDependentProperties": true

    },

    {

    "symbolicName": "P2",

    "hasDependentProperties": true

    }]

    3.I have created logic in EDS(In RequestMode:inProgressChanges) that if the user enters value in one property then other property required flag set to false. Below is the sample code.

    loOverrideProperty.put("required", false);

    4.The code executes without errors. In the logs, I could see that ResponseProperties has required flag set to false for the property. But in the search template it doesn't remove the asterisk(*). Hence Search Button is not enabled.

    Please guide me what could be the issue or Any other way to achieve the Requirement.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 2.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Tue January 19, 2021 05:40 AM

    Hi,

    You may overwrite the _updateDependentAttributes() function in ecm.widget.search.SearchForm to pick up the updated required flag. Here is the sample code.

    ecm.widget.search.SearchForm.prototype._updateDependentAttributes: function(attributes, childComponents) { .... if (attrib.updatedReadOnly) criterion.readOnly = attrib.readOnly; if (attrib.updatedRequired) // <<<<<<<<<<< add here criterion.valueRequired = attrib.required; ... }

    Regards,

    Angie



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 3.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Tue January 19, 2021 05:59 AM

    Correction... replace ":" with "="

    ecm.widget.search.SearchForm.prototype._updateDependentAttributes = function(attributes, childComponents) {

    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 4.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Tue January 19, 2021 02:07 PM

    Hi Angie,

    Thanks for the reply. I have tried the way you suggest. I guess you mean we have to overwrite the function ecm.widget.search.SearchForm.prototype._updateDependentAttributes in Global Plugin.js file. If yes, I have tried below code.


    aspect.after(ecm.widget.search.SearchForm.prototype, "_updateDependentAttributes", function(attributes, childComponents) {

    alert('inside SearchForm _updateDependentAttributes1');

    alert('attributes ::'+attributes);

    alert('childComponents ::'+childComponents);

    var self = this;

    array.forEach(attributes, function(attrib) {

    alert('1');

    array.forEach(self._searchTemplate.searchCriteria, function(criterion) {

    alert('2');

    if (attrib.updatedReadOnly)

               criterion.readOnly = attrib.readOnly;

             if (attrib.updatedRequired)

               criterion.valueRequired = attrib.required;

    });

    });

    alert('3');

    });


    output: attributes is undefined. Hence it is not going inside the loop.




    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 5.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Wed January 20, 2021 02:08 AM

    The requierd fields which are set in search template UI should be controlled by js private methods/properties. But if you overwrite ICN private methods, it may break ICN functions which are not suggested and supported by IBM. So I suggest you to contact your support and request a FER for this issue.

    Thanks,

    Jason



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 6.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Wed January 20, 2021 08:16 AM

    Thanks for the reply Jason. I think you are right. Overwriting private methods/properties is not a good idea. Will try to raise a case for this issue. By the way, May I know what is FER?



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 7.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Wed January 20, 2021 08:57 AM

    Sorry, it means "Feature Enhancement Request"​.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 8.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Thu January 21, 2021 11:55 AM

    Hi Jason,


    I have raised case for the same issue. IBM support also confirmed that currently whatever I'm doing is not supported. Hence I have requested the FER. Meanwhile do you have any other suggestions for my requirement since it is must have for the business.



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration


  • 9.  RE: ICN EDS - Search Template Field Required Flag ON/OFF Not Working

    Posted Sun January 24, 2021 10:57 AM

    Hi,

    I consulted our search feature expert but got the 'no' answer. We have to enhance our code to handle "required" or refactor our code to make it extensible by plug-ins.

    Thanks,

    Jason​



    #IBMContentNavigator(ICN)
    #Support
    #SupportMigration