SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV Studio (http://forums.sagetv.com/forums/forumdisplay.php?f=34)
-   -   Utility functions to simplify STV import (http://forums.sagetv.com/forums/showthread.php?t=17063)

Morgan111 09-24-2006 04:10 PM

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.

nathanm 12-14-2006 04:58 PM

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?

dflachbart 12-14-2006 06:35 PM

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

http://s91885874.onlinehome.us/html/...getv/link1.jpg http://s91885874.onlinehome.us/html/...getv/link2.jpg

will result in

http://s91885874.onlinehome.us/html/...getv/link3.jpg


Dirk

Tiki 01-03-2007 11:50 PM

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?

dflachbart 01-04-2007 11:53 AM

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

JREkiwi 01-04-2007 02:07 PM

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

Tiki 01-04-2007 02:18 PM

2 Attachment(s)
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

Tiki 01-04-2007 02:32 PM

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

JREkiwi 01-04-2007 02:40 PM

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

Tiki 01-04-2007 02:42 PM

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...

Tiki 01-04-2007 02:47 PM

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).

JREkiwi 01-04-2007 02:47 PM

Removed as you had got it sorted. Gotta love posts at exactly the same time.:)

John

dflachbart 01-08-2007 11:48 AM

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


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

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