Fixes for several loader functions in Foundry

git-svn-id: https://svn.libreccm.org/ccm/trunk@2980 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-11-21 09:04:39 +00:00
parent b5f0c78969
commit c3115830e8
4 changed files with 47 additions and 39 deletions

View File

@ -4,11 +4,11 @@
<!--
<application name = "" page-class=""></application>
-->
<application name="admin" internal="true">admin-layout.xml</application>
<application name="login" internal="true">admin-layout.xml</application>
<application name="admin" origin="internal">admin-layout.xml</application>
<application name="login" origin="internal">admin-layout.xml</application>
<application name="navigation" class="portalPage">portal-workspace.xml</application>
<application name="navigation" class="portalGridPage">portal-workspace-grid.xml</application>
<application name="none" class="cms-admin" internal="true">admin-layout.xml</application>
<application name="none" class="cms-admin" origin="internal">admin-layout.xml</application>
<application name="portal">portal-workspace.xml</application>
<default>default-layout.xml</default>
</applications>

View File

@ -483,20 +483,22 @@
</foundry:doc>
<xsl:template name="foundry:process-template">
<xsl:param name="template-file" as="xs:string"/>
<xsl:param name="internal" as="xs:boolean" select="false()"/>
<xsl:param name="origin" as="xs:string" select="''"/>
<xsl:choose>
<xsl:when test="$internal = true()">
<xsl:apply-templates select="document(foundry:gen-path(
concat('foundry/templates/',
normalize-space($template-file))))"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(foundry:gen-path(
concat('templates/',
normalize-space($template-file))))"/>
</xsl:otherwise>
</xsl:choose>
<xsl:message>
<xsl:value-of select="concat('process-template called with template-file = ', $template-file, ' and origin = ', $origin)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat('using template file: ', foundry:gen-path(
concat('templates/',
normalize-space($template-file)),
$origin))"/>
</xsl:message>
<xsl:apply-templates select="document(foundry:gen-path(
concat('templates/',
normalize-space($template-file)),
$origin))"/>
</xsl:template>
<xsl:template name="foundry:process-title-attribute">

View File

@ -170,13 +170,13 @@
<xsl:when test="string-length($media) &gt; 0">
<link rel="stylesheet"
type="text/css"
href="{foundry:gen-path(concat('styles/', $media, '/', $filename, $origin))}"
href="{foundry:gen-path(concat('styles/', $media, '/', $filename), $origin)}"
media="{$media}" />
</xsl:when>
<xsl:otherwise>
<link rel="stylesheet"
type="text/css"
href="{foundry:gen-path(concat('styles/', $filename, $origin))}" />
href="{foundry:gen-path(concat('styles/', $filename), $origin)}" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

View File

@ -37,38 +37,31 @@
<xsl:template match="bebop:page">
<!--<xsl:variable name="application">
<xsl:choose>
<xsl:when test="./@application">
<xsl:value-of select="./@application"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'none'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>-->
<xsl:variable name="class" select="@class" />
<xsl:variable name="app-layout-template-file"
select="foundry:get-app-layout-template(foundry:get-current-application(),
foundry:get-current-application-class())"/>
<xsl:message>
<xsl:value-of select="concat('app-layout-template-file = ', $app-layout-template-file)"/>
</xsl:message>
<xsl:choose>
<xsl:when test="$app-layout-template-file = ''">
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="'default-layout.xml'"/>
<xsl:with-param name="internal" select="true()"/>
<xsl:with-param name="origin" select="internal"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="$app-layout-template-file"/>
<xsl:with-param name="internal"
select="foundry:app-layout-template-is-internal(foundry:get-current-application(),
foundry:get-current-application-class())"/>
<xsl:with-param name="origin"
select="foundry:app-layout-template-get-origin(foundry:get-current-application(),
foundry:get-current-application-class())"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
@ -144,6 +137,10 @@
<xsl:param name="application" as="xs:string"/>
<xsl:param name="class" as="xs:string"/>
<xsl:message>
<xsl:value-of select="concat('templates.xml path: ', foundry:gen-path('conf/templates.xml'))"/>
</xsl:message>
<xsl:choose>
<xsl:when test="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]">
<xsl:sequence select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]"/>
@ -164,19 +161,28 @@
</xsl:choose>
</xsl:function>
<xsl:function name="foundry:app-layout-template-is-internal" as="xs:boolean">
<xsl:function name="foundry:app-layout-template-get-origin" as="xs:string">
<xsl:param name="application" as="xs:string"/>
<xsl:param name="class" as="xs:string"/>
<xsl:message>
<xsl:value-of select="concat('trying to determine origin for template file for application = ', $application, ' and class = ', $class)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat('using templates file: ', foundry:gen-path('conf/templates.xml'))"/>
</xsl:message>
<xsl:choose>
<xsl:when test="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]">
<xsl:sequence select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]/@internal = 'true'"/>
<xsl:when test="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]
and document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]/@origin">
<xsl:sequence select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]/@origin"/>
</xsl:when>
<xsl:when test="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]">
<xsl:sequence select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]/@internal = 'true'"/>
<xsl:when test="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]
and document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]/@origin">
<xsl:sequence select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]/@origin"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="false()"/>
<xsl:sequence select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>