PrizmDoc Application Services Configuration
The Prizm Application Services 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
is a value that is used for identification on specific routes (as noted in the PAS API reference). Whenever noted as required in the API, PAS will expect that this value be set to the Accusoft-Secret
header. To keep your application secure, you are strongly encouraged to change this to a unique string value.
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 self-hosted or Accusoft-hosted, 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 an Accusoft-hosted PrizmDoc Server. This value will be ignored for a self-hosted 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.
"database"
- Store inside the configured database. See Configuring the database below for more details.
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.
Examples:
documents.storage: "filesystem"
documents.path: "/usr/share/prizm/Samples/Documents"
markupLayerRecords.storage: "filesystem"
markupLayerRecords.path: "%ALLUSERSPROFILE%\\Accusoft\\Prizm\\MarkupLayerRecords"
viewingPackagesData.storage: "database"
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 preconvert 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. Note: Pre-Conversion Services are included as a "Developer Preview." This feature is in late-stage development and api's marked as such should be used for evaluation purposes only and should not be used in production deployments. Note that these api's may undergo change prior to feature completion. The Pre-Conversion Services will be feature complete in PrizmDoc version 11.2.
Examples:
feature.viewingPackages: enabled
Configuring the database
Note: A database is required in order to use Viewing Packages. This feature is currently a developer preview, and will need to be turned on. Without turning Viewing Packages on, PAS will not use a database, or even check for its existence 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 Server
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" ]
Pre-Conversion Services developer preview
Pre-Conversion Services are included as a "Developer Preview." This feature is in late-stage development and api's marked as such should be used for evaluation purposes only and should not be used in production deployments. Note that these api's may undergo change prior to feature completion. The Pre-Conversion Services will be feature complete in PrizmDoc version 11.2. The Viewing Package Creator API provides a facility to fully convert a document for viewing prior to the creation of a Viewing Session. If a large document is converted for viewing at the time a Viewing Session is created, the user may experience a delay when viewing later pages in the document. By converting a document prior to viewing, the entire document is available for viewing immediately.