What’s New in Xafari 15.2.9010.523

New Major Features in x010

Major Features in x010

Breaking Changes

To learn about breaking changes in this version, please refer to the following page:
Breaking Changes in Xafari 15.2.9010.523


NEW FEATURES

Xafari.Base Namespace

XafariValueManager Class

The XafariValueManager class facilitates interaction with IValueManager by exposing 2 methods to get and set the object of the ValueManager.

public static TService Instance
{
get { return XafariValueManager.GetInstance<TService>("Instance"); }
}
public new static SettingsAccessor Instance
{
set { XafariValueManager.SetInstance("Instance", value); }
}

Xafari.Helpers Namespace

The IMemberInfoHelper class exposes a new GetCriteriaEqualsTo method

This method returns the CriteriaOperator instance for the specified IMemberInfo.
It is useful when there is a task to create a filter for data selection according to a specified field value.
The method takes into account the specific structure of the filter for XPWeakReference, XPWeakReferenceStruct, GuidWeakReference.
Sample:

interface Object1
{
string String1 {get;set;}
XPWeakReference Weak {get;set;}
}

var criteria = typeof(Object1).Xafari().TypeInfo().FindMember(“String1”).Xafari().GetCriteriaEqualsTo(“1”); // result – “[String1]=’1′”
var criteria2 = typeof(Object1).Xafari().TypeInfo().FindMember(“String1”).Xafari().GetCriteriaEqualsTo(null); // result – “[String1] is null”

var criteria = typeof(Object1).Xafari().TypeInfo().FindMember(“Weak”).Xafari().GetCriteriaEqualsTo(object1); // result – “[Weak.TargetType] = ? AND [Weak.TargetKey] = ?”
var criteria2 = typeof(Object1).Xafari().TypeInfo().FindMember(“Weak”).Xafari().GetCriteriaEqualsTo(null); // result – “[Weak] is null”

New Helpers to extend standard DX clases
The following classes have been added:

  • Xafari.Helpers.IMemberInfoHelper
  • Xafari.Helpers.IObjectSpaceHelper
  • Xafari.Helpers.ITypeInfoHelper
  • Xafari.Helpers.ITypesInfoHelper
  • Xafari.Helpers.ObjectHelper
  • Xafari.Helpers.SessionHelper
  • Xafari.Helpers.TypeHelper
  • Xafari.Helpers.ViewControllerHelper
  • Xafari.Helpers.XafApplicationHelper
  • Xafari.Helpers.XafariHelperBase
  • Xafari.Helpers.XPMemberInfoHelper

They are intended to replace the usage of static extensions. To learn more, refer to the Helpers topic.

Xafari.DC Namespace

WeakListAttribute Class for non-persistent collections
WeakListAttribute is intended to define non-persistent collections implemented by the DomainLogicBase.GetWeakList method. When the application starts, Xafari analyzes all persistent DC and finds all the properties with this attribute. Then the framework modifies the XAF metadata in such a way that all founded non-persistent collections become the features of a standard persistent one, it also adds the NonPersistentDC and BackReferenceProperty attributes to this list property.
If you specify both attributes simultaneously (BackReferenceProperty and WeakList), then to calculate properties with a back reference the BackReferenceProperty attribute will be used. Modification of metadata is performed in such a way as to ensure the most effective queries when working with collections.

Xafari.Win Namespace

Grouping Application Model nodes by namespaces
It works similar to the Views section: the context menu of the parent node contains Group and Ungroupitems.
It is implemented for a Model Editor (Tools|Edit Model) and WorkPlace Model Editor (Tools|Edit administrator Workplace) invoked by end-users and administrators from the running Win app.
To use this feature, it is necessary to call RegisterGroupAlias(Type collectionNodeType, string groupPropertyName) method of the Xafari.Win.XafariModelEditorViewController class, its parameters are:
– the type of Application Model’s node which subnodes must be grouped;
– the string that specifies the name of the property for grouping, this property should contain the full class name (with namespace).
Grouping feature when invoking the Model Editor is provided by the Xafari.Win.WinXafariEditModelController derived from the EditModelController.

Xafari.BC Namespace

AliveType attribute for Domain Components
AliveType attribute allows defining the type of entity which will be used in runtime instead of the ancestor type which was declared when designing the system.
The code snippet below demonstrates this situation:

[AliveType(typeof(Object2))] interface Object1 {}
interface Object2 : Object1 {}

This means that in runtime the Object2 type will be used instead of Object1 type. For instance:

Object creation:
var obj1 = objectSpace.Xafari().CreateObject();
The Object2 object will be created.

Data selection:
objectSpace.Xafari().GetObjects(criteriaForObject2);
The only those Object2 objects will be retrieved which satisfy the criteriaForObject2 restrictions.

Why is it needed

Often, the entity that declared at the design of the core system gradually acquired new fields and features. For example, inheritance hierarchy of classes means the Employee entity, but with a different set of fields. In practice, the development and deployment of enterprise systems the many base entities have been extended by one way or another. This can be done both by using classical inheritance, or by the implementation and registering the Extensions (see Xafari XF). Thus, at the stage of actual use of an entity in the application, it may be that it has a number of additional (purchased) capabilities.
Use AliveType allows utilizing these features when the application operates on the basic entity.

Xafari.BC.DC Namespace

HierarchyNodeExt Domain Component
This interface declares HierarchyFullName and HierarchyFullPath properties for default hierarchy. See the HierarchyNodeExt Interface topic.
ISharedObject Domain Component
This DC is intended to store the service information about the binding entity to the user. ISharedObject declares the following properties:

  • string UserName { get; set; }. The name of the user who owns the record. If the username is empty, it is considered that the record is shared.
  • bool IsShared { get; set; }. Calculated (not persistent) property that indicates whether a record is private or shared. If set this property to true, the UserName field will be cleared (reset). If set this property to false, then the current user will be specified in the UserName field. It is assumed that the system administrator changes the value of this property. By default, the property is not displayed in visual forms. If necessary, you can customize the layout of the admin’s form to add this property.
  • bool UserIsOwner { get; }. Calculated (not persistent) property which indicates whether the current user is the owner of the current record.

To select from the database all records owned by the current user, use the criteria available through a static property SharedObjectLogic.AvailableSharedObjectsFilter:
using (var objectSpace = Application.CreateObjectSpace()) {
var availableObjects = objectSpace.GetObjects(SharedObjectLogic.AvailableSharedObjectsFilter);
...
}

SharedObjectViewController automatically adds the specified filter to the criteria list of the CollectionSource. This is done for List Views of all objects that support the ISharedObject interface. To control the filter’s activity, it is possible activate/deactivate the SharedObjectViewController from the custom controller:
protected override void OnActivated()
{
base.OnActivated();
Frame.GetController().Active["Deactivated by Controller1"] = false;
}

Dock Panels

Dock Panels support Expressions when set RelationCriteria property
RelationCriteria property specifies the filter which defines the data relationship between General View and Dock Panel. Earlier, it used the Xafari Object Formatter syntax, now it supports Expressions. To learn more, refer to the Dock Panels. Data Relation topic.

Hierarchical Data

General improvements and optimization
There are new classes to implement hierarchical structure.
HierarchyManager class manages a hierarchical metadata. This class is XafariService and provides effective performance when processing a large amount of data.
HierarchyInfo and HierarchyNodeTypeInfo classes provide metadata to describe hierarchies.
Now there are no restrictions on the method of implementation of hierarchical data. It is possible to define hierarchy both using attributes (previously used method) and using special methods to register hierarchies. This allows you to add hierarchical data for the previously defined non-hierarchical entity, for instance, it may be a hierarchical Extensions.
Registration is doing after initialization of the application:
application.SetupComplete += (sender, args) =
{
var hierarchy1 = XafTypesInfo.Instance.Xafari()
.RegisterHierarchy<HierarchyObject3>("Hierarchy1",
"Parent1",
nodeNameMemberPath: "Name1",
childrenMemberPath: "Children1",
fullNameMemberPath: "HierarchyFullName1",
fullPathMemberPath: "HierarchyFullPath1");
hierarchy1.DeletingMode = DeletingMode.Replacement;
}

Use XafariService to implement the HierarchyManager will significantly reduce the time of recalculation of hierarchical data. In some cases, the operating time decreased in 10 times.

Xafari Object Formatter

DevExpress Expressions support
Format string support Expressions syntax to navigate on the properties. To learn more, refer to the Xafari Object Formatter section.

Xafari Services

Memory Leaks Diagnostic Service
This service diagnoses ObjectSpace memory leaks, it is available in the app and displays detailed information about all not disposed objects. To learn more, refer to the Memory Leaks Diagnostic Service topic.

Business Operations

Group feature in Application Model
In Application Model, Bo nodes may be grouped together by namespaces which contain types of the respective Business Operations Xafari|BusinessOperations node exposes Group/Ungroup item in context menu.
This feature is implemented for the Model Editor and WorkPlace Model Editor invoked by end-users and administrators from the running Win app.

Docflow

New Signatures functionality
Signatures are defined for the Document’s type. Signatures are created in the moment when the Schema is activated. Each Signature has information about its approvals. There is an Action to set Document’s Signature, the value of Signature is calculated by the specified formula.

Reports

Availability criteria property in the Report Template
This criterion restricts the set of Parameter objects. Objects that match the criteria, display the Template in the lookup lists of available templates. To learn more, refer to the Xafari Reports.Templates topic.
Reports store path property for the File Reports
Xafari.Reports.File.IPathSupport Domain Component provides Path property that specifies the path to store resulting reports. This property is displayed on the Template Detail View. To learn more refer to the
File Report Path in Parameters topic.
Separate templates filter for each report
A user can filter lookup list with templates separately for each report instance. This is provided by the Checked List (see https://documentation.devexpress.com/#WindowsForms/CustomDocument10605). Report’s node in Application Model exposes FavouriteTemplatesFilter property to set default filter.
Write US