Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
CSIDE and OScript
how to override a method in builder
Tamer_Morsi
i am fairly new to ll builder, & need some pointers in overloading a method (9.7.1).In Module: Project -> MyProjects -> Projects-> the ManageSelect script is what i am trying to overload.We need to retrieve more columns from the dtree table versus the original code, which is:getInfo.ColumnsList = { 'DataID', 'Name', 'CreateDate', 'ModifyDate', 'SubType', 'Status' }My question is how do i override this file (ManageSelect) to replace it with additional column names?would i need to create a whole new module or can i use an existing custom module to do this ?what i did so far is, in an existing custom module i have orphaned the (project) object in the core module and made the code changes but the new code is not getting called instead of the old one ...
Find more posts tagged with
Comments
Iain_Halliwell
Hi Tamer, When I have carried customisation I have used a module called CustomizationRT, this enables you to manage your customisation after you have applied them for example when you have many overrides and you need to know where they all are there is a script that can be executed to find and list them all.In answer to your question you will require some extra script in your _init script to replace the orig code with your customisation.This is something that was written explaining the process sometime ago but I think it still holds true:are you changing a single feature of a single object ?if so, try this...1. create a Child object in the Root object of your OSpace2. call this Overrides3. create a script in this new object called '__Init' - NOTE THERE ARE 2 _ chars there !! This script will get called by livelink on startup, and we will use it in each object below to register an override.4. create a child of this new object, and call it the name of the OSpace you are overriding (WebWork)5. within this object, create another child with the name of the OBJECT you are overriding. It may seem like a lot of new objects, but it just makes it easier to maintain.6. you will now find it easier to open a 2nd OSpace browser window.7. Go find the object you want to change, and drag the feature you want to change into your new object - it should ask you if you want to copy it - say yes.8. Now drag the original object itself into your new object. You will be asked to name it, and by convention I normally stick an 'f' infront of the name, where the f stands for feature as opposed to script. This will create what is called an object reference feature, which allows us to point to the original object.9. in the __Init script, enter a line such as this....fWorkStatus._BrowseContents = this._BrowseContentssubstitute the names for your object and feature.10. Now we need to tell Livelink about your new object, so it will run this __Init script on startup.11. In your OSpace's Globals object is a script called BuildOSpace. Right mouse click on this script and select Run Script. This will register all objects with a script feature called __Init in the Global object's f__InitObjs feature. Just so you know, take a look in your OSpace's Root object's startup script. This is predefined to make a call to...$Kernel.OSpaceUtils.InitObjects( .f__InitObjs )which goes through running all these __Init scripts.What this script is saying, is... 'replace the feature called _BrowseContents in the object pointed to by fWorkStatus with the feature called _BrowseContents in object'. (this is not strictly required, but it makes it clearer).The reason I tend to use this method of overriding, is that the other way would involve creating an orphan of the original object. Livelink would then look at your copy of the object instead of the original. This is OK, except when more than one person/module needs to change the same object - you wouldn't be able to guarantee who's version would be used.I hope this is of help.Many Thanks Iain
Hans Stoop
Just a stupid question: Did you run 'Build OSPace' and restarted the builder? Hans
Hans Stoop
Hi Iain,You wrote:The reason I tend to use this method of overriding, is that the other way would involve creating an orphan of the original object. Livelink would then look at your copy of the object instead of the original. This is OK, except when more than one person/module needs to change the same object - you wouldn't be able to guarantee who's version would be used.I agree with you that just orphaning the object and change the features is not a good idea.Personally I prefer to use customizationsRT. With that you also need to orphan the object that you want to patch, but you can prevent the above undesired behaviour by setting fEnable to false or to change the _Init function to a dummy function. The patch method of customizationsRT will skip these features and do not overwrite them in the parent.Hans
Tamer_Morsi
yea; did that multiple times; that's why i figured their must be some other step i am missing.
Tamer_Morsi
do you know where i can get the customizationsRT module from ? and do you know if it works with 9.7.1
Mahesh_Pinnamaneni
Hi Iain,I have followed your approach and getting an error..I had a breakpoint in my orphaned script but it is not coming into this. So I checked if it has initialized. I have found that when I manually run the StartUp script in Root, then it is opening a Debugger window with a message: Cannot get Value; a non-existent feature was specified. But when I run the __Init script it ran successfully. not really sure what was wrong..any clues?Thanks,Mahesh
Mahesh_Pinnamaneni
here you go..
https://knowledge.opentext.com/knowledge/llisapi.dll/fetch/2001/2120338/3755714/3971010/3971340/customview.html?func=ll&objId=3971340&objAction=browse&viewType=1
Tamer_Morsi
thanks, much appreciated
Tamer_Morsi
i get the same thing but in the __Init method;when add (.fProjects._ManageSelect = this._ManageSelect) to the init method i errors out on execution with: cannot get value; a non-existant feature was specified ...thanks
Iain_Halliwell
Object superObject = .fAttachmentssuperObject.GetProcessTaskData = this.GetProcessTaskDatasuperObject.GetMapData = this.GetMapDataThis is where .fAttachments is the reference to the object in the other oSpace that you have referenced in your new module, you do this by dragging and dropping the object onto your new oSpace.The GetProcessTaskData is the script in which I have made my changes.I hope this clears things up. Failing that please feel free to send me your oSpace and which version of LL and I will take a look. It's not normally a free service but I do have some free time.Many Thanks IainIain.Halliwell@trusttech.co.uk
Iain_Halliwell
This is erroring because either fProjects or _ManageSelect doesn't exist as a peer script to the __Init script that is running.Many Thanks IainIain.Halliwell@trustTech.co.uk
Mahesh_Pinnamaneni
I figured that out..I was actually adding the mapping of .fWebWork._BrowseContents = this._BrowserContents in the __Inits script which is located in the Overrides Object. try to add this in the local to your webnode object where you are customizing the script (i.e. Root-> overrides -> Webnode -> webnode) and it will work.
Elrico_Heinen_(eheinen@datacentrix.co.za_(Delete)_
Hi there,Just wanted to know if you figured it out, because I'm having the same problem. __Init runs fine, as does Startup, but when I put a breakpoint in my _BrowseSort script, it ignores it.When I put a breakpoint in the original WebNode->WebNode->_BrowseSort script, then builder debugs, so it would seem my override is not taking effect?!Regards,Elrico