Package ome.formats.importer
Class ImportConfig
- java.lang.Object
-
- ome.formats.importer.ImportConfig
-
public class ImportConfig extends java.lang.Object
Utility class which configures the Import.- Since:
- Beta4.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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.static class
ImportConfig.VersionInfo
Keys for fileset version information entries.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ImportConfig()
Simplest constructor which use callsImportConfig(File)
with null.ImportConfig(java.io.File configFile)
CallsImportConfig(Preferences, IniFileLoader, Properties)
with user preferences, a localPreferenceContext
, anIniFileLoader
initialized with the given argument, andSystem.getProperties()
.ImportConfig(java.util.prefs.Preferences prefs, IniFileLoader ini, java.util.Properties props)
Complete constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canLogin()
Confirm all information for login is suppliedvoid
configureDebug(java.lang.String levelString)
Modifies the logging level of everything under theome.formats
,ome.services.blitz
,ome.system
andloci
packages hierarchically.OMEROMetadataStoreClient
createStore()
Create and return a new OMEROMetadataStoreClientvoid
fillVersionInfo(java.util.List<NamedValue> versionInfo)
Note useful version information that can be extracted from this system, as provenance that is useful for debugging.java.lang.String
getAppTitle()
java.lang.String
getBioFormatsVersion()
boolean
getCustomImageNaming()
int
getDebugLevel()
java.lang.String
getFeedbackUrl()
boolean
getForceFileArchiveOn()
java.lang.String
getForumUrl()
java.lang.String
getHomeUrl()
java.lang.String
getIniVersionNumber()
java.lang.String
getLogFile()
int
getNumOfDirectories()
java.lang.String
getOmeroVersion()
boolean
getStaticDisableHistory()
ImportTarget
getTarget()
java.lang.String
getTokenUrl()
java.awt.Rectangle
getUIBounds()
java.lang.String
getUploaderUrl()
boolean
getUseQuaqua()
boolean
getUserDisableHistory()
boolean
getUserFullPath()
Deprecated.java.lang.String
getUserSettingsDirectory()
java.lang.String
getVersionNumber()
boolean
isUpgradeNeeded()
Check online to see if this is the current versionvoid
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.java.util.Map<java.lang.String,java.lang.String>
map()
protected <T> void
prompt(ImportConfig.Value<T> value, java.lang.String prompt, boolean hide)
Build promptvoid
requestFromUser()
if can't log in request needed informationvoid
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(java.awt.Rectangle bounds)
void
setUseQuaqua(boolean b)
void
setUserDisableHistory(boolean b)
void
setUserFullPath(boolean b)
Deprecated.void
setVersionNumber(java.lang.String s)
protected java.util.List<ImportConfig.Value<?>>
values()
-
-
-
Field Detail
-
SERVER_NAME_SEPARATOR
public static final java.lang.String SERVER_NAME_SEPARATOR
Delimiter used to encode multiple servers in one preferences value.- See Also:
- Constant Field Values
-
READERS_KEY
public static final java.lang.String READERS_KEY
Lookup key forSystem.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
-
noStatsInfo
public final ImportConfig.BoolValue noStatsInfo
-
email
public final ImportConfig.StrValue email
-
userSpecifiedName
public final ImportConfig.StrValue userSpecifiedName
-
userSpecifiedDescription
public final ImportConfig.StrValue userSpecifiedDescription
-
targetClass
@Deprecated public final ImportConfig.StrValue targetClass
Deprecated.
-
targetId
@Deprecated public final ImportConfig.LongValue targetId
Deprecated.
-
target
public final ImportConfig.StrValue target
-
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
-
parallelUpload
public final ImportConfig.IntValue parallelUpload
-
parallelFileset
public final ImportConfig.IntValue parallelFileset
-
qaBaseURL
public final ImportConfig.StrValue qaBaseURL
-
checkUpgrade
public final ImportConfig.BoolValue checkUpgrade
-
useCustomImageNaming
public final ImportConfig.BoolValue useCustomImageNaming
-
useFullPath
@Deprecated public final ImportConfig.BoolValue useFullPath
Deprecated.
-
numOfDirectories
public final ImportConfig.IntValue numOfDirectories
-
savedDirectory
public final ImportConfig.FileValue savedDirectory
-
readersPath
public final ImportConfig.StrValue readersPath
-
checksumAlgorithm
public final ImportConfig.StrValue checksumAlgorithm
-
encryptedConnection
public final ImportConfig.BoolValue encryptedConnection
-
autoClose
public final ImportConfig.BoolValue autoClose
-
keepAlive
public final ImportConfig.IntValue keepAlive
-
annotations
public final ImportConfig.AnnotationListValue annotations
-
userPixels
public final ImportConfig.DoubleArrayValue userPixels
-
DEFAULT_QABASEURL
public static final java.lang.String DEFAULT_QABASEURL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImportConfig
public ImportConfig()
Simplest constructor which use callsImportConfig(File)
with null.
-
ImportConfig
public ImportConfig(java.io.File configFile)
CallsImportConfig(Preferences, IniFileLoader, Properties)
with user preferences, a localPreferenceContext
, anIniFileLoader
initialized with the given argument, andSystem.getProperties()
.- Parameters:
configFile
- Can be null.
-
ImportConfig
public ImportConfig(java.util.prefs.Preferences prefs, IniFileLoader ini, java.util.Properties props)
Complete constructor. All values can be null.- Parameters:
prefs
- user and system preference and configuration dataini
- loadsimporter.ini
or other specified fileprops
- a Java properties object overriding other sources of preferences and configuration data
-
-
Method Detail
-
getBioFormatsVersion
public java.lang.String getBioFormatsVersion()
-
getOmeroVersion
public java.lang.String getOmeroVersion()
-
fillVersionInfo
public void fillVersionInfo(java.util.List<NamedValue> versionInfo)
Note useful version information that can be extracted from this system, as provenance that is useful for debugging.- Parameters:
versionInfo
- the map into which version information is to be added
-
configureDebug
public void configureDebug(java.lang.String levelString)
Modifies the logging level of everything under theome.formats
,ome.services.blitz
,ome.system
andloci
packages hierarchically.- Parameters:
levelString
- the level to set or, ifnull
, then the initial debug level is used as before having been changed.
-
createStore
public OMEROMetadataStoreClient createStore() throws java.lang.Exception
Create and return a new OMEROMetadataStoreClient- Returns:
- a new OMEROMetadataStoreClient
- Throws:
java.lang.Exception
- if the creation failed
-
isUpgradeNeeded
public boolean isUpgradeNeeded()
Check online to see if this is the current version- Returns:
- if it is not the current version
-
canLogin
public boolean canLogin()
Confirm all information for login is supplied- Returns:
- true if all is ok
-
getLogFile
public java.lang.String getLogFile()
- Returns:
- ini log file
-
getHomeUrl
public java.lang.String getHomeUrl()
- Returns:
- ini home URL
-
getForumUrl
public java.lang.String getForumUrl()
- Returns:
- ini forum URL
-
getAppTitle
public java.lang.String getAppTitle()
- 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 java.lang.String getVersionNumber()
- Returns:
- ini version note
-
setVersionNumber
public void setVersionNumber(java.lang.String s)
-
getIniVersionNumber
public java.lang.String getIniVersionNumber()
- Returns:
- ini version number
-
getUserSettingsDirectory
public java.lang.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 java.awt.Rectangle getUIBounds()
- Returns:
- UI bounds for application window
-
setUIBounds
public void setUIBounds(java.awt.Rectangle bounds)
- Parameters:
bounds
- - set UI bounds for application window
-
getFeedbackUrl
public java.lang.String getFeedbackUrl()
- Returns:
- feedback URL for QA system
-
getTokenUrl
public java.lang.String getTokenUrl()
- Returns:
- token URL for QA system
-
getUploaderUrl
public java.lang.String getUploaderUrl()
- Returns:
- upload URL for QA system
-
getUserFullPath
@Deprecated public boolean getUserFullPath()
Deprecated.- Returns:
- ini user full path
-
setUserFullPath
@Deprecated public void setUserFullPath(boolean b)
Deprecated.- Parameters:
b
- ini user full path
-
getCustomImageNaming
public boolean getCustomImageNaming()
- Returns:
- custom image naming
-
setCustomImageNaming
public void setCustomImageNaming(boolean b)
- Parameters:
b
- custom image naming
-
getNumOfDirectories
public int getNumOfDirectories()
- Returns:
- number of directories
-
setNumOfDirectories
public void setNumOfDirectories(int i)
- Parameters:
i
- number of directories
-
prompt
protected <T> void prompt(ImportConfig.Value<T> value, java.lang.String prompt, boolean hide)
Build prompt- Type Parameters:
T
- the kind of value contained by the "value" argument- Parameters:
value
- the valueprompt
- the prompthide
- use*
s for characters
-
requestFromUser
public void requestFromUser()
if can't log in request needed information
-
values
protected java.util.List<ImportConfig.Value<?>> values()
-
map
public java.util.Map<java.lang.String,java.lang.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()
-
getTarget
public ImportTarget getTarget()
-
-