<jsp:root 
	version="2.0" 
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:portlet="http://java.sun.com/portlet"    
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"    
	xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"     
>
	<jsp:directive.page session="false"/>
	<jsp:directive.page isELIgnored="false"/>
	<fmt:setLocale value=""/>
	<fmt:setBundle basename="samples.webcenter.portlets.wiki.WikiPortlet"/>		
	<portlet:defineObjects/>
	<pt:common.namespace xmlns:pt="http://www.plumtree.com/xmlschemas/ptui/" pt:token="$$TOKEN$$"/>
	
	<c:set var="actionUrl" value="${actionUrl}" scope="request"/>
	<c:set var="uid" scope="request">$$TOKEN$$</c:set>
	<c:set var="def_url" value="http://${pageContext.request.serverName}:${pageContext.request.serverPort}" scope="request"/>
	<c:set var="portlet_path" value="${fn:substringBefore(pageContext.request.requestURI, 'views/init.jspx')}" scope="request"/>
	<c:set var="wiki_template" value="${wiki_template != null ? wiki_template : 'default'}" scope="request"/>
	<c:set var="rte_path" value="${def_url}${pageContext.request.contextPath}/fckeditor/fckeditor.js" scope="request"/>	
	<c:set var="fckEditorPath" value="${def_url}${pageContext.request.contextPath}/fckeditor/" scope="request"/>
	
	<link id="wikiPortlet_css" href="pt://images/plumtree/portal/custom/wcservices/wiki/css/${wiki_template}.css" rel="stylesheet" type="text/css"></link>
	<script type="text/javascript" src="pt://images/plumtree/portal/custom/wcservices/wiki/js/wiki.js"></script>
	
	<script type="text/javascript">
		//<![CDATA[
		var wikiblogPortlet_fckeditorPath = "${fckEditorPath}";
	
		var wikiScriptNode = document.getElementById("wikiPortlet_script");
		if (!wikiScriptNode) {
			var headEl = document.getElementsByTagName("head")[0];
			var wikiScriptNode = document.createElement("script");
			wikiScriptNode.type = "text/javascript";
			wikiScriptNode.id = "wikiPortlet_script";
			headEl.appendChild(wikiScriptNode);
		}			

		var rteScriptNode = document.getElementById("rte_script");
		if (!rteScriptNode) {
			var headEl = document.getElementsByTagName("head")[0];
			var rteScriptNode = document.createElement("script");
			rteScriptNode.type = "text/javascript";
			rteScriptNode.id = "rte_script";
			headEl.appendChild(rteScriptNode);
		}
		
		//linkNode.href = "${css_path}";
		wikiScriptNode.src = "${js_path}";
		rteScriptNode.src = "${rte_path}";
		
		if (${wiki_create == 'true'}) {
			wikiPortlet_doCreate("${uid}");
		}
		//]]>
	</script>	
</jsp:root>