Class NovaRazorPage
A RazorPage implementation with some utility methods to access the model and to render view components.
Implements
Inherited Members
Namespace: Noxum.Nova.Razor.Model
Assembly: Noxum.Nova.Razor.Model.dll
Syntax
public abstract class NovaRazorPage : RazorPage<NovaRazorModel>, IRazorPage
Constructors
NovaRazorPage()
The constructor will be called from the constructor of the derived view class.
Declaration
public NovaRazorPage()
Properties
EditingJsUrl
The URL to get the Nova Editing Script as JS
Declaration
public string EditingJsUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
First
The first object in the list of input objects
Declaration
public NovaRazorObject First { get; }
Property Value
| Type | Description |
|---|---|
| NovaRazorObject |
FontsCssUrl
The URL to get Nova Font Face Objects as CSS
Declaration
public string FontsCssUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
Objects
The list of input objects
Declaration
public IReadOnlyList<NovaRazorObject> Objects { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<NovaRazorObject> |
OpfxXslUrl
The URL to get Nova XSL to render OPFX in the browser
Declaration
public string OpfxXslUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
OutputMediaType
Gets or sets the media type of the output content, e.g., "text/html" or "application/vnd.noxum.ipub". (default: text/html)
Declaration
public string OutputMediaType { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Source
Get the Nova Razor View object this Razor Page is created from
Declaration
public NovaRazorView Source { get; }
Property Value
| Type | Description |
|---|---|
| NovaRazorView |
StylesCssUrl
The URL to get Nova Style Objects as CSS
Declaration
public string StylesCssUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
ThemingCssUrl
The URL to get Nova Theming Styles as CSS
Declaration
public string ThemingCssUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetCssUrl(ObjId)
Get a URL to the CSS file of a TypeCascadingStyleSheet object by id.
Declaration
public string GetCssUrl(ObjId objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | objectId | The id of the object |
Returns
| Type | Description |
|---|---|
| string | The URL pointing to the CSS file. |
GetCssUrl(Guid)
Get a URL to the CSS file of a TypeCascadingStyleSheet object by guid.
Declaration
public string GetCssUrl(Guid objectGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | objectGuid | The guid of the object |
Returns
| Type | Description |
|---|---|
| string | The URL pointing to the CSS file. |
GetCssUrl(string)
Get a URL to the CSS file of a TypeCascadingStyleSheet object by api identifier.
Declaration
public string GetCssUrl(string apiId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiId | The api identifier of the object |
Returns
| Type | Description |
|---|---|
| string | The URL pointing to the CSS file. |
GetObjectsByTypeAsync(ObjId)
Get all objects of a specific type that are not deleted. MAY LOAD A LOT OF DATA!
Declaration
public Task<IReadOnlyList<NovaRazorObject>> GetObjectsByTypeAsync(ObjId typeId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | typeId | The object type ID |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<NovaRazorObject>> | The list of corresponding NovaRazorObjects |
RenderObjectAsync(string, ObjId, params (string, object)[])
Use a named ViewComponent to render the specified object in the context of the current page.
Usage:
@await RenderObjectAsync("MyViewComponent", myObjId, ("paramName", anyValue))
Declaration
public Task<IHtmlContent> RenderObjectAsync(string apiId, ObjId objId, params (string, object)[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiId | The API identifier of the RazorView object containing the ViewComponent's code. |
| ObjId | objId | The ID if the Nova object to be rendered |
| (string, object)[] | data | Optional key-value pairs passed to the ViewData dictionary of the child ViewComponent. |
Returns
| Type | Description |
|---|---|
| Task<IHtmlContent> |
RenderObjectAsync(string, NovaRazorObject, params (string, object)[])
Use a named ViewComponent to render the specified object in the context of the current page.
Usage:
@await RenderObjectAsync("MyViewComponent", myObj, ("paramName", anyValue))
Declaration
public Task<IHtmlContent> RenderObjectAsync(string apiId, NovaRazorObject obj, params (string, object)[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiId | The API identifier of the RazorView object containing the ViewComponent's code. |
| NovaRazorObject | obj | The Nova object to be rendered |
| (string, object)[] | data | Optional key-value pairs passed to the ViewData dictionary of the child ViewComponent. |
Returns
| Type | Description |
|---|---|
| Task<IHtmlContent> |
RenderObjectAsync(string, NovaRazorValue, params (string, object)[])
Use a named ViewComponent to render the specified object in the context of the current page.
Usage
@await RenderObjectAsync("MyViewComponent", myValue, ("paramName", anyValue))
Declaration
public Task<IHtmlContent> RenderObjectAsync(string apiId, NovaRazorValue val, params (string, object)[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiId | The API identifier of the RazorView object containing the ViewComponent's code. |
| NovaRazorValue | val | A Nova value referencing the object to be rendered |
| (string, object)[] | data | Optional key-value pairs passed to the ViewData dictionary of the child ViewComponent. |
Returns
| Type | Description |
|---|---|
| Task<IHtmlContent> |
ResolveObjectAsync(ObjId)
Resolve an object ID to the corresponding NovaRazorObject.
Declaration
public Task<NovaRazorObject> ResolveObjectAsync(ObjId objId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | objId | The object ID |
Returns
| Type | Description |
|---|---|
| Task<NovaRazorObject> | The corresponding NovaRazorObject |
ResolveObjectAsync(Guid)
Resolve an object ID to the corresponding NovaRazorObject.
Declaration
public Task<NovaRazorObject> ResolveObjectAsync(Guid objGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | objGuid | The object GUID |
Returns
| Type | Description |
|---|---|
| Task<NovaRazorObject> | The corresponding NovaRazorObject |
ResolveObjectsAsync(IEnumerable<ObjId>)
Resolve object IDs to their corresponding NovaRazorObjects. The sort order is preserved.
Declaration
public Task<IReadOnlyList<NovaRazorObject>> ResolveObjectsAsync(IEnumerable<ObjId> objIds)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ObjId> | objIds | The object IDs |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<NovaRazorObject>> | The list of corresponding NovaRazorObjects |
ResolveSystemObject(ObjId)
Resolve an object ID to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public NovaRazorObject ResolveSystemObject(ObjId objId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | objId | The object ID |
Returns
| Type | Description |
|---|---|
| NovaRazorObject | The corresponding NovaRazorObject |
ResolveSystemObject(Guid)
Resolve a GUID to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public NovaRazorObject ResolveSystemObject(Guid objGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | objGuid | The object GUID |
Returns
| Type | Description |
|---|---|
| NovaRazorObject | The corresponding NovaRazorObject |
ResolveSystemObject(string)
Resolve an APIIdentifier to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public NovaRazorObject ResolveSystemObject(string apiIdentifier)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiIdentifier | The object ID |
Returns
| Type | Description |
|---|---|
| NovaRazorObject | The corresponding NovaRazorObject |
ResolveSystemObject<T>(ObjId)
Resolve an object ID to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public T ResolveSystemObject<T>(ObjId objId) where T : NovaRazorObject
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | objId | The object ID |
Returns
| Type | Description |
|---|---|
| T | The corresponding NovaRazorObject |
Type Parameters
| Name | Description |
|---|---|
| T |
ResolveSystemObject<T>(Guid)
Resolve an APIIdentifier to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public T ResolveSystemObject<T>(Guid objGuid) where T : NovaRazorObject
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | objGuid | The object GUID |
Returns
| Type | Description |
|---|---|
| T | The corresponding NovaRazorObject |
Type Parameters
| Name | Description |
|---|---|
| T |
ResolveSystemObject<T>(string)
Resolve an APIIdentifier to the corresponding NovaRazorObject. This synchronous method will work for system objects (attributes, languages..) only.
Declaration
public T ResolveSystemObject<T>(string apiIdentifier) where T : NovaRazorObject
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiIdentifier | The object ID |
Returns
| Type | Description |
|---|---|
| T | The corresponding NovaRazorObject |
Type Parameters
| Name | Description |
|---|---|
| T |
SearchObjectsByValueAsync(ObjId, ScopedAttributeKey, object)
Search for objects of a specific type by value.
Declaration
public Task<IReadOnlyList<NovaRazorObject>> SearchObjectsByValueAsync(ObjId typeId, ScopedAttributeKey key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjId | typeId | The object type ID |
| ScopedAttributeKey | key | The ScopedAttributeKey to search for |
| object | value | The value to search for |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<NovaRazorObject>> | The list of existing NovaRazorObjects in object ID order |
SearchObjectsByValueAsync(ScopedAttributeKey, object)
Search for objects of any type by value.
Declaration
public Task<IReadOnlyList<NovaRazorObject>> SearchObjectsByValueAsync(ScopedAttributeKey key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| ScopedAttributeKey | key | The ScopedAttributeKey to search for |
| object | value | The value to search for |
Returns
| Type | Description |
|---|---|
| Task<IReadOnlyList<NovaRazorObject>> | The list of existing NovaRazorObjects in object ID order |