You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,6 @@ _(Example assumes that your classname is `SampleApps.Serialize.MapTesting`, that
24
24
From the terminal,in the name space where your class exists :
25
25
26
26
```javascript
27
-
28
27
Set obj = ##class(SampleApps.Serialize.MapTesting).%OpenId(1)
29
28
Set objJSON =obj.Export()
30
29
Do objJSON.%ToJSON()
@@ -46,9 +45,9 @@ Basically when we compile a class that inherits from our Adaptor, the class will
46
45
47
46
We can have several maps for a particular class (for example to exchange data from an object with different systems or organizations, we might need to export or import some properties but not others, or apply different conversions to some values, or name the properties differently , etc…).
48
47
49
-
By default, all classes that inherit from `OPNLib.Serialize.Adaptor` will have an associated default map: MAP0, that will make a direct mapping regarding property names (same name for target an source property).
48
+
By default, all classes that inherit from `OPNLib.Serialize.Adaptor` will have an associated default map: `MAP0`, that will make a direct mapping regarding property names (same name for target an source property).
50
49
51
-
Each property will be categorized in group types, numbered from 1 to 6. Currently these are the group types supported :
50
+
Each property will be categorized in group types, numbered from `1` to `6`. Currently these are the group types supported :
52
51
53
52
Code | Category | Description
54
53
---- | ------------- | -----------
@@ -60,10 +59,10 @@ Code | Category | Description
60
59
6 | List of Objects | A property of type %Collection.ListOfObject
61
60
7 | Stream | Properties of type %Stream.*, %CSP.*stream*,…
62
61
63
-
During map generation, by default, the Adaptor sets export and Import conversion methods for dates and streams (which are exported as a stream in base64).
62
+
During map generation, by default, the `Adaptor` sets export and import conversion methods for dates, datetimes, timestamps and streams (which are exported as a stream in base64).
@@ -85,7 +84,7 @@ During map generation, by default, the Adaptor sets export and Import conversion
85
84
86
85
### How could we configure our mapping for serialization?
87
86
88
-
We can have as much mapping definitions for a class as we need. An easy way to start to define our customized maps is exporting the default MAP0 and importing it again with a different name, then we can make changes in the map regarding the properties that should be exported /imported, names, conversor methods to apply. To do this, we can modify directly in the global, or do it programatically (See `OPNLib.Serialize.Util` class for tools to export/import maps, get / set property mappings,etc…)
87
+
We can have as much mapping definitions for a class as we need. An easy way to start to define our customized maps is exporting the default `MAP0` and importing it again with a different name, then we can make changes in the map regarding the properties that should be exported /imported, names, conversor methods to apply. To do this, we can modify directly in the global, or do it programatically (See `OPNLib.Serialize.Util` class for tools to export/import maps, get / set property mappings,etc…)
89
88
90
89
---
91
90
**Example:**
@@ -148,11 +147,11 @@ Anyway, the primary class is not affected and doesn't have to be changed no matt
148
147
Using these classes is very easy. Let's see an example:
149
148
150
149
---
151
-
Example :
150
+
**Example:**
152
151
153
-
We want to be able to export SampleApps.Serialize.PersistObject to JSON, but just some of the properties: `cod`, `description` and `start`. We want to project those properties, for example, in Spanish, as: `codigo`, `descripcion` and `inicio` respectively.
152
+
We want to be able to export `SampleApps.Serialize.PersistObject` to JSON, but just some of the properties: `cod`, `description` and `start`. We want to project those properties, for example, in Spanish, as: `codigo`, `descripcion` and `inicio` respectively.
154
153
155
-
We design the required map, that we call MAP2 and load it:
154
+
We design the required map, that we call `MAP2` and load it:
156
155
157
156
```javascript
158
157
do ##class(SampleApps.Serialize.HandleMaps).SetPersistObjectMAP2()
0 commit comments