Default Data Format Repository (Magic xpi 4.13)
The Default Data Format repository displays the defaults that you want Magic xpi to use for XML and JSON data types. You can also use this dialog box to enter your own defaults for XML and JSON data types.
|
Defaults for Database data types are saved in the following file: <Magic xpi installation>\Studio\data_types.xml.
|
The Default Data Format repository can be accessed in the following ways:
-
In the Repositories section of the Solution Explorer, double-click on Default Data Format. When accessed in this way, the existing defaults are displayed. Here, you can add default data formats for the project. Duplicate names are not allowed, and the name field cannot be left empty.
-
In the XML Properties pane's Data Format property, click . When accessed in this way, two tabs are displayed: Existing List and Modify List. The Modify List tab enables you to change the default data format (picture) and to add new data formats to those used by Magic xpi when reading XSD files
-
By pressing SHIFT+F11.
The Default Data Format repository contains the following parameters:
|
|
Data Type
|
The name of the data type that exists in the Magic xpi database. If you are adding a data type to the list, you should enter its name here. Spaces are allowed.
|
Attribute
|
You can change the attributes of default and new data types. Select one of the following attributes from the drop-down list:
-
Alpha
-
Numeric
-
Logical
-
Date
-
Time
-
BLOB
|
Format
|
You can change the format of default and new data types. Enter the data type's format here.
Changes in a particular Source or Destination are relevant only to that Source or Destination. For example, if you change a Source's format, this does not affect the format of the Destination that the Source is mapped to.
|
The Default Data Format repository has the following buttons:
|
|
Add
|
Click here to add a new data type. You can then enter the relevant parameters, which are described above. You can also add a data type by right-clicking on any of the data types on the list and selecting Add from the context menu. These additions are made to a specific XML entry.
|
Delete
|
Select a data type, and click here to delete it from the list. Before deleting a data type, you should make sure that it is not used in other places in your project. You can do this by running the Find Reference utility.
|
OK
|
Click here to save your additions and changes, and to exit the dialog box.
|
Cancel
|
Click here to exit the dialog box without saving any additions and changes.
|
|
-
If you change the attribute information for a data attribute that is already in use in the Data Mapper, the dialog box opens the next time you open the Mapper.
-
If you are working with a database that has a field, the Data Mapper treats this field as a field. This means that the time portion of the field is lost. You can make sure that you retain this data by opening a file called , which can be found in the root directory of Magic xpi. The XML file contains the following data:
<Mapping>
<From_DB_Type>DATETIME</From_DB_Type>
<To_Data_Type>Date</To_Data_Type>
<MagicPic>YYYY/MM/DD</MagicPic>
<StoredSize>8 </StoredSize>
<StoredAs></StoredAs>
<StoradAsNumber>19</StoradAsNumber>
<StoredType></StoredType>
</Mapping>
You should change this to:
<Mapping>
<From_DB_Type>DATETIME</From_DB_Type>
<To_Data_Type>STRINGDATE</To_Data_Type>
<MagicPic></MagicPic>
<StoredSize></StoredSize>
<StoredAs>ZString</StoredAs>
<StoradAsNumber>3</StoradAsNumber>
<StoredType></StoredType>
</Mapping>
This change ensures that Magic xpi treats this field as a string, but converts it from a date/time format to a string whenever it is necessary.
|