objectdiff

ObjectDiff

Stable version 1.0.2 (Compatible with OutSystems 11)
Published on 4 Dec (3 days ago) by 
5.0
 (1 rating)
objectdiff

ObjectDiff

Details
This component compares the differences in objects of the same type. It is intended for use in auditing. It handles differences for the create, update and delete of entities. There are multiple actions available to return the differences between entities in text, HTML or in a structure where you may programmatically use the differences. HTML is generated using EncodeHtml to prevent injection attacks. Translations are available in English, Spanish, French, Japanese, Malay, Portuguese, Russian, Chinese. Let me know if there is another translation you would like. Translation files are also welcome. Foreign key attributes are formatted using the "Label" attribute of the foreign entity as well as the ID.
Read more

Compare two objects of the same entity type and return the differences.

There are different versions of actions with method signatures to suit different scenarios.

Translations are available in English, Spanish, French, Japanese, Malay, Portuguese, Russian, Chinese.

The currency symbol, decimal symbol, group symbol and null placeholder can be overridden via site properties or per call to an action.

The simplest usage is to just call CompareObjectsToText, or CompareObjectsToHtml.  These will compare the objects and return Text or HTML identifying the difference between the passed in objects.

For the creation of an object, pass in NullObject() for the OldObject.  For the deletion of an object, pass in NullObject() for the NewObject.

The CompareObjects action returns the differences in a structure that can be used programmatically.

The ComparisonResultToText action converts the comparison returned by CompareObjects to text. It is intened this is used for human readable audit records.

The ComparisonResultToHtml action converts the comparison returned by CompareObjects to HTML. It is intended this is used for human readable audit records.  Values are HTML encoded to guard against injection attacks.

The "Config" actions provide additional configuration options.  Site properties are also available to override default configuration settings for NullPlaceholder, CurrencySymbol, DecimalSeparator and GroupSeparator.  FormatOverrides allow a .NET format specifier to control how an attribute is formatted in the output.

Users of the library can also write their own formatting actions and just use the CompareObjects action.

Note on foreign keys:

Values for foreign keys use the "Label" attribute of the foreign entity as well as displaying the id.  If the label attribute of a foreign entity is a foreign key, the library will display the value for the second foreign entity, if a Label attribute is defined for it.  The id value for the foreign key entity is also displayed.

What’s new (1.0.2)

This version now compares entities defined in an Extension.

This version adds the ability to specify attributes to either include or exclude.  To include or exclude attributes, use the advanced action CompareObjectsConfig to compare objects.


Reviews (0)