<style>
  a {behavior: url(#default#AnchorClick);} 

  .FileContent {  
    padding: 10px;
    color: #0e396c;
  }
  
  .FileContent .NavigationContainer {  
    padding-bottom: 5px;
    background: url('/ecmexplorer/skin/images/file/TitleBG1x21.gif') repeat-x top;
    border: 1px solid #cbcbcb;
  }
  
  .FileContent .TopTitle {  
    padding-left: 10px;
    height: 21px; line-height: 21px;
    color: #058ee6; font-weight: bold; 
  }
  
  .FileContent .ECMIframe {
    border: 1px solid #cbcbcb; 
    height: 100% ;
    overflow: auto;
    width: 93.9%;
    margin: 5px;
    background: white;
  }
  
  .FileContent .Content {  
    white-space: normal;
    overflow: auto;
    padding: 0px 10px;
    height: 300px;
  }
  
   .FileContent .Content .TextContent {  
    margin: auto;
  }
  
  .FileContent .ContentDetail {  
    text-align: center;
    overflow: visible;
    padding: 15px 0px;
  }      
</style>
<%
		import org.exoplatform.ecm.webui.utils.Utils;
  def originalNode = uicomponent.getOriginalNode();
  def currentNode = uicomponent.getNode() ; 
  def contentNode = currentNode.getNode("jcr:content") ;
  def mimeType = contentNode.getProperty("jcr:mimeType").getString() ;
  
  public String formatNodeName(String text) {
    return text.replaceAll("'", "\\\\'") ;
  }
  String restContextName = Utils.getRestContextName(uicomponent.getPortalName());  
%>
<div class="FileContent"> 
  <div class="NavigationContainer">       
    <div class="TopTitle">$originalNode.name</div>
    <div class="Content">
      <div class="TextContent">
        <% println "<pre>" + uicomponent.encodeHTML(contentNode.getProperty("jcr:data").getString()) + "</pre>"; %>     
       </div>
    </div>  
  </div> 
  <div class="UIAction">                                          
    <table align="center" class="ActionContainer">  
      <tr>
        <td align="center">
          <a href="javascript:eXo.ecm.ECMUtils.generateWebDAVLink('<%=uicomponent.getWebDAVServerPrefix()%>','<%=uicomponent.getPortalName()%>','<%=restContextName%>','<%=uicomponent.getRepository()%>','<%=uicomponent.getWorkspaceName()%>','<%=formatNodeName(originalNode.getPath())%>','<%=mimeType%>')" class="ActionButton LightBlueStyle">
            <div class="ButtonLeft">
              <div class="ButtonRight">
                <div class="ButtonMiddle">
                  <%=_ctx.appRes("File.view.label.webDAV")%>
                </div>
              </div>
            </div>
          </a>
          <a href="<%=uicomponent.getDownloadLink(currentNode)%>" class="ActionButton LightBlueStyle">
            <div class="ButtonLeft">
              <div class="ButtonRight">
                <div class="ButtonMiddle" title="<%=_ctx.appRes("File.view.label.download")%>">
                  <%=_ctx.appRes("File.view.label.download")%>
                </div>
              </div>
            </div>
          </a>
        </td>
      </tr>          
    </table>
  </div>  
</div>