<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
%>      
<%@page import="org.eclipse.cosmos.internal.dr.ps.common.Configuration"%>
<jsp:useBean id="template" scope="request" class="org.eclipse.cosmos.provisional.dr.ps.common.Template" > 
<jsp:setProperty name="template" property="*"/>
</jsp:useBean> 
<% 
template.setLocale(request.getLocale());
//check installation
Configuration configuration = new Configuration();
String propFile = getServletContext().getRealPath(getServletContext().getInitParameter("COSMOSUI_CONFIGURATION_PATH")+"/configuration.properties");
boolean exists = configuration.load(propFile);
template.initialize(configuration);

if (request.getParameter("page") != null)
	template.setPage(request.getParameter("page"));

%>
<%
	String pageDirect = "install/index.jsp"; 
	if (exists)
		pageDirect = template.getPage()+"/";
%>
<jsp:include page="<%=pageDirect %>" flush="true"/>