edu.ucsb.nceas.morpho.plugins.datapackagewizard.pages
Class AccessPage

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.ucsb.nceas.morpho.framework.AbstractUIPage
                      extended byedu.ucsb.nceas.morpho.plugins.datapackagewizard.pages.AccessPage
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class AccessPage
extends AbstractUIPage

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JComboBox accessComboBox
           
 boolean accessIsAllow
           
protected  javax.swing.JTree accessTree
           
protected  javax.swing.JTextField dnField
           
protected  edu.ucsb.nceas.morpho.plugins.datapackagewizard.pages.AccessProgressThread pbt
           
 JTreeTable treeTable
           
protected  javax.swing.JComboBox typeComboBox
           
protected  java.lang.String userAccess
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AccessPage()
           
 
Method Summary
protected  void cancelGetDocumentFromMetacat()
           
protected  void displayDNPanel()
           
protected  void displayTree(javax.swing.tree.DefaultMutableTreeNode treeNode)
          Checks if treenode is present - if present, creates a ScrollPane and sends back the scrollpane...
protected  void generateAccessTree()
          Generates Access.accessTreeNode ...
protected  org.w3c.dom.Document getDocumentFromFile()
           
protected  void getDocumentFromMetacat()
           
 java.lang.String getNextPageID()
          Returns the ID of the page that the user will see next, after the "Next" button is pressed.
 OrderedMap getPageData()
          gets the Map object that contains all the key/value paired settings for this particular UI page
 OrderedMap getPageData(java.lang.String xPathRoot)
          gets the Map object that contains all the key/value paired settings for this particular UI page
 java.lang.String getPageID()
          gets the unique ID for this wizard page
 java.lang.String getPageNumber()
          Returns the serial number of the page
 java.lang.String getSubtitle()
          gets the subtitle for this wizard page
 java.util.List getSurrogate()
           
 java.lang.String getTitle()
          gets the title for this wizard page
protected  javax.swing.tree.DefaultMutableTreeNode getTreeFromDocument(org.w3c.dom.Document doc)
           
 boolean isQueryMetacatCancelled()
           
 boolean onAdvanceAction()
          The action to be executed when the "OK" button is pressed.
 void onLoadAction()
          The action to be executed when the page is loaded Here, it does nothing because this is just a Panel and not the outer container
 void onRewindAction()
          The action to be executed when the "Prev" button is pressed.
protected  void parseInputStream(java.io.InputStream queryResult)
           
 boolean setPageData(OrderedMap map, java.lang.String xPathRoot)
          sets the fields in the UI page using the Map object that contains all the key/value paired
 void setQueryMetacatCancelled(boolean queryMetacatCancelled)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

accessTree

protected javax.swing.JTree accessTree

dnField

protected javax.swing.JTextField dnField

userAccess

protected java.lang.String userAccess

typeComboBox

protected javax.swing.JComboBox typeComboBox

accessComboBox

protected javax.swing.JComboBox accessComboBox

pbt

protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.pages.AccessProgressThread pbt

treeTable

public JTreeTable treeTable

accessIsAllow

public boolean accessIsAllow
Constructor Detail

AccessPage

public AccessPage()
Method Detail

setQueryMetacatCancelled

public void setQueryMetacatCancelled(boolean queryMetacatCancelled)

generateAccessTree

protected void generateAccessTree()
Generates Access.accessTreeNode ... the algorithm followed is the following: 0. show a progress bar with text at the bottom showing which step is being performed and a cancel button .. if cancel button is pressed, thing on step 4 are performed.... 1. try to read accesslist.xml and find if there is an entry for current metacat server name... 2. if there is an entry generate the dom for the and send it domToTreeNode() funtion. 3. If not, contact metacat server with action=getprincipals... 4. If metacat server is not available, set appropriate text in middlePanel, show dnPanel, make other required changes in panel and close the progressbar 5. If metacat server is available, get the result... store it in file.. if it in the file already then delete the old entry and write the file again...

Returns:

getDocumentFromFile

protected org.w3c.dom.Document getDocumentFromFile()

getDocumentFromMetacat

protected void getDocumentFromMetacat()

parseInputStream

protected void parseInputStream(java.io.InputStream queryResult)

displayDNPanel

protected void displayDNPanel()

cancelGetDocumentFromMetacat

protected void cancelGetDocumentFromMetacat()

displayTree

protected void displayTree(javax.swing.tree.DefaultMutableTreeNode treeNode)
Checks if treenode is present - if present, creates a ScrollPane and sends back the scrollpane... otherwise sends back null.


getTreeFromDocument

protected javax.swing.tree.DefaultMutableTreeNode getTreeFromDocument(org.w3c.dom.Document doc)

onAdvanceAction

public boolean onAdvanceAction()
The action to be executed when the "OK" button is pressed. If no onAdvance processing is required, implementation must return boolean true.

Specified by:
onAdvanceAction in class AbstractUIPage
Returns:
boolean true if dialog should close and return to wizard, false if not (e.g. if a required field hasn't been filled in)

getSurrogate

public java.util.List getSurrogate()
Returns:
a List contaiing 2 String elements - one for each column of the 2-col list in which this surrogate is displayed

getPageData

public OrderedMap getPageData()
Description copied from class: AbstractUIPage
gets the Map object that contains all the key/value paired settings for this particular UI page

Specified by:
getPageData in class AbstractUIPage
Returns:
data the Map object that contains all the key/value paired settings for this particular UI page

getPageData

public OrderedMap getPageData(java.lang.String xPathRoot)
Description copied from class: AbstractUIPage
gets the Map object that contains all the key/value paired settings for this particular UI page

Specified by:
getPageData in class AbstractUIPage
Parameters:
xPathRoot - the root xpath to prepend to all the xpaths returned by this method
Returns:
data the Map object that contains all the key/value paired settings for this particular UI page

onRewindAction

public void onRewindAction()
The action to be executed when the "Prev" button is pressed. May be empty Here, it does nothing because this is just a Panel and not the outer container

Specified by:
onRewindAction in class AbstractUIPage

onLoadAction

public void onLoadAction()
The action to be executed when the page is loaded Here, it does nothing because this is just a Panel and not the outer container

Specified by:
onLoadAction in class AbstractUIPage

getPageID

public java.lang.String getPageID()
gets the unique ID for this wizard page

Specified by:
getPageID in class AbstractUIPage
Returns:
the unique ID String for this wizard page

getTitle

public java.lang.String getTitle()
gets the title for this wizard page

Specified by:
getTitle in class AbstractUIPage
Returns:
the String title for this wizard page

getSubtitle

public java.lang.String getSubtitle()
gets the subtitle for this wizard page

Specified by:
getSubtitle in class AbstractUIPage
Returns:
the String subtitle for this wizard page

getNextPageID

public java.lang.String getNextPageID()
Returns the ID of the page that the user will see next, after the "Next" button is pressed. If this is the last page, return value must be null

Specified by:
getNextPageID in class AbstractUIPage
Returns:
the String ID of the page that the user will see next, or null if this is te last page

getPageNumber

public java.lang.String getPageNumber()
Returns the serial number of the page

Specified by:
getPageNumber in class AbstractUIPage
Returns:
the serial number of the page

isQueryMetacatCancelled

public boolean isQueryMetacatCancelled()

setPageData

public boolean setPageData(OrderedMap map,
                           java.lang.String xPathRoot)
Description copied from class: AbstractUIPage
sets the fields in the UI page using the Map object that contains all the key/value paired

Specified by:
setPageData in class AbstractUIPage
Parameters:
map - the Map object that contains all the key/value paired settings for this particular UI page
xPathRoot - the String that represents the "root" of the XPath to the content of this widget, INCLUDING PREDICATES. example - if this is a "Party" widget, being used for the second "Creator" entry in a list, then xPathRoot = "/eml:eml/dataset[1]/creator[2]
Returns:
boolean true if this page can handle all the data passed in the OrderedMap, false if not. NOTE that the setPageData() method should still complete its work and fill out all the UI values, even if it is returning false


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.