tdl-manakin-training-2009-09.pdf

125
Customizing DSpace / Manakin TDL Training September 21st, 2009 Steven D. Williams University of Texas Libraries University of Texas at Austin Monday, September 21, 2009

Upload: luilas

Post on 18-Jan-2016

7 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: TDL-manakin-training-2009-09.pdf

Customizing DSpace / Manakin

TDL TrainingSeptember 21st, 2009

Steven D. WilliamsUniversity of Texas LibrariesUniversity of Texas at Austin

Monday, September 21, 2009

Page 2: TDL-manakin-training-2009-09.pdf

Outline

1. Model & Concepts

2. Configure DSpace

3. Submission to DSpace

4. Manakin: Introduction

5. Manakin: Style Tier

6. Introduction to XSL

7. Manakin: Theme Tier

Monday, September 21, 2009

Page 3: TDL-manakin-training-2009-09.pdf

What is DSpace?

Store Content

Manage Content

Distribute Content

Monday, September 21, 2009

Page 4: TDL-manakin-training-2009-09.pdf

Model & Concepts

1Monday, September 21, 2009

Page 5: TDL-manakin-training-2009-09.pdf

DSpace data model

Monday, September 21, 2009

Page 6: TDL-manakin-training-2009-09.pdf

DSpace data model

Community

Item

Bundle

Bitstream

Bitstream

Bundle

Bitstream

Metadata(Dublin Core)

Collection

Community

Item

Bundle

Bitstream

Bitstream

Bundle

Bitstream

Metadata(Dublin Core)

Collection

Monday, September 21, 2009

Page 7: TDL-manakin-training-2009-09.pdf

PracticalLet us pause at this point and ...

- Look at the DSpace user interface- Investigate the data model 1

Monday, September 21, 2009

Page 8: TDL-manakin-training-2009-09.pdf

DSpace Architecture

Monday, September 21, 2009

Page 9: TDL-manakin-training-2009-09.pdf

Item lifecycle

Ingest

Batch import

Web-based submission

Published

Accessible over the web

Withdrawn

Hidden from view

Expunge

Permanently removed

Monday, September 21, 2009

Page 10: TDL-manakin-training-2009-09.pdf

Bitstreams&

formats

Bitstream formats

MIME types

File extensions

Support levels

Supported

Known

Unsupported

Monday, September 21, 2009

Page 11: TDL-manakin-training-2009-09.pdf

Metadata

Descriptive Metadata

Qualified Dublin Core

Limited expansion to other formats

Administrative Metadata

Internal access control

Structural Metadata

Bundles & bitstreams

Monday, September 21, 2009

Page 12: TDL-manakin-training-2009-09.pdf

Registry

Metadata Registry

Approved fields

Multiple ‘schemas’

Format Registry

Approved file formats

Support levels

Browser support

Monday, September 21, 2009

Page 13: TDL-manakin-training-2009-09.pdf

Handles

Persistent identifier

Communities

Collections

Items

Format:

prefix

identifier

hdl:1721.123/4567http://hdl.handle.net/1721.123/4567

Monday, September 21, 2009

Page 14: TDL-manakin-training-2009-09.pdf

E-People&

groups

Individual users

Authenticated

Password

LDAP

Shibboleth

others...

Groups of E-People

Monday, September 21, 2009

Page 15: TDL-manakin-training-2009-09.pdf

Authorizations

Role

Several actions

Upon a single object

Responsibility

Privilege

Individual actions

Upon a single object

Grant the ability to perform a specific action over an object

Monday, September 21, 2009

Page 16: TDL-manakin-training-2009-09.pdf

Authorizations

Community:ADD / REMOVE

Collection:ADD / REMOVEDEFAULT_ITEM_READDEFAULT_BITSTREAM_READCOLLECTION_ADMINWORKFLOW_STEP_1WORKFLOW_STEP_2WORKFLOW_STEP_3

Item:ADD / REMOVE / READ / WRITE

Bundle:ADD / REMOVE

Bitstream:READ / WRITE

Monday, September 21, 2009

Page 17: TDL-manakin-training-2009-09.pdf

Crosswalks

Export metadata into various formats

Current crosswalks:

DIM

MODS

DC & QDC

Custom XSLT

Monday, September 21, 2009

Page 18: TDL-manakin-training-2009-09.pdf

OAI-PMH

Open Archive Initiative’s Protocol for Metadata Harvesting

Export metadata

Uses crosswalk plugins

Google scholar

Oaister

Monday, September 21, 2009

Page 19: TDL-manakin-training-2009-09.pdf

Media filters

Plugins for file type support

Current filters

Adobe PDF

HTML, Text

Microsoft Word

JPEG

Branded Preview

Monday, September 21, 2009

Page 20: TDL-manakin-training-2009-09.pdf

Configuring DSpace

2Monday, September 21, 2009

Page 21: TDL-manakin-training-2009-09.pdf

Topics

The Basics

Authentication

Search & Browse

Plugins

XMLUI

Monday, September 21, 2009

Page 22: TDL-manakin-training-2009-09.pdf

The basics

Java Property file

name = value

Use slash (“/”) to continue to the next line

Monday, September 21, 2009

Page 23: TDL-manakin-training-2009-09.pdf

The basics

DSpace installation directory

Base URL

Host name

Site name

Database settings

Connection pool parameters

SMTP mail server

File storage

Monday, September 21, 2009

Page 24: TDL-manakin-training-2009-09.pdf

Authentication

Shibboleth

Password

LDAP

Stackable

plugin.sequence.org.dspace.authenticate.AuthenticationMethod = \ org.dspace.authenticate.PasswordAuthentication, \ org.dspace.authenticate.LDAPAuthentication

Monday, September 21, 2009

Page 25: TDL-manakin-training-2009-09.pdf

Browse

User exploration

Four fixed browse indexes

Title

Subject

Author

Date

Monday, September 21, 2009

Page 26: TDL-manakin-training-2009-09.pdf

Browse Configuration

Default DSpace browse indexes:

webui.browse.index.date = dc.date.issuedwebui.browse.index.author = dc.contributor.*webui.browse.index.title = dc.titlewebui.browse.index.subject = dc.subject.*

Monday, September 21, 2009

Page 27: TDL-manakin-training-2009-09.pdf

Search

Targeted retrieval

Unlimited number of search indexes

Manakin tweak to add index labels

Monday, September 21, 2009

Page 28: TDL-manakin-training-2009-09.pdf

Browse Configuration

Default DSpace search indexes:search.index.1 = author:dc.contributor.*search.index.2 = author:dc.creator.*search.index.3 = title:dc.title.*search.index.4 = keyword:dc.subject.*search.index.5 = abstract:dc.description.abstractsearch.index.6 = author:dc.description.statementofresponsibilitysearch.index.7 = series:dc.relation.ispartofseriessearch.index.8 = abstract:dc.description.tableofcontentssearch.index.9 = mime:dc.format.mimetypesearch.index.10 = sponsor:dc.description.sponsorshipsearch.index.11 = identifier:dc.identifier.*search.index.12 = language:dc.language.iso

Monday, September 21, 2009

Page 29: TDL-manakin-training-2009-09.pdf

Advanced search syntax

texasSearch for ‘texas’ in any field or extracted text

(texas)Same as above

(title:texas)Search for ‘texas’ in the title

(title:texas) AND (author:john)Search for items with ‘texas’ in the title and john as an author

(title:texas) AND ((author:john) OR (author:leggett))Search for items with ‘texas’ in the title and either john or leggett as an author

Monday, September 21, 2009

Page 30: TDL-manakin-training-2009-09.pdf

Plugins

Media Filter

Help to full-text index content or perform automated format conversion

Checksum checker

Item export and download settings

OAI-PMH

Sword

Others

Monday, September 21, 2009

Page 31: TDL-manakin-training-2009-09.pdf

XMLUI

Submission process settings

Thumbnail creation and sizing

Item export and download settings

Browse and sort display configuration

Recent submissions and RSS Feeds

Sitemap

Others

Monday, September 21, 2009

Page 32: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Login to your DSpace instance- Create an administrator account- Review the DSpace config file. 1

Monday, September 21, 2009

Page 33: TDL-manakin-training-2009-09.pdf

Submission to DSpace

3Monday, September 21, 2009

Page 34: TDL-manakin-training-2009-09.pdf

Workflow

Originating from

Web-based submission

Batch ingest

Task pool

3-step process

Separate review at each step

Monday, September 21, 2009

Page 35: TDL-manakin-training-2009-09.pdf

Ingest process

External SIPBatch

Importer

Web-based

Submission

In Progress

Submission

Workflow

Item

InstallerItem in

DSpace

DSpace Ingest Process

Monday, September 21, 2009

Page 36: TDL-manakin-training-2009-09.pdf

Workflow steps

Unfinished

Submission

Workflow

Step 1

Workflow

Step 2

Available in

DSpace

Workflow

Step 3

Submit Accept Accept

Edit Metadata

Reject Reject

Accept

Edit Metadata

Monday, September 21, 2009

Page 37: TDL-manakin-training-2009-09.pdf

Batch item import

Command line import

Directory structure

“contents” file

“dublin_core.xml” file

“handle” file

bitstreams files

Monday, September 21, 2009

Page 38: TDL-manakin-training-2009-09.pdf

Simple contents file

dissertation.pdfdublin_core.xml bundle:METADATAlicense.txt bundle:LICENSE

Examples:

<filename>

or

<filename> <tab> bundle:<bundle name>

Format:

Monday, September 21, 2009

Page 39: TDL-manakin-training-2009-09.pdf

Complex contents file

-r -s 1 -f dissertation.pdf-r -s 2 -f dublin_core.xml bundle:METADATA-r -s 1 -f license.txt bundle:LICENSE

Examples:

-r -s <#> -f <filename> <tab> bundle:<bundle name>

Where:-s <#> Which ‘asset store’ to store the file-f <filename> The bitstream’s file namebundle:<bundle name> (Optional) Which bundle to place in

Format:

Monday, September 21, 2009

Page 40: TDL-manakin-training-2009-09.pdf

Import command

[dspace]/bin/import

-a Add new items to DSpace-c <coll> Which collection to add them to-e <email> Existing user who is adding these items-m <path> Create a log file for this import-s <path> Location of the import files

-t Do not run, just test the import for validity-h Print command line options and their description

Monday, September 21, 2009

Page 41: TDL-manakin-training-2009-09.pdf

Import command (examples)

Examples

[dspace]/bin/import -a -c 123456789/2 -e [email protected] -m /path/to/import.map -s /path/to/import

-a Add new items to DSpace-c <coll> Which collection to add them to-e <email> Existing user who is adding these items-m <path> Create a log file for this import-s <path> Location of the import files

Monday, September 21, 2009

Page 42: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Create a Community and Collection- Batch import metadata and assets 1

Monday, September 21, 2009

Page 43: TDL-manakin-training-2009-09.pdf

Web-basedsubmission

Interface for the user:

Provide metadata

Upload the item

Review submission

Accept distribution license

Limited configurability

Customize metadata

DSpace / Manakin 1.5

Monday, September 21, 2009

Page 44: TDL-manakin-training-2009-09.pdf

Submission Steps

The submission configuration file controls the steps followed by a user to submit to a collection.

Location: [dspace]/config/item-submission.xml

Default submission steps

Initial Questions -> Describe -> Upload -> Verify -> License -> Complete

Monday, September 21, 2009

Page 45: TDL-manakin-training-2009-09.pdf

Structure of Item-submission.xml

<item-submission><submission-map><name-map collection-handle=”default” submission-name=”traditional” /><name-map collection-handle=”123456789/2” submission-name=”revolution” />

</submission-map>

<submission-definition><submission-process name=”traditional”>...<!-- Step definition -->

</submission-process></submission-definitions>

</item-submission>

Monday, September 21, 2009

Page 46: TDL-manakin-training-2009-09.pdf

Submission Input Forms

The forms used for description metadata fields can be modified.

Location: [dspace]/config/input-forms.xml

The input-forms.xml consist of 3 elements

<form-map> Map a form to a collection (handle)

<form-definitions> Individual forms and their metadata input fields

<form-value-pairs> Selected list referenced in the form.

Monday, September 21, 2009

Page 47: TDL-manakin-training-2009-09.pdf

Structure of Input-form.xml

<input-forms><form-map><name-map collection-handle=”default” form-name=”traditional” /><name-map collection-handle=”123456789/2” form-name=”revolution” />

</form-map>

<form-definition><form name=”traditional”><page number=”1”>...

</form></form-definitions>

</input-forms>

Monday, September 21, 2009

Page 48: TDL-manakin-training-2009-09.pdf

The Form Input-types

onebox: single box for short text

twobox: a pair of single boxes

textarea: a text area

name: a pair of text boxes for personal names

date: at least a year must be provided

dropdown: a selection list referencing a <form-value-pairs>

qualdrop-value: selection list combined with a single text box

Monday, September 21, 2009

Page 49: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Customize submission steps - Modify submission fields 1

Monday, September 21, 2009

Page 50: TDL-manakin-training-2009-09.pdf

Manakin

4Monday, September 21, 2009

Page 51: TDL-manakin-training-2009-09.pdf

What is Manakin?

Interface framework

Modular

Extendable

Tiered

A new interface to DSpace

Monday, September 21, 2009

Page 52: TDL-manakin-training-2009-09.pdf

What can Manakin

do?

Modify Look-and-Feel

Brand Content

Visualize Metadata

Provide Modularity

Monday, September 21, 2009

Page 53: TDL-manakin-training-2009-09.pdf

Tiers

1. Style Tier

Create simple themes

XHTML + CSS

2. Theme Tier

Create complex themes

XSL + XHTML + CSS

3. Aspect Tier

Add new features

Cocoon + Java

Monday, September 21, 2009

Page 54: TDL-manakin-training-2009-09.pdf

ApacheCocoon

Web development framework

Pipeline-based architecture

SAX-based XML

Modular components

Generators

Transformers

Serializers

Monday, September 21, 2009

Page 55: TDL-manakin-training-2009-09.pdf

Cocoon’s Pipeline Model

Transformer X

<doc>

<x/>

<y/>

</doc>

Transformer Y

SAX

Serializer

Cocoon PipelineSitemap

sitemap defines the pipeline

Generator

<doc>

<z/>

<x/>

</doc>

<doc>

<z/>

</doc>

Monday, September 21, 2009

Page 56: TDL-manakin-training-2009-09.pdf

Three components

Aspects

Themes

DRI Schema

Monday, September 21, 2009

Page 57: TDL-manakin-training-2009-09.pdf

Structural overview

Monday, September 21, 2009

Page 58: TDL-manakin-training-2009-09.pdf

DRI Schema

Digital Repository Interface

Metadata elements

METS, MODS, QDC, DIM

Extendable to other metadata formats

Structural elements

TEI (light) to transform XML

Abstract representation of a repository page

Theme B

Monday, September 21, 2009

Page 59: TDL-manakin-training-2009-09.pdf

DRI SchemaAbstract representation

of a repository page

Theme B

document

options

structural

elements

metadata

elements

body meta

Based upon TEI Native metadata formats:

METS, MODS, DIM...

Monday, September 21, 2009

Page 60: TDL-manakin-training-2009-09.pdf

Aspects

Applied to all pages

Interact with the repository

“Aspect Chain”

Input DRI

Output DRI

Implement a set of related features

Aspect 1 Aspect 2 Aspect 3 Theme B

Monday, September 21, 2009

Page 61: TDL-manakin-training-2009-09.pdf

Aspects

Core Aspects:

Artifact Browser

E-Person

Submission

Administrative

Possibilities:

Shopping cart

Specialized searching

Customized workflow

Implement a set of related features

Aspect 1 Aspect 2 Aspect 3 Theme B

Monday, September 21, 2009

Page 62: TDL-manakin-training-2009-09.pdf

Aspects

Self contained packages

Java source code

Javascript flow scripts

XML ConfigurationImplement a set of related features

Aspect 1 Aspect 2 Aspect 3 Theme B

Monday, September 21, 2009

Page 63: TDL-manakin-training-2009-09.pdf

Themes

Defines how the repository looks

May apply to:

A single page

All pages in a collection

All pages in a community

The whole repository

Stylize content into a particular look-and-feel

Aspect 1 Aspect 2 Aspect 3 Theme B

Monday, September 21, 2009

Page 64: TDL-manakin-training-2009-09.pdf

Themes

Self contained packages

XSL stylesheets

CSS stylesheets

Images

Static resourcesStylize content into a

particular look-and-feel

Aspect 1 Aspect 2 Aspect 3 Theme B

Monday, September 21, 2009

Page 65: TDL-manakin-training-2009-09.pdf

Putting it all together

Content Generation

ArtifactBrowser

Eperson Submission Theme B

Style Application

<document>

<body/>

<options/>

<meta/>

</document>

Monday, September 21, 2009

Page 66: TDL-manakin-training-2009-09.pdf

Putting it all together

Content Generation

ArtifactBrowser

Eperson Submission Theme B

Style Application

<document>

<body>

<div>

<head> Viewing an item </head>

<includeSet>

<objectInclude source="hdl:12345/23"/>

</includeSet>

</div>

</body>

<options/>

<meta>

...

<objectMeta>

<object identifier="hdl:12345/23"/>

.... METS document for item ...

</object>

</objectMeta>

</meta>

</document>

Monday, September 21, 2009

Page 67: TDL-manakin-training-2009-09.pdf

Putting it all together

Content Generation

ArtifactBrowser

Eperson Submission Theme B

Style Application

<document>

<body>

...

</body>

<options> ...

<list n="account">

<item xref="/logout"> logout </item>

<item xref="/profile"> Profile </item>

</list>

</options>

<meta> ...

<userMeta> ... </userMeta>

<objectMeta>

<object identifier="hdl:12345/23"/>

.... METS document for item ...

</object>

</objectMeta>

</meta>

</document>

Monday, September 21, 2009

Page 68: TDL-manakin-training-2009-09.pdf

Putting it all together

Content Generation

ArtifactBrowser

Eperson Submission Theme B

Style Application

<document>

<body> ... </body>

<options> ...

<list n="account">

<item xref="/logout"> logout </item>

<item xref="/profile"> Profile </item>

<item xref="/submissions"> Submissions </item>

</list>

</options>

<meta> ...

<userMeta> ... </userMeta>

<objectMeta>

<object identifier="hdl:12345/23"/>

.... METS document for item ...

</object>

</objectMeta>

</meta>

</document>

Monday, September 21, 2009

Page 69: TDL-manakin-training-2009-09.pdf

Putting it all together

Content Generation

ArtifactBrowser

Eperson Submission Theme B

Style Application

<html>

<head> ... </head>

<body>

<div>

<h1> viewing an item </h2>

<table>

... The item's metadata ...

</table>

</div>

</div>

<li>

<li><a href="/logout"> Logout </li>

<li><a href="/profile"> Profile </li>

<li><a href="/submissions"> Submissions </li>

</li>

</div>

</body>

</html>

Monday, September 21, 2009

Page 70: TDL-manakin-training-2009-09.pdf

Style Tier

5Monday, September 21, 2009

Page 71: TDL-manakin-training-2009-09.pdf

Tiers

1. Style Tier

XHTML + CSS

Create simple themes

2. Theme Tier

XSL + XHTML + CSS

Create complex themes

3. Aspect Tier

Cocoon + Java

Add new features

Monday, September 21, 2009

Page 72: TDL-manakin-training-2009-09.pdf

Create a theme

1. Create a theme

2. Install your theme

3. Style with CSS

4. Overview

Getting Started

Monday, September 21, 2009

Page 73: TDL-manakin-training-2009-09.pdf

Create a theme

Text

1. cd [tomcat]/webapps/xmlui/themes

2. mkdir [your theme]

3. cp -r template/* [your theme directory]

4. cd [your theme directory]

5. mv template.xsl [your theme directory].xsl

Copy Theme Template

Monday, September 21, 2009

Page 74: TDL-manakin-training-2009-09.pdf

Create a theme

Text

<map:component-configurations> <global-variables>

<theme-path>[Your theme directory]</theme-path> <theme-name>The [Your theme name] template</theme-name> </global-variables> </map:component-configurations>

Sitemap Path & Name

Note: The theme path is the directory name of your theme. The theme name is the name you assign the theme and only used to describe the theme.

Monday, September 21, 2009

Page 75: TDL-manakin-training-2009-09.pdf

Create a theme

Text

<!-- Step3: Transformation to XHTML-->

<map:transform src=”[Your theme name].xsl”/>

Sitemap Transformation

Note: The XSL document allows for more custom themes during the transformation of the DRI (Direct Rendering Infrastructure) document to XHTML.

Monday, September 21, 2009

Page 76: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Create a theme 1Monday, September 21, 2009

Page 77: TDL-manakin-training-2009-09.pdf

Install a theme

1. Edit Manakin config file

2. Name your theme

3. Attach your theme to a handle or regular expression

4. Save changes and restart Tomcat

Register your theme

Monday, September 21, 2009

Page 78: TDL-manakin-training-2009-09.pdf

Install a theme

Text

Navigate to and open config file.

1. cd [press the Enter key]

2. cd dspace/config

4. pico xmlui.xconf

Edit Manakin config file

Monday, September 21, 2009

Page 79: TDL-manakin-training-2009-09.pdf

Install a theme

Text

Register a theme as the main theme<themes> <theme name=“[Your theme name as registered in theme sitemap]” regex=“.*” path=“[Your theme path as registered in theme sitemap]/ ”/></themes>

Register a theme as a handle theme<themes> <theme name=“[Your theme name as registered in theme sitemap]” handle=“123456789/2” path=“[Your theme path as registered in theme sitemap]/ ” /></themes>

Register theme: edit Manakin config file

Monday, September 21, 2009

Page 80: TDL-manakin-training-2009-09.pdf

Install a theme

Text

1. Save changes: “Ctrl O” to save in Pico

2. Restart Tomcat

• [tomcat]/bin/shutdown.sh

• [tomcat]/bin/startup.sh

3. Your theme is installed

4. Save your theme to source!

• dspace-source/dspace-xmlui/dspace-xmlui-webapp/src/main/webapp/themes

Edit Manakin config file

Monday, September 21, 2009

Page 81: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Install a theme 1Monday, September 21, 2009

Page 82: TDL-manakin-training-2009-09.pdf

Styling withCSS

Location of CSS files

Register CSS in Sitemap and target browsers

Use the CSS declarations already in the DRI Document

Monday, September 21, 2009

Page 83: TDL-manakin-training-2009-09.pdf

Styling with CSS

Text

1. CSS files are stored in [your theme directory]/lib folder.

2. Create new CSS files for specific browsers.

3. Add only the differences to browser specific CSS files.

Edit/Maintain CSS files

Monday, September 21, 2009

Page 84: TDL-manakin-training-2009-09.pdf

Styling with CSS

Text

<sitemap><pipelines>

<!-- Theme variables --><component-configurations>

....</component-configurations>

<pipeline>

<!-- Static content --><match pattern="themes/*/**">

<read src="{2}"/></match> <!-- Aspect content --><match pattern="**">

....

</match></pipeline>

</pipelines></sitemap>

<!-- Step 1: Generate the DRI page --><generate type="file" src="cocoon://DRI/{1}"/> <!-- Step 2: Add page metadata --><select type="browser">

<when test="explorer7"><transform type="IncludePageMeta">

<parameter name="stylesheet.screen#1" value="style.css"/><parameter name="stylesheet.screen#2" value="style-ie.css"/> <parameter name="theme.path" value="{global:theme-path}"/><parameter name="theme.name" value="{global:theme-name}"/>

</transform></when><otherwise>

<transform type="IncludePageMeta"><parameter name="stylesheet.screen" value="style.css"/> <parameter name="theme.path" value="{global:theme-path}"/><parameter name="theme.name" value="{global:theme-name}"/>

</transform></otherwise>

</select>

Monday, September 21, 2009

Page 85: TDL-manakin-training-2009-09.pdf

Styling with CSS

Text

Common browsers to target <!-- Step 2: Add page metadata --><map:select type="browser">

<map:when test="explorer6">...</map:when>

<map:when test="explorer7">...</map:when>

<map:when test="explorer8">...</map:when>

<map:when test="safari2">...</map:when>

<map:when test="safari3">...</map:when><map:otherwise>...

Monday, September 21, 2009

Page 86: TDL-manakin-training-2009-09.pdf

Styling with CSS

Text

1. ds-main: main wrapper around all declarations

2.ds-header: Page header including logo, title

3.ds-trail: Page breadcrumb

4.ds-user-box: User access and profile

5.ds-body: Main content

6.ds-options: Navigation

7.ds-footer: Footer

Common DRI CSS Declarations

Monday, September 21, 2009

Page 87: TDL-manakin-training-2009-09.pdf

Themeoverview

Sitemap

The glue that binds

Reference components

Is configurable

XSL Document

Transforms DRI to HTML

CSS

Styles the resulting HTML

Components

Monday, September 21, 2009

Page 88: TDL-manakin-training-2009-09.pdf

Theme overview

Monday, September 21, 2009

Page 89: TDL-manakin-training-2009-09.pdf

Practical Let us pause at this point and ...

- Stylize a theme using CSS- Set a browser specific style sheet in your sitemap 1

Monday, September 21, 2009

Page 90: TDL-manakin-training-2009-09.pdf

Introduction to XSL

6Monday, September 21, 2009

Page 91: TDL-manakin-training-2009-09.pdf

What is XSL?

eXtensible Stylesheet Language

Transform XML documents into new XML documents

XSL is encoded in XML

XSL officially adopted by W3C

Monday, September 21, 2009

Page 92: TDL-manakin-training-2009-09.pdf

Target

Document

XSL

Stylesheet

XSLT

Processor

XML

SourceXSL

architecture

Blue = XML Document

Orange = Software

Changing the stylesheet will produce a different target document

Monday, September 21, 2009

Page 93: TDL-manakin-training-2009-09.pdf

Templates

Match patterns

Until all source elements are processed

Produce XML fragments

All templates together produce the target XML document

Monday, September 21, 2009

Page 94: TDL-manakin-training-2009-09.pdf

Example 1 (architecture)

<figure source=”/images/logo.png”> My university logo

</figure>

<img src=”/images/logo.png” alt=”My university logo”/>

Source Document (DRI)

Target Document (HTML)

XSLT

Processor

<xsl:template match=”figure”> <img src=”{@source}” alt=”{text()}”/>

</xsl:template>

XSL Stylesheet (XSL)

Monday, September 21, 2009

Page 95: TDL-manakin-training-2009-09.pdf

Example 2 (templates)

Text

<xsl:template match=”figure”>

<xsl:if test=”@target”><a href=”{@target}”>

<img src=”{@source}” alt=”{text()}”/></a>

</xsl:if>

<xsl:if test=”not(@target)”><img src=”{@source}” alt=”{text()}”/>

</xsl:if>

</xsl:template>

}}

Target case, imagewith a hyperlink

Normal case,just an image

XSL Stylesheet (XSL)

Monday, September 21, 2009

Page 96: TDL-manakin-training-2009-09.pdf

Example 2 (templates)

<figure source=”/images/logo.png” target=”http://my.university.edu/"> My university logo

</figure>

<a href=”http://my.university.edu/"> <img src=”/images/logo.png” alt=”My university logo”/>

</a>

Target Document (HTML)

Source Document (DRI)

Monday, September 21, 2009

Page 97: TDL-manakin-training-2009-09.pdf

Templateselection

Each template handles a specific element

Match rules used to determine which template is applied

<apply-templates/> finds the next template to match

Monday, September 21, 2009

Page 98: TDL-manakin-training-2009-09.pdf

Example 2 (selection)

Text

<xsl:template match="hi"> <span class=”{@rend}”>

<xsl:apply-templates /> </span></xsl:template>

<xsl:template match="xref"><a href=”{@target}”> <xsl:apply-templates /></a>

</xsl:template>

}}

Template for highlights:bold, italics, underline, etc...

Template for hyperlinks

XSL Stylesheet (XSL)

Monday, September 21, 2009

Page 99: TDL-manakin-training-2009-09.pdf

Example 2 (selection)

<hi rend=”bold”> <xref target=”http://my.university.edu/"> Click me to go to my university home page </xref></hi>

<span class=”bold”><a href=”http://my.university.edu/">

Click me to go to my university home page</a>

</span>

Target Document (HTML)

Source Document (DRI)

Monday, September 21, 2009

Page 100: TDL-manakin-training-2009-09.pdf

XPath

Used for Addressing part of an XML document

navigate XML structure

Path is relative to the root or current node

/document/body/div/head

div/head

Monday, September 21, 2009

Page 101: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div/head

Monday, September 21, 2009

Page 102: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div/*

Monday, September 21, 2009

Page 103: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div[2]/list/item[1]

Monday, September 21, 2009

Page 104: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div[2]/list/item[position() = last()]

Monday, September 21, 2009

Page 105: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div[list]

Monday, September 21, 2009

Page 106: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body/div[list]/head/text()

Monday, September 21, 2009

Page 107: TDL-manakin-training-2009-09.pdf

XPath examples

Text

<body><div>

<head>Welcome</head><p>Welcome to my digital repository.</p><p>Here you can browse the repository for interesting items.</p>

</div><div>

<head>Browse by:</head><list>

<item>Titles</item><item>Authors</item><item>Subjects</item><item>Dates</item>

</list></div>

</body>

body//item

Monday, September 21, 2009

Page 108: TDL-manakin-training-2009-09.pdf

XPath examples

Text

Replace home page welcome text.

<xsl:template match=“//dri:body/dri:div[@n=‘news’]/dri:p[1]”> <text>Your new content</text></xsl:template>

Monday, September 21, 2009

Page 109: TDL-manakin-training-2009-09.pdf

XPath examples

Text

Replace home page search box.

<xsl:template match=“//dri:body/dri:div[@n=‘front-page-search’]”> <text></text></xsl:template>

Monday, September 21, 2009

Page 110: TDL-manakin-training-2009-09.pdf

PracticalLet us pause at this point and ....

- Run an XSL template and experiment with XPath Transform home page welcome text Transform home page search box Transform advanced search box 2

Monday, September 21, 2009

Page 111: TDL-manakin-training-2009-09.pdf

Theme Tier

7Monday, September 21, 2009

Page 112: TDL-manakin-training-2009-09.pdf

Tiers

1. Style Tier

XHTML + CSS

Create simple themes

2. Theme Tier

XSL + XHTML + CSS

Create complex themes

3. Aspect Tier

Cocoon + Java

Add new features

Monday, September 21, 2009

Page 113: TDL-manakin-training-2009-09.pdf

XSL Library

Structural

Main structural components of theme

DIM-Handler

Item, Collection, and Community display types

General-Handler

Information about the file or METS

Monday, September 21, 2009

Page 114: TDL-manakin-training-2009-09.pdf

Base XSL library

/themes/dri2xhtml.xsl

/themes/dri2xhtml/structural.xsl

/themes/dri2xhtml/DIM-Handler.xsl

/themes/dri2xhtml/General-Handler.xsl

Package

Structuraldisplay

Metadatahandlers

Generalhandlers

Monday, September 21, 2009

Page 115: TDL-manakin-training-2009-09.pdf

Complete picture

Monday, September 21, 2009

Page 116: TDL-manakin-training-2009-09.pdf

Structural XSL

Contains

• dri:document

• buildHead

• buildHeader

• buildFooter

• dri:trail

• dri:body

• dri:options

• many others (ex:dri:div, dri:table, dri:p)

Monday, September 21, 2009

Page 117: TDL-manakin-training-2009-09.pdf

Structural XSL

Text

Copy template to [your theme].xsl file for customization.

<xsl:template name="buildFooter"> <!– Customize footer -->

</xsl:template>

dri2xhtml/structural - > [your theme].xsl

Monday, September 21, 2009

Page 118: TDL-manakin-training-2009-09.pdf

PracticalLet us pause at this point and ...

- Customize our theme’s footer by copying the buildFooter template and perform edits. 3

Monday, September 21, 2009

Page 119: TDL-manakin-training-2009-09.pdf

Metadatahandlers

(DIM-Handler)

Display items, collections, and communities

Four display types

1. SummaryList

2. SummaryView

3. DetailedList

4. DetailedView

Monday, September 21, 2009

Page 120: TDL-manakin-training-2009-09.pdf

Metadata Handler

Text

Copy select template to [your theme].xsl file for customization.

<xsl:template match="dim:dim" mode=”itemSummaryView-DIM”><!--Add metadata field dc.subject to item summary-->

<xsl:if test="dim:field[@element='subject'"> …

</xsl:if>

</xsl:template>

dri2xhtml/DIM-handler.xsl - > [your theme].xsl

Monday, September 21, 2009

Page 121: TDL-manakin-training-2009-09.pdf

PracticalLet us pause at this point and ...

- Modify an Item Summary View.. - by copying the itemSummaryView template - adding dc.contributor.photographer - adding dc.title.caption 4

Monday, September 21, 2009

Page 122: TDL-manakin-training-2009-09.pdf

GeneralHandler

Bitstream metadata and link to bitstream

Link to License

Monday, September 21, 2009

Page 123: TDL-manakin-training-2009-09.pdf

Metadata Handler

Text

Copy select template to [your theme].xsl file for customization.

<xsl:template match="mets:fileGrp[@USE=‘CONTENT’]"><!--edit title and display of bitsreams-->

...

</xsl:if>

</xsl:template>

dri2xhtml/General-handler.xsl - > [your theme].xsl

Monday, September 21, 2009

Page 124: TDL-manakin-training-2009-09.pdf

PracticalLet us pause at this point and ...

- Modify a bitstream title display... - Change “View” header to “Download” 5

Monday, September 21, 2009

Page 125: TDL-manakin-training-2009-09.pdf

CustomizingDSpace / Manakin

DSpace 1.5.X

Slide PreparationSeptember 21st, 2009

Steven D. WilliamsUniversity of Texas @ Austin

Scott PhillipsTexas A&M UniversityTexas Digital Library

Monday, September 21, 2009