Installing XMod Packages

New to Version 3.0

 

 

 

XMod has a new feature that enables you to more easily share form and template code. Additionally it allows you to install plug-ins and custom controls. You do this by creating "packages". Each package is simply a ZIP file that contains an XMod installation script, and one or more form files, template files, plugins, and custom controls.

 

For the most part all you need to know is how to install a package. Simply go to the Administration page - available to admins and hosts via the Actions menu.

 

PROBLEMS?: Your site's host may have disabled the uploading of XMod packages. In that case, you'll be presented with a message noting that fact. You won't be able to upload packages. Some hosts may allow the uploading of packages but may selectively disallow certain types of files (like plug-ins and custom controls). Additionally, the package installation process may not operate correctly on some sites that run in Medium Trust. In those cases, you can still just unzip the package file and use the contents of each *.xmf file to create new forms and use the contents of each new *.xmt file to create new templates. If the package contains any DLL files or SQL scripts, you'll need to have the Host install those by uploading the DLL's to the \bin directory of your DNN installation and execute any SQL scripts.

 

To install a package, browse to the file on your local drive by clicking the "Browse" button in the "Install Package" section of the page. Then click the "Install" link. After the file has been installed, you'll be presented with a log describing the success and/or failures encountered during installation.

 

About XMod Packages

Packages are ZIP files that must contain an XMod Installation script. Similar to DotNetNuke's ".dnn" script, this is an XML file saved with an .xmi extension. It looks similar to this:

 

<?xml version="1.0" encoding="utf-8"?>

<xmod version="1.0">

    <folder>MyBlueHeaven</folder>

    <files>

        <file>

            <title>My Blue Heaven ListView</title>

            <name>MyBlueHeaven_List.xmt</name>

            <description>This is the list view template for My Blue Heaven</description>

            <type>listview</type>

        </file>

        <file>

            <title>My Blue Heaven DetailView</title>

            <name>MyBlueHeaven_Detail.xmt</name>

            <description>This is the detail view template for My Blue Heaven</description>

            <type>detailview</type>

            <key>MyBlueHeaven.DetailView</key>

        </file>

        <file>

            <title>My Blue Heaven Data-Entry Form</title>

            <name>MyBlueHeaven_Form.xmf</name>

            <description>This is the data-entry form for My Blue Heaven</description>

            <type>form</type>

            <key>MyBlueHeaven.MainForm</key>

        </file>

        <file>

          <title>My Blue Heaven Display Plugin</title>

          <name>MyBlueHeaven.dll</name>

          <description>This is a plugin that does MyBlueHeaven Stuff to the Display</description>

          <type>plugin</type>

        </file>

        <file>

          <title>My Blue Heaven Custom Control</title>

          <name>MyBlueHeavenCtrls.dll</name>

          <description>This is a custom control that does MyBlueHeaven Stuff in a form</description>

          <type>customcontrol</type>

        </file>

        <file>

          <title>My Blue Heaven SQL Script</title>

          <name>MyBlueHeavenCtrls.sql</name>

          <description>This is a SQL Script file for MyBlueHeaven package</description>

          <type>other</type>

        </file>

    </files>

    <system>

      <plugins>

        <plugin>

          <title>My Blue Heaven System Plugin</title>

          <assembly>MyBlueHeaven.dll</assembly>

          <classname>MyBlueHeaven.XModPlugins.SysPluginClass</classname>

        </plugin>

      </plugins>

    </system>

</xmod>

 

There are 5 main file types recognized by XMod:

 

 

To create a package, zip one or more of the file types outlined above, together with a properly formatted .xmi file. The entries in the .xmi file must match the contents of the ZIP file. There can be only one .xmi file in a package.

 

Structure of the XMI File

 

XMI files are XML files that have a root node of <xmod> This tag must contain the ' version="1.0" ' attribute so that XMod can distinguish between future file formats.

 

The <xmod> tag must contain one <folder> tag. This specifies the folder into which supporting files will be placed. During installation, if supporting files are found, XMod will look in the portal's upload directory, under the "xmod/packages" sub-directory, for the folder name. If it's not found, XMod will attempt to create the directory and it will copy the supporting files to that folder.

 

Within the <xmod> root node is the <files> tag, which serves as a container for <file> tags. You should have one <file> tag for each file in the zip file.

 

Each <file> tag describes a single file in the package through the use of up to five child tags:

 

 

 

System Plugins via the <system> tag

For more information on System Plugins, see System Plugins Overview

 

Within the <xmod> root node is the <system> tag, which serves as a container for <plugins> tag, which, in turn, is the container for <plugin> tags. You should have one <plugin> tag for each system plugin you wish to register for the current portal.  NOTE: If the DLL that contains your plugin is already installed on the web server, you don't need to include it in the ZIP file, just create a registration for it via the <plugin> tag.

 

Each <plugin> tag describes a single assembly and class within that assembly that implements the ISystemPlugin interface (found in the KnowBetter.XMod.Extensibility.Plugins namespace). The tag has 3 child tags which contain information XMod uses at run-time to invoke your class.