|
Docmosis API 4.5.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.docmosis.util.Configuration
This class allows configuration settings to be specified. The use of these properties will override all other settings used by docmosis (eg properties files and System Properties). This class can provide all settings, or you can use a docmosis.properties file also to set some properties and then override settings using this class. Common settings are available (such as license settings) via specific methods, but any property can be set using the general setProperty() method. The typical usage using default settings would be:
Configuration config = new Configuration(String key, String site, String officeLocation); SystemManager.initialise(config);alternatively, an initialisation using extra custom settings might look like this:
Configuration config = Configuration.standard(); config.setProperty(setting1, value1); config.setProperty(setting2, value2); ... // mandatory specific settings config.setKeyAndSite(key, site); config.setOfficeLocation(myPathToOO); // launch SystemManager.initialise(config);
SystemManager
Field Summary | |
static String |
P_CONVERTER_POOL_CONFIG
specify the converter pool config definition (eg "1", "localhost:2100" or "converterPoolConfig.xml") |
static String |
P_FIELD_MARKUP_ENABLED
|
static String |
P_KEY
The license key |
static String |
P_OFFICE_LOCATION
This setting only applies when launching converters (embedded converters configured) |
static String |
P_PLAIN_FIELD_PREFIX
|
static String |
P_PLAIN_FIELD_SUFFIX
|
static String |
P_SITE
the site description - related to the key |
static String |
P_TEMPLATE_STORE_LOCATION
the location of the template store (a cache) (eg "./templatestore") |
Constructor Summary | |
Configuration()
Create a new (blank) Configuration instance. |
|
Configuration(Properties properties)
Create a new Configuration instance with properties from the given Properties instance. |
|
Configuration(String key,
String site,
String officeLocation)
Create a new typically useful configuration ready to use. |
Method Summary | |
Properties |
getProperties()
Return all current settings; |
static Properties |
getStandardConfiguration()
Get a standard configuration on which other specific settings can be made. |
Configuration |
setConverterPoolConfiguration(String configuration)
Set the converter configuration. |
Configuration |
setKeyAndSite(String key,
String site)
Set the Docmosis license key |
Configuration |
setOfficeLocation(String location)
Set the location where Open Office or Libre Office can be found. |
Configuration |
setProperty(String key,
String value)
Set any Docmosis property. |
Configuration |
setTemplateStoreLocation(String path)
Set the Template store location. |
static Configuration |
standard()
Get a standard Configuration on which other specific settings can be made. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static String P_KEY
public static String P_SITE
public static String P_TEMPLATE_STORE_LOCATION
public static String P_CONVERTER_POOL_CONFIG
public static String P_OFFICE_LOCATION
public static String P_PLAIN_FIELD_PREFIX
public static String P_PLAIN_FIELD_SUFFIX
public static String P_FIELD_MARKUP_ENABLED
Constructor Detail |
public Configuration()
public Configuration(String key, String site, String officeLocation)
- "<<" and ">>" to be the plain text markers
- html-like mark-up in data to be interpreted (eg "<b>" for bold)
- "./templateStore" to be the location of the template cache
- "-1" to be the converter configuration meaning launch converters automatically and as many as the license allows.
key
- the license key stringsite
- the license site stringofficeLocation
- where to find OpenOffice / Libre OfficegetStandardConfiguration()
public Configuration(Properties properties)
properties
- a Properties object from which configuration
can be copied.Method Detail |
public Configuration setKeyAndSite(String key, String site)
key
- the license key stringsite
- the license site string
public Configuration setOfficeLocation(String location)
location
- the path
public Configuration setConverterPoolConfiguration(String configuration)
1. The location where converter configuration can be found as a Java resource. Docmosis will use the class path to load the given name as a file resource in the class path. eg. "converterPoolConfig.xml"
2. A simple count of the number of embedded converters to launch and use. -1 means launch the maximum allowed by the license. eg. "-1"
3. A list of remote converters to connect to. The remote converters need to be
run by some external process / program and Docmosis will try to connect to them.
The format is host:port[,host:port[,host:port...]].
eg. "localhost:2100,localhost:2101"
The connection to the remote converters can be SSL/TLS enabled.
To specify SSL/TLS for all connections, add ssl settings to the end of your string:
host:port[,host:port],ssl=sslProtocol[;pathToTrustStore[;trustStorePassword]]
eg: localhost:2100,localhost:2101,ssl=TLS
eg: localhost:2100,localhost:2101,ssl=TLS;/home/security/trustStore.jks
To specify for a particular host:port, use:
host:port:sslProtocol[;pathToTrustStore[;trustStorePassword]]
eg: localhost:2100:TLSv1.2
eg: localhost:2100:TLS;/home/security/trustStore.jks
The SSL/TLS settings are determined by the version of Java in use.
configuration
- the configuration to use as specified above. Eg "3", "localhost:2101", "converterPoolConfig.xml".
IllegalArgumentException
- if the given configuration is nullpublic Configuration setTemplateStoreLocation(String path)
path
- the location for the store. If "", a temp folder
location will be used.
public Configuration setProperty(String key, String value)
key
- the key to setvalue
- the value to use
public static Properties getStandardConfiguration()
- html-like markup in data to be interpreted (eg "<b>" for bold)
- "./templateStore" to be the location of the template cache
- "1" to be the converter configuration meaning launch a single embedded converter.
public static Configuration standard()
public Properties getProperties()
|
Docmosis API 4.5.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |