ucar.unidata.idv.publish
Class InfoceteraBlogger

java.lang.Object
  extended by ucar.unidata.idv.publish.IdvPublisher
      extended by ucar.unidata.idv.publish.ServerPublisher
          extended by ucar.unidata.idv.publish.InfoceteraBlogger

public class InfoceteraBlogger
extends ServerPublisher

Note, This is very much in flux. A client to an infocetera weblog (see: http://www.infocetera.com).

Author:
IDV development team

Field Summary
static String ATTR_DIRPATH
          Attribute name for the dirpath
 
Fields inherited from class ucar.unidata.idv.publish.ServerPublisher
ATTR_PASSWORD, ATTR_PORT, ATTR_SERVER, ATTR_USER, NULL_STRING
 
Fields inherited from class ucar.unidata.idv.publish.IdvPublisher
ATTR_CLASS, GU, TAG_PUBLISHER
 
Constructor Summary
InfoceteraBlogger(IntegratedDataViewer idv)
          Create the object
InfoceteraBlogger(IntegratedDataViewer idv, Element element)
          Create the object
 
Method Summary
 boolean configure()
          Do the configuration
 String getBlogFileLink(String filename)
          What is the link to the uploaded file that we add to the content
 String getDirpath()
          Get the infocetera directory path
 String getName()
          What is the name of this publisher
protected  void init()
          Initialize
 boolean isConfigured()
          Have we been configured
 boolean publishFile(String file, Properties props)
          Post the given file to the infocetera weblog
 boolean publishMessage(String subject, String label, String msg, String filename, Properties props)
          Post the message and the file to the infocetera weblog
 boolean resultOk(String xml)
          Check the return xml from the http post
protected  void savePreferences()
          Save opff any preferences
 void setDirpath(String value)
          Set the infocetera directory path
protected  void showError(String msg, String html)
          This method strips the html tags from the given html error message.
 
Methods inherited from class ucar.unidata.idv.publish.ServerPublisher
clean, defined, doPublish, getConnection, getPassword, getPort, getServer, getUser, setPassword, setPort, setServer, setUser
 
Methods inherited from class ucar.unidata.idv.publish.IdvPublisher
getPropertyPrefix, getPublishers, publishMessageAndFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_DIRPATH

public static final String ATTR_DIRPATH
Attribute name for the dirpath

See Also:
Constant Field Values
Constructor Detail

InfoceteraBlogger

public InfoceteraBlogger(IntegratedDataViewer idv)
Create the object

Parameters:
idv - The idv

InfoceteraBlogger

public InfoceteraBlogger(IntegratedDataViewer idv,
                         Element element)
Create the object

Parameters:
idv - The idv
element - The xml element that defined us
Method Detail

init

protected void init()
Initialize

Overrides:
init in class ServerPublisher

savePreferences

protected void savePreferences()
Save opff any preferences

Overrides:
savePreferences in class ServerPublisher

getBlogFileLink

public String getBlogFileLink(String filename)
What is the link to the uploaded file that we add to the content

Parameters:
filename - The filename
Returns:
Relative link to the uploaded file

resultOk

public boolean resultOk(String xml)
Check the return xml from the http post

Parameters:
xml - The xml we go back from infocetera
Returns:
Was this ok

publishFile

public boolean publishFile(String file,
                           Properties props)
Post the given file to the infocetera weblog

Specified by:
publishFile in class IdvPublisher
Parameters:
file - The file to post
props - The properties that contain the infocetera dirpath
Returns:
Was this successful

showError

protected void showError(String msg,
                         String html)
This method strips the html tags from the given html error message. It also strips out the copyright and other footer lines and shows the results to the user.

Parameters:
msg - The message
html - The html

getName

public String getName()
What is the name of this publisher

Specified by:
getName in class IdvPublisher
Returns:
The name

isConfigured

public boolean isConfigured()
Have we been configured

Overrides:
isConfigured in class ServerPublisher
Returns:
Is configured

configure

public boolean configure()
Do the configuration

Specified by:
configure in class IdvPublisher
Returns:
Configuration ok

publishMessage

public boolean publishMessage(String subject,
                              String label,
                              String msg,
                              String filename,
                              Properties props)
Post the message and the file to the infocetera weblog

Specified by:
publishMessage in class IdvPublisher
Parameters:
subject - The subject
label - The label for the link
msg - The weblog message
filename - Filename to post
props - The properties that contain the infocetera dirpath
Returns:
Was this successful

setDirpath

public void setDirpath(String value)
Set the infocetera directory path

Parameters:
value - The path

getDirpath

public String getDirpath()
Get the infocetera directory path

Returns:
The path