Exposing elements for views
Once you have created a view, you can specify what model elements can be displayed by the view using the expose relationship. The exposed elements can be further narrowed down using filters.
Elements can be exposed for views only via the Textual Editor. For displaying exposed elements on views, see the Displaying elements in views page.
Element exposition kinds and visibility
Expose relationship is a kind of import relationship and is thus declared like an import relationship, but using the keyword expose instead of import. However, unlike imports, whose visibility can be modified, expose relationships always have protected visibility, which means that the elements exposed by a view usage are not publicly visible outside the view usage.
The exposition kind is specified as a specific suffix added to the exposed elements qualified name.
| Exposition kind | Suffix | Exposed elements | Example |
|---|---|---|---|
Membership exposition | none | Only the specified namespace (i.e., element import). | part vehicleInformation { |
Namespace exposition | ::* | The content of the specified namespace. | part vehicleInformation { |
Recursive membership exposition | ::** | The specified namespace and its content, including sub-namespaces and their elements. | part vehicleInformation { |
Recursive namespace exposition | ::*::** | The content of the specified namespace, including sub-namespaces and their elements. | part vehicleInformation { |
Exposing elements
To expose elements
- In the Textual Editor, place the cursor within the body of the view element for which you want to expose the element(s).
- Declare the keyword expose.
- Specify the qualified name of the membership/namespace you want to import, followed by the appropriate suffix for a recursive/membership/namespace exposition.
- (Optional) Specify an element filter.
- Click the Synchronize button.
You can specify multiple expose relationships for the same view.
part vehicleInformation {
part vehicleSpecs {}
part vehicleRecord {
item vehicleModel;
}
}
view 'Vehicle Details' : DS_Views::SymbolicViews::gv, DS_Views::SymbolicViewsByExpression::NonStandardLibraryElementFilter {
expose vehicleInformation::**; // recursive membership exposition of vehicleInformation, vehicleSpecs, vehicleRecord, vehicleModel
}
Reviewing exposed elements
To review the elements exposed for a specific element, open its Specification window and check the values of the Exposed Element property.