How to extend the administration interface.
In DynamicWeb 10 you have a wide range of options for extending the UI of the Administration interface. The UI is built using a set of building blocks that are reused throughout the entire system.
DynamicWeb 10 uses a modular architecture where each element has it's own distinct responsibility. In this section we are going to describe the elements in the UI, and how they interact with each other.
Queries are used for fetching data from the domain based on some specific condition, and then it transforms the domain model into a Model. A query can either return a single model or it can return a list of models, depending on what's needed.
A result from a query is typically passed to a Screen.
A model is a representation of a domain model, where the data is optimized for being viewed on some Screens. So the data in this Model is specifically created for Screens and Commands, where it contains the information that we want to show on these Screens. There's two ways to define this mapping between the domain model and the ViewModel.
- Global mapping
- Custom mapping
In this case we define the mapping based on the source type (domain model) and the target type (ViewModel). So as soon as we have defined a mapping from a specific domain model to a specific ViewModel, we can reuse it throughout the entire system every time we work with these types. This makes it a lot easier to maintain the mapping functionality, because it's the same that is being use everywhere.
In some scenarios you need to map some properties on the ViewModel in a special way, when you're working on a specific Query. When that's needed you can just do the mapping manually in the
GetModel function on the Query.
A Screen is the actual UI, which is that you see in the Administration interface. Screens receive their data in the form of a Model from a Query. The Screen is defined using code, so you don't need to worry about how the layout and the styling of the Screens will be, only what data from the Model you want to show. DynamicWeb provides three different types of Screens:
All these screen types can be used to create custom screens, but you can also create a completely custom screen implementation - read more here.
Commands are actions that are handled on the server. These can be used to manipulate data e.g. save a Page or delete a page. A command will typically receive a model or some other information that can be used to identify the entity we want to manipulate.
The command will then interact with the domain to make sure that the data is persisted in the database.