OScript Orphaning an object

Options

Hi all,

I am trying to extend navigation callback object to customize the navigation menu. Whenever I have tried to orphan the LLWEB object and extend the orphaned object on my module. But it's showing error that the Orphaned object is non-existent. I have tried with other objects also but it's still the same.

I am orphaning the object from right-clicking on object from module explorer.

Is there anything I am doing wrong while orphaning the object ?

Thanks.

Comments

  • I just did a Create Node callback for my project and it worked perfectly.

    CSIDE has problems so if you are on auto build pay special attention to the bottom left corner on save you should see the building message. Also what you may want to do is go to the Oscript side and see if you see the objects then navigate to the module side and see if the changes are there. For e.g when I suspect code corruption problems I would introduce a marker in the code say echo("test") then I would ply back to the other side to see if my marker exists.


    For what it's worth I will show you a node callback extension in my system even though I am an administrator on the machine unless I do "Run As Administrator" I cannot compile but it is quite possible that it is our organizational problem

    The Admin Index Callback allows you to insert your admin entry

    public Object #'MYCOMPANY ADMININDEXCALLBACK'# inherits WEBADMIN::AdminIndexCallback


    The Node Callback

    public Object MYCompanyMainNodeCallbacks inherits LLIAPI::NodeCallbacks

    override Boolean fEnabled = TRUE

    override List fSubTypes = { 0 ,885}


    The bolded italics are where the OT object that I am inheriting happens in my package.

    If you are a starting developer please understand that OT expects you to look at other products' ospaces and understand the structure for e.g most of us when we are in doubt will import an existing ospace and look at what OT programmers do :).I always make sure that I have a proper backup as the code on the left side is quite tantamount to corruption when developing to that effect when I reach a stable version I make a copy of the oll and call it mygolden.oll.


    My advice will be to import an existing module and look at how the NavigationCallback is constructed :)

  • You are not supposed to Orphan from the module side you always do it from the Oscript (Project explorer) side. what you are doing is old Builder technology they sometimes work but it will not many times reflect in the code you are building. Did you come from the old builder style?

  • Hi Appu,

    Thanks for all the details.

    I am not from Old builder style. I am new to OScripting, hence the process of orphaning is not much clear to me.

    Although I was trying to make a navigation option by extending the object WEBLL::NavigationCallBack:LivelinkNavigationCallback. and Overriding the Execute() method. And it's successful.

    Is that the process of orphaning an object ?

    Thanks,

    Abir

  • Sorry, I go back between my heydays of builder and then CSIDE. I haven't been keeping in touch with Oscript until I needed to do something. However, the starter document on CSIDE explains the art of Orphaning in great detail.


    If what you wrote looks like what OT programmers did then I would say it is correct Essentially the .fEnabled tells the Oscript compiler to include your object

    An orphan just means that the parent object lives in another Space.I think for e.g if you right-click WebDoc::DocNode you will see the RED that means the original code is in WEBNODE ospace In this graphic one understands this info DocNode is the Parent for Folder, Document and such like and depending on the inheritance you can see that the Action-Create7 Action-Create2 has been overridden so at this main level its .fenabled is false but its children with node type registrations have been enabled


    It is a fantastic object system with myriad subsystems and all but nowadays not many attempts to do anything oscriptish...


    will invite Oscript stalwarts like @Chris Meyer @John Simon @Ossie_Moore @Hugh Ferguson

    @Greg Griffiths are like the go-to guys who seem to help people(I also try) (there are tonnes of OT people who help as well like Chris webster, Howard Pell(retired,Donna Nalla ), and so on). If you can afford it take the script training

    I would advise that

  • Thanks Appu for all the details. The basic concept of Orphan and overriding is clear to me . From practical point of view I am clear on overriding the object but process of Orphaning an object is never clear to me.

    Hence I am a bit confused.


    Thanks,

    Abir

  • I am clear on overriding the object but process of Orphaning an object is never clear to me.

    As Appu said: orphaning is the same as overriding, but the parent is from a different OSpace. That's really all there is to it from a functional standpoint. Orphan objects show up as 'red' in the various CSIDE views. They also show up directly under the OSpace where they live.

    But it's showing error that the Orphaned object is non-existent.

    Is this still the problem you are facing? If so: can you post the top few lines of your .os file (in the OScript Explorer, not the Module Explorer as Appu flagged) so that I can see how you define the package & object? Also: could I see how you are trying to reference said object in the code that's complaining that the object doesn't exist?

    Note that OScript & the framework that Content Server provided is fairly different to most other software development experiences; as Appu flagged training (https://www.opentext.com/TrainingRegistry/course/details/2807) will help very much, should the option presents itself.

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

  • @Abir Saha Can you share either your code or your step list (ideally with screenshots) so that we can help you get there.

    At the simplest level you should :

    1. In the OScript Explorer tab
    2. Right click on your OSpace object and select New -> Object
    3. Give it an Object Name e.g. "MyMenu"
    4. For Parent Package select "WEBLL::NavigationCallBack:LivelinkNavigationCallback"
    5. Now you have your new Object, double click on it so it opens in the editor
    6. Click into the editor, then select OScript -> Override Features from the main menu
    7. Click the checkboxes next to fEnabled, Execute methods
    8. Set the value of fEnabled to TRUE and put your code into the Execute method (see page 60 of https://knowledge.opentext.com/knowledge/llisapi.dll/fetch/2001/3551166/27085930/27085937/2120999/2120340/Livelink_Module_Development_Guide.pdf?nodeid=2122008&vernum=-2 for an example)
    9. Restart and see if it works.

    As @Dave Carpeneto and @Appu Nair mentioned the best way to learn is via the course or working with our developers to help you grow.

    If you are only adding a new Menu Item, you may find an ActiveView is a better way to go to start with, try looking at the "Add Item Menu Sample" predefined template.

  • Hi @Dave Carpeneto and @Greg Griffiths Thanks for all the details. The way I was orphaning an object previously, that was not the correct way.

    However, after the discussion with @Appu Nair I am able to successfully orphan an navigation menu object and create a custom navigation menu . And @Greg Griffiths the steps I have followed is the exact same I have executed.

    Thanks for all of your help.

    A very happy new year. :)