VideoOS.Platform.Admin.ItemManager Class Reference

This class is created once for all Items of a specific Kind and is responsible for getting and saving configuration for all Items of that Kind

This class is also responsible for creating, filling and saving UserControl and relevant fields changed by the user in the administrators.
Normally there will be one ItemManager for each ItemNode.
If the Items being managed are stored on another server, then this class can utilize the Init() and Close() methods to setup sessions to the remote server in anticipation of calls to GetItems().

EventServer and Items on MAP
This class is also involved in defining ContextMenu on the SmartClient MAP, because the plug-in executing in the Event Server, are providing the Smart Client MAP ViewItem with all relevant plug-ins and their definitions.
As the Event Server uses authorization for Items, the ItemNode needs to define the SecurityActions relevant for the items being managed by the ItemManager. A minimum of two SecurityActions must always be defined for the Items to be available in the Smart Client.

Item Selection in the Administrators
Selection of an Item can happen via mouse click on the TreeView.
The user action will result in the following sequences of events:
a) ItemManager is accessed through the ItemNode
b) The GenerateUserControl() is called to allow ItemManager to create the User Control, setup the ConfigurationChangedByUserEvent, and return the UserControl to the caller.
c) The caller will add the UserControl to its relevant panel and set userControl.Dock = DockStyle.Fill to fill available area.
d) Existing configuration is fetched by calling the ItemManager.GetItem(FQID)
e) The ItemManager.FillUserControl(item) method is called to let the ItemManager populate the UserControl.


When de-selecting an item, the ItemManager.FillUserControl(null) is called to let the ItemManager clear the UserControl. The parent UserControl will also have Enabled=false; set shortly after this call.
Note: A ItemManager.ClearUserControl() is now defined - this is used when no items are selected to let the implementation clear all fields and disable the entire form.
Item edit and update
After an Item is selected or created, the system needs to know if any updates have been done by the administrator.
Ensure the ConfigurationChangedByUserHandler is called whenever the administrator changes something on the UI.
This will allow the administration application to enable Save and Apply buttons as appropriate.
When the administrator presses a Save or Apply button, the ValidateAndSaveUserControl is called to let the ItemManager and the underlying UserControl validate the entered values. If fields are valid the method returns true.

TreeView name change
On the TreeView itself, it is possible to press F2 and edit the name directly. In this case the updated name is passed to the ItemManager via the SetItemName(name) method.
The ItemManager should save the new name immediately.
More...

Classes

struct  ItemSummaryHeader
 A structure which describes a column header in a summary pane. More...
 

Public Types

enum  AdminTabBehaviour { Group , Individual }
 Describe how user selection of different tabs should be handled. More...
 

Public Member Functions

virtual void ClearUserControl ()
 Clear all user entries on the UserControl.
 
virtual void Close ()
 The Close() method is called when the user selected to log off or exit the application.
After this call there may be a new session starting, in which case the Init() method is called again. If this happens please take notice the it might be towards another server, so no caching of anything should happened after the call to the Close() method.
 
void ConfigurationChangedByUserHandler (object sender, EventArgs e)
 The UserControl needs to indicate when the user have changed any field, and should call this event handler every time. The MIP environment will ensure that save or apply buttons are enabled.
 
virtual Item CreateItem (Item parentItem, FQID suggestedFQID)
 Create a new item. Insert default values.
The parentFQID can be null, when a top level node is created (e.g. no parent)
The new fqid should be filled with ServerID, ParentId, ObjectId or ObjectIdString and Kind.

When storing the configuration on the Milestone server, the following code can be used:

 
virtual Item CreateItem (Item parentItem, FQID suggestedFQID, UserControl addUserControl)
 Create a new item. Insert values as user has entered on the AddUserControl.
The parentFQID can be null, when a top level node is created (e.g. no parent) The new fqid should be filled with ServerID, ParentId, ObjectId or ObjectIdString and Kind.
 
virtual void DeleteItem (Item item)
 When an administrator selects the context menu Delete item, or press the DEL key, a confirmation dialog is displayed and upon administrator confirms this method is called.

 
virtual void FillUserControl ()
 This overloaded method is used when no Items are selected, e.g. for summary pages.
 
virtual void FillUserControl (Item item)
 Fill the UserControl with the content of the Item or the data it represent.
When the ItemNode.ItemsAllowed == ItemsAllowed.One, the item in this call will often be null, as the ItemManager itself will be in control of the single item.
When the ItemNode.ItemsAllowed == ItemsAllowed.None, the item in this call will always be null, as the system does not know what kind of information the plugin like to display.
 
virtual UserControl GenerateAddUserControl (Item parentItem, FQID suggestedFQID)
 Create a UserControl to be used for adding a new item.
Just fill the user control with default content, but do NOT add it to your configuration yet.
Implementation of this method will determine the flow of calls for creating new Items.
When implemented, this UserControl is showed to the user, and upon OK pressed the ValidateAddUserControl is called for the plug-in to validate the entry, and a OK response will result in closing the form containing the AddUserControl and a call the the Create() method including the AddUserControl.
If not implementing this method, the Create() method WITHOUT the AddUserControl parameter is called, and a default Item is then created, stored (where ever this ItemManager stores it configuration), and displayed in the TreeView.
Last step is that the new item node is selected and the ItemManager.FillUserControl is called to fill the large configuration form.
 
virtual UserControl GenerateAlarmPreviewUserControl (FQID fqid, object alarmOrBaseEvent)
 Deprecated! Use PluginDefinition.GenerateAlarmPreviewWpfUserControl() instead.
 
virtual UserControl GenerateDetailUserControl ()
 Generate the UserControl for configuring the Kind of item that this ItemManager manages.
Overwrite it with your own implementation returning your own UserControl derived object.
 
virtual List< DetailedUserControlGenerateDetailUserControlList ()
 Generate a list of extra UserControls for configuring more pages of information this ItemManager manages.
 
virtual ItemNodeUserControl GenerateOverviewUserControl ()
 A user control to display when the administrator clicks on the treeNode. This can be a help page or a status over of the configuration.
 
virtual Dictionary< string, string > GetConfigurationReportProperties (Item item)
 Gets the configuration properties of an item. These properties are used for configuration reporting within the administration environment. Override this method to provide custom properties for the MIP plug-in configuration report.
 
virtual Collection< ContextMenuItemGetContextMenu (Item item=null)
 List of contextmenu items to be displayed in the administrator.
 
virtual Item GetItem (FQID fqid)
 Returns the Item defined by the FQID. Will return null if not found.
 
virtual String GetItemName ()
 Get the name of the current Item.
 
virtual List< ItemGetItems ()
 Returns a list of all Items on top level (e.g. no parents)
 
virtual List< ItemGetItems (Item parentItem)
 Returns a list of all Items of the Kind this ItemManager manages. When no parentItem is provided, this ItemManager should be managing a server configuration.
 
virtual string GetItemStatusDetails (Item item)
 Overloaded method when using default language ("en-US").
Please make sure to implement the GetItemStatusDetails with 2 parameters, as that method is the one being called most of the time.
 
virtual string GetItemStatusDetails (Item item, string language)
 Can return an XML string with status details to be displayed via a ContextMenu on the Smart Client Map ViewItem. The return value is null if no status is available, or an XML string like:
 
virtual List< object > GetItemSummary (Item item)
 Allows an integration to define the values to be presented in one row of a summary pane Called by the admin client when it is about to display one row of a summary pane To be re-implemented in each integration's Integrationname_ItemManager.
 
virtual List< ItemSummaryHeaderGetItemSummaryHeaders ()
 Allows an integration to define the columns in a summary pane. This includes name, value type and read-only flag. The columns will be ordered as indexed in this list, the first index being 0. Called by the admin client when it is about to display a summary pane To be re-implemented in each integration's Integrationname_ItemManager.
 
virtual Collection< EventGroupGetKnownEventGroups (CultureInfo culture)
 Return all the Event Groups this Kind of Item can deliver to the Event Server. The list is used to group the Event Types. This method should always support at least the en-US culture.
 
virtual Collection< String > GetKnownEventTypes ()
 Deprecated - see GetKnownEventTypes(CultureInfo culture).
 
virtual Collection< EventTypeGetKnownEventTypes (CultureInfo culture)
 Return all the Event Types this Kind of Item can deliver to the Event Server. This list is used for configuring alarms. This method should always support at least the en-US culture, which is the expected culture of incoming events.
 
virtual Collection< StateGroupGetKnownStateGroups (CultureInfo culture)
 Return all state groups defined by this plugin.
 
virtual OperationalState GetOperationalState (Item item)
 Return the operational state of a specific Item. This is used by the Event Server.
 
virtual Dictionary< String, string > GetTranslationDictionary (CultureInfo culture)
 Returns a Dictionary used for fine tuning specific translations.
This method is optional and does not have to be implemented or may return null.
The current use is for these translations:

 
virtual void Init ()
 The Init method is called when the Environment is up and running, and the Configuration.Instance can be used for getting specific Items from the Milestone servers, as well as calling the GetConfiguration() methods.
 
virtual bool IsContextMenuValid (string command)
 Just before a context menu is displayed, each line on the context menu is checked for it should be enabled or disabled. This method is called with the following command (If allowed by the ItemNode definition)
"ADD" - for the "Add new ..."
"DELETE" - for the "Delete ..."
"RENAME" - for rename
If your plugin has the configuration stored on another server, and management is not possible via the ItemManager, then this method can be used to disable all ContextMenu actions.
When this method is not implemented, the default value returned is true.
 
 ItemManager ()
 Construction of the ItemManager does not need any parameters.
 
void PopConfigurationChangedEventHandler ()
 Reserved for internal use.
 
void PushConfigurationChangedEventHandler ()
 Reserved for internal use.
 
virtual void ReleaseUserControl ()
 This call is issued when the itemManager needs to remove any event registration or dispose of specific objects as the UserControl is no longer being used.
 
virtual void SetItemName (String name)
 Set the name on current Item, used by TreeView edit via F2.
 
virtual bool ValidateAddUserControl (UserControl addUserControl)
 Validate the content of the AddUserControl generated by this class's GenerateAddUserControl.
 
virtual bool ValidateAndSaveItemSummary (Item item, List< object > allValues, List< int > changedIndices, out int errIndex)
 Validate the updated values from a row in a summary pane.
Called by the admin client when the end user applies all changes to one row in the summary pane To be re-implemented in each integration's Integrationname_ItemManager
External configuration should be saved during this call.
If any entry error exists, the errIndex should be filled, and either an error message can be displayed or a ValidateAndSaveMIPException can be thrown.
 
virtual bool ValidateAndSaveUserControl ()
 Validate the user entry, and return true for OK.
External configuration should be saved during this call.
If any entry error exists, the field in error should get focus, and an error message should be displayed to the user or a ValidateAndSaveMIPException should be thrown.
 

Properties

Item CurrentItem [get, set]
 The Item currently being displayed and worked on.
 
virtual bool DisableUserControlWhenNoItemIsSelected [get]
 Override this in your ItemManager and return false if your Items' UserControl does not want to be disabled when no item is selected.
 
bool ExcludePersonalDataFromConfigReport [get, set]
 Specify whether to exclude personal DataFrom Config Report.
 
virtual int SummaryUpdateInterval [get, set]
 If the summary panel needs to be updated, set this property to the number of seconds inbetween updates.
 
virtual AdminTabBehaviour TabBehaviour [get, set]
 Describe how user selection of different tabs should be handled. AdminTabBehaviour
 

Events

EventHandler ConfigurationChangedByUser
 An event that needs to fired when the user changes something on the UserControl that requires a save at some point.
 

Detailed Description

This class is created once for all Items of a specific Kind and is responsible for getting and saving configuration for all Items of that Kind

This class is also responsible for creating, filling and saving UserControl and relevant fields changed by the user in the administrators.
Normally there will be one ItemManager for each ItemNode.
If the Items being managed are stored on another server, then this class can utilize the Init() and Close() methods to setup sessions to the remote server in anticipation of calls to GetItems().

EventServer and Items on MAP
This class is also involved in defining ContextMenu on the SmartClient MAP, because the plug-in executing in the Event Server, are providing the Smart Client MAP ViewItem with all relevant plug-ins and their definitions.
As the Event Server uses authorization for Items, the ItemNode needs to define the SecurityActions relevant for the items being managed by the ItemManager. A minimum of two SecurityActions must always be defined for the Items to be available in the Smart Client.

Item Selection in the Administrators
Selection of an Item can happen via mouse click on the TreeView.
The user action will result in the following sequences of events:
a) ItemManager is accessed through the ItemNode
b) The GenerateUserControl() is called to allow ItemManager to create the User Control, setup the ConfigurationChangedByUserEvent, and return the UserControl to the caller.
c) The caller will add the UserControl to its relevant panel and set userControl.Dock = DockStyle.Fill to fill available area.
d) Existing configuration is fetched by calling the ItemManager.GetItem(FQID)
e) The ItemManager.FillUserControl(item) method is called to let the ItemManager populate the UserControl.


When de-selecting an item, the ItemManager.FillUserControl(null) is called to let the ItemManager clear the UserControl. The parent UserControl will also have Enabled=false; set shortly after this call.
Note: A ItemManager.ClearUserControl() is now defined - this is used when no items are selected to let the implementation clear all fields and disable the entire form.
Item edit and update
After an Item is selected or created, the system needs to know if any updates have been done by the administrator.
Ensure the ConfigurationChangedByUserHandler is called whenever the administrator changes something on the UI.
This will allow the administration application to enable Save and Apply buttons as appropriate.
When the administrator presses a Save or Apply button, the ValidateAndSaveUserControl is called to let the ItemManager and the underlying UserControl validate the entered values. If fields are valid the method returns true.

TreeView name change
On the TreeView itself, it is possible to press F2 and edit the name directly. In this case the updated name is passed to the ItemManager via the SetItemName(name) method.
The ItemManager should save the new name immediately.

Member Enumeration Documentation

◆ AdminTabBehaviour

Describe how user selection of different tabs should be handled.

Enumerator
Group 

This is default implementation for MIPSDK 4.0 - all tabs are called when new tabs are selected, e.g. FillUserControl is called at start of new tab selection, and ValidateAndSave are called on every new tab de-selection.

Individual 

The FillUserControl is only called once, and 3 new methods are used to understand whar UserControl are currently displayed:

  • Selected(), ValidateDetails() Deselected()

The Selected() method is call on every tab that is selected.
The Validate() is called when navigating away from a tab - and plugin can return a "Cancel" tab deselection.
The Deselected() is called after the Validate() method, if another tab is selected, or close/cancel is pressed.
The ValidateAndSave() is called upon user pressing the OK button.
If the Cancel butto is called, the the Deselected() method is called, ReleaseUserControl()

Constructor & Destructor Documentation

◆ ItemManager()

VideoOS.Platform.Admin.ItemManager.ItemManager ( )
inline

Construction of the ItemManager does not need any parameters.

Member Function Documentation

◆ ClearUserControl()

virtual void VideoOS.Platform.Admin.ItemManager.ClearUserControl ( )
inlinevirtual

Clear all user entries on the UserControl.

◆ Close()

virtual void VideoOS.Platform.Admin.ItemManager.Close ( )
inlinevirtual

The Close() method is called when the user selected to log off or exit the application.
After this call there may be a new session starting, in which case the Init() method is called again. If this happens please take notice the it might be towards another server, so no caching of anything should happened after the call to the Close() method.

◆ ConfigurationChangedByUserHandler()

void VideoOS.Platform.Admin.ItemManager.ConfigurationChangedByUserHandler ( object sender,
EventArgs e )
inline

The UserControl needs to indicate when the user have changed any field, and should call this event handler every time. The MIP environment will ensure that save or apply buttons are enabled.

Parameters
sender
e

◆ CreateItem() [1/2]

virtual Item VideoOS.Platform.Admin.ItemManager.CreateItem ( Item parentItem,
FQID suggestedFQID )
inlinevirtual

Create a new item. Insert default values.
The parentFQID can be null, when a top level node is created (e.g. no parent)
The new fqid should be filled with ServerID, ParentId, ObjectId or ObjectIdString and Kind.

When storing the configuration on the Milestone server, the following code can be used:

public override Item CreateItem(Item parentItem, FQID suggestedFQID)
{
CurrentItem = new Item(suggestedFQID, "Enter a name"); // Make a new Item, use the suggested FQID
if (_userControl != null) // If userControl visiable
{
_userControl.FillContent(CurrentItem); // show default content
}
//Save initial configuration on server - so following GetItems() will include this on the list
return CurrentItem;
}
Item CurrentItem
The Item currently being displayed and worked on.
Definition ItemManager.cs:139
virtual Item CreateItem(Item parentItem, FQID suggestedFQID)
Create a new item. Insert default values. The parentFQID can be null, when a top level node is crea...
Definition ItemManager.cs:532
Configuration provides access to all configuration objects within the Milestone Platform....
Definition Configuration.cs:25
static Configuration Instance
This class only exists once and can be accessed through the Instance static field....
Definition Configuration.cs:38
virtual void SaveItemConfiguration(Guid pluginDefinitionId, Item item)
Call this to notify the system that there is configuration to be saved for the Item.
Definition Configuration.cs:525
The Fully Qualified ID contains a complete set of fields to contact a server and get further details....
Definition FQID.cs:50
This class is used as a base class of all objects and items, be it cameras, audio sources or plug-in ...
Definition Item.cs:52
Parameters
parentItemIdentifies the configuration parent to the new item.
suggestedFQIDA pre-generated fqid with above fields filled. The ObjectId or ObjectIdString can be overridden.
Returns
A new Item, only the FQID and Name field are required to be filled. The return valus is used to identify and select the item tree node

◆ CreateItem() [2/2]

virtual Item VideoOS.Platform.Admin.ItemManager.CreateItem ( Item parentItem,
FQID suggestedFQID,
UserControl addUserControl )
inlinevirtual

Create a new item. Insert values as user has entered on the AddUserControl.
The parentFQID can be null, when a top level node is created (e.g. no parent) The new fqid should be filled with ServerID, ParentId, ObjectId or ObjectIdString and Kind.

Parameters
parentItemIdentifies the configuration parent to the new item.
suggestedFQIDA pre-generated fqid with above fields filled. The ObjectId or ObjectIdString can be overridden.
addUserControlA filled user control returned by the GeneratedAddUserControl method after it has been displayed and edited by the user
Returns
A new Item, only the FQID and Name field are required to be filled. The return values is used to identify and select the item tree node

◆ DeleteItem()

virtual void VideoOS.Platform.Admin.ItemManager.DeleteItem ( Item item)
inlinevirtual

When an administrator selects the context menu Delete item, or press the DEL key, a confirmation dialog is displayed and upon administrator confirms this method is called.

//For configurations saved on the video server, the following code can be used:
if (item != null)
{
}
virtual void DeleteItemConfiguration(Guid platformDefinitionId, Item item)
Delete configuration for one Item.
Definition Configuration.cs:611
Parameters
itemThe Item to delete

◆ FillUserControl() [1/2]

virtual void VideoOS.Platform.Admin.ItemManager.FillUserControl ( )
inlinevirtual

This overloaded method is used when no Items are selected, e.g. for summary pages.

Supported from MIP v4.5

When not implemented, it will call the FillUserControl(null) and ignore any NullReferenceExceptions

◆ FillUserControl() [2/2]

virtual void VideoOS.Platform.Admin.ItemManager.FillUserControl ( Item item)
inlinevirtual

Fill the UserControl with the content of the Item or the data it represent.
When the ItemNode.ItemsAllowed == ItemsAllowed.One, the item in this call will often be null, as the ItemManager itself will be in control of the single item.
When the ItemNode.ItemsAllowed == ItemsAllowed.None, the item in this call will always be null, as the system does not know what kind of information the plugin like to display.

Parameters
itemThe Item to work with

◆ GenerateAddUserControl()

virtual UserControl VideoOS.Platform.Admin.ItemManager.GenerateAddUserControl ( Item parentItem,
FQID suggestedFQID )
inlinevirtual

Create a UserControl to be used for adding a new item.
Just fill the user control with default content, but do NOT add it to your configuration yet.
Implementation of this method will determine the flow of calls for creating new Items.
When implemented, this UserControl is showed to the user, and upon OK pressed the ValidateAddUserControl is called for the plug-in to validate the entry, and a OK response will result in closing the form containing the AddUserControl and a call the the Create() method including the AddUserControl.
If not implementing this method, the Create() method WITHOUT the AddUserControl parameter is called, and a default Item is then created, stored (where ever this ItemManager stores it configuration), and displayed in the TreeView.
Last step is that the new item node is selected and the ItemManager.FillUserControl is called to fill the large configuration form.

Returns

◆ GenerateAlarmPreviewUserControl()

virtual UserControl VideoOS.Platform.Admin.ItemManager.GenerateAlarmPreviewUserControl ( FQID fqid,
object alarmOrBaseEvent )
inlinevirtual

Deprecated! Use PluginDefinition.GenerateAlarmPreviewWpfUserControl() instead.

For displaying detail information about an Alarm or an Event, this method can be implemented to return a UserControl to be displayed when the user selects an Alarm in the alarm list, or a Event in the event list, in the Smart Client.
The returned UserControl will be placed together with other relevant information like CameraViewItem's within the AlarmPreview ViewItem.
Note: the alarmOrBaseEvent need to be checked for type and type casted accordingly, e.g. to Alarm, BaseEvent or AnalyticsEvent.

Returns
null if no relevant information to display, otherwise a filled UserControl

◆ GenerateDetailUserControl()

virtual UserControl VideoOS.Platform.Admin.ItemManager.GenerateDetailUserControl ( )
inlinevirtual

Generate the UserControl for configuring the Kind of item that this ItemManager manages.
Overwrite it with your own implementation returning your own UserControl derived object.

Returns

◆ GenerateDetailUserControlList()

virtual List< DetailedUserControl > VideoOS.Platform.Admin.ItemManager.GenerateDetailUserControlList ( )
inlinevirtual

Generate a list of extra UserControls for configuring more pages of information this ItemManager manages.

Note that this method will only be called if GenerateDetailUserControl returns null, so you will need to overwrite it with an implementation returning null for this method to be utilized.
The ItemManager needs to keep track of all the UserControls it generates, e.g. passing on the ItemManager class to each DetailedUserControl or implement relevant events for understanding when the user changes the UI and when the ItemManager need to update the content.

Returns

◆ GenerateOverviewUserControl()

virtual ItemNodeUserControl VideoOS.Platform.Admin.ItemManager.GenerateOverviewUserControl ( )
inlinevirtual

A user control to display when the administrator clicks on the treeNode. This can be a help page or a status over of the configuration.

◆ GetConfigurationReportProperties()

virtual Dictionary< string, string > VideoOS.Platform.Admin.ItemManager.GetConfigurationReportProperties ( Item item)
inlinevirtual

Gets the configuration properties of an item. These properties are used for configuration reporting within the administration environment. Override this method to provide custom properties for the MIP plug-in configuration report.

Parameters
itemThe item.
Returns
Dictionary of key-value pairs representing property name and value.

◆ GetContextMenu()

virtual Collection< ContextMenuItem > VideoOS.Platform.Admin.ItemManager.GetContextMenu ( Item item = null)
inlinevirtual

List of contextmenu items to be displayed in the administrator.

When the item parameter is null, the administrator right clicked on the type node, while when the item contains a specific item, the administrator right clicked on an individual item. This also reflects the hierarchy of the ItemNode's - when the administrator clicks on an ItemNode that does not have any parent ItemNode - the item will be null; while when the administrator clicks on an item (or its type) that has a parent ItemNode - the Item will be filled with the specific parent Item.

This method needs to return immediately - no remote communication should be required.

Parameters
itemThe item the contextmenu will be shown for
Returns

◆ GetItem()

virtual Item VideoOS.Platform.Admin.ItemManager.GetItem ( FQID fqid)
inlinevirtual

Returns the Item defined by the FQID. Will return null if not found.

Parameters
fqidFully Qualified ID of an Item
Returns
An Item

◆ GetItemName()

virtual String VideoOS.Platform.Admin.ItemManager.GetItemName ( )
inlinevirtual

Get the name of the current Item.

Returns

◆ GetItems() [1/2]

virtual List< Item > VideoOS.Platform.Admin.ItemManager.GetItems ( )
inlinevirtual

Returns a list of all Items on top level (e.g. no parents)

Returns
A list of items. Allowed to return null if no Items found.

◆ GetItems() [2/2]

virtual List< Item > VideoOS.Platform.Admin.ItemManager.GetItems ( Item parentItem)
inlinevirtual

Returns a list of all Items of the Kind this ItemManager manages. When no parentItem is provided, this ItemManager should be managing a server configuration.

Parameters
parentItemThe parent owning the items.
Returns
A list of items. Allowed to return null if no Items found.

◆ GetItemStatusDetails() [1/2]

virtual string VideoOS.Platform.Admin.ItemManager.GetItemStatusDetails ( Item item)
inlinevirtual

Overloaded method when using default language ("en-US").
Please make sure to implement the GetItemStatusDetails with 2 parameters, as that method is the one being called most of the time.

Parameters
item
Returns
null or an XML string

◆ GetItemStatusDetails() [2/2]

virtual string VideoOS.Platform.Admin.ItemManager.GetItemStatusDetails ( Item item,
string language )
inlinevirtual

Can return an XML string with status details to be displayed via a ContextMenu on the Smart Client Map ViewItem. The return value is null if no status is available, or an XML string like:

\<?xml version="1.0" encoding="utf-8"?\>
\<details language="en-US"\>
\<detail detailname="CPU Usage %"\>
\<detail_int64 unit="percent"\>6\</detail_int64\>
\</detail\>
\<detail detailname="Memory Free"\>
\<detail_int64 unit="bytes"\>4067426304\</detail_int64\>
\</detail\>
\</details\>
\</xml\>


The valid 'detail' types are:

  • detail_string, detail_integer, detail_int64, detail_decimal, detail_datetime_start, detail_datetime_end
    The valid 'unit' types are:
  • bytes, percent, bitspersecond, bytespersecond
Parameters
item
languageThe language the Smart Client is using. The detailname and content should be translated to defined language.
Returns
null or an XML string

◆ GetItemSummary()

virtual List< object > VideoOS.Platform.Admin.ItemManager.GetItemSummary ( Item item)
inlinevirtual

Allows an integration to define the values to be presented in one row of a summary pane Called by the admin client when it is about to display one row of a summary pane To be re-implemented in each integration's Integrationname_ItemManager.

Parameters
itemThe Item which the pane is to display in a row
Returns
A list of objects. The order and type of each object must match the type returned in GetItemSummaryHeaders()

◆ GetItemSummaryHeaders()

virtual List< ItemSummaryHeader > VideoOS.Platform.Admin.ItemManager.GetItemSummaryHeaders ( )
inlinevirtual

Allows an integration to define the columns in a summary pane. This includes name, value type and read-only flag. The columns will be ordered as indexed in this list, the first index being 0. Called by the admin client when it is about to display a summary pane To be re-implemented in each integration's Integrationname_ItemManager.

Returns
A list of ItemSummaryHeaders defining the summary pane's column headers

◆ GetKnownEventGroups()

virtual Collection< EventGroup > VideoOS.Platform.Admin.ItemManager.GetKnownEventGroups ( CultureInfo culture)
inlinevirtual

Return all the Event Groups this Kind of Item can deliver to the Event Server. The list is used to group the Event Types. This method should always support at least the en-US culture.

Parameters
cultureThe requested culture in which the group names should be returned
Returns
The collection of known event groups

◆ GetKnownEventTypes() [1/2]

virtual Collection< String > VideoOS.Platform.Admin.ItemManager.GetKnownEventTypes ( )
inlinevirtual

Deprecated - see GetKnownEventTypes(CultureInfo culture).

Returns

◆ GetKnownEventTypes() [2/2]

virtual Collection< EventType > VideoOS.Platform.Admin.ItemManager.GetKnownEventTypes ( CultureInfo culture)
inlinevirtual

Return all the Event Types this Kind of Item can deliver to the Event Server. This list is used for configuring alarms. This method should always support at least the en-US culture, which is the expected culture of incoming events.

Parameters
cultureThe requested culture in which the event type messages should be returned
Returns
The collection of known event types

◆ GetKnownStateGroups()

virtual Collection< StateGroup > VideoOS.Platform.Admin.ItemManager.GetKnownStateGroups ( CultureInfo culture)
inlinevirtual

Return all state groups defined by this plugin.

The state group is used to understand which events are modifying a given state.

Parameters
cultureThe requested culture in which the group names should be returned
Returns

◆ GetOperationalState()

virtual OperationalState VideoOS.Platform.Admin.ItemManager.GetOperationalState ( Item item)
inlinevirtual

Return the operational state of a specific Item. This is used by the Event Server.

Parameters
item
Returns

◆ GetTranslationDictionary()

virtual Dictionary< String, string > VideoOS.Platform.Admin.ItemManager.GetTranslationDictionary ( CultureInfo culture)
inlinevirtual

Returns a Dictionary used for fine tuning specific translations.
This method is optional and does not have to be implemented or may return null.
The current use is for these translations:

  • 'Add'. The heading used for the dialog showed when adding a new Item from the Management Client. The default text is combined "Add "+ItemNode.Name
  • Smart Map context menu items. The string that is used for the lookup will be the MapAlarmContextMenu.Command.
  • The kind. The string used for the lookup is the upper-case string representation of the kind GUID.
Parameters
culture
Returns

◆ Init()

virtual void VideoOS.Platform.Admin.ItemManager.Init ( )
inlinevirtual

The Init method is called when the Environment is up and running, and the Configuration.Instance can be used for getting specific Items from the Milestone servers, as well as calling the GetConfiguration() methods.

◆ IsContextMenuValid()

virtual bool VideoOS.Platform.Admin.ItemManager.IsContextMenuValid ( string command)
inlinevirtual

Just before a context menu is displayed, each line on the context menu is checked for it should be enabled or disabled. This method is called with the following command (If allowed by the ItemNode definition)
"ADD" - for the "Add new ..."
"DELETE" - for the "Delete ..."
"RENAME" - for rename
If your plugin has the configuration stored on another server, and management is not possible via the ItemManager, then this method can be used to disable all ContextMenu actions.
When this method is not implemented, the default value returned is true.

Parameters
command
Returns

◆ PopConfigurationChangedEventHandler()

void VideoOS.Platform.Admin.ItemManager.PopConfigurationChangedEventHandler ( )
inline

Reserved for internal use.

◆ PushConfigurationChangedEventHandler()

void VideoOS.Platform.Admin.ItemManager.PushConfigurationChangedEventHandler ( )
inline

Reserved for internal use.

◆ ReleaseUserControl()

virtual void VideoOS.Platform.Admin.ItemManager.ReleaseUserControl ( )
inlinevirtual

This call is issued when the itemManager needs to remove any event registration or dispose of specific objects as the UserControl is no longer being used.

◆ SetItemName()

virtual void VideoOS.Platform.Admin.ItemManager.SetItemName ( String name)
inlinevirtual

Set the name on current Item, used by TreeView edit via F2.

Parameters
name

◆ ValidateAddUserControl()

virtual bool VideoOS.Platform.Admin.ItemManager.ValidateAddUserControl ( UserControl addUserControl)
inlinevirtual

Validate the content of the AddUserControl generated by this class's GenerateAddUserControl.

Parameters
addUserControl
Returns
True if the content is valid.

◆ ValidateAndSaveItemSummary()

virtual bool VideoOS.Platform.Admin.ItemManager.ValidateAndSaveItemSummary ( Item item,
List< object > allValues,
List< int > changedIndices,
out int errIndex )
inlinevirtual

Validate the updated values from a row in a summary pane.
Called by the admin client when the end user applies all changes to one row in the summary pane To be re-implemented in each integration's Integrationname_ItemManager
External configuration should be saved during this call.
If any entry error exists, the errIndex should be filled, and either an error message can be displayed or a ValidateAndSaveMIPException can be thrown.

Exceptions
ValidateAndSaveMIPExceptionCan be thrown to provide a more specific error message.
Parameters
itemThe item for which one or more of its property values has been changed
allValuesA list of values, changed as well as unaltered ones.
changedIndicesA list of 0-based indexes for those values which were changed.
errIndexReturns the 0-based index of the most critical field, which has an invalid value. Returns -1 for no invalid fields.
Returns
True if all the changed value were accepted. If false is returned, the UI will set focus to the field given by errIndex.

◆ ValidateAndSaveUserControl()

virtual bool VideoOS.Platform.Admin.ItemManager.ValidateAndSaveUserControl ( )
inlinevirtual

Validate the user entry, and return true for OK.
External configuration should be saved during this call.
If any entry error exists, the field in error should get focus, and an error message should be displayed to the user or a ValidateAndSaveMIPException should be thrown.

Exceptions
ValidateAndSaveMIPExceptionCan be thrown to provide a more specific error message.
Returns
Indicates error in user entry. True is a valid entry

Property Documentation

◆ CurrentItem

Item VideoOS.Platform.Admin.ItemManager.CurrentItem
getset

The Item currently being displayed and worked on.

◆ DisableUserControlWhenNoItemIsSelected

virtual bool VideoOS.Platform.Admin.ItemManager.DisableUserControlWhenNoItemIsSelected
get

Override this in your ItemManager and return false if your Items' UserControl does not want to be disabled when no item is selected.

◆ ExcludePersonalDataFromConfigReport

bool VideoOS.Platform.Admin.ItemManager.ExcludePersonalDataFromConfigReport
getset

Specify whether to exclude personal DataFrom Config Report.

◆ SummaryUpdateInterval

virtual int VideoOS.Platform.Admin.ItemManager.SummaryUpdateInterval
getset

If the summary panel needs to be updated, set this property to the number of seconds inbetween updates.

When set to 0, updates are disabled.

◆ TabBehaviour

virtual AdminTabBehaviour VideoOS.Platform.Admin.ItemManager.TabBehaviour
getset

Describe how user selection of different tabs should be handled. AdminTabBehaviour

Event Documentation

◆ ConfigurationChangedByUser

EventHandler VideoOS.Platform.Admin.ItemManager.ConfigurationChangedByUser

An event that needs to fired when the user changes something on the UserControl that requires a save at some point.