PDA

View Full Version : Obtaining correct UI context


dflachbart
07-12-2006, 01:22 PM
I noticed that one of my plugins does not work correctly when I import it on my MVP, but the same plugin works fine on my server / clients.

I see the following exception during the import :


Wed 7/12 15:02:02.280 EXCEPTION in getValueAsObject:java.lang.Exception: EvaluatorVisitor.getValue(): Error during evaluation



My guess is that this is caused by passing the wrong UI context to the SageTV.apiUI() method... My import utility library always calls this API with the "SAGETV_PROCESS_LOCAL_UI" context, which is obviously wrong in case of the MVP.

Now, how do I obtain the correct context of the caller ? The java doc lists GetUIContextName(), which will only be available in 5.1, and GetUIContextNames(), which might return more than one context.

I just tried this out and printed the results of this API on my Server machine (running as a service), and on my MVP, and on both it only returned one context name ("SAGETV_PROCESS_LOCAL_UI" on the server, and the MAC address on the MVP). My question is: under which circumstances does the GetUIContextNames() API return multiple contexts, and how can I obtain the caller context in this case (before 5.1 comes out) ?

Thanks,
Dirk

nielm
07-13-2006, 02:05 AM
In the SageTV service, it should only return extender's context names (MVP's and placeshifter) if any are connected.

In the SageTV client (or in the SageTV UI on the server when running with the service enabled), it will only return an array containing "SAGETV_PROCESS_LOCAL_UI"

If you dont use the service, then on the server, it will return an array containing "SAGETV_PROCESS_LOCAL_UI" and string for each extender (MVP/Placeshifter)

dflachbart
07-13-2006, 07:44 PM
In the SageTV service, it should only return extender's context names (MVP's and placeshifter) if any are connected.

In the SageTV client (or in the SageTV UI on the server when running with the service enabled), it will only return an array containing "SAGETV_PROCESS_LOCAL_UI"

If you dont use the service, then on the server, it will return an array containing "SAGETV_PROCESS_LOCAL_UI" and string for each extender (MVP/Placeshifter)
Thanks for the info.
If I understand this correctly - if you have multiple MVP/Placeshifter connections running, it is currently impossible to retrieve the correct UI context ?

So best practice right now (before 5.1 comes out) would be to always use the first context returned by GetUIContextNames()for all SageTV.apiUI() calls, which would always work for client and SageTV UI in service/non-service mode, but for Placeshifter/MVP only if at the time of the import only one of those clients is connected ?

Thanks,
Dirk

dflachbart
07-17-2006, 07:10 AM
So best practice right now (before 5.1 comes out) would be to always use the first context returned by GetUIContextNames()for all SageTV.apiUI() calls, which would always work for client and SageTV UI in service/non-service mode, but for Placeshifter/MVP only if at the time of the import only one of those clients is connected ?

Any comments on this from the official side :) ?


Thanks,
Dirk