You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2014/10/08 07:55:15 UTC
svn commit: r1630010 [1/2] - in /sling/trunk/samples/slingshot: ./
src/main/appended-resources/ src/main/appended-resources/META-INF/
src/main/java/org/apache/sling/sample/slingshot/
src/main/java/org/apache/sling/sample/slingshot/impl/ src/main/resour...
Author: cziegeler
Date: Wed Oct 8 05:55:13 2014
New Revision: 1630010
URL: http://svn.apache.org/r1630010
Log:
Revamp slingshot sample
Added:
sling/trunk/samples/slingshot/src/main/appended-resources/
sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/
sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE (with props)
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java (with props)
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java (with props)
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java (with props)
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/
- copied from r1630005, sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/
- copied from r1629481, sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json
- copied, changed from r1628371, sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view.json (with props)
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/images/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/images/view.jpg (with props)
Removed:
sling/trunk/samples/slingshot/LICENSE
sling/trunk/samples/slingshot/NOTICE
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/ResourceTypeConversionDecorator.java
sling/trunk/samples/slingshot/src/main/resources/META-INF/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/ApacheCon/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/ApacheCon.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/Europe/
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/Europe.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/nodetypes/
Modified:
sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json
sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/tags.json
Added: sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE (added)
+++ sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE Wed Oct 8 05:55:13 2014
@@ -0,0 +1,7 @@
+Uses jquery-breadcrumb from http://phonicuk.com
+jquery-breadcrumb 1.0
+http://code.google.com/p/jquery-breadcrumb/
+
+Copyright 2011 Michael Biggins
+Licenced under Creative Commons Attribution 3.0 Unported (CC BY 3.0)
+http://creativecommons.org/licenses/by/3.0/
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/appended-resources/META-INF/NOTICE
------------------------------------------------------------------------------
svn:eol-style = native
Added: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java (added)
+++ sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java Wed Oct 8 05:55:13 2014
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+package org.apache.sling.sample.slingshot;
+
+
+public abstract class SlingshotConstants {
+
+ /** This is the resource path for the root of our application. */
+ public static final String APP_ROOT_PATH = "/slingshot";
+
+ /** The resource type for a category. */
+ public static final String RESOURCETYPE_CATEGORY = "slingshot/Category";
+
+ /** The resource type for an item. */
+ public static final String RESOURCETYPE_ITEM = "slingshot/Item";
+
+ /** The resource type for a user. */
+ public static final String RESOURCETYPE_USER = "slingshot/User";
+
+ /** The resource type for a comment. */
+ public static final String RESOURCETYPE_COMMENT = "slingshot/Comment";
+
+ /** The resource type for a user. */
+ public static final String RESOURCETYPE_HOME = "slingshot/Home";
+
+ public static final String PROPERTY_TITLE = "title";
+
+ public static final String PROPERTY_DESCRIPTION = "description";
+
+ public static final String PROPERTY_LOCATION = "location";
+
+ public static final String PROPERTY_TAGS = "tags";
+
+ public static final String PROPERTY_USER = "jcr:createdBy";
+
+ public static final String PROPERTY_CREATED = "jcr:created";
+}
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java (added)
+++ sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java Wed Oct 8 05:55:13 2014
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package org.apache.sling.sample.slingshot;
+
+import org.apache.sling.api.resource.Resource;
+
+public abstract class SlingshotUtil {
+
+ public static String getUserId(final Resource resource) {
+ final String prefix = SlingshotConstants.APP_ROOT_PATH + "/";
+
+ String id = null;
+ if ( resource.getPath().startsWith(prefix) ) {
+ final int areaEnd = resource.getPath().indexOf('/', prefix.length());
+ if ( areaEnd != -1 ) {
+ final int userEnd = resource.getPath().indexOf('/', areaEnd + 1);
+ if ( userEnd == -1 ) {
+ id = resource.getPath().substring(areaEnd + 1);
+ } else {
+ id = resource.getPath().substring(areaEnd + 1, userEnd);
+ }
+ }
+ }
+ return id;
+ }
+}
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java?rev=1630010&r1=1630009&r2=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java (original)
+++ sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java Wed Oct 8 05:55:13 2014
@@ -32,6 +32,7 @@ import org.apache.sling.api.resource.Res
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.sample.slingshot.Constants;
+import org.apache.sling.sample.slingshot.SlingshotConstants;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;
@@ -95,7 +96,7 @@ public class AutomaticTaggingService
if ( (tagsValue & 4) == 4 ) {
tags.add("Cool");
}
- mvm.put(Constants.PROPERTY_SLINGSHOT_TAGS, tags.toArray(new String[tags.size()]));
+ mvm.put(SlingshotConstants.PROPERTY_TAGS, tags.toArray(new String[tags.size()]));
try {
resolver.commit();
} catch (final PersistenceException e) {
Added: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java (added)
+++ sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java Wed Oct 8 05:55:13 2014
@@ -0,0 +1,84 @@
+package org.apache.sling.sample.slingshot.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.jackrabbit.api.security.user.Authorizable;
+import org.apache.jackrabbit.api.security.user.UserManager;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ModifiableValueMap;
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.jcr.base.util.AccessControlUtil;
+import org.apache.sling.sample.slingshot.SlingshotConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component
+public class SetupService {
+
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
+ @Reference
+ private ResourceResolverFactory factory;
+
+ private static final String[] USERS = new String[] {"slingshot1", "slingshot2"};
+
+ @Activate
+ protected void activate() throws LoginException, PersistenceException, RepositoryException {
+ logger.info("Setting up SlingShot...");
+ ResourceResolver resolver = null;
+ try {
+ resolver = this.factory.getAdministrativeResourceResolver(null);
+ setupUsers(resolver);
+ setupContent(resolver);
+ } finally {
+ if ( resolver != null ) {
+ resolver.close();
+ }
+ }
+ logger.info("Finished setting up SlingShot");
+ }
+
+ private void setupUsers(final ResourceResolver resolver) throws RepositoryException {
+ final UserManager um = AccessControlUtil.getUserManager(resolver.adaptTo(Session.class));
+ for(final String userName : USERS) {
+ Authorizable user = um.getAuthorizable(userName);
+ if ( user == null ) {
+ logger.info("Creating user {}", userName);
+ um.createUser(userName, userName);
+ }
+ }
+ }
+
+ private void setupContent(final ResourceResolver resolver) throws PersistenceException {
+ final Resource root = resolver.getResource(SlingshotConstants.APP_ROOT_PATH);
+ if ( root != null ) {
+ // fix resource type of root folder
+ if ( !root.isResourceType(SlingshotConstants.RESOURCETYPE_HOME)) {
+ final ModifiableValueMap mvm = root.adaptTo(ModifiableValueMap.class);
+ mvm.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, SlingshotConstants.RESOURCETYPE_HOME);
+ resolver.commit();
+ }
+ final Resource publicResource = root.getChild("public");
+ for(final String userName : USERS) {
+ final String path = SlingshotConstants.APP_ROOT_PATH + "/public/" + userName;
+ final Resource homeResource = resolver.getResource(path);
+ if ( homeResource == null ) {
+ final Map<String, Object> props = new HashMap<String, Object>();
+ props.put(ResourceResolver.PROPERTY_RESOURCE_TYPE, SlingshotConstants.RESOURCETYPE_USER);
+ resolver.create(publicResource, userName, props);
+ resolver.commit();
+ }
+ }
+ }
+ }
+}
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java (added)
+++ sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java Wed Oct 8 05:55:13 2014
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+@Version("1.0")
+package org.apache.sling.sample.slingshot;
+
+import aQute.bnd.annotation.Version;
+
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
------------------------------------------------------------------------------
svn:keywords = author date id revision rev url
Propchange: sling/trunk/samples/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,39 @@
+<%--
+ 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.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+
+ final ValueMap attributes = resource.getValueMap();
+ final String title = ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_TITLE, resource.getName()));
+%><html>
+ <head>
+ <title><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
+ </head>
+ <body class="ui-slingshot-main">
+ <sling:include resource="<%= resource %>" replaceSelectors="trail"/>
+ <h1><%= title %></h1>
+ <hr/>
+ <sling:include resource="<%= resource %>" replaceSelectors="itemlist"/>
+</body>
+</html>
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp Wed Oct 8 05:55:13 2014
@@ -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="java.util.Iterator,
+ java.util.List,
+ org.apache.sling.api.resource.Resource,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><div class="metro ui-slingshot-content">
+ <%
+ int i = 0;
+ final Iterator<Resource> fi = resource.listChildren();
+ while ( fi.hasNext()) {
+ final Resource current = fi.next();
+ if ( current.isResourceType(SlingshotConstants.RESOURCETYPE_ITEM)) {
+ %>
+ <sling:include resource="<%= current %>" replaceSelectors="main"/>
+ <%
+ }
+ }
+ %>
+</div>
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,54 @@
+<%--
+ 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.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
+ org.apache.sling.api.request.ResponseUtil" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><%
+ final ValueMap attr = resource.getValueMap();
+ final String itemTitle = attr.get(SlingshotConstants.PROPERTY_TITLE, resource.getName());
+
+ String imagePath = null;
+ int count = 0;
+ for(final Resource current : resource.getChildren()) {
+ if ( current.isResourceType(SlingshotConstants.RESOURCETYPE_ITEM)) {
+ if ( imagePath == null ) {
+ final Resource imagesResource = resource.getResourceResolver().getResource(current, "images");
+ if ( imagesResource != null ) {
+ for(final Resource imgResource : imagesResource.getChildren()) {
+ imagePath = imgResource.getPath();
+ break;
+ }
+ }
+ }
+ }
+ count++;
+ }
+%><div class="tile double ui-slingshot-clickable" data-link="<%= request.getContextPath() %><%=resource.getPath()%>.html">
+ <div class="tile-content image">
+ <img src="<%= request.getContextPath() %><%=imagePath%>"/>
+ </div>
+ <div class="brand">
+ <span class="label fg-white"><%= ResponseUtil.escapeXml(itemTitle) %></span>
+ <span class="badge bg-orange"><%= count %></span>
+ </div>
+</div>
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,36 @@
+<%--
+ 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.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
+ org.apache.sling.api.request.ResponseUtil" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><div class="comment">
+<%
+ final ValueMap attr = resource.getValueMap();
+ final String title = attr.get(SlingshotConstants.PROPERTY_TITLE, resource.getName());
+ final String description = attr.get(SlingshotConstants.PROPERTY_DESCRIPTION, "");
+ final String userId = attr.get(SlingshotConstants.PROPERTY_USER, "");
+%>
+ <h4><%= ResponseUtil.escapeXml(userId) %> : <%= ResponseUtil.escapeXml(title) %></h4>
+ <p><%= ResponseUtil.escapeXml(description) %></p>
+ <p><%= ResponseUtil.escapeXml(attr.get(SlingshotConstants.PROPERTY_CREATED, "")) %></p>
+</div>
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,30 @@
+<%--
+ 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.slingshot.SlingshotConstants" %><%
+%><link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/jquery-ui.min.css" rel="stylesheet"/>
+ <link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/jquery-ui.structure.min.css" rel="stylesheet"/>
+ <link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/jquery-ui.theme.min.css" rel="stylesheet"/>
+ <link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/metro-bootstrap.min.css" rel="stylesheet"/>
+ <link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/jquery-breadcrumbs.css" rel="stylesheet"/>
+ <link href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/css/slingshot.css" rel="stylesheet"/>
+ <script src="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/js/jquery.js" type="text/javascript" ></script>
+ <script src="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/js/jquery-ui.min.js" type="text/javascript" ></script>
+ <script src="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/js/metro.min.js" type="text/javascript" ></script>
+ <script src="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/js/jquery-breadcrumbs.js" type="text/javascript" ></script>
+ <script src="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/resources/js/slingshot.js"> type="text/javascript" </script>
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,58 @@
+<%--
+ 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="java.util.ArrayList,
+ java.util.List,
+ org.apache.sling.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
+ org.apache.sling.sample.slingshot.SlingshotUtil,
+ org.apache.sling.api.request.ResponseUtil" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><ul id="breadcrumbs" data-home="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/public/<%= request.getRemoteUser() %>.html">
+ <li class="ui-slingshot-clickable" data-link="<%= request.getContextPath() %>/system/sling/logout.html?resource=<%= SlingshotConstants.APP_ROOT_PATH %>.html">Logout</li>
+ <%
+ final ValueMap attributes = resource.getValueMap();
+ // let's create the trail
+ final List<Object[]> parents = new ArrayList<Object[]>();
+ if ( resource.getPath().startsWith(SlingshotConstants.APP_ROOT_PATH) && !resource.isResourceType(SlingshotConstants.RESOURCETYPE_USER)) {
+ Resource parent = resource.getParent();
+ String prefix = "../";
+ boolean continueProcessing = true;
+ do {
+ final ValueMap parentAttr = parent.getValueMap();
+ final String parentName = parent.getName();
+ parents.add(new Object[] {prefix + parentName, ResponseUtil.escapeXml(parentAttr.get(SlingshotConstants.PROPERTY_TITLE, parentName))});
+ if ( parent.isResourceType(SlingshotConstants.RESOURCETYPE_USER) ) {
+ continueProcessing = false;
+ } else {
+ parent = parent.getParent();
+ prefix = prefix + "../";
+ }
+ } while ( continueProcessing);
+ }
+ for(int k=parents.size()-1;k>=0;k--) {
+ %>
+ <li class="ui-slingshot-clickable" data-link="<%= parents.get(k)[0] %>.html"><%= parents.get(k)[1] %></li>
+ <%
+ }
+ %>
+</ul>
+
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,77 @@
+<%--
+ 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.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+
+ final ValueMap attributes = resource.getValueMap();
+ final String title = ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_TITLE, resource.getName()));
+%><html>
+ <head>
+ <title>Welcome to SlingShot!</title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
+ </head>
+
+ <body class="ui-body-app">
+ <%
+ if ( request.getRemoteUser() != null && !request.getRemoteUser().equals("anonymous") ) {
+ %>
+<div class="ui-widget ui-form">
+ <div class="ui-widget-header">
+ <h1>Welcome to SlingShot</h1>
+ </div>
+ <div class="ui-widget-content">
+ <p>Welcome back, <%= request.getRemoteUser() %></p>
+ <p><a href="<%= request.getContextPath() %><%= SlingshotConstants.APP_ROOT_PATH %>/public/<%= request.getRemoteUser() %>.html">Go to your SlingShot home page</a></p>
+ </div>
+ </div>
+ <%
+ } else {
+ %>
+<div class="ui-widget ui-form">
+ <div class="ui-widget-header">
+ <h1>Welcome to SlingShot</h1>
+ </div>
+ <div class="ui-widget-content">
+ <form class="ui-form-form" method="POST" action="<%= request.getContextPath() %><%= resource.getPath() %>.user.html" enctype="multipart/form-data" accept-charset="UTF-8">
+ <input type="hidden" name="_charset_" value="UTF-8" />
+ <input type="hidden" name="resource" value="<%= request.getContextPath() %><%= resource.getPath() %>.user.html" />
+ <span class="ui-form-label">
+ <label for="j_username" accesskey="u">Username</label>
+ </span>
+ <input id="j_username" name="j_username" type="text" class="ui-form-field">
+
+ <span class="ui-form-label">
+ <label for="j_password" accesskey="p">Password</label>
+ </span>
+ <input id="j_password" name="j_password" type="password" class="ui-form-field">
+ <button accesskey="l" class="ui-button ui-form-button ui-form-button-login" type="submit">Go</button>
+ <button accesskey="n" class="ui-button ui-form-button ui-form-button-new" type="button">New Account</button>
+ <button accesskey="n" class="ui-button ui-form-button ui-form-button-help" type="button">Help Me</button>
+ </form>
+ </div>
+ </div>
+ <%
+ }
+ %>
+</body>
+</html>
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,28 @@
+<%--
+ 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.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+
+ response.sendRedirect(request.getContextPath() + SlingshotConstants.APP_ROOT_PATH + "/public/" + request.getRemoteUser() + ".html");
+ return;
+%>
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,56 @@
+<%--
+ 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.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
+ org.apache.sling.api.request.ResponseUtil" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><div class="ui-slingshot-comments">
+<h3>Comments</h3>
+<%
+ final Resource parent = resource.getChild("comments");
+ if ( parent == null ) {
+ %><p>No comments...</p><%
+ } else {
+ int count = 0;
+ for(final Resource c : parent.getChildren()) {
+ %><hr/><sling:include resource="<%= c %>" replaceSelectors="item"/><%
+ count++;
+ if( count >= 10 ) {
+ break;
+ }
+ }
+ }
+ if ( slingRequest.getAuthType() != null ) {
+ %>
+ <hr/><p>Leave a comment...</p>
+ <form method="POST" action="<%= request.getContextPath() %><%=resource.getName() %>/comments/*">
+ <input type="hidden" name="sling:resourceType" value="<%= SlingshotConstants.RESOURCETYPE_COMMENT %>"/>
+ <input type="hidden" name=":order" value="first"/>
+ <input type="hidden" name=":redirect" value="<%= request.getContextPath() %><%=resource.getPath() %>.html"/>
+ <p>Title: <input name="<%= SlingshotConstants.PROPERTY_TITLE %>"/></p>
+ <p>Description: <input name="<%= SlingshotConstants.PROPERTY_DESCRIPTION %>"/></p>
+ <button class="ui-button ui-form-button" type="submit">Add</button>
+ </form>
+ <%
+ }
+%>
+</div>
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp?rev=1630010&r1=1630005&r2=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp (original)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp Wed Oct 8 05:55:13 2014
@@ -16,27 +16,40 @@
specific language governing permissions and limitations
under the License.
--%><%@page session="false" %><%
-%><%@page import="org.apache.sling.api.resource.ResourceUtil,
+%><%@page import="org.apache.sling.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
org.apache.sling.api.resource.ValueMap,
- org.apache.sling.api.request.ResponseUtil"%><%
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants"%><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
- final ValueMap attributes = ResourceUtil.getValueMap(resource);
- final String photoName = ResponseUtil.escapeXml(attributes.get("jcr:title", resource.getName()));
+ final ValueMap attributes = resource.getValueMap();
+ final String title = ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_TITLE, resource.getName()));
+
+ String imagePath = null;
+ final Resource imagesResource = resource.getResourceResolver().getResource(resource, "images");
+ if ( imagesResource != null ) {
+ for(final Resource imgResource : imagesResource.getChildren()) {
+ imagePath = imgResource.getPath();
+ break;
+ }
+ }
%><html>
<head>
- <title><%= photoName %></title>
+ <title><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
</head>
- <body>
- <h1><%= photoName %></h1>
- <img src="<%=resource.getName() %>"/>
- <form method="POST" action="<%=resource.getName() %>">
- <input type="hidden" name=":redirect" value="<%=resource.getName() %>.html"/>
- <p>Title: <input name="jcr:title" value="<%=photoName%>"/></p>
- <p>Description: <input name="jcr:description" value="<%=ResponseUtil.escapeXml(attributes.get("jcr:description", ""))%>"/></p>
- <p>Location: <input name="slingshot:location" value="<%=ResponseUtil.escapeXml(attributes.get("slingshot:location", ""))%>"/></p>
- <button name="save">Save</button>
- <p><a href="<%=resource.getName() %>.html">Cancel</a></p>
+ <body class="ui-slingshot-main">
+ <sling:include resource="<%= resource %>" replaceSelectors="trail"/>
+ <h1><%= title %></h1>
+ <img src="<%= request.getContextPath() %><%= imagePath %>"/>
+ <form method="POST" action="<%= request.getContextPath() %><%=resource.getName() %>">
+ <input type="hidden" name=":redirect" value="<%= request.getContextPath() %><%=resource.getName() %>.html"/>
+ <p>Title: <input name="<%= SlingshotConstants.PROPERTY_TITLE %>" value="<%= title %>"/></p>
+ <p>Description: <input name="<%= SlingshotConstants.PROPERTY_DESCRIPTION %>" value="<%=ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_DESCRIPTION, ""))%>"/></p>
+ <p>Location: <input name="<%= SlingshotConstants.PROPERTY_LOCATION %>" value="<%=ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_LOCATION, ""))%>"/></p>
+ <button class="ui-button ui-form-button" type="submit">Save</button>
+ <p><a href="<%= request.getContextPath() %><%=resource.getName() %>.html">Cancel</a></p>
</form>
</body>
</html>
\ No newline at end of file
Modified: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp?rev=1630010&r1=1630005&r2=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp (original)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp Wed Oct 8 05:55:13 2014
@@ -16,36 +16,51 @@
specific language governing permissions and limitations
under the License.
--%><%@page session="false" %><%
-%><%@page import="org.apache.sling.api.resource.ResourceUtil,
+%><%@page import="org.apache.sling.api.resource.Resource,
+ org.apache.sling.api.resource.ResourceUtil,
org.apache.sling.api.resource.ValueMap,
- org.apache.sling.api.request.ResponseUtil"%><%
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
+ org.apache.sling.sample.slingshot.SlingshotUtil"%><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
- final ValueMap attributes = ResourceUtil.getValueMap(resource);
- final String photoName = ResponseUtil.escapeXml(attributes.get("jcr:title", resource.getName()));
- final String albumName = ResponseUtil.escapeXml(ResourceUtil.getValueMap(resource.getParent()).get("jcr:title", resource.getParent().getName()));
+ final ValueMap attributes = resource.getValueMap();
+ final String title = ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_TITLE, resource.getName()));
+ final String categoryName = ResponseUtil.escapeXml(resource.getParent().getValueMap().get(SlingshotConstants.PROPERTY_TITLE, resource.getParent().getName()));
+
+ String imagePath = null;
+ final Resource imagesResource = resource.getResourceResolver().getResource(resource, "images");
+ if ( imagesResource != null ) {
+ for(final Resource imgResource : imagesResource.getChildren()) {
+ imagePath = imgResource.getPath();
+ break;
+ }
+ }
%><html>
<head>
- <title><%= photoName %></title>
+ <title><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
</head>
- <body>
- <h1><%= photoName %></h1>
- <img src="<%=resource.getName() %>"/>
- <p>Description: <%=ResponseUtil.escapeXml(attributes.get("jcr:description", ""))%></p>
- <p>Location: <%=ResponseUtil.escapeXml(attributes.get("slingshot:location", ""))%></p>
- <p>Tags:
-<%
- String[] values = attributes.get("slingshot:tags", String[].class);
- if (values != null ) {
- for(int k=0;k<values.length;k++) {
- if(k>0) out.write(", ");
- out.write(ResponseUtil.escapeXml(values[k]));
- }
-
- }
-%>
- </p>
- <p><a href="<%=resource.getName() %>.edit.html">Edit</a></p>
- <p>Album: <a href="../<%=resource.getParent().getName() %>.html"><%= albumName %></a></p>
+ <body class="ui-slingshot-main">
+ <sling:include resource="<%= resource %>" replaceSelectors="trail"/>
+ <h1><%= title %></h1>
+ <div style="width:100%; display:block; float:left;">
+ <div style="width:70%; float:left; display:block;">
+ <img src="<%= request.getContextPath() %><%= imagePath %>"/>
+ </div>
+ <div style="width:30%; float:left; padding:15px; display:block;">
+ <p><%=ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_DESCRIPTION, ""))%></p>
+ <% if ( attributes.get(SlingshotConstants.PROPERTY_LOCATION) != null ) { %>
+ <p>Location</p>
+ <p><%=ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_LOCATION, ""))%></p>
+ <% } %>
+ <% if ( slingRequest.getRemoteUser() != null && slingRequest.getRemoteUser().equals(SlingshotUtil.getUserId(resource)) ) { %>
+ <button class="ui-button ui-form-button ui-slingshot-clickable"
+ data-link="<%= request.getContextPath() %><%=resource.getName() %>.edit.html" type="button">Edit</button>
+ <% } %>
+ </div>
+ </div>
+ <hr/>
+ <sling:include resource="<%= resource %>" replaceSelectors="comments"/>
</body>
</html>
\ No newline at end of file
Modified: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp?rev=1630010&r1=1630005&r2=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp (original)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp Wed Oct 8 05:55:13 2014
@@ -19,32 +19,31 @@
%><%@page import="org.apache.sling.api.resource.Resource,
org.apache.sling.api.resource.ResourceUtil,
org.apache.sling.api.resource.ValueMap,
- org.apache.sling.sample.slingshot.Constants,
+ org.apache.sling.sample.slingshot.SlingshotConstants,
org.apache.sling.api.request.ResponseUtil" %><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
-%><div class="photo">
-<%
- final ValueMap attr = ResourceUtil.getValueMap(resource);
- final String photoName = attr.get("jcr:title", resource.getName());
- final String relPath = resource.getPath();
- String imagePath = relPath;
- String previewPath = resource.getParent().getPath() + '/' + Constants.FOLDER_NAME_PREVIEW + '/' + resource.getName();
- if ( resource.getResourceResolver().getResource(previewPath) != null ) {
- imagePath = previewPath;
- }
-%>
- <a href="<%= request.getContextPath() %><%=relPath%>.html"><img src="<%=imagePath%>" width="100" height="100"/></a><br/>
- <p><a href="<%= request.getContextPath() %><%=relPath%>.html"><%= ResponseUtil.escapeXml(photoName) %></a></p>
- <p>Tags:
-<%
- String[] values = attr.get("slingshot:tags", String[].class);
- if (values != null ) {
- for(int k=0;k<values.length;k++) {
- if (k>0) out.write(", ");
- out.write(ResponseUtil.escapeXml(values[k]));
+%><%
+ final ValueMap attr = resource.getValueMap();
+ final String itemTitle = attr.get(SlingshotConstants.PROPERTY_TITLE, resource.getName());
+
+ String imagePath = null;
+ int count = 0;
+ final Resource imagesResource = resource.getResourceResolver().getResource(resource, "images");
+ if ( imagesResource != null ) {
+ for(final Resource imgResource : imagesResource.getChildren()) {
+ if ( imagePath == null ) {
+ imagePath = imgResource.getPath();
+ }
+ count++;
}
}
-%>
- </p>
+%><div class="tile double ui-slingshot-clickable" data-link="<%= request.getContextPath() %><%=resource.getPath()%>.html">
+ <div class="tile-content image">
+ <img src="<%= request.getContextPath() %><%=imagePath%>"/>
+ </div>
+ <div class="brand">
+ <span class="label fg-white"><%= ResponseUtil.escapeXml(itemTitle) %></span>
+ <span class="badge bg-orange"><%= count %></span>
+ </div>
</div>
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp Wed Oct 8 05:55:13 2014
@@ -0,0 +1,41 @@
+<%--
+ 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.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap,
+ org.apache.sling.api.request.ResponseUtil,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+
+ final ValueMap attributes = resource.getValueMap();
+ final String title = ResponseUtil.escapeXml(attributes.get(SlingshotConstants.PROPERTY_TITLE, resource.getName()));
+%><html>
+ <head>
+ <title><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
+ </head>
+ <body class="ui-slingshot-main">
+ <div>
+ <sling:include resource="<%= resource %>" replaceSelectors="trail"/>
+ <h1><%= title %></h1>
+ <hr/>
+ <sling:include resource="<%= resource %>" replaceSelectors="itemlist"/>
+ </div>
+</body>
+</html>
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp Wed Oct 8 05:55:13 2014
@@ -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="java.util.Iterator,
+ java.util.List,
+ org.apache.sling.api.resource.Resource,
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
+%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
+%><sling:defineObjects/><%
+%><div class="metro ui-slingshot-content">
+ <%
+ int i = 0;
+ final Iterator<Resource> fi = resource.listChildren();
+ while ( fi.hasNext()) {
+ final Resource current = fi.next();
+ if ( current.isResourceType(SlingshotConstants.RESOURCETYPE_CATEGORY)) {
+ %>
+ <sling:include resource="<%= current %>" replaceSelectors="user"/>
+ <%
+ }
+ }
+ %>
+</div>
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,3 @@
+{
+ "jcr:primaryType":"sling:Folder"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
------------------------------------------------------------------------------
svn:keywords = Id
Copied: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json (from r1628371, sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json)
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json?p2=sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json&p1=sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json&r1=1628371&r2=1630010&rev=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json (original)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json Wed Oct 8 05:55:13 2014
@@ -1,7 +1,6 @@
{
- "jcr:primaryType":"sling:Folder",
- "jcr:mixinTypes":["slingshot:Album","sling:Resource"],
- "sling:resourceType":"slingshot:Album",
- "jcr:description":"This is the slingshot root album.",
- "jcr:title":"Root Album"
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/User",
+ "description":"This is the user space of slingshot1!",
+ "title":"Welcome to my World"
}
\ No newline at end of file
Modified: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json?rev=1630010&r1=1629481&r2=1630010&view=diff
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json (original)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json Wed Oct 8 05:55:13 2014
@@ -1,6 +1,6 @@
{
- "jcr:primaryType":"nt:folder",
- "jcr:mixinTypes":["slingshot:Album"],
- "jcr:title":"Travel",
- "jcr:description":"All travel related albums."
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Category",
+ "title":"Travel",
+ "description":"Stuff related to travel."
}
\ No newline at end of file
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Item",
+ "title":"Home Sweet Home",
+ "description":"This is the place where I live..."
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg?rev=1630010&view=auto
==============================================================================
Binary file - no diff available.
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg
------------------------------------------------------------------------------
svn:mime-type = image/jpeg
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Item",
+ "title":"My Pet",
+ "description":"Always hungry...but never gets fat"
+}
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg?rev=1630010&view=auto
==============================================================================
Binary file - no diff available.
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg
------------------------------------------------------------------------------
svn:mime-type = image/jpeg
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json?rev=1630010&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json Wed Oct 8 05:55:13 2014
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Item",
+ "title":"The Sea",
+ "description":"You can see my boat in the distance"
+}
\ No newline at end of file
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json
------------------------------------------------------------------------------
svn:keywords = Id
Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg?rev=1630010&view=auto
==============================================================================
Binary file - no diff available.
Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg
------------------------------------------------------------------------------
svn:mime-type = image/jpeg