-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Files
The LobsterConfig.xml file is located in the CodeSource directory. It lists the different databases that the CodeSource can be connected to. Here is an example from the Sample folder:
<?xml version="1.0" encoding="utf-8"?>
<CodeSourceConfig xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://schemas.datacontract.org/2004/07/LobsterModel">
<Name>Sample CodeSource</Name>
<ConnectionConfigList>
<ConnectionConfig>
<AllowAutomaticClobbing>true</AllowAutomaticClobbing>
<Host>localhost</Host>
<IsRestrictedEnvironment>false</IsRestrictedEnvironment>
<Name>Sample Database</Name>
<Parent z:Ref="i1" />
<Port>1521</Port>
<SID>sampledb</SID>
<UsePooling>false</UsePooling>
<Username>username</Username>
</ConnectionConfig>
</ConnectionConfigList>
</CodeSourceConfig>There can be multiple ConnectionConfig elements in the ConnectionConfigList element. Each ConnectionConfig element needs the following children:
Name: The name of the database (this is used for display purposes only).
Host: The host of the database server. Entries in the hostnames file can also be used.
Port: The port that the server listens on.
SID: The Oracle System ID of the database to connect to.
Username: The name of the user to connect as. It is important to connect as a user with the privileges to access every table that could be modified by Lobster.
UsePooling: When Lobster connects to the Oracle database with pooling enabled, Oracle will remember the connection for a time, and reuse it if the same computer connects using the same connection string. This can improve Lobster connection performance slightly, but will decrease server performance if the maximum number of connections is low.
ClobTypes: We'll deal with this one later.
The LobsterDescriptors directory should be put in a CodeSource directory. Inside should be a series of XML files that contain a DirectoryDescriptor XML element. Here is an example from the Sample directory:
<?xml version="1.0" encoding="utf-8"?>
<DirectoryDescriptor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Name>Resource Types</Name>
<DirectoryName>ResourceTypes</DirectoryName>
<PushOnFileChange>true</PushOnFileChange>
<SearchRules>
<SearchRule xsi:type="IncludeRule">
<Pattern>*.xml</Pattern>
</SearchRule>
</SearchRules>
<DefaultDataType>CLOB</DefaultDataType>
<InsertStatement>
INSERT INTO decmgr.resource_types (
res_type
, xml_data
) VALUES (
:p_filename_without_extension
, XMLTYPE(:p_file_content_clob)
)
</InsertStatement>
<UpdateStatement>
UPDATE decmgr.resource_types
SET xml_data = XMLTYPE(:p_file_content_clob)
WHERE res_type = :p_filename_without_extension
</UpdateStatement>
<DeleteStatement>
DELETE FROM decmgr.resource_types
WHERE res_type = :p_filename_without_extension
</DeleteStatement>
<DatabaseFileExistsStatement>
SELECT COUNT(*)
FROM decmgr.resource_types
WHERE res_type = :p_filename_without_extension
</DatabaseFileExistsStatement>
<FetchStatement>
SELECT xml_data
FROM decmgr.resource_types
WHERE res_type = :p_filename_without_extension
</FetchStatement>
</DirectoryDescriptor>These are the child elements of the DirectoryDescriptor element:
Name: The name of the DirectoryDescriptor. Like the name of a Database Connection, this has no functional bearing, but is used for display purposes.
DirectoryName: The name of the directory in the CodeSource that this DirectoryDescriptor. Note that this can contain path separators, so the directory does not have to be a top level CodeSource directory ( e.g. ApplicationMetadata/WorkRequestTypes is valid)
PushOnFileChange: A boolean value indicating whether synchronised files should be automatically pushed to the database when they are changed.
SearchRules The SearchRules element is optional and can contain any number of SearchRule elements. Each SearchRule element should have the attribute "xsi:type" with the value "IncludeRules" or "ExcludeRules". The SearchRule should have a child element called "Pattern" with a file pattern (e.g. *.xml, *.txt or *.sql). If there are only include rules, then only files that match will be used. If there are only exclude rules, then all files except those that are excluded will be used.
DefaultDataType: The :p_data_type parameter will use this value as a default if no DataTypeStatement element is specified. If there is no DefaultDataType element, then "CLOB" is used as the DefaultDataType instead.
The following elements are SQL statements to be used for synchronising local files with database files. All SQL statements can use any of the parameters in the Parameters page. The InsertStatement, UpdateStatement, DatabaseFileExistsStatement and FetchStatement elements are mandatory.
InsertStatement: The SQL statement to be used when inserting a new file into the database
UpdateStatement: The SQL statement to be used when a file that is already synchronised with the database is pushed
DeleteStatement: The optional SQL statement to be used when a file is deleted from the database
DatabaseFileExistsStatement: The SQL statement to be used to determine whether the file is synchronised with the database or not. It should return a single row and column with a non-zero value indicating that the file is synchronised and a zero value indicating that it is not synchronised.
FetchStatement: The SQL statement to be used to get the text of file from the database. This is used to pull synchronised files, backup files before they are pushed and to compare local files to database files.
FetchBinaryStatement: The optional SQL statement to be used to get the binary data of the file from the database. FetchStatement is normal used, but FethcBinaryStatement is used if FileDataTypeStatement returns BLOB (or if the DefaultDataType is BLOB)
FileDataTypeStatement: The optional SQL statement to be used toe determine the data type of the file. This should return only a single row and column with the value "CLOB" or "BLOB".
FileMimeTypeStatement: The optional SQL statement to be used as the value of the :p_mime_type parameter if it exists (see the Parameters page for more information)