Extension point for displaying Messages of all object types
Namespace: |
EleWise.ELMA.Messages.Components.Feed |
Extension point: |
DefaultFeedObjectGroupExtension |
Short description
We do not recommend using the IFeedObjectGroupExtension interface, because if it is modified, there is no guarantee that your modules will be assembled.
The extension point is a component and is registered in the system with the ServiceScope.Shell level.
Extension point methods
/// <summary>
/// Check if the extension point supports this object type.
/// </summary>
/// <param name="objectTypeUid">Object type UID.</param>
public virtual bool IsSupport(Guid objectTypeUid)
Returns true, if the extension point supports the specified object type, if not, then false. Must be defined in the inherited class.
/// <summary>
/// Name of the message type.
/// </summary>
/// <param name="objectTypeUid">Object type UID.</param>
public virtual string MessageTypeName(Guid objectTypeUid)
Returns the message type name. By default, the name of the object is used (DisplayName property from the object’s metadata). Can be defined in the inherited class.
Extension point properties
/// <summary>
/// Class for rendering message type.
/// </summary>
public virtual string MessageTypeCssClass
Return the style class name defined in *.css files. By default, it is "FeedTypeDefault"). It can be redefined in the inherited class.
/// <summary>
/// Tip in the quick comment field.
/// </summary>
public virtual string CommentaryDescription
Defines the text in the quick comment field.
By default, SR.T("Leave comment") is used. Can be redefined in the inherited class.
Usage example (basing on the Calendar module)
/// <summary>
/// Extension point for displaying messages on calendar events.
/// </summary>
[Component(Order = 500)]
public class CalendarEventFeedObjectGroupExtension : DefaultFeedObjectGroupExtension
{
/// <summary>
/// Check if the extension point supports the specified object type.
/// </summary>
/// <param name="objectTypeUid">Object type UID.</param>
/// <returns></returns>
public override bool IsSupport(Guid objectTypeUid)
{
return MetadataLoader.IsBaseOrChildClass<ICalendarEvent>(objectTypeUid);
}
/// <summary>
/// Message type name.
/// </summary>
public override string MessageTypeName(Guid objectTypeUid)
{
return SR.T("Calendar event");
}
/// <summary>
/// Class for rendering message type.
/// </summary>
public override string MessageTypeCssClass
{
get { return "FeedTypeCalendarEvent"; }
}
}
The IsSupport method determines if the checked object type belongs to ICalendarEvent and to all its children such as IDocumentCalendarEvent. If true is returned, other methods and properties of the extension point are called.
The MessageTypeName method returns the object type name as it will be displayed in the message feed. The object type is not checked because it was previously performed in the IsSupport method.
The MessageTypeCssClass property defines the style class to be used when rendering the message feed item in the user interface. Rendering details are specified in Feed.css of the Calendar module:
/* Feed */
div.FeedTypeCalendarEvent div.FeedObjectTypeTitle-Left {
background: url("/Modules/EleWise.ELMA.BPM.Web.Calendar/Content/Images/feedtype-title-CalendarEvent-l.png") no-repeat;
}
div.FeedTypeCalendarEvent div.FeedObjectTypeTitle-Right {
background: url("/Modules/EleWise.ELMA.BPM.Web.Calendar/Content/Images/feedtype-title-CalendarEvent-r.png") no-repeat;
}
div.FeedTypeCalendarEvent div.FeedObjectTypeTitle-Text {
background-color: #FFCAD2;
border-color: #FEA5AF;
}
The CommentaryDescription property is not defined in the module because it is used as default value.