How to override a function overriden on Webattribute module in my custom module ?

Options

Hello community,

I have integrated a custom code on Webattribute module exactly in a function already overriden. My problem is when I create a new OSpace in my custom module and when I override this function CS does not read its content. Can you help me ?

Regards,

Comments

  • As per the suggestion I posted in your other forum post: Have a look to see if your object is inherited correctly.

    Also: to see what is happening I'd put a breakpoint in CSIDE at a point where you know code is getting executed, and then try to step through to see where things are going. Probably the best place for you to do this is inside the function you're overriding. That way you can see the stack & from there figure out why things aren't going how you want them to. Alternately if you're not sure where the request is going my go-to for things like this is WEBDSP::RequestHandlerSubsystem.Dispatch().

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you

  • Many advanced Oscripters code will actually override at Run Time essentially unless that programmer clued you in you won’t know . If you are a starter I would basically start cside and remove patches one by one and see if a patch is providing the override , then by trial and error move to custom modules at some point you will know how the 3rd party module programmer has changed it . I also think if you run the function called system report you get to it by doing ?func=admin.sysreport and pick Lite OT will print out what they consider core and custom . There will be a lot of false positives but some good information can be gleaned. Since you know this is we attribute if you look at hierarchy within cside or builder one should be able to understand by colors and such like
  • Oh and BTW patching as in .pat and .txt files in the patch directory
  • @Dave Carpeneto said:
    As per the suggestion I posted in your other forum post: Have a look to see if your object is inherited correctly.

    Also: to see what is happening I'd put a breakpoint in CSIDE at a point where you know code is getting executed, and then try to step through to see where things are going. Probably the best place for you to do this is inside the function you're overriding. That way you can see the stack & from there figure out why things aren't going how you want them to. Alternately if you're not sure where the request is going my go-to for things like this is WEBDSP::RequestHandlerSubsystem.Dispatch().

    Thanks Dave for your help,
    I put a breakpoint inside teh function overricen and it is never called, I'm really not sure where the request is going. Where exactly can I inherit the Dispatch function to see the problem.

    Best regards

  • @Appu Nair said:
    Many advanced Oscripters code will actually override at Run Time essentially unless that programmer clued you in you won’t know . If you are a starter I would basically start cside and remove patches one by one and see if a patch is providing the override , then by trial and error move to custom modules at some point you will know how the 3rd party module programmer has changed it . I also think if you run the function called system report you get to it by doing ?func=admin.sysreport and pick Lite OT will print out what they consider core and custom . There will be a lot of false positives but some good information can be gleaned. Since you know this is we attribute if you look at hierarchy within cside or builder one should be able to understand by colors and such like

    Thank you very much Mr Appu Nair :smile: , I am very grateful to you, actually I am noting all your advices here and in the other post to do nowadays and I think after sometime I will be better and understand more about OScript best practices.

    Best regards

  • Where exactly can I inherit the Dispatch function to see the problem.

    WEBDSP::RequestHandlerSubsystem.Dispatch() is a pretty safe place to assume the request will go. If you're completely at a loss as to where the code is going: place a break point there & then step through the execution. Even if this doesn't show you why things go wrong the first time you do it: it's a very educational process to perform :smile:

    As per Appu's suggestion: OpenText does offer a 'CSIDE fundamentals' cource @ https://www.opentext.com/products-and-solutions/services/training-and-learning-services/course-catalog/opentext-content-suite-training-offerings . It's not offered as often as I'd like it to be, however it is worthwhile if you're new to OScript development.

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you

  • I found a solution by swapping boolean state of the fEnabled in the first function overridden and my own one.
    But inside my function I am trying to read from local xml file. Unfortunately it did not work for me. Please if you have simple guide to read from local xml file help me.
    Thanks

  • Glad to hear that you've figured out the main problem.

    For file access: https://knowledge.opentext.com/knowledge/cs.dll/fetch/-15106263/15106294/15106295/16376487/67794710/67790529/documentation/file.html

    For XML parsing: we provide both a SAX & DOM parser via the built-ins (you'll see links to these on the above page :smile:

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you