Well, I should add a test to make sure the RSS is available.

Add just above the h1 tag
<!-- Test for RSS -->
<xsl:if test="document($RSSMapURL)/rss/channel/item">

Close it just after the </ul>
</xsl:if>

From: Williams, Steven D [mailto:[email protected]]
Sent: Friday, February 26, 2010 8:03 AM
To: [email protected]
Subject: Re: [Dspace-tech] How to get the "Most recent Submission" in the home 
page

I found a solution and thought I would share for feedback. The solution is the 
read the RSS URL in the DRI Document , open the RSS and loop through the 
values. Please look over the following XSL and provide feedback.

<!-- Home Page Recent Submission: Read RSS, pull values and display after the 
search box-->
<!-- Match on from page search -->
<xsl:template match="/dri:document/dri:body/dri:d...@n='front-page-search']">
    <!-- apply rest of front-page-search template -->
    <xsl:apply-templates />
    <!-- Name value of the second feed element for RSS location -->
    <xsl:variable name="RSSMapURL" 
select="concat('cocoon:/',/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='feed'][2])"/>
    <h1 
class="ds-list-head"><i18n:text>xmlui.ArtifactBrowser.CommunityViewer.head_recent_submissions</i18n:text></h1>
    <ul class="ds-artifact-list">
    <!-- Open document, navigate to item and loop -->
    <xsl:for-each select="document($RSSMapURL)/rss/channel/item">
        <li class="ds-artifact-item odd">
        <div class="artifact-description">
        <div class="artifact-title">
            <a>
                <xsl:attribute name="href">
                    <xsl:text>/handle</xsl:text>
                    <!-- Trim RSS URL to use local directory structure for 
improved statistics -->
                    <xsl:variable name="itemurl" 
select="substring(normalize-space(link),22)"/>
                    <xsl:value-of select="$itemurl"/>
                </xsl:attribute>
                <xsl:value-of select="title" />
            </a>
        </div>
        <div class="artifact-info">
            <xsl:value-of select="description" />
            <!-- Trim RSS pubDate value  -->
            <xsl:variable name="dateformated" 
select="substring(normalize-space(pubDate),1,16)"/>
            <xsl:text> (</xsl:text><xsl:value-of select="$dateformated" 
/><xsl:text>)</xsl:text>
        </div>
        </div>
        </li>
    </xsl:for-each>
    </ul>
</xsl:template>

Steve Williams
Webmaster
University of Texas Libraries
University of Texas at Austin

From: Williams, Steven D [mailto:[email protected]]
Sent: Thursday, February 25, 2010 9:22 AM
To: [email protected]
Subject: [Dspace-tech] How to get the "Most recent Submission" in the home page

Hello,

Does anyone now how to place a "Most Recent Submission" on the Dspace home page 
with the Manakin interface?
Steve
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to