Adding custom exports
This article outlines the tasks that are needed in exporting your own custom entity type from inRiver into Litium Studio.
Following is an outline of steps that you need to follow in exporting your own custom entity.
- Have a source compiled inRiver connector addOn, as described earlier in this Develop section.
- Makesure your source compiled version is running, and it can be debugged both with inRiver when exporting and with Litium Studio when importing.
- Create your custom entity in inRiver model tool, lets name it Custom for this example, and the link type that connect it to an existing entity, lets say ChannelNodeCustom for this example.
- The Litium.Studio.AddOns.InRiver.dll.config in your inRiver installation folder, has following two settings, which should not contain the above custom entity or the link type.
- excludeEntityTypeIds
- excludeLinkTypeIds
- If you try to start the inriver connect now, the addOn will throw an exception and log an error saying that it does not understand how to export the Custom entity and ChannelNodeCustom link type.
- You need to build it, so that this exception will automatically dissappear.
- Take an existing "LinkService" implementation and copy it and rename to represent your custom link type, for this example ChannelNodeCustom. A good simple example to copy is \Src\Litium.Studio.AddOns.Inriver\LinkServices\AssortmentNodeLinks\ChannelNodeItemLinkService.cs. And take a look at other implementations also to understand how it all works.
- Modify the _linkTypdId appropriately, in this case to ChannelNodeCustom
- Modify the DocumentType property, you might need to modify this enum to add your own.
- Modify the LinkTypeBehaviour property, you might need to modify this enum to add your own.
- Modify the TargetEntityBehaviour appropriately, you might need to modify this enum to add your own.
- Override the CreateModelMapping, this is the method that is responsible for exporting information required to create the Litium Studio "model", whatever you might have in the Litium Studio Control panel goes here.
- Once you get the things to export successfully, write the import by coping and modifying an existing import file, for example \src\litium.studio.addons.inriver.integration\import\articleimport.cs
- The main method that handles the import is public override void ProcessItem(DataSetDataItem pubDoc, DataSetSyncCommand.SyncCommandRow args, DataSetSyncCommand.CommandArgsDataTable commandArgs)
- As you can see, you may even put your own custom commands and deal with them in import time.
- If you have model changes, that is any changes that need to be set to Litium Studio backoffice Control panel area, you need to change the ModelBuilder.cs so it will read the model file and do the necessary changes.
- Test thoroughly your implementation and remember to have code comments to explain and help a future upgrade. Also it would be helpful to read the common issues in "Debug & Troubleshooting" section in this documentation as well.
Updated
2020-06-10
|