This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to use valueCase with PcmsObjAttrStruct

Hi all,

I have a problem with the PcmsQuery function. I want to search in a product for a file.
For example: TEST.txt
When the product contains TEST.txt, PCMS_QUERY return PCMS_OK but when the filename in another product contains a lowercase characters like Test.txt. So the PcmsQuery function returns PCMS_FAIL.
Is it possible to use PcmsQuery function with valueCase.
I saw that there is PcmsObjAttrDefStruct but PcmsAttrDefInit returns each time PCMS_FAIL.

You find as below my code :

 itemObj.objType = PCMS_ITEM;
 itemObj.noAttrs = 2;
 itemObj.attrs = (PcmsObjAttrStruct*)PcmsEvntCalloc(sizeof(PcmsObjAttrStruct) * itemObj.noAttrs);
 number_of_attr = 1;
 SET_ATTR(PCMS_ATTR_PRODUCT_ID, itemObj, product, number_of_attr);
 SET_ATTR(PCMS_ATTR_FILENAME, itemObj, fileName, number_of_attr);
 if (PcmsAttrDefInit(connectionID, itemObj.typeUid, itemObj.objType, 2, &attrDef) != PCMS_OK)
    return PCMS_FAIL;
 attrDef->valueCase = 'M';
 itemObj.attrs[1].attrDef = attrDef;
 apiResult = PcmsQuery(connectionID, &itemObj, PCMS_OPT_LATEST, &uids_item_number, &uids_item);
 if (apiResult == PCMS_OK && uids_item_number)
    return PCMS_OK
 else
    return PCMS_FAIL

  • 0

    Hello,

    valueCase is not intended to affect the behavior of PcmsQuery . Probably it was initially designed to force the storage/input of user attribute values, but it is not really used today.

    With the existing functionality I can only think about the usage of DB Published Views to find the whole product repository file by name case-insensitively.

    Brute-force approach can be re-trying combinations UPPER, lower, Capitalized, but that'd be never accurate enough, of course (say, MyMixedFileName.txt case won't succeed).

    I think it's a valid enhancement request for a future release.

    Kind Regards,
    Alex

    --
    Alex Shevchenko
    Sr Development Manager
    Although I work for OpenText, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button.