Archived / Obsolete Documentation

Documentation in this space is no longer accurate.
Looking for official DSpace documentation? See all documentation

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

There are some items of information which are repeated many times throughout a message catalog. For example, to name an instance of DSpace as, say, OurSpace requires editing most, but not all, of several score of message texts containing the token "DSpace". Similarly, phone numbers and other contact information may be repeated in various places. Tracking these down and changing them all is tedious, and as new message texts are introduced in new releases of DSpace we just track them down again.

Perhaps a better approach would be to substitute values from the DSpace configuration (config/dspace.cfg) into message texts so that common substrings such as the service's name can be configured once and used everywhere. One such modification has been created.

It turns out that some message texts already have parameter tokens for positional parameters provided in the code. In JSPUI localized message texts are inserted into the page using

fmt:message

tags, which may contain

fmt:param

tags to provide the positional parameters. To add named parameter substitution from the configuration, the proposed modification replaces these tags with

dspace:message

and

dspace:param

which have been added to the existing DSpace-specific tag library that is part of the product. This approach requires modifying all 150-odd JSP files which use message texts. The new parameter tokens have the form

\{property.name\}

, where the string between the braces is the name of a property defined in the configuration.

XMLUI uses Cocoon's

i18n

facilities to look up localized message texts. Rather than try to replicate that rather extensive machinery, the proposed modification adds a new pipeline stage to each theme following the

i18n

transformation. A new transformer searches for

<ds:cfg>

elements and replaces them with configuration property values. For example, to insert the value of

dspace.name.short

one would write

<ds:cfg ds:key="dspace.name.short"/>

.

  • No labels