Skip to content

Commit 3575125

Browse files
hl662Copilot
andauthored
docs: Rewrite Settings and Workspaces documentation (#9065)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4794e79 commit 3575125

12 files changed

Lines changed: 831 additions & 264 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "Updated TSDoc for Settings and IModelDb to reference current EditTxn APIs instead of deprecated methods.",
5+
"type": "none",
6+
"packageName": "@itwin/core-backend"
7+
}
8+
],
9+
"packageName": "@itwin/core-backend",
10+
"email": "50554904+hl662@users.noreply.github.com"
11+
}

core/backend/src/IModelDb.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,6 +2259,7 @@ export abstract class IModelDb extends IModel {
22592259
* @param name The name for the SettingDictionary. If a dictionary by that name already exists in the iModel, its value is replaced.
22602260
* @param dict The SettingDictionary object to stringify and save.
22612261
* @note All saved `SettingDictionary`s are loaded into [[workspace.settings]] every time an iModel is opened.
2262+
* @see [[Settings.addDictionary]] to register a dictionary for the current session only without persisting it.
22622263
* @beta @deprecated Use EditTxn.saveSettingDictionary instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
22632264
*/
22642265
public saveSettingDictionary(name: string, dict: SettingsContainer) {

core/backend/src/workspace/Settings.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,16 @@ export interface SettingsDictionaryProps extends SettingsDictionarySource {
203203
* Like iModel-specific settings, any settings supplied by the iTwin will override those defined at the application level.
204204
*
205205
* Application settings are loaded into [[IModelHost.appWorkspace]] when the session begins (i.e., when [[IModelHost.startup]] is invoked), and unloaded when it ends (in [[IModelHost.shutdown]]).
206-
* They are read from [JSON5](https://json5.org/) files delivered with the application. The application should register any additional [[SettingsDictionary]]'s '(and their corresponding
207-
* [[SettingGroupSchema]]s) at this time.
206+
* They are read from [JSON5](https://json5.org/) files delivered with the application. The application should register any additional [[SettingsDictionary]]s
207+
* (and their corresponding [[SettingGroupSchema]]s) at this time.
208208
*
209209
* iModel-specific settings are stored in the iModel's property table and loaded into [[IModelDb.workspace]] when the iModel is first opened.
210-
* You can add and remove a [[SettingsDictionary]] from the property table using [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]].
210+
* You can add and remove a [[SettingsDictionary]] from the property table using [[EditTxn.saveSettingDictionary]] and [[EditTxn.deleteSettingDictionary]].
211+
* If you are migrating older code, [[IModelDb.saveSettingDictionary]] and [[IModelDb.deleteSettingDictionary]] are deprecated in favor of the [[EditTxn]] APIs.
211212
*
212213
* iTwin-specific settings are stored in a [[CloudSqliteContainer]] in the cloud.
213214
* When [[IModelHost.getITwinWorkspace]] is invoked, the container is accessed using the iTwinId and the settings are loaded into the returned [[Workspace]].
214-
* You can add and remove a [[SettingsDictionary]] from the container using [[Workspace.saveSettingsDictionary]] and [[Workspace.deleteSettingsDictionary]].
215+
* You can add and remove a [[SettingsDictionary]] from the container using [[IModelHost.saveSettingDictionary]] and [[IModelHost.deleteSettingDictionary]].
215216
*
216217
* See the [learning article]($docs/learning/backend/Workspace) for a detailed overview and examples.
217218
*
@@ -256,6 +257,7 @@ export interface Settings {
256257

257258
/** Add a new [[SettingsDictionary]] with the priority, name, and [[WorkspaceDb]] specified by `props` and setting values supplied by `settings`.
258259
* @note If a dictionary with the same name and [[WorkspaceDb]] already exists, it will be replaced.
260+
* @note Values added via this method exist only for the current session. They are not persisted and will be lost when the host shuts down.
259261
* @see [[addFile]], [[addJson]], and [[addDirectory]] for convenient ways to add dictionaries from various sources.
260262
*/
261263
addDictionary(props: SettingsDictionaryProps, settings: SettingsContainer): void;

docs/changehistory/5.8.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Previously, settings and binary resources (fonts, textures, templates) were stor
100100

101101
##### Creating a local SettingsDb
102102

103-
See [SettingsDb]($docs/learning/backend/Workspace.md#settingsdb) for full documentation.
103+
See [Settings containers]($docs/learning/backend/Settings.md#settings-containers) for full documentation.
104104

105105
#### Container type convention
106106

docs/changehistory/NextVersion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Delete it:
275275

276276
To use iTwin-scoped settings dictionaries, configure [IModelHost.authorizationClient]($backend) and [BlobContainer.service]($backend) so the backend can query and update the iTwin settings workspace container.
277277

278-
See the [Workspace documentation]($docs/learning/backend/Workspace.md) for full details.
278+
See the [Settings documentation]($docs/learning/backend/Settings.md#itwin-settings) for full details on iTwin-scoped settings and the [Workspace documentation]($docs/learning/backend/Workspace.md) for workspace resources.
279279

280280
## Quantity Formatting
281281

0 commit comments

Comments
 (0)