<%
  import java.net.URLEncoder; 
  import java.util.List;
  import java.util.ArrayList;  
  
  import org.exoplatform.wiki.tree.SpaceTreeNode;
  import org.exoplatform.portal.config.model.PortalConfig;  
  import org.exoplatform.wiki.webui.UIWikiPortlet;
  import org.exoplatform.webui.commons.EventUIComponent.EVENTTYPE;
%>
<% 
 def rcontext = _ctx.getRequestContext();
 String initParam = uicomponent.initParam;
 String initURL = uicomponent.initURL;
 String childrenURL = uicomponent.childrenURL;
 String actionClassName = uicomponent.SELECT_NODE;
 boolean isRenderLink = uicomponent.isRenderLink;
 String baseLink = uicomponent.getBaseLink();
 
 // Reuse the resource bundle
 String retrictedLabel = _ctx.appRes("UIWikiPageInfoArea.label.Restrict").toLowerCase();
 String restrictedTitle = _ctx.appRes("UITreeExplorer.label.restricted-node");
 String restrictedModifyTitle = _ctx.appRes("UITreeExplorer.label.restricted-node-modify");
 
 boolean isEvent = false;
 if (uicomponent.getEventComponent() != null) {
   isEvent = uicomponent.getEventComponent().getType().equals(EVENTTYPE.EVENT);
 }
 String action = uicomponent.event(uicomponent.SELECT_NODE); 
 if (!isEvent){
   action = uicomponent.url(uicomponent.SELECT_NODE);
 }
 
 if (initParam!=null) {
   def requireJs = rcontext.getJavascriptManager().getRequireJS();
   requireJs.require("SHARED/UITreeExplorer", "UITreeExplorer");
   requireJs.addScripts("UITreeExplorer.init('" + uicomponent.id  + "','" + initParam + "',true," + isRenderLink + ",'" + baseLink + "','" + retrictedLabel + "',\"" + restrictedTitle + "\",\""+restrictedModifyTitle+"\"  );");
 } 
%>
	<div class="uiTreeExplorer" id="$uicomponent.id">
		 <a href="$action" class="SelectNode" style="display:none" ></a>
		 <input class="InitURL" type="hidden" value="$initURL" />
		 <input class="ChildrenURL" type="hidden" value="$childrenURL" />		   
	</div>
