de.mud.jta.plugin
Class Capture

java.lang.Object
  extended by de.mud.jta.Plugin
      extended by de.mud.jta.plugin.Capture
All Implemented Interfaces:
FilterPlugin, VisualPlugin, java.awt.event.ActionListener, java.util.EventListener

public class Capture
extends Plugin
implements FilterPlugin, VisualPlugin, java.awt.event.ActionListener

A capture plugin that captures data and stores it in a defined location. The location is specified as a plugin configuration option Capture.url and can be used in conjunction with the UploadServlet from the tools directory.

Parametrize the plugin carefully:
Capture.url should contain a unique URL can may have parameters for identifying the upload.
Example: http://mg.mud.de/servlet/UpladServlet?id=12345

The actually captured data will be appended as the parameter content.

Maintainer: Matthias L. Jugel

Version:
$Id: Capture.java 499 2005-09-29 08:24:54Z leo $
Author:
Matthias L. Jugel, Marcus Mei???ner

Field Summary
protected  boolean captureEnabled
          Whether the capture is currently enabled or not
protected  javax.swing.JDialog doneDialog
           
protected  javax.swing.JDialog errorDialog
           
protected  javax.swing.JDialog fileDialog
           
protected  javax.swing.JMenu menu
          The plugin menu
protected  java.util.Hashtable remoteUrlList
          The remote storage URL
protected  FilterPlugin source
           
 
Fields inherited from class de.mud.jta.Plugin
bus, id
 
Constructor Summary
Capture(PluginBus bus, java.lang.String id)
          Initialize the Capture plugin.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 FilterPlugin getFilterSource()
           
 javax.swing.JMenu getPluginMenu()
          The Capture menu for the menu bar as configured in the constructor.
 javax.swing.JComponent getPluginVisual()
          The Capture plugin has no visual component that is embedded in the JTA main frame, so this returns null.
 int read(byte[] b)
          Read data from the left side plugin, capture the content and pass it on to the next plugin which called this method.
 void setFilterSource(FilterPlugin source)
          The filter source is the plugin where Capture is connected to.
 void write(byte[] b)
          Write data to the backend but also append it to the capture buffer.
 
Methods inherited from class de.mud.jta.Plugin
error, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remoteUrlList

protected java.util.Hashtable remoteUrlList
The remote storage URL


menu

protected javax.swing.JMenu menu
The plugin menu


errorDialog

protected javax.swing.JDialog errorDialog

fileDialog

protected javax.swing.JDialog fileDialog

doneDialog

protected javax.swing.JDialog doneDialog

captureEnabled

protected boolean captureEnabled
Whether the capture is currently enabled or not


source

protected FilterPlugin source
Constructor Detail

Capture

public Capture(PluginBus bus,
               java.lang.String id)
Initialize the Capture plugin. This sets up the menu entries and registers the plugin on the bus.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setFilterSource

public void setFilterSource(FilterPlugin source)
The filter source is the plugin where Capture is connected to. In the list of plugins this is the one to the left.

Specified by:
setFilterSource in interface FilterPlugin
Parameters:
source - the next plugin

getFilterSource

public FilterPlugin getFilterSource()
Specified by:
getFilterSource in interface FilterPlugin

read

public int read(byte[] b)
         throws java.io.IOException
Read data from the left side plugin, capture the content and pass it on to the next plugin which called this method.

Specified by:
read in interface FilterPlugin
Parameters:
b - the buffer to store data into
Returns:
the amount of bytes actually read
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Write data to the backend but also append it to the capture buffer.

Specified by:
write in interface FilterPlugin
Parameters:
b - the buffer with data to write
Throws:
java.io.IOException

getPluginVisual

public javax.swing.JComponent getPluginVisual()
The Capture plugin has no visual component that is embedded in the JTA main frame, so this returns null.

Specified by:
getPluginVisual in interface VisualPlugin
Returns:
always null

getPluginMenu

public javax.swing.JMenu getPluginMenu()
The Capture menu for the menu bar as configured in the constructor.

Specified by:
getPluginMenu in interface VisualPlugin
Returns:
the drop down menu