<% 
  import org.exoplatform.portal.webui.util.Util;
  import java.util.Locale;
  import org.exoplatform.portal.webui.workspace.UIPortalApplication;
  
  def node = uicomponent.getCurrentNode();
%>

<div class="$uicomponent.id">
<% uiform.begin() %>
	<table class="UIGrid">      	 			
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("validator", "label")%></td>
	    <td>
	      <% 
	        if (node.hasProperty("publication:validator")) {
			      println node.getProperty("publication:validator").getString();
			    }
			  %>
	    </td>
	  </tr>
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("to-workspace", "label")%></td>
	    <td>
	      <% 
	        if (node.hasProperty("exo:publishWorkspace")) {
			      println node.getProperty("exo:publishWorkspace").getString();
			    } 
			  %>
	    </td>
	  </tr>
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("at-location", "label")%></td>
	    <td>
	      <% 
	        if (node.hasProperty("exo:publishPath")) {
			      println node.getProperty("exo:publishPath").getString();
			    }
			  %>
	    </td>
	  </tr>
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("state", "label")%></td>
	    <td>
	      <% 
	        if (node.hasProperty("publication:currentState")) {
	          String value = node.getProperty("publication:currentState").getString();
	          value = value + " " + uicomponent.getLabel("by", "label");
	          value = value + " " + node.getSession().getUserID();
			      println value;
			    }
			  %>
	    </td>
	  </tr>
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("backupWorkspace", "label")%></td>
	    <td>
	      <% 
			    if (node.hasProperty("exo:backupWorkspace")) {
			      println node.getProperty("exo:backupWorkspace").getString();
			    }
			  %>
	    </td>
	  </tr>
	  
	  <tr>
	    <td style="width:25%"><%=uicomponent.getLabel("backupPath", "label")%></td>
	    <td>
	      <% 
			    if (node.hasProperty("exo:backupPath")) {
			      println node.getProperty("exo:backupPath").getString();
			    }
			  %>
	    </td>
	  </tr>
	</table>
	
	
	<div class="UIAction"> 
      <% for (action in uicomponent.getActions()) { 
      		 String actionLabel = uicomponent.getLabel(action, "action");
					 String link = uicomponent.event(action) ;
      %>
      <a href="$link" class="ActionButton LightBlueStyle">
	    $actionLabel
		</a>
      <%}%>    
  </div>
	
	
	<%
  	def hideProcess = uicomponent.getLabel("hide-process-link", "label");
  	def showProcess = uicomponent.getLabel("show-process-link", "label");
  %>
  <div onclick="(function(ele) {
		  										var parent = ele.parentNode;
			  								 	if (parent.className == 'Hide') {
			  								 		parent.className = 'Show';
			  								 		ele.innerHTML = '$showProcess';
			  								 	} else {
			  								 		parent.className = 'Hide'; 
			  								 		ele.innerHTML = '$hideProcess';								 	
			  								 	}
		  							})(this);" style="cursor: pointer; text-align: center; height: 23px; margin: 3px;font-weight:bold;text-decoration:underline;" >
  	$showProcess
  </div>
	<%if (uicomponent.getLinkStateImage(Util.getUIPortal().getAncestorOfType(UIPortalApplication.class).getLocale()) != "") {%>
    <div class="DefaultHide ActionContainer">	
      <div style="margin: auto; width:447px;">
        <img src="<%=uicomponent.getLinkStateImage(Util.getUIPortal().getAncestorOfType(UIPortalApplication.class).getLocale())%>" height="450" width="447" border="0" alt="<%=_ctx.appRes("UITask.title.state-image")%>"/><br />
      </div>
		</div>
	<%}%>  
	
	<%uiform.end()%>
</div>

<style type="text/css">
	.UIWorkflowPublicationViewForm .DefaultHide, .DefaultShow {
		display: none;
	}
	.Hide .DefaultHide {
		display: block;
	}
	.Show .DefaultShow {
		display: block;
	}
</style>
