SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-03-2010, 09:15 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Calling methods on "Custom" Objects

Can you invoke methods on custom objects you are manipulating in studio?

For example, lets say one of static methods returns a List<CustomObject> which I use as the basis for a table. Inside of the table, each cell is set to an instance of CustomObject. Can I invoke a method on that object? I tried CustomObject_method() - which would return a string value - but it did not seem to execute that.

I know I can have a static CustomObject.Method(CustomObject) method - and build that to perform the same action as the non static method.. But, I wanted to know if it was possible to invoke methods on custom objects in sage without resorting to that type of refactoring?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #2  
Old 11-03-2010, 09:52 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by broconne View Post
Can you invoke methods on custom objects you are manipulating in studio?

For example, lets say one of static methods returns a List<CustomObject> which I use as the basis for a table. Inside of the table, each cell is set to an instance of CustomObject. Can I invoke a method on that object? I tried CustomObject_method() - which would return a string value - but it did not seem to execute that.

I know I can have a static CustomObject.Method(CustomObject) method - and build that to perform the same action as the non static method.. But, I wanted to know if it was possible to invoke methods on custom objects in sage without resorting to that type of refactoring?
You need to specify the complete package and name, and then pass in the object reference.

ObjectReference = intance of sagex.phoenix.MyCustomClass
sagex_phoenix_MyCustomClass_MyNonStaticMethod(ObjectReference, AnyOtherArg1, AnyOtherArg2,...)

If the method is static, then you do not need the ObjectReference, but the syntax is the same.
Reply With Quote
  #3  
Old 11-03-2010, 10:22 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Ahh.. Ok, makes sense. Not much more convenient than having static method instead.


Thanks.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #4  
Old 11-03-2010, 11:53 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
This is covered on p. 151 of the Studio manual.
__________________
-- Greg
Reply With Quote
  #5  
Old 11-03-2010, 12:15 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Thanks GKusnick - I looked through the manual but this particular part of method invocation still was not clear to me. But I see it there and understand it now.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #6  
Old 11-03-2010, 04:58 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
It's also worth noting that to create a new Object from Studio use the full package and class name prefixed with new_

So if your class is

Code:
com.package.my.CoolClass {

  void aGoodMethod(String S) {
  }

}
you invoke the constructor in Studio like this:

Code:
MyObject = new_com_package_my_CoolClass()
and then invoke the method like this:

Code:
com_package_my_CoolClass_aGoodMethod(MyObject, "the String")
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost "Send To Custom Group" in My Videos BFisher SageMC Custom Interface 1 02-07-2009 09:12 AM
Is it possible to connect SageMC "Movie Now" menu to 1 of the custom button? thenewguy1979 SageMC Custom Interface 2 09-19-2008 11:07 PM
"Set defaults" for Series forgets "Keep"/"Auto-delete" setting maxpower SageMC Custom Interface 9 05-14-2008 09:44 PM
Made a custom Aspect Ratio to "add overscan" on the HD100 Slipshod SageTV Media Extender 8 03-27-2008 07:04 PM
Change text of "Malore Custom Menus"? YellowBox SageTV Customizations 0 08-14-2004 08:15 PM


All times are GMT -6. The time now is 01:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.