org.archiviststoolkit.plugin
Interface ATPlugin


public interface ATPlugin

Archivists' Toolkit(TM) Copyright 2005-2009 Regents of the University of California, New York University, & Five Colleges, Inc. All rights reserved. This software is free. You can redistribute it and / or modify it under the terms of the Educational Community License (ECL) version 1.0 (http://www.opensource.org/licenses/ecl1.php) This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ECL license for more details about permissions and limitations. Archivists' Toolkit(TM) http://www.archiviststoolkit.org info@archiviststoolkit.org The simple plugin interface which all AT Plugins need to be implement in order to be loaded into the AT Created by IntelliJ IDEA.


Field Summary
static java.lang.String ACCESSION_EDITOR
           
static java.lang.String ALL_EDITOR
           
static java.lang.String ASSESSMENT_EDITOR
           
static java.lang.String DEFAULT_CATEGORY
           
static java.lang.String DIGITALOBJECT_EDITOR
           
static java.lang.String EDITOR_CATEGORY
           
static java.lang.String EMBEDDED_EDITOR_CATEGORY
           
static java.lang.String IMPORT_CATEGORY
           
static java.lang.String INSTANCE_EDITOR
           
static java.lang.String NAME_EDITOR
           
static java.lang.String RESOURCE_COMPONENT_EDITOR
           
static java.lang.String RESOURCE_EDITOR
           
static java.lang.String SUBJECT_EDITOR
           
static java.lang.String TOOL_CATEGORY
           
static java.lang.String VIEWER_CATEGORY
           
 
Method Summary
 void doTask(java.lang.String task)
          Method to do a specific task in the plugin.
 java.lang.String getCategory()
          Method to get the category of the plugin i.e.
 java.lang.String getEditorType()
          Method to return the type of domain objects this plugin can edit or view.
 java.util.HashMap getEmbeddedPanels()
          Method to return a hasmap containing jpanels for plugins that are not dialog or frames.
 java.lang.String getName()
          Method to return the name of the plugin.
 java.lang.String[] getTaskList()
          Method to get the list of specific task the plugin can perform.
 void setApplicationFrame(ApplicationFrame mainFrame)
          Method to set the application frame.
 void setCallingTable(javax.swing.JTable callingTable)
          Method to get the table from which the record was selected.
 void setEditorField(ArchDescriptionFields editorField)
          Method to set the editor field.
 void setEditorField(DomainEditorFields editorField)
          Method to set the editor field.
 void setModel(DomainObject domainObject, InfiniteProgressPanel monitor)
          Method to set the domain model.
 void setRecordPositionText(int recordNumber, int totalRecords)
          Method to set the current record number along with the total number of records
 void setSelectedRow(int selectedRow)
          Method to set the selected row of the calling table.
 void showPlugin()
          Method to display the plugin or do anything else the plugin requires when selected from the plugin or import menu, if it doesn't define a task list.
 void showPlugin(java.awt.Dialog owner)
          Method to display a plugin that needs a parent dialog.
 void showPlugin(java.awt.Frame owner)
          Method to display a plugin that needs a parent frame.
 

Field Detail

DEFAULT_CATEGORY

static final java.lang.String DEFAULT_CATEGORY
See Also:
Constant Field Values

IMPORT_CATEGORY

static final java.lang.String IMPORT_CATEGORY
See Also:
Constant Field Values

TOOL_CATEGORY

static final java.lang.String TOOL_CATEGORY
See Also:
Constant Field Values

VIEWER_CATEGORY

static final java.lang.String VIEWER_CATEGORY
See Also:
Constant Field Values

EDITOR_CATEGORY

static final java.lang.String EDITOR_CATEGORY
See Also:
Constant Field Values

EMBEDDED_EDITOR_CATEGORY

static final java.lang.String EMBEDDED_EDITOR_CATEGORY
See Also:
Constant Field Values

RESOURCE_EDITOR

static final java.lang.String RESOURCE_EDITOR
See Also:
Constant Field Values

RESOURCE_COMPONENT_EDITOR

static final java.lang.String RESOURCE_COMPONENT_EDITOR
See Also:
Constant Field Values

DIGITALOBJECT_EDITOR

static final java.lang.String DIGITALOBJECT_EDITOR
See Also:
Constant Field Values

NAME_EDITOR

static final java.lang.String NAME_EDITOR
See Also:
Constant Field Values

SUBJECT_EDITOR

static final java.lang.String SUBJECT_EDITOR
See Also:
Constant Field Values

ACCESSION_EDITOR

static final java.lang.String ACCESSION_EDITOR
See Also:
Constant Field Values

INSTANCE_EDITOR

static final java.lang.String INSTANCE_EDITOR
See Also:
Constant Field Values

ASSESSMENT_EDITOR

static final java.lang.String ASSESSMENT_EDITOR
See Also:
Constant Field Values

ALL_EDITOR

static final java.lang.String ALL_EDITOR
See Also:
Constant Field Values
Method Detail

getCategory

java.lang.String getCategory()
Method to get the category of the plugin i.e. default, import, view or edit

Returns:
String that specify the category type

getName

java.lang.String getName()
Method to return the name of the plugin. If the plugin category is either import or default, this name appears in the menu

Returns:
Returns the plugin names

setApplicationFrame

void setApplicationFrame(ApplicationFrame mainFrame)
Method to set the application frame. In the AT, the application frame provides a means to access the current worksurface and hence the displayed records. This method is called every time a plugin is selected in the menu.

Parameters:
mainFrame - The main AT application frame

showPlugin

void showPlugin()
Method to display the plugin or do anything else the plugin requires when selected from the plugin or import menu, if it doesn't define a task list.


showPlugin

void showPlugin(java.awt.Frame owner)
Method to display a plugin that needs a parent frame. This method is not currently used in the AT so it can be left blank.

Parameters:
owner - The parent frame of this plugin

showPlugin

void showPlugin(java.awt.Dialog owner)
Method to display a plugin that needs a parent dialog. Not currently used in the AT, so it can be left blank.

Parameters:
owner - The parent dialog of this plugin

getEmbeddedPanels

java.util.HashMap getEmbeddedPanels()
Method to return a hasmap containing jpanels for plugins that are not dialog or frames. This is used for plugins that are to be embedded in a Domain Editor. The hasmap is keyed using the plugin names. The format of the plugin name can also be used to specify the location and whether to remove a planel already at that location. Format to use is panel_name::location::yes, no, main Examples >> New Editor Panel::0::yes (replace panel at index zero with this one) New Editor Panel::0::no (just insert the panel at zero) New Editor Panel::0::main (In Subjects editor only remove all other components in the panel and add this panel)

Returns:
The HashMap containing JPanels and their display name

setEditorField

void setEditorField(ArchDescriptionFields editorField)
Method to set the editor field. This is used by embeddable plugins so that they can gain access to public method of the editor field.

Parameters:
editorField - The editor field the plugin is embedded into

setEditorField

void setEditorField(DomainEditorFields editorField)
Method to set the editor field. This is used by embeddable plugins so that they can gain access to public method of the editor field.

Parameters:
editorField - The editor field the plugin is embedded into

doTask

void doTask(java.lang.String task)
Method to do a specific task in the plugin. This method is implemented by plugins that are can do multiple task. For example an importer for multiple file types. Its called each time a plugin that defines a task list is selected from the import or plugin menu.

Parameters:
task - The task for the plugin to do

getTaskList

java.lang.String[] getTaskList()
Method to get the list of specific task the plugin can perform. This task are displayed in submenus under either the import or plugin menu.

Returns:
A list of task this plugin can perform

getEditorType

java.lang.String getEditorType()
Method to return the type of domain objects this plugin can edit or view. This method is used by plugins that are implemented as an editor for one or more of the main domain objects such Names, Subjects, Accessions, Resuorces, and Digital Objects. Plugins that supports the supports the viewing and/or editing of multiple record types can be specify in the following manner: A plugin that supports viewing and/or editing of Names, Subjects, and Digital Object Records will return the following String: editorType = NAMES_EDITOR + " " + SUBJECT_EDITOR + " " + DIGITALOBJECT_EDITOR If a plugin returns ALL_EDITOR it means it can view and/or edit all main AT records.

Returns:
The type or types of recors an editor/viewer plugin can open.

setModel

void setModel(DomainObject domainObject,
              InfiniteProgressPanel monitor)
Method to set the domain model. This is always called by the AT

Parameters:
domainObject - The domain object
monitor - The progress monitor

setCallingTable

void setCallingTable(javax.swing.JTable callingTable)
Method to get the table from which the record was selected.

Parameters:
callingTable - The table containing the record

setSelectedRow

void setSelectedRow(int selectedRow)
Method to set the selected row of the calling table. This lets the plugin know the current row selection

Parameters:
selectedRow - The selected row

setRecordPositionText

void setRecordPositionText(int recordNumber,
                           int totalRecords)
Method to set the current record number along with the total number of records

Parameters:
recordNumber - The current record number
totalRecords - The total number of records