...
Info |
---|
Es wird empfohlen, den Import zunächst in einer eigenen Testumgebung durchzuführen. |
Importer installieren
Wie im oberen Artikel beschrieben, wird eine Importer.exe
benötigt. Diese kann selbst geschrieben werden. Für die meisten Fälle bietet antony aber Standard-Importer an. Diese können im Hub manuell installiert werden. Dazu auf im Hub auf Umgebungsverwaltung > Produkte
und den Punkt Produkt installieren
aufklicken und den Namen des gwünschten Importers angeben.
AntonyDataImportCsv
AntonyDataImportMsSql
AntonyDataImportMySql
AntonyDataImportOdbc
AntonyDataImportOracle
_import_configuration
The _import_configuration
Table holds some basedata for the import.
Database field | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
id | Each Import has its own id. This is a GUID, you can simply generate | |||||||||
is_active | With this flag you can activate (1) and deactivate (0) the import | |||||||||
debug | The
| |||||||||
frequency | The frequency the import will be triggered. Format: <d>.<HH>:<MM>:<ss>. You cannot define a range unter a minute, as the importer only checks one per minute. | |||||||||
import_name | The name of the import. Free for use | |||||||||
comment | A comment for this import. Free for use | |||||||||
connection_information | Some ConnectionInformations the | |||||||||
import_group | Someday you want to configure multiple imports from the same origin. These imports might contain a link to each other like as This feature was orignally designed for customer link fields within an flexobject | |||||||||
mapping_name | This setting is only relevant in combination of an You need to make sure, that the mapping_name is unique over all of your configured imports. Otherwise the importer cannot relate the foreign_id of the importee to antony’s ids. | |||||||||
importer_exe | The Full Path to the | |||||||||
import_exe_args | This arguments are passed to the | |||||||||
target_type | The type the importer should import to. This can be
| |||||||||
import_parameter | These are some parameter the | |||||||||
merge_fields | Sometimes you don't want to import a whole object, but only import some data from a system to an existing one. Imagine you import some orders from a shop into a flexobject. Aou have also an ERP which holds the status of this order by a the ordernumer of the order. With the Therefore the importer will check, if there is already a flexobject with the value the If you have multiple Flexobjects which are matching the condition, then ALL flexobjects will be updated. You can provide multiple fields which ALL needs to match. The field within the database is comma-separated You have multiple Flexobjects which are matching the condition, then ALL flexobjects will be updated | |||||||||
batch_size | This sets the size of the batch the importer imports without a delay. The defaultvalue is 1. This option and the | |||||||||
delay_between_batch | This sets the delay the importer adds on every batch, defined by | |||||||||
suppress_create | This flag is usefull if you want to make sure, that no item will be created by the import. Use this if you only want to import some additional data from a source to an already existing dataset within antony. F.e. a generated link of your Shop or ERP |
import_configuration_mapping fields
This table contains the configuration of the import on how the provides fields of the importer.exe
are mapped to the antony field.
Database field | Description | |||||
---|---|---|---|---|---|---|
id | An incremental id | |||||
foreign_source_field | This is the fieldname the | |||||
antony_target_field | This is the field of your configured For customFields you need to know the <ID> of the field. The easiest way to get this is to open the flexobject in layout mode and copy it from the properties view. | |||||
converter_infos | Here you can configure converters to convert the values provided by the
An example could be
Be sure to properly quote the QuotationMarks (“ to \”) | |||||
comment | A comment. This can be filled by you to still understand the mapping in 2 days. | |||||
import_configuration_id | The ImportId of the importer. This one is the link to the |
List Antony Fields
Of course you want to configure the mapping of the fields to the according antony fields. Therefore you need to know the name of the fields antony provides. You can find them here
Contact
TargetType: “antony://contact”
Antony Mapping Field | .net Data-Type | Comments | |||||
---|---|---|---|---|---|---|---|
MainContactId | System.Int64 | This is the id of antonys main contact, if the contact wants to be a subcontact. Normally you wont have this present within the foreign system - So you need to map them. Therefore you can use the build in Converter “IdLookup” and provide the
If the given main contact isn't present within antonys import mapping, the crearted contact will be a normal main contact | |||||
TitleId | System.Int64 | The id of the title of the contact. You can find them in the table | |||||
Company | System.String | ||||||
Firstname | System.String | ||||||
Lastname | System.String | ||||||
Street | System.String | ||||||
Zipcode | System.String | ||||||
City | System.String | ||||||
State | System.Int64 | The id of the state. You can find it them in the table | |||||
CountryId | System.Int64 | The id of the country. You can find them in the table | |||||
Phone | System.String | ||||||
Phone2 | System.String | ||||||
Fax | System.String | ||||||
System.String | |||||||
Mobile | System.String | ||||||
Homepage | System.String | ||||||
Comment | System.String | ||||||
StreetPrivate | System.String | ||||||
ZipcodePrivate | System.String | ||||||
CityPrivate | System.String | ||||||
StatePrivate | System.Int64 | The id of the state. You can find it them in the table | |||||
CountryIdPrivate | System.Int64 | The id of the country. You can find them in the table | |||||
PhonePrivate | System.String | ||||||
Phone2Private | System.String | ||||||
FaxPrivate | System.String | ||||||
Department | System.String | ||||||
Picture | Byte[] | ||||||
Birthday | System.DateTime | Be sure to place LocalTime here | |||||
ContactGroup | System.Boolean | This is a write only property. If you pass a contact group here the contact will be added to the given contact group. The present contact will not be removed from existing ones | |||||
Customfields of contacts can be added by placing |
Appointment
TargetType: “antony://appointment”
Antony Mapping Field | .net Data-Type | Comments | |||||
---|---|---|---|---|---|---|---|
UID | System.Int64 | ||||||
Sequence | System.Int64 | ||||||
AllDay | System.Boolean | ||||||
StartDateTime | System.DateTime | LOCALTIME! | |||||
EndDateTime | System.DateTime | LOCALTIME! | |||||
Subject | System.String | ||||||
Location | System.String | ||||||
Description | System.String | ||||||
Label | System.Int64 | ||||||
Status | System.Int64 | ||||||
IsPrivate | System.Boolean | ||||||
HasReminder | System.Boolean | True, if a reminder is configured | |||||
ReminderTimeBeforeStart | System.Int64 | The number of nanoseconds of the reminder time. This is some kind of technical dept. | |||||
ResourceIds | List`1 | The ids of the resource the appointment should be placed in. You can find them within the antony admin. Example
| |||||
Creating recurring appointments is not supported. |
Flexobjects
The importer is also able to import flexobjects, which are configured within your environment. As a flexobject only contains CustomFields you need to look them up. They can be added by placing Field_n
within the antony_field. The n
is the id of the customfield itselve. You can either grab is from antonys visual editor or the table instance_customfields
TargetType: “antony://flexobject/<type_id>”
The type_id is the id of the type of the flexobject itselve. You can find it in the table flexobject
Conclusion
The import is a powerful but complex tool to import any data from an external datasource. You can also write a custom importer to grab data from your custom source.
If you have troubles to get your import up an running, please contact us.