SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio

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 09-24-2006, 04:10 PM
Morgan111's Avatar
Morgan111 Morgan111 is offline
Sage Fanatic
 
Join Date: Nov 2003
Location: Oak Ridge, Tennessee
Posts: 762
Ah! Thanks! Actually I had just tried putting it under The "Main Menu" menu that was already there and was able to import it that way. I don't know if that is kosher or not, but I will do it the way it should be and put it under the section in the template you mentioned.
Reply With Quote
  #62  
Old 12-14-2006, 04:58 PM
nathanm nathanm is offline
Sage User
 
Join Date: Aug 2004
Posts: 39
Send a message via AIM to nathanm
I noticed you can use..

df_sageutils_Import_link("LinkToMainMenuTheme", "/STV/THEME ORGANIZER/MenuThemes/MainMenuTheme")

But is it also possible to have the placeholder name to be the actual name of the widget you wish for it to be replaced by.

df_sageutils_Import_link("MainMenuTheme", "/STV/THEME ORGANIZER/MenuThemes/MainMenuTheme")

Would that work?
Reply With Quote
  #63  
Old 12-14-2006, 06:35 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by nathanm

But is it also possible to have the placeholder name to be the actual name of the widget you wish for it to be replaced by.

df_sageutils_Import_link("MainMenuTheme", "/STV/THEME ORGANIZER/MenuThemes/MainMenuTheme")

Would that work?
Hi nathanm,

yes this would work. Bear in mind that the placeholder name is really just that, a placeholder which gets replaced by the actual widget name found in the STV at the specified path - you can name it anything you want. Just make sure you use the same name in the placeholder widget and in the link command.

So, both of your examples



will result in




Dirk
Reply With Quote
  #64  
Old 01-03-2007, 11:50 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,975
flachbar -

I'm using your latest df_sage_utils (2.0) and I've run into two problems.

1.) the Link() function does not appear to work. It will return success, but it doesn't create the link. If I use defineLink() instead with the same parameters, it works properly.

2.) I'm using the template code, but it doesn't delete the import code (the debug log indicates it did, but it really didn't).

I noticed that the code renames the imported hook before it tries to delete the import code. Here is the command it uses to delete the import code:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/STVImported/\"Import code\")
I thought that might be part of the problem, so I tried modifying the import code to use the new name:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/" + ImportName + " import hook" + "/\"Import code\")
I also tried:
Code:
df_sageutils_Import_deleteWidgetTree("/STV/" + ImportName + " import hook" + "/\"Import code\")
Am I doing something wrong or is there a bug here?
Reply With Quote
  #65  
Old 01-04-2007, 11:53 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Hi Tiki,

I can reassure you that those functions are working, so something else must be going wrong

Quote:
Originally Posted by Tiki
1.) the Link() function does not appear to work. It will return success, but it doesn't create the link. If I use defineLink() instead with the same parameters, it works properly.
This is indeed strange. The implementation of defineLink() simply calls link()

Code:
public static boolean defineLink(String placeHolderWidgetName, String pathOfWidgetToLink) {
        return link(placeHolderWidgetName, pathOfWidgetToLink);
    }
so I could not imagine at all why defineLink() would work, but link() would not ...


Quote:
2.) I'm using the template code, but it doesn't delete the import code (the debug log indicates it did, but it really didn't).

I noticed that the code renames the imported hook before it tries to delete the import code. Here is the command it uses to delete the import code:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/STVImported/\"Import code\")
I thought that might be part of the problem, so I tried modifying the import code to use the new name:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/" + ImportName + " import hook" + "/\"Import code\")
Ok, I admit it's not straight forward, but the path ""/Imported/STVImported" will still identify the new imported hook even after is has been renamed. The import library builds a cache for already used path expressions, and it will return the hook widget even with a lookup on the old name.

The hook code removal works in all my plugins, so there must be something else going on. Can you set plugins/df/debug_level=1 in the property file before doing the import, and post the log file ?

Dirk
Reply With Quote
  #66  
Old 01-04-2007, 02:07 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,118
Quote:
Originally Posted by Tiki
1.) the Link() function does not appear to work. It will return success, but it doesn't create the link. If I use defineLink() instead with the same parameters, it works properly.
Just in case it's not a typo here, but link() should be lower case, caught me out when I changed from defineLink to link

The cleanup code in all the imports I've looked at is
Code:
widget = df_sageutils_Import_findImportedWidget("STVImported;\"Import code\"", ";")
df_sageutils_Import_deleteWidgetTree(widget)
which is different to what's in the current template, but I've no idea where I got it from. Possibly an older version of the template.


John

Last edited by JREkiwi; 01-04-2007 at 02:38 PM.
Reply With Quote
  #67  
Old 01-04-2007, 02:18 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,975
OK Here you go
Quote:
The hook code removal works in all my plugins, so there must be something else going on. Can you set plugins/df/debug_level=1 in the property file before doing the import, and post the log file ?
I attached the log file and the STVi. I am importing this into a copy of the stock STV that came with Sage version 5.04.

As long as you're looking, feel free to point out anything else you see that I might be doing wrong or should be doing differently.

Thanks for the help,
Tom
Attached Files
File Type: txt sagetv_0.txt (128.2 KB, 205 views)
File Type: stvi Enhance_Malore.stvi (21.2 KB, 220 views)
Reply With Quote
  #68  
Old 01-04-2007, 02:32 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,975
Thanks for the input John,

Quote:
Originally Posted by JREkiwi
Just in case it's not a typo here, but link() should be lower case, caught me out when I changed from defineLink to link

John
I just went back and re-tried link() and it is working now. So, you're probably right and I had a type-o of "Link" instead of "link" or something similar.

-Tom
Reply With Quote
  #69  
Old 01-04-2007, 02:40 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,118
I've tried your import and it works with this cleanup code
Code:
widget = df_sageutils_Import_findImportedWidget("STVImported;\"Import code\"", ";")
df_sageutils_Import_deleteWidgetTree(widget)
John
Reply With Quote
  #70  
Old 01-04-2007, 02:42 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,975
Quote:
Originally Posted by JREkiwi
The cleanup code in all the imports I've looked at is
Code:
widget = df_sageutils_Import_findImportedWidget("STVImported;\"Import code\"", ";")
df_sageutils_Import_deleteWidgetTree(widget)
which is different to what's in the current template, but I've no idea where I got it from. Possibly an older version of the template.

John
John - you are right about the missing quote at the end, but that is the way it is in the template.

I tried adding the missing quote - it still doesn't work, but at least it reports an error in the debug log now:
Code:
Thu 1/4 15:33:39.090 *** removing import hook code ***
Thu 1/4 15:33:39.091 invalid path /Imported/STVImported/"Import code"
Thu 1/4 15:33:39.091 root /Imported in path /Imported/STVImported/"Import code" not found
Thu 1/4 15:33:39.091 root /Imported in path /Imported/STVImported/"Import code" not found
Thu 1/4 15:33:39.091 widget path /Imported/STVImported/"Import code" not found
Thu 1/4 15:33:39.091 ERROR: deleteWidgetTree(): root is null
Thu 1/4 15:33:39.091 import hook code removed
I'm getting closer...
Reply With Quote
  #71  
Old 01-04-2007, 02:47 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 1,975
Success!

There was another type-o in the template:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/STVImported/\"Import code\")
should be:
Code:
df_sageutils_Import_deleteWidgetTree("/Import/STVImported/\"Import code\"")
("/Import/" not "/Imported/" and two "s at the end).
Reply With Quote
  #72  
Old 01-04-2007, 02:47 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,118
Removed as you had got it sorted. Gotta love posts at exactly the same time.

John

Last edited by JREkiwi; 01-04-2007 at 03:01 PM.
Reply With Quote
  #73  
Old 01-08-2007, 11:48 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by Tiki
Success!

There was another type-o in the template:
Code:
df_sageutils_Import_deleteWidgetTree("/Imported/STVImported/\"Import code\")
should be:
Code:
df_sageutils_Import_deleteWidgetTree("/Import/STVImported/\"Import code\"")
("/Import/" not "/Imported/" and two "s at the end).
Thanks for the heads-up, I'll fix these typos in the download package asap...

Dirk
Reply With Quote
Reply


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

Advanced Search
Display Modes

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 03:59 AM.


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