Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Interface/GroupTemplate.md

174 lines
11 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateListView.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateExportView.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateImportView.cs
- Common/DTS.Common/Interface/GroupTemplate/ITemplateChannelListView.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateInfoControlView.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateViewModel.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateInfoControlViewModel.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplate.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateListViewModel.cs
- Common/DTS.Common/Interface/GroupTemplate/ITemplateChannelListViewModel.cs
- Common/DTS.Common/Interface/GroupTemplate/IGroupTemplateChannel.cs
- Common/DTS.Common/Interface/GroupTemplate/ITestObjectTemplate.cs
generated_at: "2026-04-16T03:01:39.419615+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "82ebb4dd66e3412f"
---
# GroupTemplate Module Documentation
## 1. Purpose
This module defines the interface contracts for the Group Template feature within the DTS system, providing abstractions for data models, view models, and views related to group templates, their channels, and associated operations (import/export, list views, info controls). It serves as a contract layer decoupling UI presentation from business logic and data persistence, enabling modular implementation and testability of group template functionality. The interfaces collectively support template management workflows including listing, filtering, sorting, channel configuration, and import/export operations.
## 2. Public Interface
### Interfaces (GroupTemplate namespace unless otherwise noted)
#### `IGroupTemplate`
- **Properties**:
- `bool Disabled { get; set; }` Whether the template is disabled.
- `string Name { get; set; }` Template name.
- `string Description { get; set; }` Human-readable description.
- `string Channels { get; set; }` Serialized representation of channels (likely JSON or CSV).
- `string AssociatedGroups { get; set; }` Serialized list of associated group IDs/names.
- `string LastModifiedBy { get; set; }` User who last modified the template.
- `DateTime LastModified { get; set; }` Timestamp of last modification.
- `string SerialNumber { get; set; }` Unique serial number identifier.
- **Methods**:
- `bool Filter(string term)` Returns `true` if the template matches the given search term.
#### `IGroupTemplateChannel`
- **Properties**:
- `bool Custom { get; }` Whether the channel is user-defined (custom) vs. system-defined.
- `int DisplayOrder { get; set; }` Order in which the channel is displayed.
- `string NameOfTheChannel { get; set; }` Display name of the channel.
- `string Name { get; }` Internal name/key of the channel.
- `bool Required { get; set; }` Whether the channel is required.
- `string ISOCode { get; }` ISO standard code associated with the channel.
- **Methods**:
- `bool Filter(string term)` Returns `true` if the channel matches the given search term.
- **Nested Type**:
- `GroupTemplateChannelComparer : IComparer<IGroupTemplateChannel>` Implements comparison logic for sorting channels. Uses `GroupTemplateChannelFields` enum (imported from `DTS.Common.Enums.GroupTemplates`) to determine sort field (`Required`, `Name`, `ISOCode`, `Custom`, `DisplayOrder`). Supports ascending/descending via `Ascending` property.
#### `ITestObjectTemplate`
- **Properties**:
- `string TemplateName { get; set; }` Template identifier (may be GUID for embedded templates).
- `string TemplateNameOrOriginalTemplateName { get; }` Human-readable name (original name for embedded templates; `TemplateName` otherwise).
- `string Icon { get; set; }` Icon identifier/path.
- `string Description { get; set; }` Template description.
- `bool LocalOnly { get; set; }` Whether the template is local-only (not shared).
- `int Version { get; set; }` Template version (not currently used per comments).
- `string LastModifiedBy { get; set; }` Last modifier.
- `DateTime LastModified { get; set; }` Last modification timestamp.
- `int CRC32 { get; set; }` CRC32 checksum (not currently used).
- `string TestObject { get; set; }` ISO meta-field for test object.
- `string TestObjectType { get; set; }` ISO meta-field for test object type.
- `string TemplateParent { get; set; }` Parent template name (for composite templates; legacy).
- `bool SysBuilt { get; set; }` Whether the template is system-built (uncertain usage).
- `string OriginalTemplateName { get; set; }` Original name for embedded templates.
- `bool Embedded { get; set; }` Whether the template is embedded in a test setup.
- **Methods**:
- `bool IsISOMode()` Indicates whether the template is in ISO mode.
#### `IGroupTemplateListView`
- Inherits `IBaseView`. No additional members.
#### `IGroupTemplateExportView`
- Inherits `IBaseView`. No additional members.
#### `IGroupTemplateImportView`
- Inherits `IBaseView`. No additional members.
#### `ITemplateChannelListView`
- Inherits `IBaseView`. No additional members.
#### `IGroupTemplateInfoControlView`
- Inherits `IBaseView`. No additional members.
*Note: Defined in `DataPro.Common.Interface` namespace, not `DTS.Common.Interface.GroupTemplate`.*
---
### View Models
#### `IGroupTemplateViewModel`
- **Namespace**: `DTS.Common.Interface.GroupTemplate`
- **Inherits**: `IBaseViewModel`
- **Properties**:
- `IGroupTemplateImportView ImportView { get; set; }` View for import functionality.
- `IGroupTemplateExportView ExportView { get; set; }` View for export functionality.
- **Methods**:
- `void Unset()` Releases resources or clears state.
#### `IGroupTemplateInfoControlViewModel`
- **Namespace**: `DataPro.Common.Interface`
- **Inherits**: `IBaseViewModel`
- **Properties**:
- `IGroupTemplateInfoView View { get; }` *Note: `IGroupTemplateInfoView` is referenced but not defined in the provided source files.*
- `IGroupTemplate SelectedGroupTemplate { get; set; }` Currently selected group template.
#### `IGroupTemplateListViewModel`
- **Namespace**: `DTS.Common.Interface.GroupTemplate`
- **Inherits**: `IBaseViewModel`, `IFilterableListView`
- **Properties**:
- `IGroupTemplateListView View { get; set; }`
- `IGroupTemplate[] Templates { get; set; }` Array of templates.
- **Methods**:
- `void GetAllTemplates(bool bIncludeEmbedded, bool bISOMode)` Loads templates; parameters control inclusion of embedded templates and ISO mode.
- `void Unset()` Releases resources.
- `void Sort(object o, bool columnClick)` Sorts templates (likely by column header interaction).
- `void Filter(string term)` Filters templates via `IGroupTemplate.Filter(term)`.
#### `ITemplateChannelListViewModel`
- **Namespace**: `DTS.Common.Interface.GroupTemplate`
- **Inherits**: `IBaseViewModel`
- **Properties**:
- `ITemplateChannelListView View { get; set; }`
- **Methods**:
- `void Unset()` Releases resources.
- `void Sort(object o, bool columnClick)` Sorts channels.
- `void Filter(string term)` Filters channels via `IGroupTemplateChannel.Filter(term)`.
- `void SetAllChannels(IGroupTemplateChannel[] channels)` Sets the full channel list.
- `IGroupTemplateChannel[] GetAllChannels()` Returns current channel list.
- `void MoveDown(IGroupTemplateChannel channel)` Decreases `DisplayOrder` of the channel.
- `void MoveUp(IGroupTemplateChannel channel)` Increases `DisplayOrder` of the channel.
- `void SetParent(object o)` Sets parent context (type unclear; `object` suggests loosely-typed parent reference).
---
## 3. Invariants
- All view interfaces (`IGroupTemplateListView`, `IGroupTemplateExportView`, etc.) inherit `IBaseView` and contain no additional members—view implementations must conform to `IBaseView` contract.
- All view model interfaces inherit `IBaseViewModel` (or `IBaseViewModel` via `IFilterableListView`).
- `IGroupTemplate` and `IGroupTemplateChannel` both implement `Filter(string term)` for UI-driven search.
- `IGroupTemplateListViewModel.Templates` is an array of `IGroupTemplate`, and `ITemplateChannelListViewModel` operates on `IGroupTemplateChannel[]`.
- `GroupTemplateChannelComparer` requires `SortField` to be one of the defined `GroupTemplateChannelFields` values; otherwise, `ArgumentOutOfRangeException` is thrown.
- `ITestObjectTemplate.OriginalTemplateName` is only meaningful when `Embedded` is `true`.
- `ITestObjectTemplate.TemplateName` may be a GUID for embedded templates, while `TemplateNameOrOriginalTemplateName` provides a user-friendly name.
---
## 4. Dependencies
### Dependencies *of* this module:
- **`DTS.Common.Base`** Provides `IBaseView` and `IBaseViewModel` base interfaces.
- **`DataPro.Common.Base`** Used by `IGroupTemplateInfoControlView` and `IGroupTemplateInfoControlViewModel`.
- **`DTS.Common.Interface.Pagination`** `IGroupTemplateListViewModel` implements `IFilterableListView` (from this namespace).
- **`DTS.Common.Enums.GroupTemplates`** `GroupTemplateChannelComparer` uses `GroupTemplateChannelFields` enum.
### Dependencies *on* this module:
- UI layers (e.g., WPF/WinForms) likely consume the view interfaces (`IGroupTemplateListView`, etc.).
- Business logic layers likely implement view models (`IGroupTemplateListViewModel`, `ITemplateChannelListViewModel`, etc.).
- Data persistence layers likely implement `IGroupTemplate` and `ITestObjectTemplate`.
---
## 5. Gotchas
- **Namespace inconsistency**: `IGroupTemplateInfoControlView` and `IGroupTemplateInfoControlViewModel` reside in `DataPro.Common.Interface`, not `DTS.Common.Interface.GroupTemplate`. This may indicate cross-namespace coupling or legacy naming.
- **Missing view definition**: `IGroupTemplateInfoControlViewModel` references `IGroupTemplateInfoView`, which is not defined in the provided source files.
- **Unclear `object` parameters**: Methods like `Sort(object o, bool columnClick)`, `SetParent(object o)`, and `GetAllTemplates(bool bIncludeEmbedded, bool bISOMode)` use `object` or unclear boolean flags—implementation details are not evident from interfaces alone.
- **Unused fields**: `ITestObjectTemplate.Version`, `CRC32`, and `TemplateParent` are explicitly marked as unused or legacy in comments.
- **Serialization ambiguity**: `IGroupTemplate.Channels` and `IGroupTemplate.AssociatedGroups` store serialized data (type/format unspecified).
- **ISO mode ambiguity**: `IsISOMode()` and `bISOMode` parameter suggest dual-mode behavior, but the distinction is not defined in these interfaces.
- **No `IGroupTemplateInfoView` definition**: Critical for `IGroupTemplateInfoControlViewModel` but absent from source.