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 07-09-2006, 04:31 AM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
Error trying to remove widget while importing

Hi all,

I am writing my own STVI tools.
I am trying to do some cleanup after I broke some child parent relationship, and clean house.
I am trying to do RemoveWidget but it fails with the following error:

Code:
private static void removeLeftOvers()
        throws InvocationTargetException
    {
        ArrayList lst = new ArrayList();
//        Object[] widgets =(Object[]) SageApi.Api("GetAllWidgets");
//        int size = SageApi.IntApi("Size", new Object[]{widgets});
//        log("all widgets = " +widgets+", " + size);
//        log("children size = " + size);
        List imported = Arrays.asList((Object[])_importedWidgets);
        for (Iterator iter = imported.iterator(); iter.hasNext();)
        {
            Object widget = (Object) iter.next();
            Object[] parents =(Object[]) SageApi.Api("GetWidgetParents", new Object[]{widget});
//            log("checking " + widget);
            if (parents.length>0)
                continue;
 
            ImportAction act = isImportActionsWidgets(widget);
            if (act != null)
            {
                lst.add(widget);
                log("found to delete " + widget);
            }
        }
 
        for (Iterator iter = lst.iterator(); iter.hasNext();)
        {
            Object widget = (Object) iter.next();
            log("the widget to del = " + widget);
            SageApi.Api("RemoveWidget", new Object[]{widget});//line 109
        }
    }
Code:
 
found to delete TimerExport:null|Action:linkme to Menu, Main Menu
Sun 7/9 13:18:02.580 the widget to del = TimerExport:null|Action:linkme to Menu, Main Menu
java.lang.NullPointerException
Sun 7/9 13:18:02.581  at sage.c.l$6.new(Unknown Source)
Sun 7/9 13:18:02.582  at sage.at.a(Unknown Source)
Sun 7/9 13:18:02.582  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.583  at sage.SageTV.api(Unknown Source)
Sun 7/9 13:18:02.584  at net.sf.sageplugins.sageutils.SageApi.Api(SageApi.java:17)
Sun 7/9 13:18:02.585  at alon24.Utils.removeLeftOvers(Utils.java:109)
Sun 7/9 13:18:02.585  at alon24.Utils.finish(Utils.java:74)
Sun 7/9 13:18:02.586  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sun 7/9 13:18:02.586  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.586  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.587  at java.lang.reflect.Method.invoke(Unknown Source)
Sun 7/9 13:18:02.587  at sage.d$d.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.c.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.d.m.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.590  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.590  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.591  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.591  at tv.sage.b.k.a(Unknown Source)
Sun 7/9 13:18:02.591  at tv.sage.c.a(Unknown Source)
Sun 7/9 13:18:02.592  at sage.StudioFrame.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.592  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.593  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.593  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.594  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
Sun 7/9 13:18:02.594  at javax.swing.AbstractButton.doClick(Unknown Source)
Sun 7/9 13:18:02.595  at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
Sun 7/9 13:18:02.595  at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
Sun 7/9 13:18:02.596  at java.awt.Component.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.596  at javax.swing.JComponent.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.597  at java.awt.Component.processEvent(Unknown Source)
Sun 7/9 13:18:02.598  at java.awt.Container.processEvent(Unknown Source)
Sun 7/9 13:18:02.599  at java.awt.Component.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.599  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.600  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.602  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
Sun 7/9 13:18:02.603  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.604  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.605  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.606  at java.awt.Window.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.607  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.608  at java.awt.EventQueue.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.609  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
Sun 7/9 13:18:02.610  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Sun 7/9 13:18:02.611  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.612  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.612  at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.reflect.InvocationTargetException
Sun 7/9 13:18:02.616  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sun 7/9 13:18:02.616  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.617  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.617  at java.lang.reflect.Method.invoke(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d$d.a(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d.c.a(Unknown Source)
Sun 7/9 13:18:02.619  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.619  at sage.d.m.a(Unknown Source)
Sun 7/9 13:18:02.620  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.620  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.622  at tv.sage.b.k.a(Unknown Source)
Sun 7/9 13:18:02.622  at tv.sage.c.a(Unknown Source)
Sun 7/9 13:18:02.622  at sage.StudioFrame.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.623  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.623  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.624  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.624  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.AbstractButton.doClick(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
Sun 7/9 13:18:02.626  at java.awt.Component.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.626  at javax.swing.JComponent.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Component.processEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Container.processEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Component.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
Sun 7/9 13:18:02.629  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.629  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Window.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventQueue.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Sun 7/9 13:18:02.632  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.632  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.633  at java.awt.EventDispatchThread.run(Unknown Source)
Sun 7/9 13:18:02.634 Caused by: java.lang.reflect.InvocationTargetException: Exception while executing SageApi: "RemoveWidget" numargs=1
Sun 7/9 13:18:02.634  at net.sf.sageplugins.sageutils.SageApi.Api(SageApi.java:20)
Sun 7/9 13:18:02.635  at alon24.Utils.removeLeftOvers(Utils.java:109)
Sun 7/9 13:18:02.635  at alon24.Utils.finish(Utils.java:74)
Sun 7/9 13:18:02.636  ... 43 more
Sun 7/9 13:18:02.636

can any 1 suggest a solution, or a reason for this.

I need to do cleanup, I could also not break the parent but it wont delete it there either.
Attached Images
File Type: jpg linkme.JPG (18.7 KB, 396 views)
__________________
Server
SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1
Client
SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1

Using Nielm's Web server 2.22
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 02:58 PM.


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