PrizmDoc Application Services Configuration
The PrizmDoc Application Services (PAS) use a central configuration file to determine, among other things, where to find documents, where to store logs and how to connect to a database.
Configuration File Location
On Windows, assuming a default installation, the configuration file is located at C:\Prizm\pas\pcc.win.yml
.
On Linux, assuming a default installation, the configuration file is located at /usr/share/prizm/pas/pcc.nix.yml
.
Default Configuration
Among other things, the config file includes the port
, secretKey
, logs.path
, defaults.viewingSessionTimeout
properties.
port
defines the port that PAS will use to listen to its HTTP connection.
secretKey
defines a shared secret value which must be provided in requests to critical PAS REST API routes (typically non-GET routes that modify data). If you host your PAS server on the public internet, callers must provide this value via an Accusoft-Secret
request header in order for many of the REST API routes to function. To keep your application as secure as possible, we strongly recommend you change the default value of this property to a unique string that only your application uses.
logs.path
determines the location on the local filesystem where the logs for PAS will be stored.
defaults.viewingSessionTimeout
is the length of time that a viewing session remains usable. This must be an integer, followed by "s", "m", "h", or "d". The suffixes stand for second, minute, hour, or day, respectively. There should not be any space characters between the number and suffix. For example, "20m" indicates viewing sessions will timeout after 20 minutes.
Configuring the PrizmDoc Server Connection
The connection to your desired PrizmDoc Server, whether Enterprise (self-hosted) or Cloud, can be configured through the pccServer
object, which has the following properties:
pccServer.hostName
- the hostname to use to connect to PrizmDoc Server.pccServer.port
- the port on the above hostname to connect to.pccServer.scheme
- the scheme to use to communicate with PrizmDoc Server. This can be set tohttp
orhttps
.pccServer.apiKey
- the API Key that PAS should use if you are using the PrizmDoc Cloud Server. This value will be ignored for a PrizmDoc Enterprise Server.
Configuring Storage
There are various data entities stored or accessed by PAS, as noted by comments in the config file. All of these can be configured separately.
Each storage entity will have a name, such as documents
or markupLayerRecords
, and each named entity will have a .storage
property, such as documents.storage
. This property defines the kind of storage that will be used. The supported values are as follows:
"filesystem"
- Store on the local filesystem or network attached storage that has been mapped to a local drive or folder. For any data entity configured to be stored on the filesystem, the following additional properties are required:.path
- the folder location where the data should be stored. On Windows, this can also include environment variables. If these paths are changed from the default values, PrizmDoc must be granted write permissions for them to function.
"database"
- Store inside the configured database. See Configuring the database below for more details."S3"
- Store files in S3 Buckets. For any data entity configured to be stored in S3 Buckets, the following additional properties are required:.s3BucketName
- the name of the bucket that you would like to store the specified data entity type. This bucket must be unique across all of Amazon S3 services and must be created in your S3 dashboard..path
- the base “key” the data should be organized into. S3 uses keys as its directory structure. This must have no starting / and no trailing /.
Not all storage entities are compatible with all storage providers. Checking for these values is done on start up and an informative error will be logged to the PAS log, {installDir}/logs/pas, in the case of a mismatch.
Additional S3 Notes:
You must handle Amazon Web Services credentials in one of the available ways that are provided on the following pages:
Loading credentials in Node.js from IAM Roles for EC2: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-iam.html
Loading credentials from a shared credentials file: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html
Loading credentials from environment variables: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html
Examples:
documents.storage: "filesystem"
documents.path: "/usr/share/prizm/Samples/Documents"
markupLayerRecords.storage: "filesystem"
markupLayerRecords.path: "%ALLUSERSPROFILE%\\Accusoft\\Prizm\\MarkupLayerRecords"
viewingPackagesData.storage: "database"
documents.storage: "s3"
documents.s3BucketName: "myS3Bucket"
documents.path: "Samples/Documents"
Note: some data entities have limitations on the kind of storage that they can be stored in. If PAS is misconfigured, it will not start correctly. It's best to keep a copy of the defaults so that you can revert them if you need to.
Legacy Mode
Legacy Mode refers to being able to open markup files that were created using one of the Web Tier Samples available before the release of PAS. To work correctly, it needs to be enabled on documents
, markupXml
, and markupLayerRecords
, as such:
documents.legacyMode: true
markupXml.legacyMode: true
markupLayerRecords.legacyMode: true
If you do not need this feature -- for example, if PAS is the first time you are using markup files -- you can turn this off by setting all values to false
, which will provide a small performance gain when working with the markup APIs. Note that all markup files created by PAS itself, regardless of whether legacyMode
was on or off, will be compatible with PAS when legacyMode
is off.
Feature Toggles
Some features in PAS are behind feature flags, and they can be turned on or off. This is the done through feature.*
options in the config file. The values can be set to:
enabled
- turns the feature ondisabled
- turns the feature off
You can also remove the specific feature configuration value altogether in order to observe the default behavior for that feature. The list of features is:
viewingPackages
- default:disabled
- Enables Pre-Conversion Services and APIs, which allow you to pre-convert documents and cache on-demand document views in PAS, improving the speed at which documents can be viewed, as well as reducing the processing time in PrizmDoc Server for repeat document views.
Examples:
feature.viewingPackages: enabled
Configuring the Database
Note: A database is required in order to use Viewing Packages. This feature is disabled by default and will need to be turned on. Without turning Viewing Packages on, PAS will not use a database, or even check for its existencce in the configuration.
PAS requires configuration to a database, allowing it to store some of its data there. It will not start correctly without having a correctly configured and accessible database. The following config properties are available in PAS to support that:
database.adapter
- the type of database being used. The following values are supported:sqlserver
- Microsoft SQL Servermysql
- MySQL
database.host
- the hostname to use to communicate with the database.database.port
- the port to use to communicate with the database.database.user
- the user to use when connecting to the database.database.password
- the password for the specified user.database.database
- the database name to use on the database server.
Configuring Cross-Origin Resource Sharing
While you can set up CORS quite easily through your web server, PAS also supports settings CORS headers directly. It is exposed through the cors
config object, as such:
cors.enabled
- whether to set CORS headers. Supported values aretrue
orfalse
.cors.allowedOrigins
- an array of the exact origin values to support. Not including this value will cause all CORS requests to be denied. This array will be used to determine theAccess-Control-Allow-Origin
header.cors.exposedHeaders
(optional) - an array of headers keys to allow the browser to read. This value is configured to include headers returned by PAS by default.
Examples:
cors.enabled: true
cors.allowedOrigins: [ "http://example.com", "https://example.com" ]