org.pdfsam.guiclient.configuration.services.xml
Class XmlConfigurationService

java.lang.Object
  extended by org.pdfsam.guiclient.configuration.services.xml.XmlConfigurationService
All Implemented Interfaces:
ConfigurationService

public class XmlConfigurationService
extends java.lang.Object
implements ConfigurationService

Configuration service that reads the configuration from an xml file

Author:
Andrea Vacondio

Field Summary
static java.lang.String CONFIGURATION_FILE_NAME
           
static java.lang.String DEFAULT_CONFIG_DIRECTORY
           
static int DEFAULT_POOL_SIZE
           
static java.lang.String OLD_CONFIGURATION_FILE_NAME
           
 
Constructor Summary
XmlConfigurationService()
           
 
Method Summary
 java.lang.String getConfigurationInformations()
           
 org.pdfsam.console.business.ConsoleServicesFacade getConsoleServicesFacade()
           
 java.lang.String getDefaultEnvironment()
           
 java.lang.String getDefaultWorkingDirectory()
           
 java.util.ResourceBundle getI18nResourceBundle()
           
 java.lang.String getLanguage()
           
 int getLoggingLevel()
           
 int getLookAndFeel()
           
 java.lang.String getPluginAbsolutePath()
           
 int getTheme()
           
 int getThumbCreatorPoolSize()
           
 java.lang.String getThumbnailsCreatorIdentifier()
           
 int getThumbnailSize()
           
 boolean isAskOverwriteConfirmation()
           
 boolean isCheckForUpdates()
           
 boolean isHighQualityThumbnils()
           
 boolean isPlaySounds()
           
 void save()
          save the configuration
 void setAskOverwriteConfirmation(boolean askOverwriteConfirmation)
          set the ask for confirmation flag
 void setCheckForUpdates(boolean checkForUpdates)
          set the checl for updates flag
 void setDefaultEnvironment(java.lang.String defaultEnvironment)
          set the path for the default environment
 void setDefaultWorkingDirectory(java.lang.String defaultWorkingDirectory)
          set the path to the default working directory
 void setLanguage(java.lang.String language)
          Set the language
 void setLoggingLevel(int loggingLevel)
          Set the logging level
 void setLookAndFeel(int lookAndFeel)
          Set the look and feel
 void setPlaySounds(boolean playSounds)
          Set the play sounds flag
 void setTheme(int theme)
          Set the theme
 void setThumbnailsCreatorIdentifier(java.lang.String thumbnailsCreatorIdentifier)
          Set the thumbnail creator identifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OLD_CONFIGURATION_FILE_NAME

public static final java.lang.String OLD_CONFIGURATION_FILE_NAME
See Also:
Constant Field Values

CONFIGURATION_FILE_NAME

public static final java.lang.String CONFIGURATION_FILE_NAME
See Also:
Constant Field Values

DEFAULT_POOL_SIZE

public static final int DEFAULT_POOL_SIZE
See Also:
Constant Field Values

DEFAULT_CONFIG_DIRECTORY

public static final java.lang.String DEFAULT_CONFIG_DIRECTORY
Constructor Detail

XmlConfigurationService

public XmlConfigurationService()
                        throws ConfigurationException
Throws:
ConfigurationException
Method Detail

isCheckForUpdates

public boolean isCheckForUpdates()
Specified by:
isCheckForUpdates in interface ConfigurationService
Returns:
the checkForUpdates

setCheckForUpdates

public void setCheckForUpdates(boolean checkForUpdates)
Description copied from interface: ConfigurationService
set the checl for updates flag

Specified by:
setCheckForUpdates in interface ConfigurationService

isPlaySounds

public boolean isPlaySounds()
Specified by:
isPlaySounds in interface ConfigurationService
Returns:
the playSounds

setPlaySounds

public void setPlaySounds(boolean playSounds)
Description copied from interface: ConfigurationService
Set the play sounds flag

Specified by:
setPlaySounds in interface ConfigurationService

getDefaultWorkingDirectory

public java.lang.String getDefaultWorkingDirectory()
Specified by:
getDefaultWorkingDirectory in interface ConfigurationService
Returns:
path to te default working directory

setDefaultWorkingDirectory

public void setDefaultWorkingDirectory(java.lang.String defaultWorkingDirectory)
Description copied from interface: ConfigurationService
set the path to the default working directory

Specified by:
setDefaultWorkingDirectory in interface ConfigurationService

getDefaultEnvironment

public java.lang.String getDefaultEnvironment()
Specified by:
getDefaultEnvironment in interface ConfigurationService
Returns:
path to the default environment

setDefaultEnvironment

public void setDefaultEnvironment(java.lang.String defaultEnvironment)
Description copied from interface: ConfigurationService
set the path for the default environment

Specified by:
setDefaultEnvironment in interface ConfigurationService

getThumbCreatorPoolSize

public int getThumbCreatorPoolSize()
Specified by:
getThumbCreatorPoolSize in interface ConfigurationService
Returns:
size of the threadpool used by the thumbnails creator

getThumbnailsCreatorIdentifier

public java.lang.String getThumbnailsCreatorIdentifier()
Specified by:
getThumbnailsCreatorIdentifier in interface ConfigurationService
Returns:
identifier of the thumbnails creator to use

setThumbnailsCreatorIdentifier

public void setThumbnailsCreatorIdentifier(java.lang.String thumbnailsCreatorIdentifier)
Description copied from interface: ConfigurationService
Set the thumbnail creator identifier

Specified by:
setThumbnailsCreatorIdentifier in interface ConfigurationService

getLoggingLevel

public int getLoggingLevel()
Specified by:
getLoggingLevel in interface ConfigurationService
Returns:
logging level

setLoggingLevel

public void setLoggingLevel(int loggingLevel)
Description copied from interface: ConfigurationService
Set the logging level

Specified by:
setLoggingLevel in interface ConfigurationService

getI18nResourceBundle

public java.util.ResourceBundle getI18nResourceBundle()
Specified by:
getI18nResourceBundle in interface ConfigurationService
Returns:
internationalization resource bundle

getConsoleServicesFacade

public org.pdfsam.console.business.ConsoleServicesFacade getConsoleServicesFacade()
Specified by:
getConsoleServicesFacade in interface ConfigurationService
Returns:
facade for the console services

getLookAndFeel

public int getLookAndFeel()
Specified by:
getLookAndFeel in interface ConfigurationService
Returns:
the look and feel

setLookAndFeel

public void setLookAndFeel(int lookAndFeel)
Description copied from interface: ConfigurationService
Set the look and feel

Specified by:
setLookAndFeel in interface ConfigurationService

getTheme

public int getTheme()
Specified by:
getTheme in interface ConfigurationService
Returns:
the theme

setTheme

public void setTheme(int theme)
Description copied from interface: ConfigurationService
Set the theme

Specified by:
setTheme in interface ConfigurationService

getLanguage

public java.lang.String getLanguage()
Specified by:
getLanguage in interface ConfigurationService
Returns:
String representation of the language

setLanguage

public void setLanguage(java.lang.String language)
Description copied from interface: ConfigurationService
Set the language

Specified by:
setLanguage in interface ConfigurationService

getConfigurationInformations

public java.lang.String getConfigurationInformations()
Specified by:
getConfigurationInformations in interface ConfigurationService
Returns:
information about the configuration service to be displayed

getPluginAbsolutePath

public java.lang.String getPluginAbsolutePath()
Specified by:
getPluginAbsolutePath in interface ConfigurationService
Returns:
the plugin absolute path

isAskOverwriteConfirmation

public boolean isAskOverwriteConfirmation()
Specified by:
isAskOverwriteConfirmation in interface ConfigurationService
Returns:
true to ask for confirmation when overwriting check box is selected

setAskOverwriteConfirmation

public void setAskOverwriteConfirmation(boolean askOverwriteConfirmation)
Description copied from interface: ConfigurationService
set the ask for confirmation flag

Specified by:
setAskOverwriteConfirmation in interface ConfigurationService

getThumbnailSize

public int getThumbnailSize()
Specified by:
getThumbnailSize in interface ConfigurationService
Returns:
the size of the thumbnails

isHighQualityThumbnils

public boolean isHighQualityThumbnils()
Specified by:
isHighQualityThumbnils in interface ConfigurationService
Returns:
true if the thumbnails should be generated in high quality

save

public void save()
          throws java.io.IOException
Description copied from interface: ConfigurationService
save the configuration

Specified by:
save in interface ConfigurationService
Throws:
java.io.IOException - in case of error saving the configuration