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 10-09-2006, 01:51 AM
blackb0x blackb0x is offline
New Member
 
Join Date: Oct 2006
Posts: 4
Sage TV API

Hi all,

I have a problem.
Is there any way that I can use the api of sage?
It seems that, after i imported all Sage.jar
All the classes is a.class b.class, ap.class etc...
There is no way that I can use the methods given in the Java Doc.

Thank you
Reply With Quote
  #2  
Old 10-09-2006, 02:16 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
There's extensive API documentation at http://download.sage.tv/api/index.html, including specific instructions on how to call the API from Studio and from Java.

However if you're talking about writing a standalone Java app that runs separately from SageTV.exe and uses Sage.jar as a class library, that's probably not going to work. The SageTV API is designed for use from within SageTV, either directly from Studio code or from Java classes called from Studio code.

Questions of this sort, relating to how to program SageTV addons and plugins, are probably best handled in the Studio forum.
__________________
-- Greg
Reply With Quote
  #3  
Old 10-09-2006, 02:19 AM
blackb0x blackb0x is offline
New Member
 
Join Date: Oct 2006
Posts: 4
Thank you...
I will go over to the other link u have stated to take a look...
Reply With Quote
  #4  
Old 10-09-2006, 03:37 AM
Mahoney Mahoney is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 483
blackb0x - the critical bit seems to be this:

Quote:
The SageTV API calls can also be invoked from Java code directly. To do this, you can use the following static method in the sage.SageTV class:

public static Object api(String methodName, Object[] methodArgs) throws java.lang.reflect.InvocationTargetException;

The methodName parameter should be the name of the SageTV API call and the method Args should be an array of the arguments to pass to the API call. It is safe to use null for methodArgs if the call has no arguments. If an exception is thrown during execution of the SageTV API call then the exception will be wrapped in an InvocationTargetException and thrown.
As you've seen, they obfuscate their code prior to compilation, so you have to use this way of making the calls.
Reply With Quote
  #5  
Old 10-09-2006, 07:16 AM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Check out the source code for nielm's webserver on SourceForge (along with the sageutils project). It uses the
Sage API's extensively from Java. Your main class must implement Runnable (or inherit from Thread) and you need to add an entry to load_at_startup_runnable_classes= in the sage.properties file to tell Sage to load your class when it starts. Multiple entries are separated by a semicolon.
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

Reply With Quote
  #6  
Old 10-09-2006, 10:47 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by jreichen
Your main class must implement Runnable (or inherit from Thread) and you need to add an entry to load_at_startup_runnable_classes= in the sage.properties file to tell Sage to load your class when it starts.
That's assuming you want to implement a background process that runs continuously and doesn't interact with the UI. Not every plugin needs to do that. If you just want to write some Java functions you can call from Studio widget code, you don't need to create a Runnable class or load it at startup.

If we had a better idea of what you're trying to accomplish, we could give better advice on how to accomplish it.
__________________
-- Greg
Reply With Quote
  #7  
Old 10-11-2006, 02:39 AM
Joshua Joshua is offline
Sage User
 
Join Date: Sep 2006
Posts: 7
Quote:
Originally Posted by jreichen
Check out the source code for nielm's webserver on SourceForge (along with the sageutils project). It uses the
Sage API's extensively from Java. Your main class must implement Runnable (or inherit from Thread) and you need to add an entry to load_at_startup_runnable_classes= in the sage.properties file to tell Sage to load your class when it starts. Multiple entries are separated by a semicolon.
Quote:
Originally Posted by GKusnick
That's assuming you want to implement a background process that runs continuously and doesn't interact with the UI. Not every plugin needs to do that. If you just want to write some Java functions you can call from Studio widget code, you don't need to create a Runnable class or load it at startup.

If we had a better idea of what you're trying to accomplish, we could give better advice on how to accomplish it.
Hi,

I am actually working together with Blackbox.

We had been using nielm's webserver and find it very useful. However, it lack of some functionalities that we hope to address. Examples :-

1. Enabling recording to the nearest minute.
2. Able to add daily, weekly recordings on the portal.
3. Able to name the recorded file with better meaning.

Our problem is getting started.

1. Can Sage Studio enable us to edit nielm's webserver ?
2. Where can we download or purchase Sage Studio ?
Reply With Quote
  #8  
Old 10-11-2006, 02:44 AM
Mahoney Mahoney is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 483
Sage Studio comes as part of Sage; you get into it by pressing some key (check the manual). Opus4 has links to the manual in his sig.

I imagine nielm's webserver is straight java code, so get it from CVS (see post above) and edit it in an IDE like Eclipse.
Reply With Quote
  #9  
Old 10-11-2006, 07:01 AM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Quote:
Originally Posted by Mahoney
Sage Studio comes as part of Sage; you get into it by pressing some key (check the manual). Opus4 has links to the manual in his sig.
Ctrl+Shift+F12.

Quote:
Originally Posted by Mahoney
I imagine nielm's webserver is straight java code, so get it from CVS (see post above) and edit it in an IDE like Eclipse.
Yes it is. An Eclipse project is checked into SF's CVS so you can do a new project in Eclipse and select 'Projects from CVS' and step through the wizard.
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

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


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


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