#* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *# #* * Use this macro at the top of all of your layout decorations so as * to provide required context objects. *# #macro (defineLayoutObjects) #set($preferedLocale = $JS2RequestContext.locale) #set($rootFragment = $jetspeed.currentFragment) #set($site = $request.getAttribute("org.apache.jetspeed.portalsite.PortalSiteRequestContext")) #set($theme = $request.getAttribute("org.apache.jetspeed.theme")) #set($layoutDecoration = $theme.getDecoration($rootFragment)) #end #* Adds javascript for PortletSelector on HTML *# #macro (includeJavaScriptForHead) #end #* * Returns the full URL for the base of this site. This * can and should be used in the the * of your decoration. *# #macro(BaseHref)${request.scheme}://${request.serverName}:${request.serverPort}${request.contextPath}/#end #* * Returns the correct Content-type string for use within the Content-type * meta tag. *# #macro (ContentType)text/html#if($response.characterEncoding); charset=$response.characterEncoding#end#end #* * Returns the page title string for the current page * *# #macro (PageTitle)$jetspeed.page.getTitle($preferedLocale)#end #* * Returns the site description string for use within the * meta tag *# #macro (PageDescription)$jetspeed.page.getTitle($preferedLocale)#end #* * Returns the site version string for use within the * meta tag *# #macro (SiteVersionTag)$$Id$$ #end #** * Includes all of the stylesheets for this Page's theme. *# #macro (IncludeStylesheets) #foreach($style in $theme.styleSheets) #end #end #* Adds additional style sheets and java script from portlets *# #macro (includeHeaderResource) #acquireHeaderResource() $resourceHeader.getContent() #end #* Adds additional style sheets and java script from portlets - desktop version *# #macro (desktopIncludeDojoHeaderContent) #acquireHeaderResource() $resourceHeader.getNamedContentForPrefix( "header.dojo" ) #end #* Adds additional style sheets and java script from portlets - desktop version *# #macro (desktopIncludeHeaderContent) #acquireHeaderResource() $resourceHeader.getContent() #end #macro (acquireHeaderResource) #if ( ! $resourceHeader ) #if ( $JS2ComponentManager ) #set($resourceHeaderFactory = $JS2ComponentManager.getComponent("org.apache.jetspeed.headerresource.HeaderResourceFactory")) #else #set($resourceHeaderFactory = $jetspeed.getComponent("org.apache.jetspeed.headerresource.HeaderResourceFactory")) #end #set($resourceHeader = $resourceHeaderFactory.getHeaderResouce($JS2RequestContext)) #end #end #* * Returns the base CSS class to use in top level tags *# #macro (BaseCSSClass $_decoration)${_decoration.baseCSSClass}#end #macro (PageBaseCSSClass)#BaseCSSClass($layoutDecoration)#end #** * Returns the fully-qualified path the specified resources using * $decorator *# #macro (GetResource $_decorator $_path)$request.contextPath/$!{_decorator.getResource($_path)}#end #** * Returns the fully-qualified path the specified resources using * the $layoutDecorator that is defined by calling the #defineLayoutObjects() * macro. *# #macro (GetPageResource $_path)#GetResource($layoutDecoration $_path) #end #* Dispalys the standard action bar for this page. *# #macro (PageActionBar) #set($_actions = $layoutDecoration.actions)
#if($_actions.size() >0) #foreach ($_action in $_actions) ${_action.Alt} #end #end
#end #macro(PortletActionBar $_decoration) #set($_actions = $_decoration.actions)
#foreach ($_action in $_actions) ${_action.Alt} #end
#end #macro(PagesMenu) #set($_pages = $site.getMenu("pages").elements) #end #macro(NavigationsMenu) #set($_navigations= $site.getMenu("navigations").elements) #set($_seperatorCount = 0) #end #set($_seperatorCount = $_seperatorCount + 1) #end #end #macro (Breadcrumbs) #set($_breadcrumbs = $site.getMenu("breadcrumbs").elements) #end #macro (int $_variable) #set($_aint=0) #set($_variable=$_aint.valueOf("$_variable")) #end #macro (bool $_variable) #set($_abool=true) #set($_variable=$_abool.valueOf("$_variable")) #end #macro (getProperty $_property $_properties $_name $_default) #set($_value = "") #set($_value = $_properties.getProperty($_name)) #set($_property = $_default) #if($_value != "") #set($_property=$_value) #end #end #macro (getIntProperty $_property $_properties $_name $_default) #getProperty($_property $_properties $_name $_default) #int($_property) #end #macro (getBoolProperty $_property $_properties $_name $_default) #getProperty($_property $_properties $_name $_default) #bool($_property) #end