Skip to main content

Developing Modules

Module Development

 

eonicweb 5 is designed to enable new bespoke modules to be easily create and deployed. Several key principles are important to understand when developing modules.

  • xForms allow the specification of both the XML content schema and the form to update it.
  • xForms are loaded from the root directory path in deference to the ewcommon path, allowing common content types to be "overridden"
  • Behaviours for the form content can be applied by specifying a bespoke .Net class path on the content node allowing unlimited functionality.
  • XSLT templates to render the new content types in html can be added to the XSLT template library called by the site.
  • Where several XSLT templates match the same call. The last one in the library sequence is called allowing bespoke templates to override common ones.
  • We are implementing "Provider" models for specific features within eonicweb such as Mailing List Transmission to allow for numerous 3rd party integration providers to be developed without bloating the eonicweb core unnecessarily.

Modules can be created and deployed to all eonicweb sites, they may assume the latest build but as we run a SaaS environment this should not be an issue.

Modules are not added to the ewCommon download so as not bloat the size of the core or to complicate the user with a multitude of unnecessary features.

A module is packaged as a zip file, modules will be (in time) available form a gallery within the eonicweb.com website. Some will be freely available but there may also be chargeable modules. Some modules will benefit from some bespoke integration or configuration, to make best use of them for a specific site.

3rd Party Developers can build modules and sell via our marketplace, eonic charge a commission and will test the quality of the module.

For more details contact us.

 

 

Installing a module

 

Installing a module is a manual process at the moment. It is on the development roadmap to build an automated installer.

To install a module follow the instructions outlined in the Installer.Xml in the root of the zip file. This contains easy to understand xml based instructions for installing the module.

Developers of modules should follow the follow packaging standard.

 

Packaging a Module

 

Modules are packaged by creating a zip file.

The zip file should be created with a directory structure the same as that of the location of the files when they will be installed into a site.

This may include:

\admin\adminMenu.xml for modifications to the admin menu

\xforms\ for xforms to be added to the site

\xsl\Layout.xsl for bespoke layouts to be added to the sites XSLT library

The package should also contain an Installer.xml which contains a series of instructions for installing the module.

UpdateXml will insert XML into a file

fileCopy will copy a file to a specified location

ifexist will test for the existence of a file

Please see the following example...

 
 
<?xml version="1.0" encoding="utf-8" ?>
<ModuleInstaller name="CampaignMonitor">
	<!--Web.Config Additions-->
	<UpdateXml targetFile="web.config" targetXpath="configuration/configSections/configSection[@name='eonic']">
		<section name="messagingProviders" type="Eonic.ProviderSectionHandler, EonicWebV4_0" restartOnExternalChanges="false"/>
	</UpdateXml>
	<UpdateXml targetFile="web.config" targetXpath="configuration/eonic">
		<messagingProviders>
			<providers>
				<add name="CampaignMonitorProvider" type="CampaignMonitorEonicWebIntegration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
			</providers>
		</messagingProviders>
	</UpdateXml>
	<!--Bin Additions-->
	<filecopy sourcefile="bin/CampaignMonitorAPIWrapper.dll" destination="/bin"/>
	<filecopy sourcefile="bin/CampaignMonitorEonicWebIntegration.dll" destination="/bin"/>
	<!--xForm Additions-->
	<filecopy sourcefile="xforms/config/CampaignMonitorSettings.xml" destination="/xforms/config"/>
	<filecopy sourcefile="xforms/content/module/CampaignMonitorSubscribe.xml" destination="/xforms/content/module"/>
	<filecopy sourcefile="xforms/content/module/CampaignMonitorUnSubscribe.xml" destination="/xforms/content/module"/>
	<!--AdminMenu Additions-->
	<ifexists file="/admin/adminMenu.xml">
		<then>
			<UpdateXml targetFile="/admin/adminMenu.xml" targetXpath="AdminMenu/descendant-or-self::MenuItem[@name='SiteSettings']" mode="append">
				<MenuItem name="Campaign Monitor" cmd="WebSettings.CampaignMonitorSettings" display="true" feature="Search"/>
			</UpdateXml>
		</then>
		<else>
			<filecopy sourcefile="/admin/adminMenu.xml" destination="/admin"/>
		</else>
	</ifexists>
	<!--xsl Templates to copy to standard-->
	<!--For installer need some clever logic to load a local standard.xsl that contains the Layouts but references in the standard specified in the config-->
	<UpdateXml targetFile="/xsl/standard.xslt" targetXpath="xsl:stylesheet" sourcefile="xsl/Layouts.xsl" mode="append"/>
</ModuleInstaller>