Where Data Comes From
From a developer perspective you have three kinds of Data:
In addition you have Settings and Resources:
And you have Context information:
- MyContext / CmsContext
The complete App Data is always available in these objects:
The current App with
Pathinformation and more.
All the data of the current app for immediate use, fully cached in memory of the web server.
Queries which were created using VisualQuery and can be run to access prepared data.
The primary and often the only content-items for this template.
Can contain additional presentation settings for this content, like how to format it.
One or more Streams (lists) of zero-or-more content items
The header data if the template expects to be a list and also needs a title or intro.
Can contain additional presentation settings for the header, like how to format it.
Code Retrieved Data
Your code can also retrieve data using normal C# code to do things like
- Get lists of files from ADAM or the file system
- Read data from SQL
- Manually parse CSV files or access external Web Services
- Use DataSources to get SQL, CSV or other data
Configuration and Settings
Configuration is usually found on specific objects which are configured. There are three types:
- View Configuration
- App Configuration
- Feature activations
Settings usually affect templates / Razor or C# WebAPIs. They are usually configured at various levels like on the View, App, Site or Global.
C# code will usually get these settings from the
Settings object which consolidates all the settings.
👉 See Settings
Resources are meant to provide translated labels, logos etc. You can configure them at View, App, Site or Global level.
👉 See Resources
- Introduced in 2sxc v1
- App.Data added ca. 2sxc 6
- App.Query added ca. 2sxc 7
- Settings and Resources added in 2sxc 12