Upgrade from Xopus 2 to 3

Xopus 3 migration plan

Xopus 3 is not backward compatible with Xopus 2. So in order to upgrade to Xopus 3, the Xopus integration needs to be upgraded as well. This document explains the steps you need to take to upgrade your Xopus 2 integration.

If you have an upgrade subscription you can upgrade free of charge. If you don't have an upgrade subscription you can contact xopussupport@sdl.com for more information about upgrading your license.

Licensing

Xopus 3 uses a license model that is different from the model used for Xopus 2. In Xopus 2, the hostname of the server on which it was licensed to run was embedded in the software. In Xopus 3, there is a license directory that needs to contain a license file for each of the servers on which you run Xopus. You can request license files for your servers at: xopussupport@sdl.com .

Global Configuration

The procedure to start Xopus hasn't changed. You can still use either the xopus.jsscript or a hyperlink to start Xopus.

Xopus 2 had a xopusPlugins directory which contained the global Xopus configuration. The configuration was spread over four JavaScript files.

cmsdriver.js

The cmsdriver.js file contains the settings needed to integrate Xopus into the user interface of a CMS. Most of the CMS driver settings have an equivalent in Xopus 3.

  • dontRedrawNodeValueChanges is obsolete.
  • fastRedraw is always true.
  • Application.setSuppressErrors() is obsolete.
  • Application.setAllowToolbarHide() is obsolete.
  • fixResizableHTMLElements is always true.
  • Application.setStrictValidationMode() has been replaced with the validateSimpleTypes element.
  • Application.setMaxInsertRows() has been replaced with the rows attribute.
  • Application.setMaxInsertColumns() has been replaced with the columns attribute.
  • Application.addLookupType() has been replaced with the lookup element.
  • Application.addNodeIcon() is obsolete.
  • Application.setAllowConfigureToolbar() has been replaced with the allowPersonalisation element.
  • Application.defineLineBreak() has been replaced by setting the role attribute to "linebreak".
  • Application.defineDefaultChild() has been replaced by setting the role attribute to either "paragraph", "tablebody" or "tablecell".
  • Application.showAttributesInInsertMenu() is always set to false.
  • Application.showElementsInContextMenu() is always set to true.
  • Application.defineTableStructure() has been replaced by defining the table roles for all table elements.
  • Application.editDocument() is obsolete.
  • Application.addValidationXSL() is obsolete.
  • Application.setDefaultLanguage() is obsolete.
  • Application.setLanguage() is obsolete.
  • Application.getSymbols() is replaced by Editor.getSymbols.
  • Application.setSymbols() is replaced by Editor.setSymbols.
  • CMSDriver.newDocument() is obsolete.
  • CMSDriver.openDocument() is obsolete.
  • CMSDriver.getHomeURL() is obsolete.
  • CMSDriver.getExitURL() has been replaced with Editor.setExitURL and Editor.getExitURL.
  • CMSDriver.getStandbyURL() is obsolete.
  • CMSDriver.changeToolbarDefinition() has been moved to the xopus/deprecated.js file. There it give access to the Xopus 2 API. This file will be ignored in Xopus 4.

datadriver.js

Most of the DataDriver functions have been moved to the IO object. You can use the IO object in all script files under Xopus control.

schemaextensions.js

SchemaExtensions no longer exists in Xopus 3. However, Xopus 3 has a far more powerful event model. Xopus 2 supported two events: onCreate and onSplit. Xopus 3 supports the following XML manipulation related events:

script.js

In Xopus 2 script.js could be used to create custom code in addition to the code in datadriver.js and cmsdriver.js. Xopus 3 is more flexible and allows you to access the API and configure Xopus from several locations:

  • For the entire Xopus installation in the pathToXopus/config/config.js file, or
  • for a specific Xopus Canvas in files referenced by the javascript element, or
  • in HTML event handlers rendered by the XSL stylesheet.

Per Document Configuration

The configuration of Xopus in HTML pages has changed since Xopus 2. Xopus 3 has an extend XML configuration format that is documented .

Example of configuration in Xopus 2:

<div xopus="true">
 Starting Xopus...
 <xml>
   <pipeline xml="sample.xml" xsd="sample.xsd">
     <view id="defaultView" default="true">
       <transform xsl="sample.xsl"/>
     </view>
     <view id="treeView">
       <transform xsl="../../xopus/media/treeview/tree.xsl"> </transform>
     </view>
   </pipeline>
 </xml>
</div>

The same configuration becomes in Xopus 3:

<div xopus="true">
 Starting Xopus...
 <xml>
   <config version="1.0" xmlns="http://www.xopus.com/xmlns/config">
     <pipeline xml="sample.xml" xsd="sample.xsd">
       <view name="WYSIWYG View">
         <transform xsl="sample.xsl"/>
       </view>
       <view name="Tree View">
         <treeTransform/>
       </view>
     </pipeline>
   </config>
 </xml>
</div>

These are the changes in Xopus 3:

  • Xopus 3 introduces the <config> element. This is the root of the Xopus configuration. You can read more about the <config> element in the documentation .
  • Each <view> element now has name attribute instead of an id. This also means that view names are no longer localized.
  • The first view is now the default view.
  • The tree view can now be included using the <treeTransform> element. This element is an action like <transform> and can be combined with any number of <transform> elements in a view.

Xopus 3 also introduces several new elements in the configuration:

<import>
The import element can be used to import external configuration files.
<javascript>
The javascript element allows execution of JavaScript after Xopus has been started, when the Xopus API is available.
<lookupConfig>
The lookupConfig element replaces the Application.addLookupType call.
<roleMapping>
The roleMapping element allows you to control the behavior of certain nodes in Xopus. Roles define how the table editor works, or whether a node should be inserted using the 'B' toolbar button. Roles also control the rich text paste feature. See the role attribute documentation for an overview of all roles.
<tableEditor>
The tableEditor element controls the table editor interface.
<validation>
The validation element controls the way Xopus handles schema validation for this document.