|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame org.greenstone.gs3client.GS3JavaClient
public class GS3JavaClient
The main Javaclient class. Creates the main window containing: - the radio button group for making either Greenstone 3 or Fedora the active DL. - the comboboxes for selecting the collection and the service therein - three panes - for executing queries, viewing search results and browsing.
Nested Class Summary | |
---|---|
(package private) static class |
GS3JavaClient.PasswordAuthenticator
Inner class that handles authentication for any sites (urls, etc.) that require it. |
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
activity
To keep track of whether we are searching or browsing. |
protected BrowseDisplay |
browsePanel
|
protected BrowseResponseData |
browseResponseObject
Object that stores the data of a browse response XML message (response for classification hierarchies) |
static int |
BROWSING
The value of the BROWSING activity |
protected javax.swing.JComboBox |
collBox
|
protected javax.swing.JTextField |
collectionNameField
|
protected javax.swing.JButton |
collInfoButton
|
protected java.lang.String |
colName
The currently selected collection |
protected DigitalLibraryServicesAPIA |
dlAPIA
Reference to a digital library instance (Greenstone 3 or Fedora) that allows this client to execute services offered by the digital library |
protected javax.swing.JComboBox |
dlChooser
|
protected static java.lang.String[] |
dlOptions
|
protected static boolean |
executableServicesOnly
we want to display a drop-down box for the services available, but only Services that can be executed (searching and browsing) |
protected static int |
FEDORA
|
protected FedoraServicesAPIA |
fedoraDL
Reference to the object that interacts with the FedoraGS3.jar component |
protected static int |
GREENSTONE
|
protected GS3ServicesAPIA |
greenstoneDL
Reference to the object that interacts with Greenstone3's web services |
protected java.lang.String |
lang
Preferred language of display items in responses. |
(package private) static org.apache.log4j.Logger |
LOG
The Logger for this class |
protected javax.swing.JTextField |
nonProxyHostNamesField
|
protected javax.swing.JTextField |
proxyhostField
|
protected javax.swing.JTextField |
proxyportField
|
protected QueryForm |
queryPanel
|
protected QueryResponseData |
queryResponseObj
Object that stores the data of a query response XML message |
protected javax.swing.JButton |
searchButton
|
static int |
SEARCHING
The value of the SEARCHING activity |
protected javax.swing.JPanel |
searchPanel
|
protected SearchResultsDisplay |
searchResultsDisplay
|
protected javax.swing.JTextArea |
searchSummary
|
protected static int |
SELECT
|
protected javax.swing.JComboBox |
serviceBox
|
protected java.lang.String |
serviceName
The currently selected service |
protected javax.swing.JButton |
setProxySettings
|
protected javax.swing.JTabbedPane |
tabbedPane
|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
GS3JavaClient()
Default constructor that creates and initialises this main window and its internal GUI components |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Event handler for actionEvents such as a change in the active digital library, a collection being selected in the dropdown box or the collection -Info button being pressed, or a service being selected in the service dropdown box (browsing or searching). |
protected void |
changeDL(DigitalLibraryServicesAPIA dl)
Method that is called when the user chooses to change the active digital library (between Greenstone3 and Fedora). |
void |
changeUIColour(int DL)
Changes the background colours of the client's user interface based on what the active digital library is. |
protected boolean |
createFedoraDLConnection()
Attempts to establish a connection to FedoraGS3.jar and instantiate a FedoraServicesAPIA object and store it in the member variable fedoraDL. |
protected boolean |
createGreenstoneDLConnection()
Attempts to establish a connection to GS3 Web services and instantiate a GS3ServicesAPIA object and store it in the member variable greenstoneDL. |
void |
doBrowse(BrowseDisplay.ClassifierData classifier)
Given a ClassifierData object indicating what browsing category was chosen, this method will retrieve all its descendants in the hierarchy. |
java.lang.String |
getBaseURL()
|
java.lang.String |
getFilePath(DocumentNodeData docNode)
|
java.lang.String |
getLanguage()
|
protected org.w3c.dom.Element |
getResponseAsDOM(java.lang.String debugPrefix,
java.lang.String response)
Given an XML response string, returns the root document (element) representing its DOM form. |
static void |
main(java.lang.String[] args)
The main method of the GS3 java-client application. |
void |
performSearch(java.util.HashMap nameValParamsMap)
Called by the instance of the QueryForm class when the user has pressed the queryPanel's search button to execute a query. |
void |
retrieveAllMetadataFor(DocumentNodeData docNode)
Performs a docMetadataRetrieve message request for the docNode iff the metadata for that docNode is not already set. |
void |
retrieveContentFor(DocumentNodeData docNode)
Performs a docMetadataRetrieve message request for the docNode iff the nodeContent for that docNode is not already set. |
void |
retrieveTitledStructureFor(ClassifierNodeData classNode)
Given a ClassifierNodeData object for browsing, this method will set the classNode's children (previously retrieved) and retrieve all the children's metadata including the title. |
void |
retrieveTitledStructureFor(DocumentNodeData docNode)
Performs a structureRetrieve and title metadata retrieve message- request for the docNode, but only iff the structure and title for that docNode is not already set. |
void |
setLanguage(java.lang.String lang)
Set the preferred language of the display items |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
static org.apache.log4j.Logger LOG
public static int SEARCHING
public static int BROWSING
protected static final boolean executableServicesOnly
protected int activity
protected DigitalLibraryServicesAPIA dlAPIA
protected GS3ServicesAPIA greenstoneDL
protected FedoraServicesAPIA fedoraDL
protected QueryResponseData queryResponseObj
protected BrowseResponseData browseResponseObject
protected java.lang.String lang
protected java.lang.String colName
protected java.lang.String serviceName
protected javax.swing.JComboBox dlChooser
protected javax.swing.JTextField proxyhostField
protected javax.swing.JTextField proxyportField
protected javax.swing.JTextField nonProxyHostNamesField
protected javax.swing.JButton setProxySettings
protected javax.swing.JComboBox serviceBox
protected javax.swing.JComboBox collBox
protected javax.swing.JButton collInfoButton
protected javax.swing.JButton searchButton
protected javax.swing.JTabbedPane tabbedPane
protected static final int SELECT
protected static final int GREENSTONE
protected static final int FEDORA
protected static final java.lang.String[] dlOptions
protected QueryForm queryPanel
protected javax.swing.JTextField collectionNameField
protected SearchResultsDisplay searchResultsDisplay
protected javax.swing.JPanel searchPanel
protected javax.swing.JTextArea searchSummary
protected BrowseDisplay browsePanel
Constructor Detail |
---|
public GS3JavaClient()
Method Detail |
---|
public java.lang.String getLanguage()
public void setLanguage(java.lang.String lang)
lang
- - the preferred language for display valuesprotected boolean createGreenstoneDLConnection()
protected boolean createFedoraDLConnection()
protected void changeDL(DigitalLibraryServicesAPIA dl)
dl
- is the new active digital library (the
DigitalLibraryServicesAPIA object to change to).protected org.w3c.dom.Element getResponseAsDOM(java.lang.String debugPrefix, java.lang.String response)
response
- - the XML response string to be converted into
its DOM form
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void performSearch(java.util.HashMap nameValParamsMap)
nameValParamsMap
- - the query form control names with the values
the user has entered for them. Example, the pair (fqv, the query string),
where fqv is the form control name for the query term.public void retrieveAllMetadataFor(DocumentNodeData docNode)
docNode
- is the DocumentNodeData object for which all the
metadata is to be retrieved.public void retrieveContentFor(DocumentNodeData docNode)
docNode
- is the DocumentNodeData object for which the content
is to be retrieved.public void retrieveTitledStructureFor(DocumentNodeData docNode)
docNode
- is the DocumentNodeData object for which the title
is to be retrieved along with the titles of all its descendants.public void doBrowse(BrowseDisplay.ClassifierData classifier)
classifier
- is the ClassifierData object whose children are
to be retrieved.public void retrieveTitledStructureFor(ClassifierNodeData classNode)
classNode
- is the ClassifierNodeData object whose title is to
be retrieved along with the titles for its children.public java.lang.String getBaseURL()
public java.lang.String getFilePath(DocumentNodeData docNode)
public void changeUIColour(int DL)
DL
- indicates whether the active digital library is Greenstone or
Fedora (or neither, in which case the GUI defaults to the usual grey).public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |