Monday, June 15, 2015

8 WebDAV Imports Gotcha's to Watch Out For in SDL Tridion

WebDAV or Web Distributed Authoring and Versioning is a technology which allows files to be shared over the HTTP protocol. As it comes standard with most operating systems, all it costs is time.. to do a little configuring, a little thinking, ensure the proper IIS authentication/configuration is applied, format the Tridion content to be and off we go.

The topic came up before in terms of importing bulk multimedia components, so what about regular components? Albeit not impossible, there are a number of restrictions one should be aware of before embarking on this boat. Should any of these "requirements" turn mandatory, well, there is always the coding warrior path, build a custom application using the Tridion Core Service to do the same and more.

Your best bet is to get a hold of the schemas on which the content to be imported will be based. "Why?" you ask, because the end goal here is to create the content to be imported in Tridion as clean XML files ready to be consumed by WebDAV. When dragged and dropped in Windows Explorer from a normal folder to a Tridion WebDAV folder, WebDAV will connect to Tridion and create the files directly in the CMS. In any case, a proper schema analysis is essential in order to become clear on the following limitations:

1. No metadata on components WebDAV will not bring in metadata type fields content, so if this exists, alternatives for it would be to update the components manually post import or build a scaled down custom application to add it post import. One can also reason that if this is the case, one might as well resort to doing the import entirely by custom application.

2. Strict XML format to match schema definition Any non-adherence to the schema definition will not work. A good idea here is to create a few sample components in Tridion first, then find what they look like in XML format. Proceed based on the format created as such.

3. XHTML compliance Obviously, XHTML format must be properly considered as well, as the system will certainly try and validate the new batch and discard a non-compliant batch.

4. Mandatory fields must be populated I think by now, it has become quite obvious how simplistic WebDAV is, really it cannot handle any kind of logic, rather just passes along what it is given, and so mandatory fields without content will fail schema validation just as they would if an editor was trying to save a Component missing required fields in the Content Manager Explorer.

5. To bind to another schema we must add it to the properties of the folder in which content is imported So long as a schema is found in the publication level the content is imported, all should be well, work as expected, however, if one is looking to ensure some additional schema restrictions, then the above applies. Remember. WebDAV is simple.

6. Categories/keywords are somewhat problematic This is the case in the sense that they must be available at the time of import, and also treated as plain text in terms of field content.

7. Component links Component links are tricky, but not impossible: one must import children~linked_to_components before parents, then apply WebDAV urls in parents, follow by importing parents and making sure the parent target exists - here one reasons twice as much about going the route of a custom application, unless of course the amount of component links is insignificant, so then a little manual work coupled with focus and attention can still get the job done.

8. Circular referencing In the case where a piece of content A points to another B, and B then in turn points to A, which surprisingly can be encountered often and when least expected, we are looking at circular referencing. To achieve this little bit, both components must be created independently, then updated with the reference to each other and only after imported.

Ah, now that we have got all of that out of the way, step freely in the boat, with the content formatted properly and ready to go, updating components can be done again with drag + drop. Unless of course, one reasoned to launch forward with a custom application after all.