All Downloads are FREE. Search and download functionalities are using the official Maven repository.

initial-content.libs.nt.file.edit.jsp Maven / Gradle / Ivy

<%--
/************************************************************************
 **     $Date: $
 **   $Source: $
 **   $Author: $
 ** $Revision: $
 ************************************************************************/
--%><%
%><%@page session="false" contentType="text/html; charset=utf-8" %><%
%><%@page import="java.io.*,
                  java.net.*,
									javax.jcr.*,
									org.apache.sling.api.resource.*,
                  utils.*" 
%><%
%><%@ taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><%!
%><%
%><%
	String type = "unknown";
	if (currentNode.hasProperty("jcr:content/jcr:mimeType")) {
		String path = currentNode.getPath();
		String mimetype = currentNode.getProperty("jcr:content/jcr:mimeType").getString();

		if      (mimetype.equalsIgnoreCase("plain/text")) type = "text";
		else if (mimetype.equalsIgnoreCase("text/plain")) type = "text";
		else if (mimetype.equalsIgnoreCase("text/html")) type = "text";
		else if (path.endsWith(".jsp")) type = "text";
		else if (path.endsWith(".html"))type = "text";
		else if (path.endsWith(".css")) type = "text";
		else if (path.endsWith(".js"))  type = "text";
		else if (path.endsWith(".png")) type = "image";
	}
%>

	
	
		
		
    
<% if ("text".equalsIgnoreCase(type)) { %>
<% } else if ("image".equalsIgnoreCase(type)) { %>
<% } else { %> <% } %>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy