Hi John,

 

This is possibly best done with a full Manakin aspect rather than just at the 
XSLT level, but this little trick seems to work (unfortunately we don’t get 
tokenize() to make our job easier):

 

<xsl:variable name="queryString" 
select="/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='request']...@qualifier='queryString']"/>

<xsl:variable name="p2Param">

   <xsl:choose>

       <xsl:when test="contains($queryString, '&amp;')">

           <xsl:value-of 
select="substring-before(substring-after($queryString,'p2='),'&amp;')"/>

       </xsl:when>

       <xsl:otherwise>

            <xsl:value-of select="substring-after($queryString,'p2=')"/>

        </xsl:otherwise>

</xsl:choose>

</xsl:variable>

 

This should populate $p2Param with the value of the ‘p2’ GET parameter, 
regardless of whether it is the only GET parameter passed, and no matter where 
it appears in $queryString.

 

I’m CC’ing to the list for more input because there might be traps with this 
approach I’m not totally aware of, and without knowing exactly what you’re 
trying to achieve, I’m not sure if we should be looking to do this all at the 
XSLT level. A simple transformer might end up making things a lot easier. (See: 
http://wiki.dspace.org/index.php/Create_a_new_aspect_(Manakin) )

 

Cheers,

 

Kim

 

From: John Preston [mailto:byhisde...@gmail.com] 
Sent: Saturday, 13 June 2009 12:18 a.m.
To: Kim Shepherd
Subject: Re: [Dspace-tech] Adding page with xmlui header and footer

 

Thanks. Thats the starting point I wanted. One other favour, could you give me 
an example of using the queryString qualifier to get at any of the query string 
parameters. So for http://machine/xmlui/123456789/12345?p1=value1&p2=value2 to 
extract p1's value I would use 

select="/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='request']...@qualifier='??']"

John

On Thu, Jun 11, 2009 at 7:11 PM, Kim Shepherd <k...@waikato.ac.nz> wrote:

Hi John,

 

The request element in your page metadata is probably the best place to start 
looking.

 

 This query should help:

 

select="/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='request']...@qualifier='URI']"

 

If someone is visiting http://machine/xmlui/123456789/12345, that’ll return 
“123456789/12345”, for example.

It won’t return GET parameters that might be in the URI, but you can use the 
‘queryString’ qualifier instead of the ‘URI’ qualifier to access those.

 

If you’re looking for DRI metadata, appending ?XML to the end of an address 
while browsing (or &XML if you’re using GET stuff as well) should help, and 
http://www.dspace.org/1_5_2Documentation/ch13.html#N15E41 might help as well.

 

Cheers,

 

Kim

 

--

Kim Shepherd

IRR Technical Specialist

ITS Systems & Development

The University of Waikato

New Zealand

 

DDI +64 7 838 4025

 

 

 

From: John Preston [mailto:byhisde...@gmail.com] 
Sent: Friday, 12 June 2009 8:12 a.m.
To: dspace-tech@lists.sourceforge.net
Subject: [Dspace-tech] Adding page with xmlui header and footer

 

Can someone say how I can trap an arbitrary url, say 
http://machine/xmlui/arbitraryhandle/* using the theme xslt code so that I can 
create a page with the same header and footer as the regular interface, but 
have the body as I need. I figure I need to override the  <xsl:template 
match="dri:document"> and add a if then for a particular url. But how do I 
access the url? 

John

 

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to