Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.2
  • Version 2.0
  • Version 1.2
  • Version 1.2
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorial
      • Introduction
      • 1. Understanding Lenya
      • 2. Installing Lenya
      • 3. Anatomy of the Pipeline
      • 4. Editing in Lenya
      • 5. Custom Navigation in Lenya
      • 6a. Mod Proxy and Lenya
      • 6b. Mod Proxy and Lenya
    • How-To
      • FAQ
      • New Publication
      • Deploy Publication
      • Look and Feel
      • Custom Resource Type
      • Adding Mime Types
      • Site Navigation
      • LDAP Authentication
      • CMS Menus
      • CMS Screens
      • Search Publications
      • External Data
      • Unit Tests
    • Components
      • Access Control
        • Basic Terms
        • Access Controllers
        • Access Controller Resolvers
        • Authenticators
        • Authorizers
        • Policies and Policy Managers
        • Accreditable Managers
        • SSL Encryption
      • Authoring
        • Adding a new document creator
        • Image Upload
        • OpenOffice
      • Deployment
        • Proxying
      • Editors
        • HTML Form Editor
        • HTML One Form Editor
        • Bitflux Editor
        • Kupu
        • Xopus
      • Layout
        • Navigation
        • XHTML templating
        • Serving static resources
        • Lenya Menubar
      • Publication
        • PageEnvelopeModule
        • Site tree
      • Resource Types
        • Resource Types
      • Revision Control
        • Revision Controller
        • RCML
        • Check In
        • Check Out
        • Revisions
        • Rollback
      • Repository
        • WebDAV Servers
      • Search
        • Searching with Lucene
      • URI Handling
        • URI Parametrizer
        • URI Scheme
        • Usecases
      • Asset Management
        • Asset Management
      • Link Management
        • Link Management
      • Meta Data
        • Meta Data Handling
      • Multilingual Documents
        • Multilingual Document Handling
      • Tasks
        • The Task Concept
        • Defining Tasks
        • The TaskAction
        • Scheduling a Task
        • Included tasks
          • AntTask
          • DefaultFilePublisher
          • StaticHTMLExporter
          • MailTask
        • Developing Tasks
      • Workflow
        • Terms
        • The State Machine
        • Configuration
        • Implementation
      • Site Management
        • Archive
        • Copy
        • Deactivate
        • Delete
        • Delete the trash
        • Move
        • Move Up/Down
        • Rename
        • Restore
    • Miscellaneous
      • Namespaces
      • Reserved Names
      • XInclude Processor
    • 1.2 API (Javadoc)

Current Event

Meeting Bad Säckingen 2009

Built with Apache Lenya

Xopus

Table of Contents
  • About Xopus
  • Demo
  • Configuration
  • Saving via POST
  • Exit Xopus
  • Making a page editable with Xopus: Schemas, Views (XSLT) and Menus
  • Things to watch out for
    • Check your Internet Explorer cache settings
    • Check your local.build.properties
    • Check your schema files
    • Check your CSS files
    • Missing preparexinclude.xsl

About Xopus

Xopus is a browser based validating in-place wysiwyg XML editor. It uses Javascript, XML Schema and XSLT. At this time, it only works on Internet Explorer. If you need a cross-platform solution, take a look at BXE. Note that Xopus is not open source, but a commerical product by Q42.

Demo

There is an online XOPUS demo available. You need Internet Explorer 5.5 or newer to view the demo.

Configuration

Lenya is expecting an @XOPUS:CONTEXT@ (e.g. Xopus-2.1.66) directory within your @XOPUS:PATH@ (e.g. webapps/ROOT) directory. @XOPUS:CONTEXT@ and @XOPUS:PATH@ are configured within your local.build.properties (xopus.context resp. xopus.path). The path is relative to usecase.xmap.

Saving via POST

To enable saving via POST, one needs to modify $XOPUS/xopusPlugins/datadriver.js as follows


    // Save data START
    alert('Save XML via POST');
    var result = Application.sendXML(doc, 'POST', name);

    switch (result.status)
    {
      case 200:
        //OK
        var resultXML = result.responseXML;
        alert('XML saved');
        return;
      case -1:
        alert('Error while saving ' + name + ':\n\n' + result.responseText);
        break;
      default:
        alert('Server responded not ok while saving ' + name + ':\n\nstatus:' + result.status + '\nmessage: ' + resul
t.responseText);
    }
    // Save data END

You may change the text of the alerts by something else.

Exit Xopus

To exit Xopus one needs to modify $XOPUS/xopusPlugins/cmsdriver.js as follows


  getExitURL: function(path)
  {
    exitURL = path.substring(0, path.indexOf('?'));
    alert('Exit to: ' + exitURL);
    return exitURL;
  },

You may replace the text of the alert by something else.

Making a page editable with Xopus: Schemas, Views (XSLT) and Menus

Xopus needs an XML Schema for validation and an XSLT to view the document. The Schemas and XSLTs need to be located at:


$PUBLICATION/config/doctypes/schemas/$DOCTYPE.xsd
$PUBLICATION/lenya/xslt/xopus/$DOCTYPE.xsl

You might want to use Trang to generate XML Schemas.

Editing with Xopus is implemented as a usecase. One can add a menu item as follows:


<item uc:usecase="xopus" uc:step="open" href="?doctype=$DOCTYPE">Edit&#160;with&#160;Xopus</item>

In addition, you may want to study the oscom publication which has an Xopus integration example, as well as the root xopus.xmap, the xopus.xmap in the oscom publication, and the section in usecase.xmap pertaining to xopus. This will help you understand how the integration was done (which admittedly is a bit clunky as it predates many Lenya concepts).

Things to watch out for

Check your Internet Explorer cache settings

Make sure that the page is loaded from scratch everytime you visit it, because otherwise you'll always see a cached version. This cached version will be saved if you click on 'save' in Xopus.

Check your local.build.properties

Your variable settings could look like this:


  xopus.context=Xopus-2.1.72   root directory for all Xopus files
  xopus.path=../../ROOT        relative path from usecase.xmap to Xopus root
                               directory

Check your schema files

I had troubles with schemas including other schema files. You have to insert a separate pipeline for this kind of architecture. Unfortunately I couldn't figure out if I had to put this matcher in '$PUBLICATION/publication-sitemap.xmap' or elsewhere. I ended up using one and only one schema file for a specific doctype.

Check your CSS files

You have to provide a stylesheet for Xopus in '$PUBLICATION/lenya/xslt/xopus/$DOCTYPE.xsl'. If you use a *.css file to control layout and style of the XML file displayed by Xopus, you'll have to insert a pipeline matcher in '$PUBLICATION/publication-sitemap.xmap':


  <map:pipeline>
    <map:match pattern="**/xopus.css">
      <map:read src="resources/shared/css/xopus.css" mime-type="text/css"/>
    </map:match>
  </map:pipeline>

Missing preparexinclude.xsl

If Xopus complains that it cannot find $XOPUS/xopusPlugins/preparexinclude.xsl, then add the following at that location:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                       xmlns:x="http://www.w3.org/2001/XInclude"
                       xmlns:xlink="http://www.w3.org/1999/xlink"
                       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                       >

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Copyright © 1999-2009 The Apache Software Foundation. All rights reserved.