v25.1 plugin updates
The goal of this document is to outline the changes that are required to update an HH DM plugin from v24.2 to v25.1.
Please note that not all changes may apply to all plugins.
Preview version
To make it easier to migrate the plugin a preview version of HH Data Management v25.1 has been made available. Due to the software needing to download a data migration from the server before being able to function this version is not runnable, it can only be used to build the plugin. This release contains only minor breaking changes and therefore we believe that this should be sufficient for plugins to be updated.
Downloading and running the client
If you do not have access to this version, please let us know and it will be added to your account. The preview version is available on the Other → Releases page of the website:
The version can also be downloaded directly using this link: https://hh-dev.com/latest/HHDM-v25.1
Please note that this version is portable, meaning that it doesn't need to be installed. Unzip the downloaded directory.
Plugin settings update
To make sure the references are linked to the right version of HH DM, you will need to put the path of the HH DM 25.1 preview version in the project file of the plugin:
Example plugin
Please see https://github.com/hh-development/HHDev.HHDM.DesktopPlugin for an example commit of a simple plugin being updated.
Breaking changes
PluginInfo.json
The TargetVersionNumber
should be changed to "25.1". Make sure the TargetVersionNumber
is added to the PluginInfo.json, if it doesn't exist yet.
Interface changes
IBasicEntityFlatModel
Note that these changes are only required if you directly implement the interface IBasicEntityFlatModel
in your plugin.
Added
void AfterPropertyChangedLocally(PropertyChangedEventArgs e);
Changed
string ExecuteAction(string actionName);
becomes:
string ExecuteAction(string actionName, string userId);
INotifyPropertyChanged
Some interfaces have had the INotifyPropertyChanged
interface added to them, which might require implementations of the interface to have the INotifyPropertyChanged
interface implemented now. This change has been made to fix some memory leaks in the user interface. This is only relevant if you are implementing these interfaces directly in the plugin. The following types have changed:
HHDev.DataManagement.Client.Core.Helpers.IEditViewModel
HHDev.DataManagement.Client.Core.Caches.Interfaces.IReadOnlyContextSelectionV2
HHDev.DataManagement.Client.Core.Caches.IChildOfAccountCache<TFlatModel, TEntity>
Plugin interface changes
CGD primitive control registration
Previously, to register a primitive control in the CGD from a plugin, the IRunSheetCustomizationPlugin
interface was used to return an instance of the RunSheetCustomizationConfig
. This functionality has now been removed and replaced with a new plugin interface: ICgdPrimitiveProviderPlugin
. With this interface a property can be defined that returns a list of PrimitiveDefinition
.
It is possible to call the static function PrimitiveRegistry.Register
to register primitives, but the preferred approach is to use the ICgdPrimitiveProviderPlugin
in case breaking changes are introduced to the PrimitiveRegistry
in future versions.
Furthermore, if a run sheet CGD is defined in a plugin, and this CGD uses primitives that are registered to a single account then the account ID must be passed into the constructor of the CGD definition. If this condition is not met then null
can be passed in to the constructor.
GridControl changes
We have worked to improve the performance of the tables in HH Data Management for this release. As a result of this there have been some changes to the way GridControls should be defined in the software. These changes only apply if the columns of the table are being generated by a ColumnManager
(i.e. the columns are defined in HH Data Management rather than in the XAML of the view).
- all
dxg:GridControls
should be updated to be of typecontrols:HHGridControl
- all
dxg:TableViews
should be updated to be of typecontrols:CustomTableView
- search your code for "ColumnsSource=" and replace the code for all occasions that use a ViewModelColumnManager. The new binding should be
ColumnManager="{Binding ColumnManager}"
, i.e. the binding is not the ColumnManager.Columns collection anymore, but to the ColumnManager directly - all occasions where you now use the binding to the ColumnsManager directly can remove the line
ColumnGeneratorTemplateSelector="{StaticResource TreeListColumnTemplateSelector}"
as it is not needed anymore - all GridControls that define a DataControlDetailDescriptor additionally need to add a DetailColumnManager-binding in the parent to the ColumnManager of the child. This is very important as otherwise HH DM might crash on expanding the detail. Here is an example:
Export functions
An additional argument has been added to the HHDev.DataManagement.Client.Wpf.Components.Export.ExportFunctions.WriteExcelFile()
function; bool forceFileDialog
. To have the same behaviour as before, pass false into this argument. If true is passed then the export will always ask the user to choose the file path to save the exported file to.
Other changes of note
View model functions
All functions in view models that are called by commands (i.e. called by clicking a button in the ribbon bar) are now marked as protected virtual
whereas before some were private
. This makes it easier to customize the behaviour of some of these functions.
Flat models
We have added two virtual functions BeforeAddingLocally
and AfterAddingLocally
to all flat models. These can be used to customize flat models before or after they are added to the cache. The difference between the two functions is when they are called.
The BeforeAddingLocally
function is called before the flat model is added to the cache and therefore before the sync operation to add the item into the database is created. Therefore this is a good place to customize the flat model and not create additional sync ops for other users in the account.
The AfterAddingLocally
function is called after the flat model has been added to the cache and is therefore useful if you need to trigger calculations that require the new item to be fully defined in the software or use the Previous
/Next
properties.
It's important to know that these functions are only getting called on the computer that generates the flat model, but not on remote computers, that just receive a sync operation.