<%
	/**
	 * Created by The eXo Platform SAS
	 * Author : eXoPlatform
	 *          Nguyen The Vinh from ECMS
	 * Feb 23, 2012  
	 */ 
	import org.exoplatform.wcm.webui.Utils;	
	import org.exoplatform.services.wcm.utils.WCMCoreUtils;
	import org.exoplatform.services.wcm.publication.WCMComposer;
	import org.exoplatform.webui.application.WebuiRequestContext;	
	import org.exoplatform.webui.application.portlet.PortletRequestContext;
	import org.exoplatform.wcm.webui.paginator.UICustomizeablePaginator;
	import org.exoplatform.portal.webui.util.Util;
	
	import org.exoplatform.web.url.navigation.NodeURL;
	import org.exoplatform.web.url.navigation.NavigationResource;
	import org.exoplatform.portal.application.PortalRequestContext;

	
	def categorySpan   = "";
	def contentSpan    = "";
  def lblHome = _ctx.appRes("Breadcrumb.label.home");
	def homeSpan       = "";
	def categorySep    = "";
	def contentSep     = "";
	def clsName        = "SubNavigationBranch";
	
	PortalRequestContext portalRequestContext = Util.getPortalRequestContext();
	
	def wid = uicomponent.getId() + _ctx.getRequestContext().getWindowId();
	PortletRequestContext portletRequestContext = WebuiRequestContext.getCurrentInstance();
	def category    = Util.getPortalRequestContext().getRequestParameter("category");
  def contentTitle   = Util.getPortalRequestContext().getRequestParameter("content-title");
  def contentpath = Util.getPortalRequestContext().getRequestParameter("content-id");
  def portletId = portalRequestContext.getNodePath();
  NodeURL nodeURL = portalRequestContext.createURL(NodeURL.TYPE);
  NavigationResource resource = new NavigationResource(portalRequestContext.getSiteType(), portalRequestContext.getSiteName(), portletId);
  nodeURL.setResource(resource);
  def homeURL = nodeURL.toString();
  homeSpan = "<span class=\"SubNavigationBranch\" rel=\"tooltip\" data-placement=\"bottom\" title=\"$lblHome\">$lblHome</span>";
  if (category!=null) {
    homeSpan       = "<span class=\"SubNavigationBranch\"><a href=\"$homeURL\" rel=\"tooltip\" data-placement=\"bottom\" title=\"$lblHome\">$lblHome ></a></span>";
    if (contentTitle==null) cls = "SubNavigationLeaf";
    categorySpan = "<span class=\"" + clsName + "\"> " + category + " > </span>";
    if (contentTitle!=null) {
      contentSpan = "<span class=\"SubNavigationLeaf\"> " + contentTitle + "</span>";
    }
  }
%>
<div id="Breadcrumb$wid" class ="BreadcrumbNavigation">
  <div class="SubNavigation"><%=homeSpan%><%=categorySpan%><%=contentSpan%></div>
</div>