BeanShell - Textdatei auslesen

Bei Problemen mit der Bedienung von TV-Browser, bitte hier posten.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Der Vorteil mit Entwicklungsumgebung ist, dass du das einmal einrichtest und dann immer bei Bedarf direkt etwas ändern kannst.
Es hört sich vielleicht zu Anfang schwierig an, aber das ist viel leichter als man denkt.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Das ist schon klar. Ich kann die Umgebung ja dann auch bei Gelegenheit mal einrichten.
in dem aktuellen Fall wäre es aber lieb, wenn Du das übernhemen könntest. Geht das?
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Ja, kann ich machen, wenn ich die fehlenden Dateien noch bekomme.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Super! Danke!

Hier sind die Property-Files.

csvfilefiltercomponent.properties

Code: Alles auswählen


FilterFilterComponent.compName = CSV Filter
FilterFilterComponent.description = Allows to build filter components reading filter information from a CSV file.
FilterFilterComponent.name = CSVFileFilterComponent
FilterFilterComponent.settings.info = Please provide the CSV file path:

csvfilefiltercomponent_de.properties

Code: Alles auswählen


FilterFilterComponent.compName = CSV-Datei
FilterFilterComponent.description = Ermöglicht die Erstellung von Filterkomponenten deren Filterinformationen aus einer CSV-Datei gelesen werden.
FilterFilterComponent.name = CSV-Datei-Filterkomponente
FilterFilterComponent.settings.info = Bitte geben Sie den Pfad zur CSV-Datei an:

Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Bitte sende mir den korrigierten Code, falls da noch Bugs drin sind.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Der Quellcode ist in der Plugin-Datei enthalten.
CSVFileFilterComponent.jar
(7.81 KiB) 93-mal heruntergeladen
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Danke! :D :D :D
Das JAR kopiere ich dann in das Plugin-Verzeichnis! Richtig?
Ich mache dann mal einen Performance-Test.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Ja, oder du ziehst die Datei in das TV-Browser Fenster, dann wird die Installation angeboten.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Oh jeh! Wenn ich für den Filter mit der neuen Komponente ein Filter-Info Icon anlege, erhalte ich vom Filter-Info-Icon Plugin eine Exception

Code: Alles auswählen


Das Plugin "Filter-Info-Icons" hat einen Fehler verursacht. Soll es deaktiviert werden?

----- Start of stacktrace -----
java.lang.NullPointerException
  at csvfilefiltercomponent.CSVFileFilterComp.accept(CSVFileFilterComp.java:53)
  at tvbrowser.core.filters.ItemNode.accept(UserFilter.java:581)
  at tvbrowser.core.filters.AndNode.accept(UserFilter.java:542)
  at tvbrowser.core.filters.UserFilter.accept(UserFilter.java:407)
  at filterinfoicon.FilterEntry.accepts(FilterEntry.java:262)
  at filterinfoicon.FilterInfoIcon.getProgramTableIcons(FilterInfoIcon.java:192)
  at tvbrowser.core.plugin.JavaPluginProxy.doGetProgramTableIcons(JavaPluginProxy.java:473)
  at tvbrowser.core.plugin.AbstractPluginProxy.getProgramTableIcons(AbstractPluginProxy.java:409)
  at util.ui.ProgramPanel.getPluginIcons(ProgramPanel.java:686)
  at util.ui.ProgramPanel.paintComponent(ProgramPanel.java:711)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.CellRendererPane.paintComponent(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paintCell(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paintImpl(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paint(Unknown Source)
  at javax.swing.plaf.ComponentUI.update(Unknown Source)
  at javax.swing.JComponent.paintComponent(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintToOffscreen(Unknown Source)
  at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
  at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
  at javax.swing.RepaintManager.paint(Unknown Source)
  at javax.swing.JComponent._paintImmediately(Unknown Source)
  at javax.swing.JComponent.paintImmediately(Unknown Source)
  at javax.swing.RepaintManager$3.run(Unknown Source)
  at javax.swing.RepaintManager$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.access$1100(Unknown Source)
  at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$300(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at util.ui.textcomponentpopup.TextComponentPopupEventQueue.dispatchEvent(TextComponentPopupEventQueue.java:55)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.WaitDispatchSupport$2.run(Unknown Source)
  at java.awt.WaitDispatchSupport$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.awt.WaitDispatchSupport.enter(Unknown Source)
  at java.awt.Dialog.show(Unknown Source)
  at java.awt.Component.show(Unknown Source)
  at java.awt.Component.setVisible(Unknown Source)
  at java.awt.Window.setVisible(Unknown Source)
  at java.awt.Dialog.setVisible(Unknown Source)
  at filterinfoicon.FilterInfoIcon$1.actionPerformed(FilterInfoIcon.java:129)
  at devplugin.ContextMenuAction.actionPerformed(ContextMenuAction.java:70)
  at tvbrowser.core.plugin.ActionProxy.actionPerformed(ActionProxy.java:83)
  at tvbrowser.ui.mainframe.toolbar.ToolBar$11.actionPerformed(ToolBar.java:617)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at util.ui.PopupButton.fireActionPerformed(PopupButton.java:53)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$300(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at util.ui.textcomponentpopup.TextComponentPopupEventQueue.dispatchEvent(TextComponentPopupEventQueue.java:55)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
----- End of stacktrace -----


Zuletzt geändert von Sheldon2012 am 02 Mär 2015, 21:45, insgesamt 1-mal geändert.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Dann lösche den Filter nochmal und probiere es hiermit:
CSVFileFilterComponent.jar
(7.84 KiB) 93-mal heruntergeladen
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Das Filter-Info-Icon Plugin mag unsere Filterkomponente nicht! :(

Code: Alles auswählen


Das Plugin "Filter-Info-Icons" hat einen Fehler verursacht. Soll es deaktiviert werden?

----- Start of stacktrace -----
java.lang.NullPointerException
  at csvfilefiltercomponent.CSVFileFilterComp.prepareForComparison(CSVFileFilterComp.java:195)
  at csvfilefiltercomponent.CSVFileFilterComp.accept(CSVFileFilterComp.java:64)
  at tvbrowser.core.filters.ItemNode.accept(UserFilter.java:581)
  at tvbrowser.core.filters.AndNode.accept(UserFilter.java:542)
  at tvbrowser.core.filters.UserFilter.accept(UserFilter.java:407)
  at filterinfoicon.FilterEntry.accepts(FilterEntry.java:262)
  at filterinfoicon.FilterInfoIcon.getProgramTableIcons(FilterInfoIcon.java:192)
  at tvbrowser.core.plugin.JavaPluginProxy.doGetProgramTableIcons(JavaPluginProxy.java:473)
  at tvbrowser.core.plugin.AbstractPluginProxy.getProgramTableIcons(AbstractPluginProxy.java:409)
  at util.ui.ProgramPanel.getPluginIcons(ProgramPanel.java:686)
  at util.ui.ProgramPanel.paintComponent(ProgramPanel.java:711)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.CellRendererPane.paintComponent(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paintCell(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paintImpl(Unknown Source)
  at javax.swing.plaf.basic.BasicListUI.paint(Unknown Source)
  at javax.swing.plaf.ComponentUI.update(Unknown Source)
  at javax.swing.JComponent.paintComponent(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JViewport.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JSplitPane.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JSplitPane.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at javax.swing.JLayeredPane.paint(Unknown Source)
  at javax.swing.JComponent.paintChildren(Unknown Source)
  at javax.swing.JComponent.paintToOffscreen(Unknown Source)
  at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
  at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
  at javax.swing.RepaintManager.paint(Unknown Source)
  at javax.swing.JComponent.paint(Unknown Source)
  at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
  at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
  at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
  at java.awt.Container.paint(Unknown Source)
  at java.awt.Window.paint(Unknown Source)
  at javax.swing.RepaintManager$3.run(Unknown Source)
  at javax.swing.RepaintManager$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
  at javax.swing.RepaintManager.access$1100(Unknown Source)
  at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
  at java.awt.event.InvocationEvent.dispatch(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$300(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at 


....


Die exception ist zu lang.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Das zeigt nur, wie viel einfacher es wäre, wenn du eine Entwicklungsumgebung hättest:
CSVFileFilterComponent.jar
(7.85 KiB) 108-mal heruntergeladen
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Hurra, Jetzt sind die Exceptions weg! Danke! :D
Und das Plugin funktioniert sogar! :) Kaum zu glauben! :o

Prinzipiell hast Du ja recht! Aber wenn die Fehler, so wie jetzt, aus einer ganz anderen Ecke kommen, benötige ich mit dem aktuellen Wissensstand bzgl. des Quellcodes bis Weihnachten, um den Fehler zu finden. Wann soll ich denn dann noch Geschenke kaufen? :)

Aberjetzt habe ich ja ein aktuelles Beispiel, von dem ich weiss, das es funktioniert, an dem ich das ganze mal durchspielen kann.
ds10
Site Admin
Beiträge: 19131
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: BeanShell - Textdatei auslesen

Beitrag von ds10 »

Sheldon2012 hat geschrieben:Aber wenn die Fehler, so wie jetzt, aus einer ganz anderen Ecke kommen, benötige ich mit dem aktuellen Wissensstand bzgl. des Quellcodes bis Weihnachten, um den Fehler zu finden.
Das denke ich nicht. Java-Fehlermeldungen sind sehr spezfisch:

Code: Alles auswählen

java.lang.NullPointerException
  at csvfilefiltercomponent.CSVFileFilterComp.prepareForComparison(CSVFileFilterComp.java:195)
D.h. in Zeile 195 in CSVFileFilterComp.java trat eine NullPointerException auf. Eine NullPointerException bedeutet, es wurde auf null oder eine Variable die null enthält zugegriffen, als wenn sie nicht null wäre, Beispiel:

Code: Alles auswählen

...
23 String name;
24
25 if(name.length() > 0) {
26   System.out.println(name);
27 }
...
wird eine NullPointerException in Zeile 25 anzeigen, denn die Variable name ist nicht mit einem String initialisiert worden und enthält folglich null. Den Fehler würde man dann beispielsweise so beheben:

Code: Alles auswählen

...
23 String name = "";
24
25 if(name.length() > 0) {
26   System.out.println(name);
27 }
...
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: BeanShell - Textdatei auslesen

Beitrag von Sheldon2012 »

Die Performance ist jedoch katastrophal. :( Das habe ich befürchtet.
Bei 10.000 Einträgen in der Datei geht im TV-Browser fast nichts mehr.
Das ist natürlich irgendwo klar, wenn permanent abgefragt wird.
Womit wir wieder bei der Option wären.
Antworten