Cesivi Extensibility API Reference¶
Welcome to the Cesivi Extensibility API Reference. This documentation provides comprehensive technical information about all the interfaces, classes, and types you need to extend Cesivi with custom components.
Quick Start¶
If you're new to Cesivi extensibility, we recommend starting with the Extensibility Guide, which provides step-by-step tutorials and complete examples.
Core Extensibility Interfaces¶
Cesivi provides three main extensibility interfaces for building custom components:
ICesiviExtension¶
The ICesiviExtension interface allows you to inject custom HTML content at predefined extension points throughout the application.
Namespace: Cesivi.WebUI.Extensibility
Common Use Cases: - Adding custom headers/footers - Injecting analytics scripts - Adding custom navigation elements - Implementing custom toolbars
Example:
public class CustomFooterExtension : ICesiviExtension
{
public string Name => "CustomFooter";
public int Priority => 100;
public Task<IHtmlContent> RenderAsync(ExtensionContext context)
{
if (context.ExtensionPointName == "AfterContent")
{
var html = "<footer class='custom-footer'>© 2026 My Company</footer>";
return Task.FromResult<IHtmlContent>(new HtmlString(html));
}
return Task.FromResult<IHtmlContent>(HtmlString.Empty);
}
}
See Also:
- ExtensionContext - Provides context information for extension rendering
- ExtensionManager - Manages extension registration and rendering
IFieldRenderer¶
The IFieldRenderer interface allows you to create custom field renderers for displaying and editing SharePoint field values.
Namespace: Cesivi.WebUI.FieldRenderers
Common Use Cases: - Custom field types (signature, color picker, star rating) - Specialized display formatters - Custom edit controls - Integration with third-party UI libraries
Example:
public class StarRatingFieldRenderer : IFieldRenderer
{
public string FieldType => "StarRating";
public Task<IHtmlContent> RenderDisplayAsync(SpField field, object? value, FieldRenderContext context)
{
var rating = Convert.ToInt32(value ?? 0);
var stars = string.Concat(Enumerable.Repeat("⭐", rating));
return Task.FromResult<IHtmlContent>(new HtmlString($"<span>{stars}</span>"));
}
public Task<IHtmlContent> RenderEditAsync(SpField field, object? value, FieldRenderContext context)
{
var rating = Convert.ToInt32(value ?? 0);
var html = $@"
<select name='{field.InternalName}' class='form-select'>
<option value='0'>No rating</option>
<option value='1'{(rating == 1 ? " selected" : "")}>⭐</option>
<option value='2'{(rating == 2 ? " selected" : "")}>⭐⭐</option>
<option value='3'{(rating == 3 ? " selected" : "")}>⭐⭐⭐</option>
<option value='4'{(rating == 4 ? " selected" : "")}>⭐⭐⭐⭐</option>
<option value='5'{(rating == 5 ? " selected" : "")}>⭐⭐⭐⭐⭐</option>
</select>";
return Task.FromResult<IHtmlContent>(new HtmlString(html));
}
public Task<object?> ParseValueAsync(SpField field, IFormCollection form, FieldRenderContext context)
{
var stringValue = form[field.InternalName].ToString();
return Task.FromResult<object?>(int.Parse(stringValue));
}
}
See Also:
- FieldRenderContext - Provides context for field rendering
- FieldRendererManager - Manages field renderer registration
- SpField - Field definition model
ICesiviWebPart¶
The ICesiviWebPart interface allows you to create custom WebParts that can be added to pages.
Namespace: Cesivi.WebUI.WebParts
Common Use Cases: - Custom dashboards and widgets - Data visualization components - Content aggregation - Third-party service integration
Example:
public class WeatherWebPart : ICesiviWebPart
{
public string Title => "Weather Forecast";
public string Description => "Displays current weather and 5-day forecast";
public Guid Id => Guid.Parse("12345678-1234-1234-1234-123456789012");
public WebPartCategory Category => WebPartCategory.Content;
public Task<IHtmlContent> RenderAsync(WebPartContext context)
{
var location = context.Properties.GetValueOrDefault("Location", "New York");
// Fetch weather data and render HTML...
var html = $"<div class='weather-widget'><h3>Weather in {location}</h3>...</div>";
return Task.FromResult<IHtmlContent>(new HtmlString(html));
}
public Task<IHtmlContent> RenderEditPropertiesAsync(WebPartContext context)
{
var location = context.Properties.GetValueOrDefault("Location", "");
var html = $@"
<div class='mb-3'>
<label class='form-label'>Location</label>
<input type='text' name='Location' value='{location}' class='form-control' />
</div>";
return Task.FromResult<IHtmlContent>(new HtmlString(html));
}
public Task SavePropertiesAsync(IFormCollection form, WebPartContext context)
{
context.Properties["Location"] = form["Location"].ToString();
return Task.CompletedTask;
}
}
See Also:
- WebPartContext - Provides context for WebPart rendering
- WebPartManager - Manages WebPart registration
- WebPartCategory - WebPart category enumeration
Manager Classes¶
ExtensionManager¶
Manages the registration and rendering of all ICesiviExtension implementations. Automatically injected via dependency injection.
Key Methods:
- RenderExtensionPointAsync(string pointName, ExtensionContext context) - Renders all extensions for a specific extension point
FieldRendererManager¶
Manages the registration and rendering of all IFieldRenderer implementations.
Key Methods:
- RenderDisplayAsync(SpField field, object? value, FieldRenderContext context) - Renders field in display mode
- RenderEditAsync(SpField field, object? value, FieldRenderContext context) - Renders field in edit mode
- ParseValueAsync(SpField field, IFormCollection form, FieldRenderContext context) - Parses submitted form value
WebPartManager¶
Manages the registration and lifecycle of all ICesiviWebPart implementations.
Key Methods:
- GetWebPart(Guid id) - Retrieves a WebPart by ID
- GetAllWebParts() - Returns all registered WebParts
- RenderWebPartAsync(Guid id, WebPartContext context) - Renders a WebPart
Context Classes¶
ExtensionContext¶
Provides context information for extension rendering, including:
- HttpContext - Current HTTP context
- ExtensionPointName - Name of the extension point being rendered
- CurrentWeb - Current SPWeb (if available)
- CurrentList - Current SPList (if available)
- CurrentItem - Current SPListItem (if available)
- Parameters - Additional parameters (dictionary)
FieldRenderContext¶
Provides context information for field rendering, including:
- HttpContext - Current HTTP context
- Web - Current web
- List - Current list
- Item - Current list item
- IsEditMode - Whether rendering in edit mode
WebPartContext¶
Provides context information for WebPart rendering, including:
- HttpContext - Current HTTP context
- WebPartId - Unique identifier for this WebPart instance
- Properties - WebPart property values (dictionary)
- Web - Current web
- List - Current list (if on list page)
- Page - Current page
Registration¶
All extensibility components must be registered in the DI container in Program.cs:
// Register custom extension
builder.Services.AddSingleton<ICesiviExtension, CustomFooterExtension>();
// Register custom field renderer
builder.Services.AddSingleton<IFieldRenderer, StarRatingFieldRenderer>();
// Register custom WebPart
builder.Services.AddSingleton<ICesiviWebPart, WeatherWebPart>();
Built-in Components¶
Built-in Field Renderers (15 Total)¶
- TextFieldRenderer - Single/multi-line text, rich text
- NumberFieldRenderer - Integer and decimal numbers
- BooleanFieldRenderer - Yes/No checkboxes
- DateTimeFieldRenderer - Date and date-time pickers
- ChoiceFieldRenderer - Dropdown, radio buttons, checkboxes
- CurrencyFieldRenderer - Currency with locale formatting
- UrlFieldRenderer - Hyperlinks with description
- LookupFieldRenderer - Lookup to other lists
- UserFieldRenderer - User/group picker
- AttachmentFieldRenderer - File attachments
- RichTextFieldRenderer - HTML editor with toolbar (WYSIWYG)
- LocationFieldRenderer - Address with GPS coordinates
- TaxonomyFieldRenderer - Term store integration
- CalculatedFieldRenderer - Formula evaluation results
- RatingFieldRenderer - Star rating (1-5 stars)
Built-in WebParts (9 Total)¶
- ContentEditorWebPart - HTML content editor
- ImageWebPart - Image display with hyperlinks
- ListViewWebPart - List item display with filtering
- ScriptEditorWebPart - Custom JavaScript/CSS injection
- TableWebPart - Data table with sorting/filtering
- CalendarWebPart - Event calendar view
- GalleryWebPart - Image/video gallery
- IFrameWebPart - Embed external content
- RSSFeedWebPart - RSS/Atom feed consumer
Extension Points¶
The following extension points are available throughout the application:
| Extension Point | Location | Description |
|---|---|---|
Head |
Layout <head> |
Meta tags, custom CSS links |
Styles |
Layout <head> (after CSS) |
Inline styles, CSS overrides |
BeforeContent |
Layout (before main content) | Custom headers, banners |
AfterContent |
Layout (after main content) | Custom footers, scripts |
Scripts |
Layout (before </body>) |
Custom JavaScript |
TopBarLeft |
Top navigation bar (left side) | Custom links/actions |
TopBarRight |
Top navigation bar (right side) | Custom links/actions |
TopBarActions |
Top navigation bar (after Settings/Help) | Custom action buttons |
QuickLaunchTop |
Quick Launch menu (top) | Custom navigation items |
QuickLaunchBottom |
Quick Launch menu (bottom) | Custom navigation items |
RibbonTabs |
Ribbon control | Custom ribbon tabs |
RibbonCommands |
Ribbon control | Custom ribbon command groups |
BreadcrumbBefore |
Breadcrumb navigation (before) | Custom breadcrumb content |
BreadcrumbActions |
Breadcrumb navigation (after) | Custom breadcrumb actions |
ListViewAboveGrid |
List view (above grid) | Custom content above list |
ListViewToolbar |
List view (toolbar area) | Custom toolbar buttons |
ListViewBelowGrid |
List view (below grid) | Custom content below list |
FormHeader |
Item forms (above fields) | Custom form headers |
FormFooter |
Item forms (below fields) | Custom form footers |
Example Projects¶
Complete example extensions are available in the examples/ directory:
- CesiviExtensions.Example - Field renderers, WebParts, and extensions
- CesiviExtensions.Authentication - SAML and OAuth examples
- CesiviExtensions.Workflows - Custom workflow activities
- CesiviExtensions.CustomFields - Signature field with canvas drawing
- CesiviExtensions.CustomAPI - Custom REST API endpoints
Additional Resources¶
- Extensibility Guide - Step-by-step tutorials with complete examples
- Plugin Guide - Creating and distributing extension packages
- API Coverage - Complete API compatibility matrix
- Architecture Overview - System architecture and design patterns
Support¶
For questions, issues, or feature requests, please visit: - GitHub Issues: https://github.com/your-org/cesivi/issues - Documentation: https://cesivi.io/docs - Community Forum: https://community.cesivi.io
Last Updated: 2026-01-16 | Cesivi v7.0 Phase D (PLAN-149)