Custom module recompilation

Options
shamli
edited August 9, 2021 in CSIDE and OScript #1

Hi Experts,

We have a custom module which is developed for Livelink 9.7.1 to apply permissions once folders are created using workflow.

While recompiling this module to make it compatible with CS20.4. we are getting "unknown feature specified error" for below line in code.

RecArray.AddRecord( array, { obj, obj.GetApiObj().fOrderIndex } )

I am new to OSCRIPT. Can anyone help me to identify the error in this line.


Regards,

Shamli

Tagged:

Comments

  • Karen Weir
    Karen Weir E Community Administrator
    Options

    @shamli , I have moved your post to our Content Server area, you will have the experts you need to review your scenario:

    We have a custom module which is developed for Livelink 9.7.1 to apply permissions once folders are created using workflow.

    While recompiling this module to make it compatible with CS20.4. we are getting "unknown feature specified error" for below line in code.

    RecArray.AddRecord( array, { obj, obj.GetApiObj().fOrderIndex } )

    I am new to OSCRIPT. Can anyone help me to identify the error in this line.

  • Appu Nair
    edited August 9, 2021 #3
    Options

    @shamli

    971 to CS20 is a big jump 97 is Oscript in 32 bit CS10 is that in 64 . Currently, it can only be done if you have the working code in 971 and builder so here is a high-level way.

    So somewhere when builder is running there will be something to execute that code in 971 so what I would do is put a break into a custom RH, it can also be a Webnode command a webnode action, etc or whatnot. You say it is in workflow so probably an event script.

    Ok, then I would look at the entrance of the script and see if inside the code what is the developer doing times the original developer may have realized that OT has a permissions pusher a call that takes a parameter push permissions to subitems. You will see code in permsApplyDown1,2 &3

    So what I would do is basically make a brand new module and create a similar command and get that module installed but still, the cut and paste mode of that will still fail. Read on...as the content below is not something a novice Oscripter is bound to understand.


    Since I used to mess with LAPI my guess is the old programmer found the LAPI object and then inside Oscript called the LAPI high-level command. We all used to do that because LAPI had high-level commands abstracted easily for it to be used.

    971 became 10, then it became 10.5, then 16 and then 20 and 21

    OT stopped or removed LAPI from the codebase from version 16 onwards so that obj and obj.GetApiObj won't resolve in a system higher than 10.5

    RecArray.AddRecord( array, { obj, obj.GetApiObj().fOrderIndex } )

    As a stop-gap measure, you would use the SOAP WSDL or REST API command and see if OT has a Permissions pusher that will work taking a parameter. If I were doing this I would check the LLIAPI oscript API and see if there is an inbuilt Oscript API that has a function that will take a high-level folder and then push it down to child nodes and implement it new.

    IMHO the old module as written will fail when it sees the lapi object entry points. It will never run on even 16 software.

    If you install an old RFC module that Enterprise Scan uses to put documents OT bundles the old lapi code in its own module perhaps the ES team has already ported everything to not use LAPI so that may not fly either.I forgot the name of the temporary add-on module that OT gave ES customers it was just old lapi code bundled back.


    @John Simon @Chris Meyer @sıɹɥɔ @Hugh Ferguson @Greg Griffiths I tagged a few stalwarts as well...


    @AOTCSIDE2D

  • @Appu Nair

    Thanks for the suggestion, will try to check for the function to replace LAPI command.

    Is there any add-on module for CS20.4 with old lapi code like you mentioned above.

    Regards,

    Shamli

  • Appu Nair
    edited August 13, 2021 #5
    Options

    @shamli almost every old codebase from OT has been ported not to use LAPI on the Oscript JVM. Further LAPI was used when OT did not have a lot of new schemas, even if you took the old 971 lapi files and put it in 20 or so the compilation part will work however it misses perhaps things that OT added to address their software in later versions. You are better off trying to understand what that old code was doing and just writing a script equivalent. You will find lots of example testing code in RECman ospace where you can see test stubs the programmers use to get the Service Object(Service means CWS/SOAP) . You can very clearly see how the programmers use Oscript to call out Soap functionality like a java or .NET programmer would do things downloading WSDL. Once you understand that have .NET or Java compiler and see if there are methods that will take a parameter to apply permissions.I have used *chunked methods in soap so it will do that efficiently. Or as I said REST is what OT is developing now so you can do the same or if you want your code against obsolescence you just have to do it in Oscript.I know it is not easy to find good examples in Oscript and hardly will you get much support if you are a starter :) If at all you need it look in postings around 10 years back in this section https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=22969375&objAction=browse&viewType=1 OT retires old material and never bothers to give developers a chance or new developers to looks at old problems so your mileage will vary.

    Actually, your event script can be done by a medium developer in say 1 or 2 days.

    BTW my blog Livelink.in may have examples and most all of the links are to KB which are bound to be broken :) Some content I had locally I have in a google share so sometimes people ask me for it and I give it.

  • @Appu Nair

    Thank you so much for the reply :)

    I will try to look for some alternatives like you mentioned.


    Regards,

    Tamilba

  • I would break down your single line into its separate lines / variables for each one and then you can check if the values match the parameters for the function at the end as AddRecord has a clearly defined specification :

    RecArray.AddRecord( array, { obj, obj.GetApiObj().fOrderIndex } )