ucar.unidata.idv.publish
Class IdvPublisher

java.lang.Object
  extended by ucar.unidata.idv.publish.IdvPublisher
Direct Known Subclasses:
ServerPublisher

public abstract class IdvPublisher
extends Object

This is the start to an abstract base class that represents classes that can "publish" IDV content. Note: This framework is very much in flux

Right no we just have a single concrete derived class, InfoceteraBlogger, that publishes weblog content to an Infocetera web log.

The idea is that we might a variety of publishing mechanisms: other weblog clients, email, wiki, etc.

Instances of publishers are defined by the resources/publishers.xml file.

Author:
IDV development team

Field Summary
static String ATTR_CLASS
          Xml element "class" attribute name.
static GuiUtils GU
          A helper attribute so we can call static routines in GuiUtils without typing the whole class name
static String TAG_PUBLISHER
          Xml element "publisher" tag name
 
Constructor Summary
protected IdvPublisher(IntegratedDataViewer idv, Element element)
          Construct the object with the reference to the idv
 
Method Summary
abstract  boolean configure()
          Configure this publisher
abstract  void doPublish(String title, String filePath, String properties)
          Called by others to publish the given content
abstract  String getName()
          Get the name of this publisher
 String getPropertyPrefix()
          Used to prefix persistent properties.
static List getPublishers(IntegratedDataViewer idv, Element root)
          Process the given xml, instantiating a list of IdvPublishers
protected  void init()
          Initialize this publisher.
 boolean isConfigured()
          Has this publisher been configured.
abstract  boolean publishFile(String file, Properties properties)
          Called by others to publish the given file
abstract  boolean publishMessage(String subject, String label, String msg, String filename, Properties props)
          Called by others to publish the given content
 void publishMessageAndFile(String subject, String label, String msg, String file, Properties props)
          Publish the message and the given file
protected  void savePreferences()
          Write out the preferences held by this publisher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GU

public static final GuiUtils GU
A helper attribute so we can call static routines in GuiUtils without typing the whole class name


TAG_PUBLISHER

public static final String TAG_PUBLISHER
Xml element "publisher" tag name

See Also:
Constant Field Values

ATTR_CLASS

public static final String ATTR_CLASS
Xml element "class" attribute name. This is the class name of a concrete derived class of this class.

See Also:
Constant Field Values
Constructor Detail

IdvPublisher

protected IdvPublisher(IntegratedDataViewer idv,
                       Element element)
Construct the object with the reference to the idv

Parameters:
idv - Reference to the idv
element - The xml element that defined this publisher
Method Detail

getPublishers

public static List getPublishers(IntegratedDataViewer idv,
                                 Element root)
Process the given xml, instantiating a list of IdvPublishers

Parameters:
idv - The idv
root - Root of the publishers.xml file
Returns:
List of publishers

getPropertyPrefix

public String getPropertyPrefix()
Used to prefix persistent properties.

Returns:
The property prefix

init

protected void init()
Initialize this publisher. A hook so derived classes can get initialized


savePreferences

protected void savePreferences()
Write out the preferences held by this publisher. A hook for derived classes.


publishMessageAndFile

public void publishMessageAndFile(String subject,
                                  String label,
                                  String msg,
                                  String file,
                                  Properties props)
Publish the message and the given file

Parameters:
subject - The subject
label - The link label for the file
msg - The message
file - The file
props - The properties

isConfigured

public boolean isConfigured()
Has this publisher been configured.

Returns:
Is configured

getName

public abstract String getName()
Get the name of this publisher

Returns:
The name

configure

public abstract boolean configure()
Configure this publisher

Returns:
Was configuration successful

doPublish

public abstract void doPublish(String title,
                               String filePath,
                               String properties)
Called by others to publish the given content

Parameters:
title - Title of content
filePath - File name that was saved (e.g., an image)
properties - Other properties

publishFile

public abstract boolean publishFile(String file,
                                    Properties properties)
Called by others to publish the given file

Parameters:
file - File name that was saved (e.g., an image)
properties - Other properties
Returns:
Was this successful

publishMessage

public abstract boolean publishMessage(String subject,
                                       String label,
                                       String msg,
                                       String filename,
                                       Properties props)
Called by others to publish the given content

Parameters:
filename - File name that was saved (e.g., an image)
props - Other properties
subject - The subject line
label - The Label
msg - The message
Returns:
Was this successful