The Content Repository Plugin is used to implement a persistence layer for data so that you can store images and videos using this plugin. It contains a repository, folders and files, so you create a repository (parent folder) in which subfolders can be stored in any hierarchy.
Example call of a Content Repository Plugin function via a server-side Business Object:
var result = Simplifier.Plugin.contentRepoPlugin.contentRepositoryAdd({
"provider": "ClearFileSystem",
"name": input.name,
"description": input.description,
"permissionObjectType" : "App",
"permissionObjectID": "DummyApp"
});
The payload configuration depends on the required slot.
Difference between File System and Clear File System:
The file system stores the received content repository data in a database.
The clear file system stores this data in an actual file system (compare Windows Explorer).
Restrictions
The content repository supports documents up to 20 MB in general with the default configuration. In Setups with only little concurrency, little traffic in general and an extended memory assignment, it may handle files up to 50 MB correctly. Larger files are not supported.
Content Repositories
Add
Slot |
Description |
contentRepositoryAdd |
This function adds a new content repository |
FileSystem:
Input parameters
Key |
Type |
Description |
name |
String |
Name of the repository |
description |
String (optional) |
Description of the repository |
provider |
String |
Content provider (must be specified as ‘FileSystem’) |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
{
"permissionObjectType" : "App",
"permissionObjectID": "DummyApp",
"provider" : "FileSystem",
"name": "MyTestRepo",
"description": "MyTestRepoDescription"
}
Output parameter
Key |
Type |
Description |
id |
String |
The ID of the created repository |
{
"id": 15
}
ClearFileSystem:
Input parameters
Key |
Type |
Description |
name |
String |
Name of the repository |
description |
String (optional) |
Description of the repository |
provider |
String |
Content provider (must be specified as ‘ClearFileSystem’) |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
{
"name": "MyTestRepo",
"provider" : "ClearFileSystem",
"description": "MyTestRepoDescription",
"permissionObjectID": "MyRepoName",
"permissionObjectType": "App"
}
Output parameters
Key |
Type |
Description |
id |
Integer |
ID of the created ContentRepository |
description |
String |
Description of the repository |
{
"id": 15,
"description": "MyTestRepoDescription"
}
Find
Slot |
Description |
contentRepositoryFind |
This function lists only repositories for which the user has authorizations |
FileSystem:
Input parameter
Key |
Type |
Description |
name |
String |
Name of the searched repository |
{
"name": "MyRepo"
}
Output parameters
Key |
Type |
Description |
repositories |
Array |
Array of all repositories (max. 1 element) |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
provider |
String |
Content provider (must be specified as ‘FileSystem’) |
{
"repositories": [
{
"id": 3,
"name": "MyRepo",
"description": "My repo description",
"permissionObjectType": "App",
"permissionObjectID": "DummyApp",
"provider": "FileSystem",
}
]
}
ClearFileSystem:
Input parameter
Key |
Type |
Description |
name |
String |
Name of the searched repository |
{
"name": "MyRepo"
}
Output parameters
Key |
Type |
Description |
repositories |
Array |
Array of all repositories (max. 1 element) |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
provider |
String |
Content provider (must be specified as ‘ClearFileSystem’) |
{
"repositories": [
{
"id": 3,
"name": "MyRepo",
"description": "My repo description",
"provider": "ClearFileSystem"
}
]
}
List
Slot |
Description |
contentRepositoryList |
This function finds only repositories for which the user has authorizations |
FileSystem:
Input parameter
Key |
Type |
Description |
provider |
String (optional) |
Content provider (must be specified as ‘FileSystem’)
If no provider is specified, all repositories are returned |
{
"provider": "FileSystem"
}
Output parameters
Key |
Type |
Description |
repositories |
Array |
Array of all repositories |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
provider |
String |
Content provider |
{
"repositories": [
{
"id": 3,
"name": "MyRepo",
"description": "My repo description",
"permissionObjectType": "App",
"permissionObjectID": "DummyApp",
"provider": "FileSystem",
},
{
"id": 4,
"name": "MyRepo2",
"description": "My repo description 2",
"permissionObjectType": "Session",
"permissionObjectID": "abc",
"provider": "FileSystem",
}
]
}
ClearFileSystem:
Input parameter
Key |
Type |
Description |
provider |
String (optional) |
Content provider (must be specified as ‘ClearFileSystem’)
If no provider is specified, all repositories are returned |
{
"provider": "ClearFileSystem"
}
Output parameters
Key |
Type |
Description |
repositories |
Array |
Array of all repositories |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
provider |
String |
Content provider |
{
"repositories": [
{
"id": 5,
"name": "MyRepo5",
"description": "My repo description 5",
"provider": "ClearFileSystem"
},
{
"id": 6,
"name": "MyRepo6",
"description": "My repo description 6",
"provider": "ClearFileSystem"
}
]
}
Get
Slot |
contentRepositoryGet |
FileSystem:
Input parameter
Key |
Type |
Description |
id |
Integer |
Primary key |
{
"id": 3
}
Output parameters
Key |
Type |
Description |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
provider |
String |
Content provider (must be specified as ‘FileSystem’) |
{
"id": 3,
"name": "MyRepo",
"description": "My repo description",
"permissionObjectType": "App",
"permissionObjectID": "DummyApp",
"provider": "FileSystem",
}
ClearFileSystem:
Input parameter
Key |
Type |
Description |
id |
Integer |
Primary key |
{
"id": 3
}
Output parameters
Key |
Type |
Description |
id |
Integer |
ID of the repository |
name |
String |
Name of the repository |
description |
String |
Description of the repository |
provider |
String |
Content provider (must be specified as ‘ClearFileSystem’) |
{
"id": 3,
"name": "MyRepo",
"description": "My repo description",
"provider": "ClearFileSystem",
}
Edit
Slot |
Description |
contentRepositoryEdit |
This function edits a content repository |
FileSystem:
Input parameters
Key |
Type |
Description |
id |
Integer |
Primary key (ID of the repository) |
name |
String |
Name of the repository |
description |
String (optional) |
Description of the repository |
permissionObjectType |
String |
Must be specified as ‘App’ |
permissionObjectID |
String |
The ID of the Object Type can be freely selected |
{
"id" : 15,
"permissionObjectType" : "App",
"permissionObjectID": "DummyApp",
"name": "MyTestRepo",
"description": "My new description",
}
ClearFileSystem:
Input parameters
Key |
Type |
Description |
id |
Integer |
Primary key (ID of the repository) |
name |
String |
Name of the repository |
description |
String (optional) |
Description of the repository |
{
"id" : 15,
"name": "MyTestRepo",
"description": "My new description"
}
Delete
A repository can only be deleted if it does not contain any content folders.
Slot |
Description |
contentRepositoryDelete |
This function deletes a content repository |
Input parameter
Key |
Type |
Description |
id |
Integer |
Primary key |