Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

Code Block
languagehtml/xml
<aspects>
        <aspect name="Displaying Artifacts" path="resource://aspects/ViewArtifacts/" />
           <aspect name="Browsing Artifacts" path="resource://aspects/BrowseArtifacts/" />
           <aspect name="Searching Artifacts" path="resource://aspects/SearchArtifacts/" />
           <aspect name="Administration" path="resource://aspects/Administrative/" />
           <aspect name="E-Person" path="resource://aspects/EPerson/" />
           <aspect name="Submission and Workflow" path="resource://aspects/Submission/" />
          <aspect name="Statistics" path="resource://aspects/Statistics/" />
          <aspect name="Original Workflow" path="resource://aspects/Workflow/" />
    </aspects>

A standard distribution of Manakin/DSpace includes eight "core" aspects:

...

  • name (always required)The name attribute is used to document the theme's name.
  • path (always required)The path attribute determines where the theme is located relative to the themes/ directory and must either contain a trailing slash or point directly to the theme's sitemap.xmap file.
  • regex (either regex and/or handle is required)The regex attribute determines which URLs the theme should apply to.
  • handle (either regex and/or handle is required)The handle attribute determines which community, collection, or item the theme should apply to.
    If you use the "handle" attribute, the effect is cascading, meaning if a rule is established for a community then all collections and items within that community will also have this theme apply to them as well. Here is an example configuration:

    Code Block
    languagehtml/xml
    <themes>
            <theme name="Theme 1" handle="123456789/23" path="theme1/"/>
            <theme name="Theme 2" regex="community-list"	path="theme2/"/>
            <theme name="Reference Theme" regex=".*" path="Reference/"/>
        </themes>

    In the example above three themes are configured: "Theme 1", "Theme 2", and the "Reference Theme". The first rule specifies that "Theme 1" will apply to all communities, collections, or items that are contained under the parent community "123456789/23". The next rule specifies any URL containing the string "community-list" will get "Theme 2". The final rule, using the regular expression ".", will match *anything, so all pages which have not matched one of the preceding rules will be matched to the Reference Theme.

...

Manakin 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
languagehtml/xml
<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:

...

Example 1: a single language:

Code Block
languagehtml/xml
<document>
      <body>
        <div id="file.news.div.news" n="news" rend="primary">
            <head> TITLE OF YOUR REPOSITORY HERE </head>
            <p>
                INTRO MESSAGE HERE
                Welcome to my wonderful repository etc etc ...
                A service of <xref target="http://myuni.edu/">My University</xref>
            </p>
        </div>
      </body>
      <options/>
      <meta>
        <userMeta/>
        <pageMeta/>
        <repositoryMeta/>
      </meta>
   </document>

Example 2: all text replaced by references to localizable message keys:

Code Block
languagehtml/xml
<document>
      <body>
        <div id="file.news.div.news" n="news" rend="primary">
            <head><i18n:text>myuni.repo.title</i18n:text></head>
            <p>
                <i18n:text>myuni.repo.intro</i18n:text>
                <i18n:text>myuni.repo.a.service.of</i18n:text>
                <xref target="http://myuni.edu/"><i18n:text>myuni.name</i18n:text></xref>
            </p>
        </div>
      </body>
      <options/>
      <meta>
        <userMeta/>
        <pageMeta/>
        <repositoryMeta/>
      </meta>
    </document>

Adding Static Content

...

Any 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
languagehtml/xml
<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"/>

...