<%	
	import java.util.List;
	import org.exoplatform.portal.webui.util.Util;
	import org.exoplatform.portal.application.PortalRequestContext;
  import org.gatein.common.text.EntityEncoder;
	import org.exoplatform.commons.utils.HTMLEntityEncoder;
 
	List list = uicomponent.getPath();
	def styleBread = uicomponent.getBreadcumbsStyle();
	
	PortalRequestContext pcontext = Util.getPortalRequestContext();	
	def String portalURI = pcontext.getPortalURI();
		
	def useAJAX = uicomponent.isUseAjax();
%>

<ul class="breadcrumb">
	<li>
		<i class="uiIconTree uiIconLightGray"></i>
	</li>
	
		<%if(list.size() > 0) {
				String note = "";
				for(i in 0 .. list.size()-1) { 
					localPath = list.get(i);							
					String actionLink 
					if(useAJAX)
						actionLink = uicomponent.event("SelectPath", localPath.getId());
					else
						actionLink = portalURI + localPath.getId();	
					EntityEncoder entityEncoder = HTMLEntityEncoder.getInstance();
					String label = entityEncoder.encode(localPath.label) 
					if(i == list.size()-1) note = "active";
		%>
	<li	class="$note">
      <% if (localPath.getId() == null) { %>
         <a href="#">$label</a> 
      <% } else { %>
        <% if (useAJAX) { %>
         <a href="javascript:void(0);" onclick="<%=actionLink%>">$label</a>
        <% } else { %>
         <a href="<%=actionLink%>">$label</a> 
        <% } %>
      <% } %> 																
		<%			
					if(i != list.size()-1) {
		%>
		<i class="uiIconArrowRightMini uiIconLightGray"></i>
	</li>		
		<%	 		 
					}					 
				}
			}
		%>
</ul>