Τo see what you will end up with, have a look here.

Our goal is to create a table-based view, similar to the detail view for an item in Mirage theme (dspace 1.7.0). Having any presented element aligned allows for easier browsing of the presented data.A table based summary view with a flash video player

We need to edit item-view.xsl we ended up with at Flash streaming in Dspace. Our end result will be a table view, followed by a “more” link and a video player (if one should be loaded). Start by recognizing what needs to be altered. The necessary changes need to happen in two templates. The first template is

    <xsl:template match="dim:dim" mode="itemSummaryView-DIM">
        <div>
            <xsl:call-template name="itemSummaryView-DIM-fields"/>
        </div>
    </xsl:template>

and the other one is

<xsl:template name="itemSummaryView-DIM-fields">
        <xsl:param name="clause" select="'1'"/>
        <xsl:param name="phase" select="'even'"/>
     ...
</xsl:template>

Let’s go on, and go through what needs to be done. Pretty simple actually. Template  itemSummaryView-DIM will create the <table> markup, followed by a toggle link. It will also display a flash video player. Aside the table markup, the latter two reside in  itemSummaryView-DIM-fields. They get moved over, and the rest of the code will me transformed to create table rows for our table in itemSummaryView-DIM.

 

Step 1 – move the toggle link and flash video player

The first template is transformed to the one below.  The call to  itemSummaryView-DIM-fieldsis enclosed in a table markup since  the called  template will output table rows.

<xsl:template match="dim:dim" mode="itemSummaryView-DIM">  
        <table width="675">
            <xsl:call-template name="itemSummaryView-DIM-fields"/>
        </table>

        <!-- toggle detailed view -->
        <xsl:if test="$ds_item_view_toggle_url != ''">
            <p>
                <a>
                    <xsl:attribute name="href">
                        <xsl:value-of select="$ds_item_view_toggle_url"/>
                    </xsl:attribute>
                    <i18n:text>xmlui.ArtifactBrowser.ItemViewer.show_full</i18n:text>
                </a>
            </p>
        </xsl:if>

        <!-- Video player row -->
        <xsl:if test="dim:field[@element='relation' and @qualifier='uri']">
            <xsl:variable name="fileURL" select="./dim:field[@element='relation' and @qualifier='uri']"/>
            <div>

                <object id="FLVScrubber" width="675" height="432" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">
                    <param name="movie" value="/themes/Mirage/lib/FLVScrubber.swf"/>
                    <param name="bgcolor" value="#000000"/>
                    <param name="allowScriptAccess" value="sameDomain"/>
                    <param name="allowFullScreen" value="true"/>
                    <param name="flashVars" value="file=http://orw.lib.ucy.ac.cy/stream/{$fileURL}.flv"/>
                    <embed src="/themes/Mirage/lib/FLVScrubber.swf" bgcolor="#000000" width="675" height="432" name="FLVScrubber"
                           allowScriptAccess="sameDomain"
                           allowFullScreen="true"
                           flashVars="file=http://orw.lib.ucy.ac.cy/stream/{$fileURL}.flv"
                           type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"/>
                </object>
            </div>
        </xsl:if>

    </xsl:template>

Step 2 – creating table rows

We are creating a 2-columns table. We will be using  the dc.identifier.uri as an example. Our original xml section read

          <!-- identifier.uri row -->
            <xsl:when test="$clause = 3 and (dim:field[@element='identifier' and @qualifier='uri'])">
                <div class="simple-item-view-other">
                    <span class="bold">
                        <i18n:text>xmlui.dri2xhtml.METS-1.0.item-uri</i18n:text>:
                    </span>
                    <span>
                        <xsl:for-each select="dim:field[@element='identifier' and @qualifier='uri']">
                            <a>
                                <xsl:attribute name="href">
                                    <xsl:copy-of select="./node()"/>
                                </xsl:attribute>
                                <xsl:copy-of select="./node()"/>
                            </a>
                            <xsl:if test="count(following-sibling::dim:field[@element='identifier' and @qualifier='uri']) != 0">
                                <br/>
                            </xsl:if>
                        </xsl:for-each>
                    </span>
                </div>
                <xsl:call-template name="itemSummaryView-DIM-fields">
                    <xsl:with-param name="clause" select="($clause + 1)"/>
                    <xsl:with-param name="phase" select="$otherPhase"/>
                </xsl:call-template>
            </xsl:when>

Your new xml section should read as below to create a table row with two columns. The bold part is needed to create alternating color rows, like the detail-view table.

          <!-- identifier.uri row -->
            <xsl:when test="$clause = 3 and (dim:field[@element='identifier' and @qualifier='uri'])">
                <tr>
                   <xsl:attribute name="class">    <xsl:text>ds-table-row </xsl:text>    <xsl:value-of select="$phase" /> </xsl:attribute>
                    <td>
                        <i18n:text>xmlui.dri2xhtml.METS-1.0.item-uri</i18n:text>
                    </td>
                    <td>
                        <xsl:for-each select="dim:field[@element='identifier' and @qualifier='uri']">
                            <a>
                                <xsl:attribute name="href">
                                    <xsl:copy-of select="./node()"/>
                                </xsl:attribute>
                                <xsl:copy-of select="./node()"/>
                            </a>
                            <xsl:if test="count(following-sibling::dim:field[@element='identifier' and @qualifier='uri']) != 0">
                                <br/>
                            </xsl:if>
                        </xsl:for-each>
                    </td>
                </tr>
                <xsl:call-template name="itemSummaryView-DIM-fields">
                    <xsl:with-param name="clause" select="($clause + 1)"/>
                    <xsl:with-param name="phase" select="$otherPhase"/>
                </xsl:call-template>
            </xsl:when>

Do note that you need to do the same for each element displayed in a table row.

 

Step 3 – new i18n variables

Last thing to do is to add some new i18n variables that did not exist in the original xsl file, for example “Title”. To do this, set out a new var in our xsl file like so <i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>. This needs to be declared in messages.xml since it does not exist. Repeat as necessary for any more strings needed for the left table column.