How to load your custom module at last or how to know which module overriding my custom module

Options

Hi,

I created a custom module in my lab server which works fine there. When i install this in other environment, my code is be override by other CS module/code. Can someone please help me to understand that how to find which module is overriding my code or how to load your module at last???/

Any help would be appriciated.

 

Comments

  • It is not possible that another module overrides your code when that module already existed in the system.

    It is only possible that another module overrides the same code that you override in your module.

     

    The question is: Why do you need to overwrite code? There are plenty of callbacks or subsystems that will make your module do what it needs to do.

     

    Hans

     

    From: eLink Entry: Content Server Development Forum [mailto:development@elinkkc.opentext.com]
    Sent: Dienstag, 9. August 2016 12:13
    To: eLink Recipient
    Subject: How to load your custom module at last or how to know which module overriding my custom module

     

    How to load your custom module at last or how to know which module overriding my custom module

     

    Posted by Walia, Abhimanu On 08/09/2016 06:08 AM

     

     

    Hi,

    I created a custom module in my lab server which works fine there. When i install this in other environment, my code is be override by other CS module/code. Can someone please help me to understand that how to find which module is overriding my code or how to load your module at last???/

    Any help would be appriciated.

     


    [To post a comment, use the normal reply function]

    Forum:

    Content Server Development Forum

    Content Server:

    Knowledge Center

     

  • Yep, this has been a problem since Livelink 7.X and probably Odesta Desktops as well. If two modules both override the same object (i.e. a web node or a llNode or even a core request handler), it's a game of last man standing as to which one will persist (or perhaps last man loading).

    As Hans stated, you should really look into the various callbacks to do your custom code as you're guaranteed not to collide with another vendor (or OpenText) when you do it that way.

    If you could explain what your orphan/override does, we might be able to help you decide a better way to implement it.

    -Hugh

  • Thank you both for your quick reply. Sorry i was not able to explain it well. I am very new to this Oscript. Issue has resolved.

    Resolution:- I had created a custom module which enable item reference attribute in form with below code in startup script of new module.

    $Lliapi.LLAttributeSubsystem.AssociateTypesByCustomID( $FormAPI.AttrTypeID, { $AttrTypeNodeSelect } )

    and i had set the dependencies for FormAPI and this is working in muy lab server not in DEV environment. When i checked the logs , i found that new module was loading earlier than FORMAPI. So i created a orphan and now it is working fine.

    Thank you again.

     

  • Good research and good solution.

     

    Hans

     

    From: eLink Entry: Content Server Development Forum [mailto:development@elinkkc.opentext.com]
    Sent: Mittwoch, 10. August 2016 11:10
    To: eLink Recipient
    Subject: RE How to load your custom module at last or how to know which module overriding my custom module

     

    RE How to load your custom module at last or how to know which module overriding my custom module

     

    Posted by Walia, Abhimanu On 08/10/2016 05:08 AM

     

     

    Thank you both for your quick reply. Sorry i was not able to explain it well. I am very new to this Oscript. Issue has resolved.

    Resolution:- I had created a custom module which enable item reference attribute in form with below code in startup script of new module.

    $Lliapi.LLAttributeSubsystem.AssociateTypesByCustomID( $FormAPI.AttrTypeID, { $AttrTypeNodeSelect } )

    and i had set the dependencies for FormAPI and this is working in muy lab server not in DEV environment. When i checked the logs , i found that new module was loading earlier than FORMAPI. So i created a orphan and now it is working fine.

    Thank you again.

     


    [To post a comment, use the normal reply function]

    Topic:

    How to load your custom module at last or how to know which module overriding my custom module

    Forum:

    Content Server Development Forum

    Content Server:

    Knowledge Center

     

  • Hello everyone ,

    I'm new in OScript and I'm issueing a similar problem as same as Hugh said in this comment.
    If you have any solution to let my custom module take affect on CS please let me know how to do this.

    Thanks

  • Hi Ahmed - my vote is to go with what Hans mentioned earlier:

    The question is: Why do you need to overwrite code? There are plenty of callbacks or subsystems that will make your module do what it needs to do.

    ... it's hard to say more than that without knowing the specifics of what you're doing / what is failing.

    Question: how do things look in your deployment when you look at things such as the hierarchy / inheritance in CSIDE?

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

  • Hello Dave, Thank you for your feedback

    I very new in OScript, I did some essays to test features by tracking the logs on CSIDE in order to see functions called. After that I do the overrides and make some changes. I did not find in the Content Server SDK 16.2 - Offline Documentation the callbacks to use !! for example to assign some categories while uploading a document.

    Can you give me the correct way to find callbacks to use ?

    Thanks

  • Simple ways to get you going Node you probably know this is an object that is associated by subtype so all nodes of subtype 0 folder and subtype 144 are the same but they exhibit differences in functionality 144 is versionable but 0 is not . OT has for you listeners or callbacks on many node operations for e.g when a node is created , versioned , metadata updated , added and so on .i am not in front of cside but look at core and in that package search for callbacks . If you create a module now and orphan a create node callback and for eg specify that 144 or 0 is what you are listening and in that stub code write echo(‘Hello World’) when that event happens the logs will say that . I recently wrote a reply in this forum about trying to help a user called Franky Egan . I left a bunch of useful links in there that might help . Callbacks should be designed as judicious as possible and you should defer them when possible otherwise in a bulk operation all this extra code will fire and make the thread execute longer than they should.
  • Hello Appu Nair, Thanks a lot for your help,

    I am in front of CSIDEand I am testing to use callbacks, it works fine when I create my own node using LLIAPI and WEBNODE, but it is difficult for me now to change something when an event is occuring.
    I explain: When I upload a document I want to assign to it a specefic category by Id.
    It depends on some modules called while the upload of the document. When I see some logs on CSIDE I remark that I should override every function called while the upload is occuring.
    I widh you understand me and I wish a quite response for that. May be it is too difficult for a beginner but I would know how it works

    Thank you for the help on Frany Egan post

    Thanks a lot

  • The beauty of the callbacks is in my opinion like this
    1. You have specific entry points that will fire when OT code is happening
    2. It does not need to be in your own webnode
    3. For e.g Open up CSIDE and basically orphan the NodeCreate Callback.
    4. In that code that is now sitting in your module make a statement saying you want that firing for 144 or 0 (do you find these instructions easy or I can handhold you)
    5. If you write debug lines you should see that when those events happen.
    6. I hate to give you a module I developed because sometimes people forget the fact that the module is written to explain a point they will run with it and make it prod code and it may not be :)
    7. Callback programming is not for the faintest of heart see a link by Ossie http://www.oscriptadventures.com/2013/03/observer-effect-quantum-physics-and.html
    8. In your case, I am not sure how you are going to structure your code but again applying a Category to a Node while it is getting created is not that difficult. The difficulty is basically the attribute code because it is quite a complicated thing but there's a piece of code that is published by OT and it serves as the starting point or almost the "bible" of that.
    9. Essentially forget that you need a callback you will get there I promise you but write some lines of code (a standard request handler is the easiest when you start programming) try finding a node, attach a category to it and change a few programmatically. In my personal workspace, the links you found are quite a few snippet code that may still work you are welcome to use it but I generally write disclaimers on most of them as they might be old, ancient...Unfortunately, there aren't a lot of oscripters outside of OT and good code is hard to come by...I learned most of it by looking at how OT programmers do it so CSIDe(or builder for a lot os us) is the best friend.
    10. If possible attend an OT training I doubt if callbacks are covered but at least you will get some good exposure to the architecture :smile:

    Happy Thanksgiving now to eat....

  • Maybe we should all petition to make Appu the new official Oscript trainer :)
    -Hugh