Table of Contents

you are here (click to zoom) - discover the stack

Where Data Comes From

From a developer perspective you have three kinds of Data:

  1. App Data
  2. Instance Data
  3. Code Retrieved Data

In addition you have Settings and Resources:

  1. Configuration & Settings
  2. Resources

And you have Context information:

  • MyContext / CmsContext
  • MyPage
  • MyUser
  • MyView
  • etc.

App Data

The complete App Data is always available in these objects:

  1. App
    The current App with Settings, Resources, Path information and more.
  2. App.Data
    All the data of the current app for immediate use, fully cached in memory of the web server.
  3. App.Query
    Queries which were created using VisualQuery and can be run to access prepared data.

Instance Data

Note

Instance specific data belongs to the module-instance on the page, either because it was added manually as Content or because the View of the module-instance uses a Query.

Best read about App vs. Instance Data and Where Data Comes From

If the View is configured for manual content-editing or uses a Query then Instance Data is automatically prepared in these objects:

  1. Content
    The primary and often the only content-items for this template.
  2. Content.Presentation
    Can contain additional presentation settings for this content, like how to format it.
  3. Data
    One or more Streams (lists) of zero-or-more content items
  4. Header
    The header data if the template expects to be a list and also needs a title or intro.
  5. Header.Presentation
    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

  1. Get lists of files from ADAM or the file system
  2. Read data from SQL
  3. Manually parse CSV files or access external Web Services
  4. 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:

  1. View Configuration
  2. App Configuration
  3. 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

Resources are meant to provide translated labels, logos etc. You can configure them at View, App, Site or Global level.

👉 See Resources


History

  1. Introduced in 2sxc v1
  2. App.Data added ca. 2sxc 6
  3. App.Query added ca. 2sxc 7
  4. Settings and Resources added in 2sxc 12