public class ElogUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,xal.extension.logbook.BinaryType> |
_binaryTypes
Map of binary types keyed by extension
|
protected ConnectionDictionary |
_connectionDictionary
connection dictionary
|
protected DatabaseAdaptor |
_databaseAdaptor
database adaptor
|
static java.lang.String |
CONTROLS_LOGBOOK
Controls logbook name
|
static int |
DEFAULT_MAX_BODY_SIZE
Default maximum allowed size of the main body text
|
static int |
DEFAULT_MAX_TITLE_SIZE
Default maximum allowed size of the title size
|
static java.lang.String |
OPERATIONS_LOGBOOK
Operations logbook name
|
Constructor and Description |
---|
ElogUtility(ConnectionDictionary dictionary)
ElogUtility constructor
Uses the default database adaptor.
|
Modifier and Type | Method and Description |
---|---|
static ElogUtility |
defaultUtility()
Get the default elog utility which uses the default connection dictionary and the default database adaptor.
|
java.util.Map<java.lang.String,xal.extension.logbook.BinaryType> |
getBinaryTypes()
Get the binary types.
|
int |
getMaxBodySize()
get the maximum allowed size of the main body text
|
static ConnectionDictionary |
newConnectionDictionary()
generate a new connection dictionary appropriate for publishing new logbook entries
|
void |
postEntry(java.lang.String logbook,
java.lang.String title,
java.lang.String content)
Post an entry to a logbook using the account of the user logged in.
|
void |
postEntry(java.lang.String logbook,
java.lang.String title,
java.lang.String content,
java.lang.String dataName,
java.lang.String formatName,
byte[] data)
Post an entry to a logbook using the account of the user logged in.
|
public static final int DEFAULT_MAX_BODY_SIZE
public static final int DEFAULT_MAX_TITLE_SIZE
public static final java.lang.String CONTROLS_LOGBOOK
public static final java.lang.String OPERATIONS_LOGBOOK
protected final ConnectionDictionary _connectionDictionary
protected final DatabaseAdaptor _databaseAdaptor
protected java.util.Map<java.lang.String,xal.extension.logbook.BinaryType> _binaryTypes
public ElogUtility(ConnectionDictionary dictionary) throws DatabaseException
dictionary
- The connection dictionary.gov.sns.tools.database.DatabaseException
- if an exception occurs while connecting to the databaseDatabaseException
public static ElogUtility defaultUtility() throws DatabaseException
gov.sns.tools.database.DatabaseException
- if an exception occurs while connecting to the databaseDatabaseException
public static ConnectionDictionary newConnectionDictionary()
public int getMaxBodySize()
public void postEntry(java.lang.String logbook, java.lang.String title, java.lang.String content) throws DatabaseException
logbook
- The name of the logbook to which we are posting the entrytitle
- The title of the entry to postcontent
- The content of the entry to postgov.sns.tools.database.DatabaseException
- if a database exception occurs while posting an entryDatabaseException
public void postEntry(java.lang.String logbook, java.lang.String title, java.lang.String content, java.lang.String dataName, java.lang.String formatName, byte[] data) throws DatabaseException
logbook
- The name of the logbook to which we are posting the entrytitle
- The title of the entry to postcontent
- The content of the entry to postdataName
- The name of the associatiated image or attachment data.formatName
- The format of the image or attachment data to associate with this entry (e.g. "jpg", "pdf", "txt").data
- The image or attachment data to associate with the entry.gov.sns.tools.database.DatabaseException
- if a database exception occurs while posting an entryDatabaseException
public java.util.Map<java.lang.String,xal.extension.logbook.BinaryType> getBinaryTypes()