crafter
crafter

Reputation: 6296

Store and Use Configuaration values in Alfresco Share

I have a custom developed share dashlet that has hardcoded values in use (For example the name of a Workspace to use as a default).

I would rather have the values placed into a configuration file and have the dashlet read the fileup at server start and work from there. I have two questions:

Upvotes: 2

Views: 507

Answers (1)

skuro
skuro

Reputation: 13514

I would advise you to leverage the PreferenceService, which can be accessed from a Share Web Script by consuming the following API exposed by the repository:

GET /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
POST /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}
DELETE /cms-repository-5.0.0/service/api/people/{userid}/preferences?pf={preferencefilter?}

In this way you will probably need to define some hard coded meaningful defaults, then let the user customize his experience and store the customized settings as user preferences.

Upvotes: 2

Related Questions