introduction to xmlui and mirage theming for dspace 3

35
www.atmire.com XMLUI Primer High impact tips and tricks to enhance the DSpace User Experience Bram Luyten

Upload: bram-luyten

Post on 18-Dec-2014

1.435 views

Category:

Technology


6 download

DESCRIPTION

ELAG 2013 Workshop on customizing the DSpace XMLUI Mirage interface. The workshop first explores what can be changed in CSS, exploring the different functions of the style.css, base.css and reset.css files. It then highlights where all of these files can be found and where you need to deploy your own customizations. Digging down an additional layer, it is explained how XSL can be modified to remove or change entire blocks of functionality on a page. The key learning here is that you can alter the representation of whatever comes in through the DSpace DRI using XSL. However, if you need to include additional data or other DSpace info, you have to make sure that it appears in the DRI first, before you can start transforming it with XSL.

TRANSCRIPT

Page 1: Introduction to XMLUI and Mirage Theming for DSpace 3

www.atmire.com

XMLUI PrimerHigh impact tips and tricks to enhance the

DSpace User Experience

Bram Luyten

Page 2: Introduction to XMLUI and Mirage Theming for DSpace 3

WHAT WE WON’T BE DOING

Page 3: Introduction to XMLUI and Mirage Theming for DSpace 3

THIS SHOULD BE MORE LIKE

Page 4: Introduction to XMLUI and Mirage Theming for DSpace 3

WHERE DO WE START?

http://downloads.gosquared.com/help_sheets/07/CSS%20Help%20Sheet.pdf

Page 5: Introduction to XMLUI and Mirage Theming for DSpace 3

WHAT HAPPENS IN MIRAGE CSS?

Page 6: Introduction to XMLUI and Mirage Theming for DSpace 3

WITHOUT STYLE.CSS

Page 7: Introduction to XMLUI and Mirage Theming for DSpace 3

STYLE.CSS TAKES CARE OF

DIV width, height, percentages

Font weights & relative sizes

Colours

Some images

Page 8: Introduction to XMLUI and Mirage Theming for DSpace 3

WITHOUT STYLE.CSS

Page 9: Introduction to XMLUI and Mirage Theming for DSpace 3

STRIPPING DOWN EVEN FURTHER REMOVING BASE.CSS

Page 10: Introduction to XMLUI and Mirage Theming for DSpace 3

WAIT?

The browser should by itself know how to render basic elements, such as lists, right?

Page 11: Introduction to XMLUI and Mirage Theming for DSpace 3

RESET.CSS REMOVES ALL BROWSER INFLUENCEWITHOUT RESET.CSS (IN CHROME):

Page 12: Introduction to XMLUI and Mirage Theming for DSpace 3

WHERE CAN WE FIND THESE FILES

Original Mirage sourcefiles[dspace-src]/dspace-xmlui/src/main/webapp/themes

Your own themes and local customizations[dspace-src]/dspace/modules/xmlui/src/main/webapp/themes

In your live, deployed DSpace[dspace-install]/webapps/xmlui/themes

Page 13: Introduction to XMLUI and Mirage Theming for DSpace 3

MAKING YOUR OWN THEME

Copy & Rename the Mirage folder to MyTheme from the original source to your local theme customizations dir.

Rename MyTheme/Mirage.xsl to MyTheme/MyTheme.xsl

Rename global variables Mirage to MyTheme in MyTheme/sitemap.xmap

Page 14: Introduction to XMLUI and Mirage Theming for DSpace 3

TELL DSPACE TO START USING YOUR THEME

<themes> section in /dspace/config/xmlui.xconf

Page 15: Introduction to XMLUI and Mirage Theming for DSpace 3

CHANGING PAGE STRUCTURE

http://www.mulberrytech.com/quickref/XSLT_1quickref-v2.pdf

Page 16: Introduction to XMLUI and Mirage Theming for DSpace 3

BASIC CONCEPT

Information pulled from the database in Java classes gets represented in XML and goes to a chain of transformations before eventually being delivered as XHTML to the end user

Page 17: Introduction to XMLUI and Mirage Theming for DSpace 3

DISSECTING THE DSPACE PAGES INTO PIECES

Page 18: Introduction to XMLUI and Mirage Theming for DSpace 3

WHAT DOES THE XHTML TELL US

XHTML = the final end product of the XML pipeline

Page 19: Introduction to XMLUI and Mirage Theming for DSpace 3

PIECES OF THE HOMEPAGE

ds-body ds-options

buildHeader

Page 20: Introduction to XMLUI and Mirage Theming for DSpace 3

THE DRI DOCUMENT

DRI = Digital repository interface

Page elements that are not in the DRI are either added by the theme or by aspects. Examples: scripts, css, ...

Page 21: Introduction to XMLUI and Mirage Theming for DSpace 3

DRI - BODY

The DIV ids tell us which aspect is responsible for putting this part into the DRI

Page 22: Introduction to XMLUI and Mirage Theming for DSpace 3

DRI - OPTIONS

The DIV ids tell us which aspect is responsible for putting this part into the DRI

Page 23: Introduction to XMLUI and Mirage Theming for DSpace 3

HOW XSL OPERATES ON DRI CONTENT

Page 24: Introduction to XMLUI and Mirage Theming for DSpace 3

WHERE TO LOOK FROM HERE?

Theme XSL

We want to change the final output of something already in DRI

Aspect sitemaps and Java Code

We want to put something new into the DRI or change the way how something is represented in DRI.

The first question is always:

Is the thing I want to affect already in the DRI or not?

Page 25: Introduction to XMLUI and Mirage Theming for DSpace 3

POP QUIZ

What are the two strategies for removing the Browse element from the menu ?

Page 26: Introduction to XMLUI and Mirage Theming for DSpace 3

ANSWER

1. Prevent in the XSL that the DRI content makes it into the final XHTML

2. Ensure that the element doesn’t get in the DRI to begin with

Page 27: Introduction to XMLUI and Mirage Theming for DSpace 3

DISABLING THIS IN XSL

MyTheme.XSL reveals which stylesheets get applied

Note that older themes Reference, Kubrick and classic refer to different xsl’s.

Page 28: Introduction to XMLUI and Mirage Theming for DSpace 3

NAVIGATION.XSL

Limit which templates get applied after building the search box.

<xsl:apply-templates select="*[not(@id='aspect.viewArtifacts.Navigation.list.browse')]"/>or

<xsl:apply-templates select="*[not(@n='browse')]"/>

Page 29: Introduction to XMLUI and Mirage Theming for DSpace 3

PREVENT FROM GETTING INTO DRI

from DRI

aspect.ViewArtifacts.Navigation.browse

Remove in aspect Java Classes

dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/.../Navigation.java

Search for addList(“browse”) to see all occurrences

Page 30: Introduction to XMLUI and Mirage Theming for DSpace 3

REMOVE IN ASPECT JAVA CLASS EXAMPLE

dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/viewArtifacts/Navigation.java

Page 31: Introduction to XMLUI and Mirage Theming for DSpace 3

WAIT .. AM I NOT DOING TOO MUCH INTRUSIVE CHANGES?

All of the files you change for your own theme will end up in your customization directory and NOT in the official source code files.

Maven builds will tie them together

Page 32: Introduction to XMLUI and Mirage Theming for DSpace 3

WHAT IF THE CHANGE IS WANT TO MAKE IS NOT IN THE DRI?

Theme related static components including the header and footer are added by a particular XSL.

Page 33: Introduction to XMLUI and Mirage Theming for DSpace 3

THE BIG PICTURE

Page 34: Introduction to XMLUI and Mirage Theming for DSpace 3

THIS IS ALL FOR NOW