-
Notifications
You must be signed in to change notification settings - Fork 93
Configuration v0.2
Configuration is based on 3 distinct components:
- Configuration file(s)
- In-App Configuration Service
- In-App Configurable User Interface and Behaviour
Since Alfresco Android 1.5 the mobile application has configurable block. A block can be anything : a view, an action, a theme, an url… The main particularity of each block is it can be modified/customized without requiring any code development.
Configuration is retrieved by the mobile application via its Configuration Service. The service will typically retrieve the configuration from the server the app is currently attached to, however, it is also capable of accepting configuration from other sources, for example, a client application may provide user configuration options allow individual users to customise their app. This service is also responsible for localization.
The configuration file is responsible for storing configuration information. This file is created by a developer/administrator/integrator and must respect JSON formatting and conventions defined by the next section. Optionally it’s possible to associate a localization file with the configuration file.
The configuration file will be stored at the following location in the repository:
/Company Home/Data Dictionary/Mobile/configuration.json
Optionally it’s possible to create a "Messages" folder at the following location in the repository:
/Company Home/Data Dictionary/Mobile/Messages
It holds all the localised strings referenced in the config file. The messages folder contains a set of messages.properties files that follow the Java resource bundle naming convention. English localization must be defined inside the file named strings.properties
Other localizations file name must respect the following pattern: strings_<locale_code>.properties
where locale_code can be replaced by
- fr : French
- it : Italian
- es : Spanish
- de : German
- ja : Japanese or any other local code
strings.properties
profile.default.title=Default
profile.default.summary=Default profile
home.menu.header=Views
view.properties.title=General
view.properties.description=Default Properties
strings_fr.properties
profile.default.title=D\u00e9faut
profile.default.summary=Profile par d\u00e9faut
home.menu.header=Vues par d\u00e9faut
view.properties.title=General
view.properties.description=Description
Currently the JSON Configuration file supports 5 Configurable blocks
- Repository
- Profiles
- Features
- View Groups
- Views
Another top level block is available for versioning purpose called "Info"
{
"info": {},
"repository": {},
"features": [],
"profiles": {},
"view-groups": [],
"views": {}
}
The purpose of this block is to assure backwards compatibility and configuration evolution/versioning.
Info is mandatory
"info": {
"schema-version": 0.2
}
Important*:
- Alfresco Android 1.5 supports only schema-version = 0.1
- Alfresco Android 1.6+ supports schema-version = 0.1 & 0.2
It contains configuration information about the repository.
"repository":{
"share-url": "https://hostname:port/share"
}
It contains configuration information about features which can be activated or deactivated on mobile side.
A feature must have an unique id and a type. Types are predefined by the mobile application and can optionally allows extra parameters.
"features":[
{
"id": "<feature-id>",
"type": "<feature-type>",
"enable": true|false
}
],
Analytics
org.alfresco.client.feature.analytics |
---|
Enable or disable Analytics. |
Alfresco Mobile applications are based on multiple View Template. Each of them are customizable and can be reused across the application in different ways. Views can also contains other views. This type of views is called View-groups.
To avoid configuration duplication across the configuration file View configuration block is responsible to store all view configuration in one place. The purpose is to create a dictionary of views configuration that can be reused by other configurable blocks.
A view must have an unique id and a type.
Types are predefined by the mobile application and can optionally allows extra parameters. Optionally a label-id and description-id can be attached. Label-id is used to display a title.
"views" : {
"<view-id>":
{
"label-id": "<label-id>",
"description-id": "<description-id>",
"type": "<view-type>",
"params":
{
"<param-name>": "<param-value>"
}
}
}
Views can also contains other views or groups of views. This type of views is called View-groups.
View Groups can be
- referenced by their view id
- referenced by their view group id
- defined inline
This mechanism avoids configuration duplication.
"view-groups": [
{
"id": "<view-group-id>",
"label-id": "<label-id>",
"description-id": "<description-id>",
"items": [
{
"item-type": "view-id",
"view-id": "<view-id>"
},
{
"item-type": "view-group-id",
"view-group-id": "<view-group-id>"
},
{
"item-type": "view",
"view": {
"label-id": "<label-id>",
"description-id": "<description-id>",
"type": "<view-type>",
"form-id": "<form-id>",
"params": {
"<param-name>": "<param-value>"
}
}
}
]
}
]
Activities
org.alfresco.client.view.activities | ||||
---|---|---|---|---|
Displays user’s activities. | ||||
param-name | Description | Type | Mandatory | |
userName | Displays activities stream for a specific user | String | No | |
siteShortName | Displays activities stream for a specific site. | String | No |
Sites
org.alfresco.client.view.sites | ||||
---|---|---|---|---|
Displays a list of sites. Displays all sites by default (with no parameters) |
||||
param-name | Description | Type | Mandatory | |
show | values available : favorites|my|all | String | No |
Nodes
org.alfresco.client.view.repository | ||||
---|---|---|---|---|
Displays a folder from the repository. Displays Company Home folder by default (with no parameters) |
||||
param-name | Description | Type | Mandatory | |
path | Displays a folder defined by its absolute path | String | No (exclusive) | |
nodeRef | Displays a folder retrieved by its nodeRef | String | No (exclusive) | |
siteShortName | Displays the document library folder associated to the specified site | String | No (exclusive) | |
folderTypeId | Displays the system folder shared|userhome | String | No (exclusive) |
org.alfresco.client.view.repository-search | ||||
---|---|---|---|---|
Displays a list of nodes based on a query. By default it display a list of Files |
||||
param-name | Description | Type | Mandatory | |
keywords | keywords to search | String | Yes(exclusive) | |
isExact | Exact search. Requires : keywords | String | No | |
fullText | Fulltext search. Requires : keywords | String | No | |
searchFolderOnly | Display a list of folders. Requires : keywords | String | No | |
statement | CMIS query | String | Yes (exclusive) |
org.alfresco.client.view.node-details | ||||
---|---|---|---|---|
Displays the details of a repository node. | ||||
param-name | Description | Type | Mandatory | |
path | Absolute path to the specified folder or document | String | Yes (exclusive) | |
nodeRef | NodeRef associated to a folder or document | String | Yes (exclusive) |
Favorites
org.alfresco.client.view.favorites | ||||
---|---|---|---|---|
Displays list of favorite files and folders | ||||
param-name | Description | Type | Mandatory | |
filters | Enable a filter object | Object | No | |
filters/mode | Values : all|folders|files | String | No | |
Tasks & Workflow
org.alfresco.client.view.tasks | ||||
---|---|---|---|---|
Displays tasks. Display My tasks by default. |
||||
param-name | Description | Type | Mandatory | |
filters | Enable a filter object | Object | No | |
filters/status | Values : any|active|complete | String | No | |
filters/due | Values : today|tomorrow|week|overdue|none | String | No | |
filters/priority | Values : low|medium|high | String | No | |
filters/assignee | Values : me|unassigned|all|none | String | No |
{
"item-type": "view",
"view": {
"id": "view-task-filter",
"label-id": "Tasks with Filter",
"type": "org.alfresco.client.view.tasks",
"params": {
"filters": {
"status": "any|active|complete",
"due": " today|tomorrow|week|overdue|none",
"priority": "low|medium|high",
"assignee": "me|unassigned|all|none"
}
}
}
}
Users
org.alfresco.client.view.people | ||||
---|---|---|---|---|
Displays a list of users. | ||||
param-name | Description | Type | Mandatory | |
keywords | Displays a search view for users with the matching keywords. On OnPremise the keywords can be a query like "User jobtitle:admin" |
String | Yes (exclusive) | |
siteShortName | Displays list of members for a specific site. | String | Yes (exclusive) |
org.alfresco.client.view.person-profile | ||||
---|---|---|---|---|
Displays person profile details. By Default(no parameters) Displays user profile |
||||
param-name | Description | Type | Mandatory | |
userName | Displays the profile for the specified username. | String | No |
Local Files
org.alfresco.client.view.local | ||||
---|---|---|---|---|
Displays a list of most important local folder available inside the device |
org.alfresco.client.view.local-files | ||||
---|---|---|---|---|
Displays files local to the client. Displays application download folder by default (with no parameters) |
||||
param-name | Description | Type | Mandatory | |
path | Absolute path to the specified folder. | String | No |
Search
org.alfresco.client.view.search | ||||
---|---|---|---|---|
Displays a search view. |
org.alfresco.client.view.search-advanced | ||||
---|---|---|---|---|
Displays an advanced search view. | ||||
param-name | Description | Type | Mandatory | |
type | values available : person|document|folder | String | Yes |
Sync
org.alfresco.client.view.sync | ||||
---|---|---|---|---|
Displays list of synced content |
A profile is responsible to bind different configuration into a single unique group. With this approach it would be possible to create different configuration for different use case and for different users.
A configuration file MUST HAVE at least ONE profile.
{
"<profile-id>":
{
"default": true,
"label-id": "<label-id>",
"description-id": "<description-id>",
"root-view-id": "<view-id> or <view-group-id>"
}
}