To promote reusability and plugability of connectors and to prevent code duplication, we are introducing the Xill Project Convention, which consists of a set of best practices for setting up your project. What you will get is a set of reusable libraries, a folder structure for connectors and a way to separate connector logic from configuration.
- Clearly separate connector/library code from project configuration and scripting. Although there is always the opportunity to adjust library code, we keep this to a minimum to promote reuse.
- Package separation means that folders (robot packages) only ever include:
- Robots from the same package
- Robots from a parent folder
- Libraries from the lib/ or connector/ folders (which is why the paths have to be standardized)
- A migration project util library (directly clone into your /lib/util folder from https://github.com/xillio/util/)
- The standard decorator library (directly clone into your /lib/decorators folder from https://github.com/xillio/util/)
- We use our new
mapperlibrary, which generates a bot that maps the defined content types to a hierarchy of mapping templates (directly clone into your /lib/mapper folder from https://github.com/xillio/mapper/ ).
- Mapping templates are kept in specific configuration folders, one for the export and one for the import (adding more where neccessary).
- Connectors are kept together in a specific connector folder, because they are special-use libraries.
- Folder names stick to the Xill Naming Convention for robot packages, so alllowercase, where possible we use one word.
Main.xill -- Main robot that runs the entire project. xill.properties -- Main properties file, replaces Settings.xill, used by the Properties plugin (has to be in the root) connector/ -- Contains standard connectors that will normally not be changed in a project. drupal/ README.md -- README that explains how to set up and use the connector defaults.properties -- Default properties for the Drupal API and import/export bots. Sets expected locations of mapping folders, etc. (overridden by xill.properties) API.xill -- API wrapper for Drupal, this should only change if the Drupal API is changed. Decorators.xill -- Decorators needed in UDM in addition to the standard decorators (if any) Commons.xill -- Example of the DrupalCommons.xill library, copy to lib/project/ folder and adjust for your project export/ Prepare.xill -- Bot that runs the neccessary preparation steps (such as running the Build.xill robot from the mapper plugin) ExportNodes.xill -- Bot that exports Drupal nodes, uses settings from defaults.properties which can by overridden by xill.properties ExportUsers.xill import/ Prepare.xill -- Bot that runs the neccessary preparation steps (such as running the Build.xill robot from the mapper plugin) ImportNodes.xill ImportUsers.xill aem/ defaults.properties API.xill Decorators.xill Commons.xill export/ Prepare.xill -- Bot that runs the neccessary preparation steps (such as running the Build.xill robot from the mapper plugin) ExportPages.xill ExportBinaries.xill import/ Prepare.xill -- Bot that runs the neccessary preparation steps (such as running the Build.xill robot from the mapper plugin) ImportPages.xill ImportBinaries.xill lib/ -- Contains standard libraries that will (normally) not be changed in a project. Supports direct check-out from repositories. decorators/ -- Xillio standard library of decorators StandardDecorators.xill -- Bot that provides standard decorators, which will be used in UDMContentTypes.xill util/ -- Xillio standard library of utility functions (will be expanded over time) AllUtil.xill -- Bots that provides standard functions, which will be used throughout project bots and mapping bot ... mapper/ -- Xillio standard library for mapping defaults.properties -- Standard settings that come with the mapper library Build.xill -- Generates a mapper bot in script/ that recursively runs through the mapping bots in the mapping/ folder and executes the mappings for the correct content type(s) template/ _MapperTemplate.xill -- Template for the mapper bot _MappingTemplate.xill -- Example for type mapping bots meant to map a document to a single content type in UDM or the target system config/ -- Contains project specific configuration (mainly content types and mapping) UDMContentTypes.xill -- Creates the content types in UDM export/ Mapper.xill -- Bot generated by Build.xill. Executes the mapping for the current content type following the hierarchy recursively up to the root mapping (usually Default.xill) mapping/ -- Contains a hierarchy of mappings to map each source document to a selected content type in UDM. Default.xill -- Contains a mapping for default fields that content types might share [Mapping-for-UDMContentType1].xill -- Contains a mapping to UDMContentType1 and a list of parent mapping bots [Mapping-for-UDMContentType2].xill [Mapping-for-UDMContentType3].xill ... import/ Mapper.xill mapping/ -- Contains a hierarchy of mappings to map each source document to a selected content type in UDM. Default.xill [Mapping-for-TargetContentType1].xill [Mapping-for-TargetContentType2].xill [Mapping-for-TargetContentType3].xill ... project/ -- Contains project specific scripts Prepare.xill -- Prepares project specific settings, such as Mongo indexes Commons.xill -- List of project specific includes (such as connector.drupal.Commons) and shared functions that do not belong elsewhere Export.xill -- Runs the export Import.xill -- Runs the import ... -- Other robots you need to run your project
To make things easy for you, we provide a xill project template here to kick start your project. It does not contain the libraries yet. Please download this below.