Document Management - configuring File Storage Manager
To start using Document Management, specify your STORAGE_STRATEGY
in your system-definition.kts.
STORAGE_STRATEGY
supports the following values:
- LOCAL
- AWS
- SHAREPOINT
- SHAREPOINT_ON_PREM
item(name = "STORAGE_STRATEGY", value = "<strategy>")
Once you have set your STORAGE_STRATEGY
, you must configure the storage solution that you are going to use. The requirements for each solution are described below.
Local file storage
When using local file storage, your files are stored under your specified folder inside your genesis-home/runtime/fileupload/ folder, which is created automatically.
When using Local File Storage, your files are stored under genesis-home/runtime/fileupload/. You can optionally specify your own sub-directory under this.
If you do, the framework will automatically create it for you. If no additional directory path is required, it will default to genesis-home/runtime/fileupload/LOCAL_STORAGE.
item(name = "LOCAL_STORAGE_FOLDER", value = "<folderName>")
AWS S3
When using AWS S3 as your storage solution, you must have an S3 bucket created either locally or remotely.
Next, you must set your S3_STORAGE_MODE
.
S3_STORAGE_MODE
supports the following values:
- LOCAL (app running locally with local S3 bucket)
- DEV (app running locally with remote S3 bucket)
- AWS (app running remotely on a AWS resource with remote S3 bucket)
item(name = "S3_STORAGE_MODE", value = "<storageMode>")
Next, you need to set your bucket config as follows.
item(name = "S3_BUCKET_NAME", value = "<bucketName>")
item(name = "S3_FOLDER_PREFIX", value = "<folderPrefix>")
Once you have set your storage mode and bucket config, your must set the individual config for your chosen storage mode.
S3_STORAGE_MODE = LOCAL
item(name = "AWS_HOST", value = "<host>")
item(name = "AWS_REGION", value = "<region>")
S3_STORAGE_MODE = DEV
item(name = "AWS_REGION", value = "<region>")
item(name = "AWS_ACCESS_KEY", value = "<accessKey>")
item(name = "AWS_SECRET_ACCESS_KEY", value = "<secretAccessKey>")
S3_STORAGE_MODE = AWS
No extra config is required. The AWS resource your app is running on will extract the required config from the environment it's running on.
Sharepoint
When using Sharepoint as your storage solution, you must have a Sharepoint instance created either on-premises or remotely. Next you will need to set the following specific config.
On-premises Sharepoint
item(name = "SHAREPOINT_ROOT_URL", value = "<rootUrl>")
item(name = "SHAREPOINT_SITE_URL", value = "<siteUrl>")
item(name = "SHAREPOINT_FOLDER", value = "<folder>")
item(name = "SHAREPOINT_CLIENT_ID", value = "<clientId>")
item(name = "SHAREPOINT_CLIENT_SECRET", value = "<clientSecret>")
item(name = "SHAREPOINT_TENANT_ID", value = "<tenantId>")
Remote Sharepoint
item(name = "SHAREPOINT_TENANT_ID", value = "<tenantId>")
item(name = "SHAREPOINT_SITE_ID", value = "<siteId>")
item(name = "SHAREPOINT_CLIENT_ID", value = "<clientId>")
item(name = "SHAREPOINT_CLIENT_SECRET", value = "<clientSecret>")