close

Filter

loading table of contents...

Studio Developer Manual / Version 2401

Table Of Contents

9.9 Storing Preferences

A custom component may have to store user preferences persistently. To this end, the global @coremedia/studio-client.cap-base-models/preferences/editorPreferences offers the method getPreferences of the interface IEditorPreferences. The method returns a Struct object that is stored in the EditorPreferences content item of the current user. You can modify this struct using the standard struct API as described in Section 5.4.4, “Structs”.

To offer a bit more utility, the class @coremedia/studio-client.cap-base-models/preferences/PreferencesUtil provides two handy methods for reading and writing complex objects in the preferences struct: getPreferencesJSONProperty and updatePreferencesJSONProperty. These methods support strings, numbers, Boolean, contents, and complex objects and arrays containing such values. The Studio API uses these methods internally for persisting saved searches (including custom filters), open tabs, dashboard widget states, and bookmarks.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.