Skip to content

Commit

Permalink
add bookmarks feature, see sassoftware#39 and fix update behaviour at…
Browse files Browse the repository at this point in the history
… collections
  • Loading branch information
sajarix committed Oct 9, 2024
1 parent cd4545b commit 79b6ef0
Show file tree
Hide file tree
Showing 8 changed files with 838 additions and 151 deletions.
63 changes: 44 additions & 19 deletions sas/SASEnvironment/Files/portal/genPortalMain.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@
<!-- Template to handle a reference to a stored process (typically in bookmarks) -->

<xsl:template match="ClassifierMap[@TransformRole='StoredProcess']">
<xsl:param name="showDescription"/>
<xsl:param name="showLocation"/>

<xsl:variable name="stpProgram">
<xsl:for-each select="Trees//Tree">
Expand All @@ -492,15 +494,25 @@
</xsl:variable>

<a><xsl:attribute name="href"><xsl:value-of select="$stpURI"/></xsl:attribute><xsl:value-of select="@Name"/></a><br/>
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- <xsl:value-of select="@Desc"/></span><br/>
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- METASERVER<xsl:value-of select="$stpLocation"/></span>

<xsl:choose>
<xsl:when test="$showDescription = 'true' and @Desc != ''">
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- <xsl:value-of select="@Desc"/></span><br/>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$showLocation = 'true' and $stpLocation != ''">
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- METASERVER<xsl:value-of select="$stpLocation"/></span>
</xsl:when>
</xsl:choose>

</xsl:template>

<!-- Template to handle a reference to a Report (typically in bookmarks)-->

<xsl:template match="Transformation[@TransformRole='Report']">

<xsl:param name="showDescription"/>
<xsl:param name="showLocation"/>
<!-- Unfortunately, to display a report, you need the entire path to it, thus it is required to navigate the parent tree
structure.
-->
Expand All @@ -515,7 +527,9 @@
</xsl:variable>

<xsl:call-template name="reportLink">
<xsl:with-param name="reportSBIPURI" select="$reportSBIPURI"/>
<xsl:with-param name="reportSBIPURI" select="$reportSBIPURI"/>
<xsl:with-param name="showDescription" select="$showDescription"/>
<xsl:with-param name="showLocation" select="$showLocation"/>
</xsl:call-template>

</xsl:template>
Expand Down Expand Up @@ -553,17 +567,17 @@
In this case, we simply want to make a link to the right tab for this referenced portal page.
-->
<xsl:choose>
<xsl:when test="name(.)='PSPortalPage'">
<xsl:when test="name(.)='PSPortalPage'">
<xsl:call-template name="PortalPageLink">
<xsl:with-param name="showDescription" select="$showDescription"/>
<xsl:with-param name="showLocation" select="$showLocation"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="showDescription" select="$showDescription"/>
<xsl:with-param name="showLocation" select="$showLocation"/>
</xsl:apply-templates>
<xsl:with-param name="showDescription" select="$showDescription"/>
<xsl:with-param name="showLocation" select="$showLocation"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="showDescription" select="$showDescription"/>
<xsl:with-param name="showLocation" select="$showLocation"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</td>
Expand Down Expand Up @@ -780,8 +794,9 @@
</xsl:template>

<xsl:template name="reportLink">

<xsl:param name = "reportSBIPURI" />
<xsl:param name = "reportSBIPURI" />
<xsl:param name="showDescription"/>
<xsl:param name="showLocation"/>

<tr>
<td class="portletEntry" valign="top" colspan="2">
Expand All @@ -792,15 +807,25 @@
<xsl:variable name="wrsURI"><xsl:text>/SASWebReportStudio/openRVUrl.do?rsRID=</xsl:text><xsl:value-of select="$wrsProgram"/></xsl:variable>

<a><xsl:attribute name="href"><xsl:value-of select="$wrsURI"/></xsl:attribute><xsl:value-of select="@Name"/></a><br/>

<xsl:variable name="stpLocation">
<xsl:for-each select="Trees//Tree">
<xsl:sort select="position()" order="descending"/>
<xsl:text>/</xsl:text><xsl:value-of select="@Name"/>
</xsl:for-each>
</xsl:variable>
</xsl:variable>

<xsl:choose>
<xsl:when test="$showDescription = 'true' and @Desc != ''">
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- <xsl:value-of select="@Desc"/><br/></span>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$showLocation = 'true' and $stpLocation != ''">
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- METASERVER<xsl:value-of select="$stpLocation"/></span>
</xsl:when>
</xsl:choose>

<span style="white-space: nowrap;" colspan="13" class="treeDescription">- <xsl:value-of select="@Desc"/><br/></span>
<span style="white-space: nowrap;" colspan="13" class="treeDescription">- METASERVER<xsl:value-of select="$stpLocation"/></span>

<!--
<iframe style="overflow: auto;width: 100%" frameborder="0" >
Expand Down
47 changes: 1 addition & 46 deletions sas/SASEnvironment/Files/portlet/edit.bookmarks.get.xslt
Original file line number Diff line number Diff line change
@@ -1,49 +1,4 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<!-- input xml format is the Mod_Request xml format with context information
about the request is in the NewMetadata section
-->

<xsl:template match="/">

<xsl:variable name="id" select="/Mod_Request/NewMetadata/Id"/>

<GetMetadata>
<Metadata>
<PSPortlet PortletType="" Name="">
<xsl:attribute name="Id"><xsl:value-of select="$id"/></xsl:attribute>
</PSPortlet>
</Metadata>
<NS>SAS</NS>
<Flags>20</Flags>
<Options>
<Templates>
<PSPortlet Id="" Name="" PortletType="">
<Groups/>
<PropertySets/>
<Trees/>
</PSPortlet>
<Group>
<Members/>
</Group>
<PropertySet Id="" Name="">
<SetProperties/>
<PropertySets/>
</PropertySet>
<Property Id="" Name="" SQLType="" DefaultValue=""/>
<Extension Id="" Name="" Value=""/>
<Document Id="" Name="" URIType="" URI="" TextRole="" TextType=""/>
<Transformation Id="" Name="" TransformRole="">
<Trees/>
</Transformation>
<Tree Id="" Name="">
<ParentTree/>
</Tree>
</Templates>
</Options>
</GetMetadata>

</xsl:template>

<xsl:include href="SASPortalApp/sas/SASEnvironment/Files/portlet/edit.collection.get.xslt"/>
</xsl:stylesheet>

Loading

0 comments on commit 79b6ef0

Please sign in to comment.