Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

  1. A user visits an XMLUI page (by clicking a link or button, etc)
  2. Wiki MarkupThat request begins in the root Cocoon {{sitemap.xmap}} (located at {{\[xmlui\]/sitemap.xmap}}). This is the main entry point for *all requests*
    1. Within that sitemap, various URL path matching takes place. If the request is to download a document, that document is returned immediately.
    2. Wiki MarkupHowever, in many cases, the request is for a page within the XMLUI. In this scenario, the root sitemap.xmap will load the {{\[xmlui\]/themes/themes.xmap}} file, which controls all the Themes.
        unmigrated-wiki-markup
      1. The {{themes.xmap}} file will then load all "matching" themes which are configured in your {{\[dspace\]/config/xmlui.xconf}} file (see [#Themes] below).
      2. If more than one theme matches the current URL path, then the first match wins
      3. Once a matching theme is located, that theme's sitemap.xmap file (located in its theme directory) is loaded and processed.
        1. The theme's sitemap.xmap is in charge of actually loading the theme's XSLT, CSS, etc. However, before it does that, you'll notice it makes a call to generate the DRI document for the current page as follows:
          Code Block
          <map:generate type="file" src="cocoon://DRI/{1}"/>
        2. This DRI call generates a brand new, internal Cocoon request. This request is then processed back in the root sitemap.xmap (remember how we said that this sitemap is the main entry point for all requests).
    unmigrated-wiki-markup
  3. Back in the root sitemap, the "DRI/**" call is matched. This causes the {{\[xmlui\]/aspects/aspects.xmap}} file to be loaded. As the name suggests, this file obviously controls all the Aspects.
    1. Wiki MarkupThe {{aspects.xmap}} file will then load all enabled Aspects which are configured in your {{\[dspace\]/config/xmlui.xconf}} file (see [#Aspects] below).
    2. Each aspect is loaded in the order that it appears. However, multiple aspects may be loaded for the same URL path. Remember, aspects can build upon each other (we call this an "aspect chain") as they work together to generate the final DRI document.
    3. When an Aspect is loaded, its sitemap.xmap is loaded & processed
      • Wiki MarkupNOTE: An aspect's sitemap.xmap is actually compiled into the {{dspace-xmlui-api.jar}} file. However, if you have a copy of DSpace source handy, it can be found in: {{\[dspace-src\]/dspace-xmlui/dspace-xmlui-api/src/main/resources/aspects/\[name-of-aspect\]/}}
    4. Each aspect is processed one-by-one (again in the order they are listed in xmlui.xconf). Each aspect may add, remove or change content within the DRI document. After the final aspect is finished processing, the DRI document is complete.
      • HINT: In the XMLUI you can always view the final DRI document by adding "?XML" or "&XML" on to the end of the current URL in your web browser.
  4. Once the final DRI document is complete (all aspects are done processing), the flow will return back to your Theme's sitemap.xmap (remember, this is the same location that triggered the loading of the Aspects in the first place).
  5. At this point, your Theme's sitemap.xmap will continue its processing. Generally speaking, most themes will then perform one or more XSLT transformations (to transform the final DRI document into XHTML). They also may load up one or more CSS files to help stylize the final XHTML.
  6. Finally, once the Theme has completed its processing (remember, only one theme is ever processed for a single request), the final generated XHTML document is displayed to the user.

...

The Manakin user interface is composed of two distinct components: aspects and themes. Manakin aspects are like extensions or plugins for Manakin; they are interactive components that modify existing features or provide new features for the digital repository. Manakin themes stylize the look-and-feel of the repository, community, or collection.unmigrated-wiki-markup

The repository administrator is able to define which aspects and themes are installed for the particular repository by editing the _\[dspace\]/config/xmlui.xconf_ configuration file. The _xmlui.xconf_ file consists of two major sections: Aspects and Themes.

Aspects

The <aspects> section defines the "Aspect Chain", or the linear set of aspects that are installed in the repository. For each aspect that is installed in the repository, the aspect makes available new features to the interface. For example, if the "submission" aspect were to be commented out or removed from the xmlui.xconf, then users would not be able to submit new items into the repository (even the links and language prompting users to submit items are removed). Each <aspect> element has two attributes, name and path. The name is used to identify the Aspect, while the path determines the directory where the aspect's code is located. Here is the default aspect configuration:

...

The interface will automatically determine which file to select based upon the user's browser and system configuration. For example, if the user's browser is set to Australian English then first the system will check if messages_en_au.xml is available. If this translation is not available it will fall back to messages_en.xml, and finally if that is not available, messages.xml.unmigrated-wiki-markup

DSpace XMLUI supplies an English only translation of the interface, which can be found in the XMLUI web application ({{\[dspace\]/webapps/xmlui/i18n/messages.xml}}), after you first build DSpace.

If you wish to add other translations to the system, or make customizations to the existing messages.xml file, you can place them in the following directory:

...

Again, note that you will need to rebuild DSpace for these changes to take effect in your installed XMLUI web application!unmigrated-wiki-markup

For more information about the {{\[dspace-source\]/dspace/modules/}} directory, and how it may be used to "overlay" (or customize) the default XMLUI interface, classes and files, please see: [Advanced Customisation]

Creating a New Theme

Wiki MarkupManakin themes stylize the look-and-feel of the repository, community, or collection and are distributed as self-contained packages. A Manakin/DSpace installation may have multiple themes installed and available to be used in different parts of the repository. The central component of a theme is the sitemap.xmap, which defines what resources are available to the theme such as XSL stylesheets, CSS stylesheets, images, or multimedia files. *
1) Create theme skeleton*
Most theme developers do not create a new theme from scratch; instead they start from the standard theme template, which defines a skeleton structure for a theme. The template is located at: _\[dspace-source\]/dspace-xmlui/dspace-xmlui-webbapp/src/main/webbapp/themes/template_. To start your new theme simply copy the theme template into your locally defined modules directory, _\[dspace-source\]/dspace/modules/xmlui/src/main/webbapp/themes/\[your theme's directory\]/_. *
2) Modify theme variables*
The next step is to modify the theme's parameters so that the theme knows where it is located. Open the _\[your theme's directory\]/sitemap.xmap_ and look for _<global-variables>_

Code Block
<global-variables>
        <theme-path>[your theme's 	directory]</theme-path>
        <theme-name>[your theme's name]</theme-name>
    </global-variables>

Update both the theme's path to the directory name you created in step one. The theme's name is used only for documentation.
3) Add your CSS stylesheets
The base theme template will produce a repository interface without any style - just plain XHTML with no color or formatting. To make your theme useful you will need to supply a CSS Stylesheet that creates your desired look-and-feel. Add your new CSS stylesheets:unmigrated-wiki-markup

_\[your theme's directory\]/lib/style.css_ (The base style sheet used for all browsers)unmigrated-wiki-markup

_\[your theme's directory\]/lib/style-ie.css_ (Specific stylesheet used for internet explorer) *
4) Install theme and rebuild DSpace*
Next rebuild and deploy DSpace (replace <version> with the your current release):

  1. Wiki MarkupRebuild the DSpace installation package by running the following command from your _\[dspace-source\]/dspace/_ directory: unmigrated-wiki-markup
    Code Block
    mvn package
     package
  2. Update all DSpace webapps to _\[dspace\]/webapps_ by running the following command from your _\[dspace-source\]/dspace/target/dspace-\[version\]-build.dir_ directory:
    Code Block
    ant -Dconfig=[dspace]/config/dspace.cfg update
  3. Deploy the the new webapps:
    Code Block
    cp -R /[dspace]/webapps/* /[tomcat]/webapps
  4. Restart Tomcat
    This will ensure the theme has been installed as described in the previous section "Configuring Themes and Aspects".

...

The XMLUI "news" document is only shown on the root page of your repository. It was intended to provide the title and introductory message, but you may use it for anything.unmigrated-wiki-markup

The news document is located at _\[dspace\]/dspace/config/news-xmlui.xml_. There is only one version; it is localized by inserting "i18n" callouts into the text areas. It must be a complete and valid XML DRI document (see Chapter 15).

Its (the News document) exact rendering in the XHTML UI depends, of course, on the theme. The default content is designed to operate with the reference themes, so when you modify it, be sure to preserve the tag structure and e.g. the exact attributes of the first DIV tag. Also note that the text is DRI, not HTML, so you must use only DRI tags, such as the XREF tag to construct a link.

...

The XMLUI user interface supports the addition of globally static content (as well as static content within individual themes).unmigrated-wiki-markup

Globally static content can be placed in the _\[dspace-source\]/dspace/modules/xmlui/src/main/webapp/static/_ directory. By default this directory only contains the default _robots.txt_ file, which provides helpful site information to web spiders/crawlers. However, you may also add static HTML (_\*.html_) content to this directory, as needed for your installation.

Wiki MarkupAny static HTML content you add to this directory may also reference static content (e.g. CSS, Javascript, Images, etc.) from the same _\[dspace-source\]/dspace/modules/xmlui/src/main/webapp/static/_ directory. You may reference other static content from your static HTML files similar to the following:

Code Block
<link href="./static/mystyle.css" rel="stylesheet" type="text/css"/>
  <img src="./static/images/static-image.gif" alt="Static image in /static/images/ directory"/>
  <img src="./static/static-image.jpg" alt="Static image in /static/ directory"/>

...