incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r581899 - in /incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components: content/default.jsp content/jsp/ page/default.jsp page/jsp/
Date Thu, 04 Oct 2007 13:45:39 GMT
Author: fmeschbe
Date: Thu Oct  4 06:45:38 2007
New Revision: 581899

URL: http://svn.apache.org/viewvc?rev=581899&view=rev
Log:
SLING-37 Better default handling for script selection
 (Adapt the sample project to the new script resolution algorithm)

Added:
    incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/default.jsp
    incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/default.jsp
Removed:
    incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/jsp/
    incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/jsp/

Added: incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/default.jsp
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/default.jsp?rev=581899&view=auto
==============================================================================
--- incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/default.jsp
(added)
+++ incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/content/default.jsp
Thu Oct  4 06:45:38 2007
@@ -0,0 +1,38 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+--%>
+<%@page session="false" %>
+<%@page import="org.apache.sling.sample.*" %>
+<%@page import="org.apache.sling.component.*" %>
+<%@page import="java.util.*" %>
+<%@taglib prefix="sling" uri="http://jackrabbit.apache.org/taglibs/sling/1.0" %>
+
+<%-- Ensure the presence of the ComponentAPI objects --%>
+<sling:defineObjects contentClass="SampleContent"/>
+
+<h1><%= content.getTitle() %></h1>
+<p><%= content.getText() %></p>
+<table border="1" cellpadding="3" cellspacing="0">
+<%
+	Enumeration ci = renderRequest.getChildren(content);
+	while (ci.hasMoreElements()) {
+		Content child = (Content) ci.nextElement();
+		%><tr><td><sling:include content="<%= child %>" /></td></tr><%
+	}
+%>
+</table>
\ No newline at end of file

Added: incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/default.jsp
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/default.jsp?rev=581899&view=auto
==============================================================================
--- incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/default.jsp
(added)
+++ incubator/sling/trunk/sample/src/main/resources/SLING-INF/content/sample/components/page/default.jsp
Thu Oct  4 06:45:38 2007
@@ -0,0 +1,62 @@
+<%--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+--%>
+<%@page session="false"%>
+<%@page import="org.apache.sling.sample.*"%>
+<%@page import="org.apache.sling.component.*"%>
+<%@taglib prefix="sling"
+	uri="http://jackrabbit.apache.org/taglibs/sling/1.0"%>
+
+<%-- Ensure the presence of the ComponentAPI objects --%>
+<sling:defineObjects contentClass="SamplePage" />
+
+<%-- This is a top level component, so we have to draw the html and head tags --%>
+<html>
+<head>
+<title><%= content.getTitle() %></title>
+</head>
+<body>
+<h1><%= content.getTitle() %></h1>
+
+<table style="border: none; height: 90%; ">
+	<tr valign="top">
+		<td style="padding-top: 20px; padding-right: 20px; background-color: cornsilk">
+		<%
+		final String naviRootPath = "/sample/content";
+		Content naviRoot = new Content() {
+		    public String getComponentId() {
+		        return Navigation.class.getName();
+		    }
+		    public String getPath() {
+		        return naviRootPath;
+		    }
+		};
+		%> <sling:include content="<%= naviRoot %>" />
+		</td>
+		<td>
+		<table>
+			<tr>
+				<td><sling:include path="content" /></td>
+			</tr>
+		</table>
+		</td>
+	</tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message