Package uk.ac.starlink.vo
Class TapTableLoadDialog
java.lang.Object
uk.ac.starlink.table.gui.AbstractTableLoadDialog
uk.ac.starlink.vo.TapTableLoadDialog
- All Implemented Interfaces:
uk.ac.starlink.table.gui.TableLoadDialog
,DalLoader
public class TapTableLoadDialog
extends uk.ac.starlink.table.gui.AbstractTableLoadDialog
implements DalLoader
Load dialogue for TAP services.
- Since:
- 18 Jan 2011
- Author:
- Mark Taylor
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum for TAP run modes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptResourceIdList
(String[] ivoids, String msg) Takes a list of resource ID values and may load them or a subset into this object's dialogue as appropriate.void
Adds a listener that will be informed if the effective TAP query specified by this dialogue may have changed.void
addRunningQuery
(UwsJob tapJob) Adds a running TAP query to the list of queries this dialogue is currently aware of.void
protected Component
protected TapTableLoadDialog.TapRunMode[]
Returns the run modes provided by this dialogue.uk.ac.starlink.table.gui.TableLoader
protected uk.ac.starlink.table.TableSequence
createTableSequence
(uk.ac.starlink.table.StarTableFactory tfact, UwsJob tapJob, uk.ac.starlink.table.DescribedValue[] tapMeta) Returns a table sequence constructed from a given TAP query.protected TapQueryPanel
Creates a new TapQueryPanel.Returns an action that can log in/out to the currently displayed TAP service.uk.ac.starlink.util.ContentCoding
Returns the HTTP content coding policy used for TAP queries and some metadata requests.Returns the TAP query panel currently visible.Returns the finder panel for this window.Returns the registry panel for this window.Returns a panel-specific reload action.Returns the currently selected run mode.Returns the currently selected TAP service.getUploadLabels
(String adql) Returns a set of table identifers which are required for upload.protected uk.ac.starlink.table.StarTable
getUploadTable
(String upLabel) Returns a table named by an upload specifier in an ADQL query.Returns a callback invoked when the user clicks on a displayed URL.uk.ac.starlink.votable.VOTableWriter
Returns the VOTableWriter used for uploading table used by this dialog.boolean
isReady()
static void
Main method pops up an instance of this dialog.void
Removes a listener for TAP query changes.void
setContentCoding
(uk.ac.starlink.util.ContentCoding coding) Sets the HTTP content coding policy to use for TAP queries and some metadata requests.void
setMetaPolicy
(TapMetaPolicy metaPolicy) Sets the policy used for TAP service metadata acquisition.void
setPreferredOutputFormat
(String ofmtName) Sets the preferred format in which the service is to provide the table output.void
setServiceFinder
(TapServiceFinder finder) Sets the object that can locate TAP services by table metadata.void
setUrlHandler
(Consumer<URL> urlHandler) Sets a callback invoked when the user clicks on a displayed URL.void
setVOTableWriter
(uk.ac.starlink.votable.VOTableWriter vowriter) Sets the VOTableWriter used to serialise tables for upload to the TAP service when upload queries are performed.Methods inherited from class uk.ac.starlink.table.gui.AbstractTableLoadDialog
addToolbarAction, asIOException, createFormatSelector, getDescription, getIcon, getMenus, getName, getQueryComponent, getSelectedFormat, getSubmitAction, getToolbarActions, isAvailable, isComponentShowing, setIcon, setIconUrl, setMenus, setToolbarActions, submit, updateReady
-
Constructor Details
-
TapTableLoadDialog
public TapTableLoadDialog()Constructor.
-
-
Method Details
-
getUrlHandler
Returns a callback invoked when the user clicks on a displayed URL.- Returns:
- url click handler
-
setUrlHandler
Sets a callback invoked when the user clicks on a displayed URL.- Parameters:
urlHandler
- url click handler
-
configure
- Specified by:
configure
in interfaceuk.ac.starlink.table.gui.TableLoadDialog
- Overrides:
configure
in classuk.ac.starlink.table.gui.AbstractTableLoadDialog
-
createQueryComponent
- Specified by:
createQueryComponent
in classuk.ac.starlink.table.gui.AbstractTableLoadDialog
-
getUploadTable
Returns a table named by an upload specifier in an ADQL query. The TapTableLoadDialog implementation of this throws an exception, but subclasses may override this if they are capable of providing uploadable tables. If no table named by the given label is available, it is good practice to throw an IllegalArgumentException with an informative message, though returning null is also acceptable.- Parameters:
upLabel
- name part of an uploaded table specification, that is the part following the "TAP_UPLOAD." part- Returns:
- table named by
upLabel
-
createTableLoader
public uk.ac.starlink.table.gui.TableLoader createTableLoader()- Specified by:
createTableLoader
in interfaceuk.ac.starlink.table.gui.TableLoadDialog
-
addRunningQuery
Adds a running TAP query to the list of queries this dialogue is currently aware of.- Parameters:
tapJob
- UWS job representing TAP query
-
setMetaPolicy
Sets the policy used for TAP service metadata acquisition. As currently implemented, a change in policy triggers a reload of the metadata for the currently displayed service metadata, though not for other cached ones.- Parameters:
metaPolicy
- new metadata acquisition policy
-
setPreferredOutputFormat
Sets the preferred format in which the service is to provide the table output. This had better represent some form of VOTable. The supplied name may be a MIME type, an alias, or an ivo-id as described in sec 2.4 of TAPRegExt v1.0. If the supplied name is null, or if no output format has been declared by the service corresponding to the supplied name, then the service's default output format will be used.- Parameters:
ofmtName
- output format MIME type, alias or ivo-id
-
setServiceFinder
Sets the object that can locate TAP services by table metadata. Invoking this with a new finder instance initiates an asynchronous search for TAP services.- Parameters:
finder
- new finder
-
setVOTableWriter
public void setVOTableWriter(uk.ac.starlink.votable.VOTableWriter vowriter) Sets the VOTableWriter used to serialise tables for upload to the TAP service when upload queries are performed.- Parameters:
vowriter
- new votable serializer
-
getVOTableWriter
public uk.ac.starlink.votable.VOTableWriter getVOTableWriter()Returns the VOTableWriter used for uploading table used by this dialog.- Returns:
- table upload writer
-
setContentCoding
public void setContentCoding(uk.ac.starlink.util.ContentCoding coding) Sets the HTTP content coding policy to use for TAP queries and some metadata requests. Subsequent communications will use this setting.- Parameters:
coding
- configures HTTP compression
-
getContentCoding
public uk.ac.starlink.util.ContentCoding getContentCoding()Returns the HTTP content coding policy used for TAP queries and some metadata requests.- Returns:
- current HTTP compression configuration
-
getReloadAction
Returns a panel-specific reload action. When enabled, this performs some kind of update action relevant to the currently visible tab.- Returns:
- reload action
-
getAuthenticateAction
Returns an action that can log in/out to the currently displayed TAP service.- Returns:
- authentication action
-
acceptResourceIdList
Description copied from interface:DalLoader
Takes a list of resource ID values and may load them or a subset into this object's dialogue as appropriate.- Specified by:
acceptResourceIdList
in interfaceDalLoader
- Parameters:
ivoids
- ivo:-type identifier stringsmsg
- text of user-directed message to explain where the IDs came from- Returns:
- true iff at least some of the resources were, or may be, loaded into this window
-
getTapService
Returns the currently selected TAP service.- Returns:
- TAP service description, or null
-
createRunModes
Returns the run modes provided by this dialogue.- Returns:
- run mode options
-
addQueryActionListener
Adds a listener that will be informed if the effective TAP query specified by this dialogue may have changed.- Parameters:
l
- listener to add
-
removeQueryActionListener
Removes a listener for TAP query changes.- Parameters:
l
- listener to remove
-
createTableSequence
protected uk.ac.starlink.table.TableSequence createTableSequence(uk.ac.starlink.table.StarTableFactory tfact, UwsJob tapJob, uk.ac.starlink.table.DescribedValue[] tapMeta) throws IOException Returns a table sequence constructed from a given TAP query. This method marks each TapQuery for deletion on JVM shutdown. Subclass implementations may override this method to perform different job deletion behaviour.- Parameters:
tfact
- table factorytapJob
- UWS job representing async TAP querytapMeta
- metadata describing the query suitable for decorating the resulting table- Returns:
- table sequence suitable for a successful return from this dialog's TableLoader
- Throws:
IOException
-
createTapQueryPanel
Creates a new TapQueryPanel. This is called when a new TAP service is selected. The default implementation constructs one with a basic set of examples, but it can be overridden for more specialised behaviour.- Returns:
- new query panel
-
isReady
public boolean isReady()- Overrides:
isReady
in classuk.ac.starlink.table.gui.AbstractTableLoadDialog
-
getCurrentTapQueryPanel
Returns the TAP query panel currently visible.- Returns:
- query panel
-
getRunMode
Returns the currently selected run mode.- Returns:
- run mode
-
getRegistryPanel
Returns the registry panel for this window.- Specified by:
getRegistryPanel
in interfaceDalLoader
- Returns:
- registry panel
-
getFinderPanel
Returns the finder panel for this window.- Returns:
- finder panel
-
getUploadLabels
Returns a set of table identifers which are required for upload. This is the set of any [identifier]s in the query of the form TAP_UPLOAD.[identifier].- Parameters:
adql
- ADQL/S text- Returns:
- collection of upload identifiers
-
main
Main method pops up an instance of this dialog. An initial TAP URL may be given on the command line.
-