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
  #61  
Old 12-20-2008, 04:17 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by babgvant View Post
Does the service expose a WSDL? Or something like it that could use to autogenerate a proxy class?

I'd like to integrate with a c# application, and it would save a ton of time...
Short answer is no. The Rest API is not a web services api.

That being said, much the of the code in the api is autogenerated from the SageTV javadocs. The code currently parses the javadoc and creates a metadata for the SageAPI, from that, java apis, jsp tags, and http apis are generated. So, you could create a generator, and generate .cs files that proxy the the http calls.
Reply With Quote
  #62  
Old 12-26-2008, 10:36 PM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
I'm having a hard time getting this installed using the Jetty method. I have Jetty running for the mobile interface, so it seems to be configured properly.

I have sagex.xml in C:\Program Files\SageTV\SageTV\jetty\contexts & sagex.api-6.4.8-11.jar in C:\Program Files\SageTV\SageTV\JARs

but http://localhost:8181/sagex/rpcXml/Global/GetOS gives me a 404.

Any suggestions?

Thanks.
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #63  
Old 12-27-2008, 07:00 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
If you've previously installed the remote apis under nielm's server, then remove the servlet entry from his servlets.properties file before installing it into jetty.

Could you check your sagetv_0.txt log file (in the sagetv home directory) and see if it
contains the following entries.
Code:
Wed 12/24 15:39:50.885 Remote API Servlet initializing.
Wed 12/24 15:39:50.887 Sage Provider Implementation: sagex.remote.EmbeddedSageAPIProvider; sage://embedded
Wed 12/24 15:39:50.907 Sage Xml RPC Servlet Created.
Wed 12/24 15:39:50.908 Sage Java RPC Servlet Created.
Wed 12/24 15:39:50.909 Sage Json RPC Servlet Created.
Wed 12/24 15:39:50.911 Media Servlet Handler Created.
Wed 12/24 15:39:50.913 Sage Xbox Xml RPC Servlet Created.
Wed 12/24 15:39:50.914 Registered Handlers.
Wed 12/24 15:39:50.914 Configuring Remote Broadcast Services...
Wed 12/24 15:39:50.915 Properties not found: /opt/sagetv/server/sagex-api.properties; using defaults.
Wed 12/24 15:39:50.917 Sage Remote Api Info: Server: mediaserver; Rmi Port: 1098; Http Port: 8081
Wed 12/24 15:39:50.958 Starting Sage RMI Server...
Wed 12/24 15:39:51.069 Sage Java RMI Server ready
Wed 12/24 15:39:51.104 Annoucing Remote Sage API Server availability....
Wed 12/24 15:39:51.105 2008-12-24 15:39:51.625::INFO:  Deploy /opt/sagetv/server/jetty/contexts/sagex.xml -> org.mortbay.jetty.servlet.Context@324ff{/,null}
And I apologize in advance for the next question.... but I assume that since you are using "localhost", then are running the browser on the same machine on which the sagetv server is running?

Also, make sure that in your JARs directory, that you only have a 1 copy of the sagex.api jar file. If there multiple copies, with diferrent versions, then delete all other copies, except the latest version.

What's your java version?
Reply With Quote
  #64  
Old 12-27-2008, 08:05 AM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
Closest thing I have in the sagetx_0.log is

Fri 12/26 22:27:20.355 Loading startup runnable:sagex.jetty.starter.Main
Fri 12/26 22:27:20.358 Loaded startup runnable:sagex.jetty.starter.Main

localhost was on the sage server.

only 1 of the sagex.api files is present (I had previously deleted *-9)

Version 6 Update 11.

Thanks
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #65  
Old 12-28-2008, 12:57 AM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Uncomment the
Code:
DEBUG=true
line in JettyStarter.properties and restart SageTV. Then see if there is any additional logging in sagetv_0.txt.
__________________
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
  #66  
Old 12-28-2008, 09:04 AM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
no difference.
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #67  
Old 12-28-2008, 09:16 AM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
I forgot to ask you to make the API request again after turning on debug logging. Did you try that and then check the logs?
__________________
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
  #68  
Old 12-28-2008, 09:33 AM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
I did. I also did a request to the mobile app; neither caused any logging.
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #69  
Old 12-30-2008, 04:34 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Would you mind restarting SageTV, then posting your sagetv_0.txt log file from the server. Wait a few minutes after you restart before sending the log file to be sure that jetty extracts and starts everything. It seems odd that you don't have more relevant information in your log file.
Reply With Quote
  #70  
Old 12-30-2008, 09:07 PM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
pm'd you a link to the file.

Thanks for looking at it
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #71  
Old 01-17-2009, 02:00 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
New Release 6.4.8-12

Added rpcXbmc handler (contributed by mikwilli) and jreichen found an issue with the sage context, so there's a new context file.
Reply With Quote
  #72  
Old 01-19-2009, 12:06 PM
rotten rotten is offline
Sage User
 
Join Date: Dec 2006
Posts: 6
Question return to page?

I am wondering how you are able to assign the http rpcXml to a button and then have it not return the xml but just display the page the button was originally clicked on?
Reply With Quote
  #73  
Old 01-19-2009, 12:53 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by rotten View Post
I am wondering how you are able to assign the http rpcXml to a button and then have it not return the xml but just display the page the button was originally clicked on?
Sorry, but I'm going to need some more information. I don't really know what you are asking? Maybe you can give some specifics about what is you are trying to do.

Thanks.
Reply With Quote
  #74  
Old 01-19-2009, 01:12 PM
rotten rotten is offline
Sage User
 
Join Date: Dec 2006
Posts: 6
When I send a hfref command via a button on an html page such as:

http://10.0.1.1:8080/sagex/rpcXml/Gl...OCESS_LOCAL_UI

I get back an xml display like:

<response>
<header>
</header>
<body>
</body>
</response>

Is there a tag to redirect back to the page where the button was clicked or is there a smarter way to attach the command to a button?

Thanks
Reply With Quote
  #75  
Old 01-19-2009, 02:02 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by rotten View Post
When I send a hfref command via a button on an html page such as:

http://10.0.1.1:8080/sagex/rpcXml/Gl...OCESS_LOCAL_UI

I get back an xml display like:

<response>
<header>
</header>
<body>
</body>
</response>

Is there a tag to redirect back to the page where the button was clicked or is there a smarter way to attach the command to a button?

Thanks
Typically, you would use an ajax scripting engine to make these calls, or manually do it yourself using the XmlHttpRequest object in the browser. Either way, it's javascript.

Check out the "testJson.html" page in my test area

You'll need both the testJson.html and the jquery js files.

Hope this helps.
Reply With Quote
  #76  
Old 01-24-2009, 01:05 PM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
How do you use the API when it requires an object as an argument?

For e.g. I'm trying to pull the MediaFile reference for a path via GetMediaFileForFilePath which requires a java.io.File. I've tried passing in the path to the file (what I get back when calling GetSegmentFiles, which returns a java.io.File).

Thanks
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #77  
Old 01-24-2009, 01:53 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by babgvant View Post
How do you use the API when it requires an object as an argument?

For e.g. I'm trying to pull the MediaFile reference for a path via GetMediaFileForFilePath which requires a java.io.File. I've tried passing in the path to the file (what I get back when calling GetSegmentFiles, which returns a java.io.File).

Thanks
I don't know exactly what your question is... but here's a snippet that shows how to get a MediaFile reference using a known file, and then it prints out the title and watched status.

Code:
package test;

import java.io.File;

import sagex.api.AiringAPI;
import sagex.api.MediaFileAPI;

public class TestMisc {
    public static void main(String args[]) {
        Object mediafile = MediaFileAPI.GetMediaFileForFilePath(new File("/var/media/tv/Futurama-SpacePilot3000-2007144-0.ts"));
        System.out.printf("     Title: %s\n", MediaFileAPI.GetMediaTitle(mediafile));
        System.out.printf("Is Watched: %s\n", AiringAPI.IsWatched(mediafile)); 
    }
}
The Remote API mirrors the SageTV api... which means that when you get a MediaFile reference, you can't actually call any methods on that object. You must then continue to use the MediaFileAPI methods to extract data from the media file reference.

If this isn't what you were asking then my apologies not understanding the question.
Reply With Quote
  #78  
Old 01-24-2009, 06:47 PM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
Quote:
Originally Posted by stuckless View Post
I don't know exactly what your question is... but here's a snippet that shows how to get a MediaFile reference using a known file, and then it prints out the title and watched status.

Code:
package test;

import java.io.File;

import sagex.api.AiringAPI;
import sagex.api.MediaFileAPI;

public class TestMisc {
    public static void main(String args[]) {
        Object mediafile = MediaFileAPI.GetMediaFileForFilePath(new File("/var/media/tv/Futurama-SpacePilot3000-2007144-0.ts"));
        System.out.printf("     Title: %s\n", MediaFileAPI.GetMediaTitle(mediafile));
        System.out.printf("Is Watched: %s\n", AiringAPI.IsWatched(mediafile)); 
    }
}
The Remote API mirrors the SageTV api... which means that when you get a MediaFile reference, you can't actually call any methods on that object. You must then continue to use the MediaFileAPI methods to extract data from the media file reference.

If this isn't what you were asking then my apologies not understanding the question.
I'm using the rpcXml methods, how do I "new File("/var/media/tv/Futurama-SpacePilot3000-2007144-0.ts")"?
__________________
babgvant.com | @babgvant | Missing Remote
Reply With Quote
  #79  
Old 01-24-2009, 08:40 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Download the latest jar, which fixes a bug when file parameters are used.

Then use the following syntax for passing file parameters
Code:
http://mediaserver:8081/sagex/rpcXml/MediaFileAPI?command=GetMediaFileForFilePath&1=/var/media/tv/Futurama-SpacePilot3000-2007144-0.ts
It will return a media file object reference id, which you then use in other calls.
Code:
<response>
<header>
</header>
<body>
<objectRef ref="25756944"/>
</body>
</response>
In this case, 25756944, is the mediafile object reference id.

Code:
http://mediaserver:8081/sagex/rpcXml/MediaFileAPI/GetMediaTitle/25756944
Hope this helps...
Reply With Quote
  #80  
Old 01-25-2009, 04:14 PM
babgvant babgvant is offline
Sage Icon
 
Join Date: Jul 2008
Location: London
Posts: 1,834
Perfect, thanks.
__________________
babgvant.com | @babgvant | Missing Remote
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
Hauppauge Remote Issue yacht_boy Hardware Support 4 05-01-2008 09:25 PM
MCE remote transmitting keypresses twice arnabbiswas Hardware Support 1 02-22-2007 10:55 AM
MCE Remote not work fully with Placeshifter devinteske SageTV Placeshifter 5 02-08-2007 11:45 PM
Harmony Remote IR Reciever Help brundag5 Hardware Support 2 01-13-2007 09:08 PM
How to get SageTV to release focus to NVDVD for remote IncredibleHat SageTV Software 4 07-06-2006 07:47 AM


All times are GMT -6. The time now is 11:16 AM.


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