%--
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.
--%>
<%@ include file="../../../initTemplatesLayoutNormal.jsp" %>
<%-- Check if I am root fragment --%>
<%
/**
* @author Mohan Kannapareddy
*/
LayoutDecoration layoutDecoration = (LayoutDecoration)_myFragment.getDecoration();
// get the layout decoration header file
String headerJSP = layoutDecoration.getHeader();
if (!(headerJSP.startsWith("/")))
{
headerJSP = "/" + headerJSP;
}
pageContext.setAttribute("layoutHeaderJSP", headerJSP, PAGE_SCOPE);
// get the layout decoration footer file
String footerJSP = layoutDecoration.getFooter();
if (!(footerJSP.startsWith("/")))
{
footerJSP = "/" + footerJSP;
}
pageContext.setAttribute("layoutFooterJSP", footerJSP, PAGE_SCOPE);
%>
<%-- ***** BEGIN header.jsp ***** --%>
<%-- ***** END header.jsp ***** --%>
<%-- req paramter to positioner --%>
<%-- BEGIN setup div attributes --%>
<%
int _loopIndex = ((Integer) pageContext.getAttribute("loopIndex", REQ_SCOPE)).intValue();
String _columnFloat = _columnLayout.getColumnFloat(_loopIndex);
pageContext.setAttribute("columnFloat",_columnFloat);
String _columnWidth = _columnLayout.getColumnWidth(_loopIndex);
pageContext.setAttribute("columnWidth",_columnWidth);
%>
<%-- END setup div attributes --%>
<%-- BEGIN Render Fragments in Column --%>
<%
ContentFragment _frag = (ContentFragment) pageContext.getAttribute("frag",PAGE_SCOPE);
LayoutCoordinate _coords = _columnLayout.getCoordinate(_frag);
pageContext.setAttribute("coords",_coords);
int _col = _coords.getX();
pageContext.setAttribute("col",_col);
int _row = _coords.getY();
pageContext.setAttribute("row",_row);
pageContext.setAttribute("lastRow",_columnLayout.getLastRowNumber(_col));
%>
<%-- do the rendering --%>
<%
//inform JPT that we are current.
_jpt.setCurrentFragment(_frag);
%>
<%
// TODO hack alert, we need to do this because PortletDecorationImpl has
// decorator.vm hard coded sigh!
String _tempPath = _frag.getDecoration().getBasePath();
String _portletJSP = _tempPath.substring(0,_tempPath.lastIndexOf('/')) +
"/decorator.jsp";
pageContext.setAttribute("fragTemplateUrl", _portletJSP, PageContext.PAGE_SCOPE);
%>
<%-- END Render Fragments in Column --%>
<%-- ***** BEGIN footer.jsp ***** --%>
<%-- ***** END footer.jsp ***** --%>