ome.formats.importer
Class ImportConfig

java.lang.Object
  extended by ome.formats.importer.ImportConfig

public class ImportConfig
extends Object

Utility class which configures the Import.

Since:
Beta4.1

Nested Class Summary
static class ImportConfig.AnnotationListValue
           
static class ImportConfig.BoolValue
           
static class ImportConfig.DoubleArrayValue
           
static class ImportConfig.FileValue
           
static class ImportConfig.IntValue
           
static class ImportConfig.LongValue
           
static class ImportConfig.PassValue
           
static class ImportConfig.StrValue
           
static class ImportConfig.Value<T>
          Container which thread-safely makes a generic configuration value available, without requiring getters and setters.
 
Field Summary
 ImportConfig.StrValue agent
           
 ImportConfig.AnnotationListValue annotations
           
 ImportConfig.BoolValue archiveImage
           
 ImportConfig.BoolValue companionFile
           
 ImportConfig.BoolValue contOnError
           
 ImportConfig.BoolValue debug
           
 ImportConfig.BoolValue doThumbnails
           
 ImportConfig.StrValue email
           
 ImportConfig.BoolValue encryptedConnection
           
 ImportConfig.LongValue group
           
 ImportConfig.StrValue hostname
           
 ImportConfig.StrValue imageDescription
           
 ImportConfig.StrValue imageName
           
 ImportConfig.IntValue numOfDirectories
           
 ImportConfig.StrValue password
           
 ImportConfig.StrValue plateDescription
           
 ImportConfig.StrValue plateName
           
 ImportConfig.IntValue port
           
static String READERS_KEY
          Lookup key for System.getProperty(String).
 ImportConfig.StrValue readersPath
           
 ImportConfig.LongValue savedDataset
           
 ImportConfig.FileValue savedDirectory
           
 ImportConfig.LongValue savedProject
           
 ImportConfig.LongValue savedScreen
           
 ImportConfig.BoolValue sendFiles
           
 ImportConfig.BoolValue sendLogFile
           
 ImportConfig.BoolValue sendReport
           
static String SERVER_NAME_SEPARATOR
          Delimiter used to encode multiple servers in one preferences value.
 ImportConfig.StrValue serverList
           
 ImportConfig.StrValue sessionKey
           
 ImportConfig.StrValue targetClass
           
 ImportConfig.LongValue targetId
           
 ImportConfig.BoolValue useCustomImageNaming
           
 ImportConfig.BoolValue useFullPath
           
 ImportConfig.StrValue username
           
 ImportConfig.DoubleArrayValue userPixels
           
 
Constructor Summary
ImportConfig()
          Simplest constructor which use calls ImportConfig(File) with null.
ImportConfig(File configFile)
          Calls ImportConfig#ImportConfig(Preferences, PreferenceContext, IniFileLoader, Properties) with user preferences, a local PreferenceContext, an IniFileLoader initialized with the given argument, and System.getProperties().
ImportConfig(Preferences prefs, IniFileLoader ini, Properties props)
          Complete constructor.
 
Method Summary
 boolean canLogin()
          Confirm all information for login is supplied
 void configureDebug(org.apache.log4j.Level level)
          Modifies the Log4j logging level of everything under the ome.format and loci package hierarchically.
 OMEROMetadataStoreClient createStore()
          Create and return a new OMEROMetadataStoreClient
 String getAppTitle()
           
 boolean getCustomImageNaming()
           
 int getDebugLevel()
           
 String getFeedbackUrl()
           
 boolean getForceFileArchiveOn()
           
 String getForumUrl()
           
 String getHomeUrl()
           
 String getIniVersionNumber()
           
 String getLogFile()
           
 int getNumOfDirectories()
           
 List<String> getServerList()
           
 boolean getStaticDisableHistory()
           
 boolean getStaticDisableUpgradeCheck()
           
 String getTokenUrl()
           
 Rectangle getUIBounds()
           
 String getUploaderUrl()
           
 boolean getUseQuaqua()
           
 boolean getUserDisableHistory()
           
 boolean getUserFullPath()
           
 String getUserSettingsDirectory()
           
 String getVersionNumber()
           
 boolean isUpgradeNeeded()
          Check online to see if this is the current version
 void loadAll()
          Loads all the values for which it makes sense to have a preferences values.
 void loadGui()
          Loads gui specific values for which it makes sense to have a preferences values.
 Map<String,String> map()
           
protected  void prompt(ImportConfig.Value value, String prompt, boolean hide)
          Build prompt
 void removeServer(String server)
           
 void requestFromUser()
          if can't log in request needed information
 void saveAll()
           
 void saveGui()
          Saves gui specific values for which it makes sense to have a preferences values.
 void setCustomImageNaming(boolean b)
           
 void setDebugLevel(int level)
           
 void setNumOfDirectories(int i)
           
 void setUIBounds(Rectangle bounds)
           
 void setUseQuaqua(boolean b)
           
 void setUserDisableHistory(boolean b)
           
 void setUserFullPath(boolean b)
           
 void setVersionNumber(String s)
           
 void updateServerList(String currentServer)
          Save the current serverList if the currentServer is not on the list.
protected  List<ImportConfig.Value<?>> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER_NAME_SEPARATOR

public static final String SERVER_NAME_SEPARATOR
Delimiter used to encode multiple servers in one preferences value.

See Also:
Constant Field Values

READERS_KEY

public static final String READERS_KEY
Lookup key for System.getProperty(String). Should be the path of a readers.txt file.

See Also:
Constant Field Values

agent

public final ImportConfig.StrValue agent

hostname

public final ImportConfig.StrValue hostname

username

public final ImportConfig.StrValue username

password

public final ImportConfig.StrValue password

port

public final ImportConfig.IntValue port

savedProject

public final ImportConfig.LongValue savedProject

savedDataset

public final ImportConfig.LongValue savedDataset

savedScreen

public final ImportConfig.LongValue savedScreen

sessionKey

public final ImportConfig.StrValue sessionKey

group

public final ImportConfig.LongValue group

doThumbnails

public final ImportConfig.BoolValue doThumbnails

email

public final ImportConfig.StrValue email

serverList

public final ImportConfig.StrValue serverList

imageName

public final ImportConfig.StrValue imageName

imageDescription

public final ImportConfig.StrValue imageDescription

plateName

public final ImportConfig.StrValue plateName

plateDescription

public final ImportConfig.StrValue plateDescription

targetClass

public final ImportConfig.StrValue targetClass

targetId

public final ImportConfig.LongValue targetId

debug

public final ImportConfig.BoolValue debug

contOnError

public final ImportConfig.BoolValue contOnError

sendReport

public final ImportConfig.BoolValue sendReport

sendFiles

public final ImportConfig.BoolValue sendFiles

sendLogFile

public final ImportConfig.BoolValue sendLogFile

companionFile

public final ImportConfig.BoolValue companionFile

archiveImage

public final ImportConfig.BoolValue archiveImage

useCustomImageNaming

public final ImportConfig.BoolValue useCustomImageNaming

useFullPath

public final ImportConfig.BoolValue useFullPath

numOfDirectories

public final ImportConfig.IntValue numOfDirectories

savedDirectory

public final ImportConfig.FileValue savedDirectory

readersPath

public final ImportConfig.StrValue readersPath

encryptedConnection

public final ImportConfig.BoolValue encryptedConnection

annotations

public final ImportConfig.AnnotationListValue annotations

userPixels

public final ImportConfig.DoubleArrayValue userPixels
Constructor Detail

ImportConfig

public ImportConfig()
Simplest constructor which use calls ImportConfig(File) with null.


ImportConfig

public ImportConfig(File configFile)
Calls ImportConfig#ImportConfig(Preferences, PreferenceContext, IniFileLoader, Properties) with user preferences, a local PreferenceContext, an IniFileLoader initialized with the given argument, and System.getProperties().

Parameters:
configFile - Can be null.

ImportConfig

public ImportConfig(Preferences prefs,
                    IniFileLoader ini,
                    Properties props)
Complete constructor. All values can be null.

Parameters:
prefs -
ctx -
ini -
props -
Method Detail

configureDebug

public void configureDebug(org.apache.log4j.Level level)
Modifies the Log4j logging level of everything under the ome.format and loci package hierarchically.

Parameters:
level - if null, then #ini#getDebugLevel() will be used.

createStore

public OMEROMetadataStoreClient createStore()
                                     throws Exception
Create and return a new OMEROMetadataStoreClient

Returns:
- OMEORMetadataStoreClient
Throws:
Exception

isUpgradeNeeded

public boolean isUpgradeNeeded()
Check online to see if this is the current version


canLogin

public boolean canLogin()
Confirm all information for login is supplied

Returns:
true if all is ok

getLogFile

public String getLogFile()
Returns:
ini log file

getHomeUrl

public String getHomeUrl()
Returns:
ini home URL

getForumUrl

public String getForumUrl()
Returns:
ini forum URL

getAppTitle

public String getAppTitle()
Returns:
ini application title

getStaticDisableUpgradeCheck

public boolean getStaticDisableUpgradeCheck()
Returns:
ini application title

getForceFileArchiveOn

public boolean getForceFileArchiveOn()
Returns:
ini getForceFileArchiveOn

getStaticDisableHistory

public boolean getStaticDisableHistory()
Returns:
ini getStaticDisableHistory

getUserDisableHistory

public boolean getUserDisableHistory()
Returns:
ini getUserDisableHistory

setUserDisableHistory

public void setUserDisableHistory(boolean b)
Parameters:
b - - true if Quaqua should be used

getVersionNumber

public String getVersionNumber()
Returns:
ini version note

setVersionNumber

public void setVersionNumber(String s)

getIniVersionNumber

public String getIniVersionNumber()
Returns:
ini version number

getUserSettingsDirectory

public String getUserSettingsDirectory()
Returns:
ini user settings directory

getUseQuaqua

public boolean getUseQuaqua()
Returns:
ini option for if Qquaqua should be use for Macs

setUseQuaqua

public void setUseQuaqua(boolean b)
Parameters:
b - - true if Quaqua should be used

setDebugLevel

public void setDebugLevel(int level)
Parameters:
level - - default debug level

getDebugLevel

public int getDebugLevel()
Returns:
current debug level

getUIBounds

public Rectangle getUIBounds()
Returns:
UI bounds for application window

setUIBounds

public void setUIBounds(Rectangle bounds)
Parameters:
bounds - - set UI bounds for application window

getFeedbackUrl

public String getFeedbackUrl()
Returns:
ini feedback URL for QA system

getTokenUrl

public String getTokenUrl()
Returns:
ini token URL for QA system

getUploaderUrl

public String getUploaderUrl()
Returns:
ini upload URL for QA system

getUserFullPath

public boolean getUserFullPath()
Returns:
ini user full path

setUserFullPath

public void setUserFullPath(boolean b)

getCustomImageNaming

public boolean getCustomImageNaming()
Returns:
ini user full path

setCustomImageNaming

public void setCustomImageNaming(boolean b)

getNumOfDirectories

public int getNumOfDirectories()
Returns:
ini user full path

setNumOfDirectories

public void setNumOfDirectories(int i)

getServerList

public List<String> getServerList()
Returns:
server list

updateServerList

public void updateServerList(String currentServer)
Save the current serverList if the currentServer is not on the list. Make sure that the server is a valid string and does not represent fake input text like "--> Enter server"


removeServer

public void removeServer(String server)
Parameters:
server - - remove this server from the server list

prompt

protected void prompt(ImportConfig.Value value,
                      String prompt,
                      boolean hide)
Build prompt

Parameters:
value -
prompt -
hide - - use *s for characters

requestFromUser

public void requestFromUser()
if can't log in request needed information


values

protected List<ImportConfig.Value<?>> values()

map

public Map<String,String> map()

loadGui

public void loadGui()
Loads gui specific values for which it makes sense to have a preferences values.

See Also:
saveAll()

saveGui

public void saveGui()
Saves gui specific values for which it makes sense to have a preferences values.

See Also:
saveAll()

loadAll

public void loadAll()
Loads all the values for which it makes sense to have a preferences values.

See Also:
saveAll()

saveAll

public void saveAll()
See Also:
loadAll()


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.