Revamp slingshot sample
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1630010 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/slingshot/LICENSE b/slingshot/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/slingshot/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/slingshot/NOTICE b/slingshot/NOTICE
deleted file mode 100644
index d70f91c..0000000
--- a/slingshot/NOTICE
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Sling Slingshot Sample
-Copyright 2009-2010 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/slingshot/src/main/appended-resources/META-INF/NOTICE b/slingshot/src/main/appended-resources/META-INF/NOTICE
new file mode 100644
index 0000000..6e51c42
--- /dev/null
+++ b/slingshot/src/main/appended-resources/META-INF/NOTICE
@@ -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
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
new file mode 100644
index 0000000..d82e83d
--- /dev/null
+++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotConstants.java
@@ -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";
+}
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
new file mode 100644
index 0000000..392c2c1
--- /dev/null
+++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/SlingshotUtil.java
@@ -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;
+ }
+}
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java
index 08a5ac1..5da2cdf 100644
--- a/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java
+++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/AutomaticTaggingService.java
@@ -32,6 +32,7 @@
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 @@
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) {
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/ResourceTypeConversionDecorator.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/ResourceTypeConversionDecorator.java
deleted file mode 100644
index 9c614a5..0000000
--- a/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/ResourceTypeConversionDecorator.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.impl;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceDecorator;
-import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.api.resource.ResourceWrapper;
-import org.apache.sling.sample.slingshot.Constants;
-
-/**
- * This resource decorator "converts" the standard resource types
- * nt:file, sling:Folder and nt:filder to the resource types used inside
- * Slingshot.
- *
- * We only adapt if the resource is within the Slingshot albums folder.
- */
-@Component
-@Service(value=ResourceDecorator.class)
-@Properties({
- @Property(name="service.description",
- value="Apache Sling - Slingshot Resource Type Decorator")
-})
-public class ResourceTypeConversionDecorator
- implements ResourceDecorator {
-
- /**
- * @see org.apache.sling.api.resource.ResourceDecorator#decorate(org.apache.sling.api.resource.Resource)
- */
- public Resource decorate(Resource resource) {
- return this.decorate(resource, null);
- }
-
- /**
- * @see org.apache.sling.api.resource.ResourceDecorator#decorate(org.apache.sling.api.resource.Resource, javax.servlet.http.HttpServletRequest)
- */
- public Resource decorate(Resource resource, HttpServletRequest request) {
- if ( resource.getPath().startsWith(Constants.ALBUMS_ROOT) ) {
- if ( ResourceUtil.isA(resource, Constants.RESOURCETYPE_FILE) ) {
- return new SlingshotResource(resource, Constants.RESOURCETYPE_PHOTO);
- }
- if ( ResourceUtil.isA(resource, Constants.RESOURCETYPE_EXT_FOLDER)
- || ResourceUtil.isA(resource, Constants.RESOURCETYPE_FOLDER) ) {
- return new SlingshotResource(resource, Constants.RESOURCETYPE_ALBUM);
- }
- }
- return resource;
- }
-
- public static final class SlingshotResource extends ResourceWrapper {
-
- private final String resourceType;
-
- public SlingshotResource(final Resource resource, final String resourceType) {
- super(resource);
- this.resourceType = resourceType;
- }
-
- @Override
- public String getResourceType() {
- return this.resourceType;
- }
-
- @Override
- public String getResourceSuperType() {
- return super.getResourceType();
- }
-
- @Override
- public boolean isResourceType(final String resourceType) {
- if ( this.resourceType.equals(resourceType) ) {
- return true;
- }
- return super.isResourceType(resourceType);
- }
- }
-}
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
new file mode 100644
index 0000000..d55f416
--- /dev/null
+++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/impl/SetupService.java
@@ -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();
+ }
+ }
+ }
+ }
+}
diff --git a/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java b/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
new file mode 100644
index 0000000..6a32b6d
--- /dev/null
+++ b/slingshot/src/main/java/org/apache/sling/sample/slingshot/package-info.java
@@ -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;
+
diff --git a/slingshot/src/main/resources/META-INF/LICENSE b/slingshot/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/slingshot/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/slingshot/src/main/resources/META-INF/NOTICE b/slingshot/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index d70f91c..0000000
--- a/slingshot/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,9 +0,0 @@
-Apache Sling Slingshot Sample
-Copyright 2009-2010 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed
-by Day Software (http://www.day.com/).
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album.json
deleted file mode 100644
index 5bc6e26..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "jcr:mixinTypes":["sling:ResourceSuperType"],
- "sling:resourceSuperType":"nt:folder"
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp
deleted file mode 100644
index e3b29f2..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp
+++ /dev/null
@@ -1,78 +0,0 @@
-<%--
- 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" %><%
-%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
-%><sling:defineObjects/><%
-
- final ValueMap attributes = ResourceUtil.getValueMap(resource);
- final String albumName = ResponseUtil.escapeXml(attributes.get("jcr:title", ResourceUtil.getName(resource)));
-%><html>
- <head>
- <title>Album <%= albumName %></title>
- </head>
- <style>
-div.photolist {
- width: 100%;
- text-align: left;
-}
-div.photo {
- display: inline-block;
- margin-left: 10px;
-}
-div.tags {
- width: 100%;
- background-color: #BBBBBB;
- height: 30px;
- text-align: left;
- vertical-align: middle;
- padding-right: 10px;
- padding-top: 8px;
- color: #FFFFFF;
- font-size: 15px;
-}
-div.tag {
- display: inline-block;
- margin-left: 10px;
-}
-div.trail {
- width: 100%;
- background-color: #BBBBBB;
- height: 30px;
- text-align: left;
- vertical-align: middle;
- padding-right: 10px;
- padding-top: 8px;
- color: #FFFFFF;
- font-size: 15px;
-}
-div.trailpart {
- display: inline-block;
- margin-left: 10px;
-} </style>
- <body>
- <h1><%= albumName %></h1>
- <sling:include resource="<%= resource %>" replaceSelectors="trail"/>
- <sling:include resource="<%= resource %>" replaceSelectors="tree"/>
- <hr/>
- <sling:include resource="<%= resource %>" replaceSelectors="photolist"/>
- <sling:include resource="<%= resource %>" replaceSelectors="tags"/>
-</body>
-</html>
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tags.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tags.html.jsp
deleted file mode 100644
index 6b12aea..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tags.html.jsp
+++ /dev/null
@@ -1,39 +0,0 @@
-<%--
- 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,
- org.apache.sling.api.resource.Resource,
- org.apache.sling.api.resource.ResourceUtil,
- org.apache.sling.api.resource.ValueMap,
- org.apache.sling.api.request.ResponseUtil" %><%
-%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
-%><sling:defineObjects/><%
-%><div class="tags">
- <div class="tag">Tags:</div>
- <%
- final Resource tags = resource.getResourceResolver().getResource("/slingshot/tags");
- if ( tags != null ) {
- final Iterator<Resource> ni = tags.listChildren();
- while ( ni.hasNext() ) {
- final Resource current = ni.next();
- final ValueMap attr = ResourceUtil.getValueMap(current);
- %><div class="tag"><a href="<%= request.getContextPath() %><%= current.getPath() %>.html"><%=ResponseUtil.escapeXml(current.getName()) %></a></div><%
- }
- }
- %>
-</div>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tree.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tree.html.jsp
deleted file mode 100644
index 7f303f2..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/tree.html.jsp
+++ /dev/null
@@ -1,38 +0,0 @@
-<%--
- 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,
- org.apache.sling.api.resource.Resource,
- org.apache.sling.sample.slingshot.Constants" %><%
-%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
-%><sling:defineObjects/><%
-%><div class="tree">
- <div class="albumlist">
- <h2>Contained Albums</h2>
- <%
- final Iterator<Resource> ri = resource.listChildren();
- while ( ri.hasNext()) {
- final Resource current = ri.next();
- if ( current.isResourceType(Constants.RESOURCETYPE_ALBUM)
- && Constants.includeAsAlbum(current)) {
- %><sling:include resource="<%= current %>" resourceType="slingshot/Album" replaceSelectors="treeentry"/><%
- }
- }
- %>
- </div>
-</div>
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json
new file mode 100644
index 0000000..0a081f0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
new file mode 100644
index 0000000..e0c87f2
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/html.jsp
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
similarity index 79%
rename from slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp
rename to slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
index 1e7e431..ba23f26 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/itemlist.html.jsp
@@ -19,19 +19,18 @@
%><%@page import="java.util.Iterator,
java.util.List,
org.apache.sling.api.resource.Resource,
- org.apache.sling.sample.slingshot.Constants" %><%
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
-%><div class="photolist">
+%><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(Constants.RESOURCETYPE_PHOTO)
- && Constants.includeAsMedia(current)) {
+ if ( current.isResourceType(SlingshotConstants.RESOURCETYPE_ITEM)) {
%>
- <sling:include resource="<%= current %>" resourceType="slingshot/Photo" replaceSelectors="main"/>
+ <sling:include resource="<%= current %>" replaceSelectors="main"/>
<%
}
}
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
new file mode 100644
index 0000000..63bf76a
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Category/user.html.jsp
@@ -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>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json
new file mode 100644
index 0000000..0a081f0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
new file mode 100644
index 0000000..fbd80a4
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Comment/item.html.jsp
@@ -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>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
new file mode 100644
index 0000000..561cace
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/head.html.jsp
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/trail.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
similarity index 61%
rename from slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/trail.html.jsp
rename to slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
index a8abc4f..605f38f 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/trail.html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Component/trail.html.jsp
@@ -21,32 +21,38 @@
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.sample.slingshot.SlingshotUtil,
org.apache.sling.api.request.ResponseUtil" %><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
-%><div class="trail"><div class="trailpart">Trail:</div>
+%><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 = ResourceUtil.getValueMap(resource);
+ final ValueMap attributes = resource.getValueMap();
// let's create the trail
final List<Object[]> parents = new ArrayList<Object[]>();
- if ( resource.getPath().startsWith(Constants.ALBUMS_ROOT + '/') ) {
+ 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 = ResourceUtil.getValueMap(parent);
+ final ValueMap parentAttr = parent.getValueMap();
final String parentName = parent.getName();
- parents.add(new Object[] {prefix + parentName, ResponseUtil.escapeXml(parentAttr.get("jcr:title", parentName))});
- parent = parent.getParent();
- prefix = prefix + "../";
- if ( parent.getPath().equals(Constants.APP_ROOT) ) {
+ 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--) {
- %><div class="trailpart" style="padding:3px;"><a href="<%=parents.get(k)[0] %>.html"><%=parents.get(k)[1] %></a></div><%
+ %>
+ <li class="ui-slingshot-clickable" data-link="<%= parents.get(k)[0] %>.html"><%= parents.get(k)[1] %></li>
+ <%
}
%>
-</div>
+</ul>
+
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json
new file mode 100644
index 0000000..0a081f0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
new file mode 100644
index 0000000..aa2f2fb
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/html.jsp
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/treeentry.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
similarity index 65%
rename from slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/treeentry.html.jsp
rename to slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
index 9553a56..70cb392 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/treeentry.html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Home/user.html.jsp
@@ -16,13 +16,13 @@
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.api.request.ResponseUtil" %><%
+%><%@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/><%
- ValueMap attributes = ResourceUtil.getValueMap(resource);
- Resource parent = resource.getParent();
- String name = resource.getName();
-%>- <a href="<%=parent.getName() %>/<%=name %>.html"><%=ResponseUtil.escapeXml(attributes.get("jcr:title", name)) %></a><br/>
\ No newline at end of file
+
+ response.sendRedirect(request.getContextPath() + SlingshotConstants.APP_ROOT_PATH + "/public/" + request.getRemoteUser() + ".html");
+ return;
+%>
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json
new file mode 100644
index 0000000..0a081f0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
new file mode 100644
index 0000000..a2c84c8
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/comments.html.jsp
@@ -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>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp
new file mode 100644
index 0000000..2e13dd0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/edit.html.jsp
@@ -0,0 +1,55 @@
+<%--
+ 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.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()));
+
+ 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><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
+ </head>
+ <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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp
new file mode 100644
index 0000000..6651148
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/html.jsp
@@ -0,0 +1,66 @@
+<%--
+ 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.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 = 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><%= title %></title>
+ <sling:include resource="<%= resource %>" replaceSelectors="head"/>
+ </head>
+ <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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp
new file mode 100644
index 0000000..e1c2b8d
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Item/main.html.jsp
@@ -0,0 +1,49 @@
+<%--
+ 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;
+ final Resource imagesResource = resource.getResourceResolver().getResource(resource, "images");
+ if ( imagesResource != null ) {
+ for(final Resource imgResource : imagesResource.getChildren()) {
+ if ( imagePath == null ) {
+ imagePath = imgResource.getPath();
+ }
+ 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>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo.json
deleted file mode 100644
index 23c58c3..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "jcr:mixinTypes":["sling:ResourceSuperType"],
- "sling:resourceSuperType":"nt:file"
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/edit.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/edit.html.jsp
deleted file mode 100644
index 0a5b754..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/edit.html.jsp
+++ /dev/null
@@ -1,42 +0,0 @@
-<%--
- 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"%><%
-%><%@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()));
-%><html>
- <head>
- <title><%= photoName %></title>
- </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>
- </form>
- </body>
-</html>
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp
deleted file mode 100644
index 316007d..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp
+++ /dev/null
@@ -1,51 +0,0 @@
-<%--
- 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"%><%
-%><%@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()));
-%><html>
- <head>
- <title><%= photoName %></title>
- </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>
-</html>
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp
deleted file mode 100644
index 7f315a9..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp
+++ /dev/null
@@ -1,50 +0,0 @@
-<%--
- 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.Constants,
- 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]));
- }
- }
-%>
- </p>
-</div>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json
new file mode 100644
index 0000000..0a081f0
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User.json
@@ -0,0 +1,4 @@
+{
+ "jcr:primaryType":"sling:Folder",
+ "sling:resourceSuperType":"slingshot/Component"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
new file mode 100644
index 0000000..9cbb018
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/html.jsp
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
similarity index 79%
copy from slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp
copy to slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
index 1e7e431..c844857 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/photolist.html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/User/itemlist.html.jsp
@@ -19,19 +19,18 @@
%><%@page import="java.util.Iterator,
java.util.List,
org.apache.sling.api.resource.Resource,
- org.apache.sling.sample.slingshot.Constants" %><%
+ org.apache.sling.sample.slingshot.SlingshotConstants" %><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
-%><div class="photolist">
+%><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(Constants.RESOURCETYPE_PHOTO)
- && Constants.includeAsMedia(current)) {
+ if ( current.isResourceType(SlingshotConstants.RESOURCETYPE_CATEGORY)) {
%>
- <sling:include resource="<%= current %>" resourceType="slingshot/Photo" replaceSelectors="main"/>
+ <sling:include resource="<%= current %>" replaceSelectors="user"/>
<%
}
}
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json
deleted file mode 100644
index 81738e1..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "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"
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel.json
deleted file mode 100644
index bbd1ce7..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "jcr:primaryType":"nt:folder",
- "jcr:mixinTypes":["slingshot:Album"],
- "jcr:title":"Travel",
- "jcr:description":"All travel related albums."
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/ApacheCon.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/ApacheCon.json
deleted file mode 100644
index cd6f133..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/ApacheCon.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "jcr:primaryType":"nt:folder",
- "jcr:mixinTypes":["slingshot:Album"],
- "jcr:title":"Travel ApacheCon",
- "jcr:description":"Everything from the various Apache Conferences."
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/Europe.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/Europe.json
deleted file mode 100644
index 95601ac..0000000
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot/albums/travel/Europe.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "jcr:primaryType":"sling:Folder",
- "jcr:mixinTypes":["slingshot:Album"],
- "jcr:title":"Travel Europe",
- "jcr:description":"All travels around Europe."
-}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
similarity index 96%
rename from slingshot/src/main/resources/SLING-INF/content/slingshot.json
rename to slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
index f1d1b47..d4c41a8 100644
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot.json
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public.json
@@ -1,3 +1,3 @@
{
"jcr:primaryType":"sling:Folder"
-}
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json
new file mode 100644
index 0000000..c55522f
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1.json
@@ -0,0 +1,6 @@
+{
+ "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
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json
new file mode 100644
index 0000000..43aae26
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel.json
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Category",
+ "title":"Travel",
+ "description":"Stuff related to travel."
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json
new file mode 100644
index 0000000..100c49f
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home.json
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg
new file mode 100644
index 0000000..23693c7
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/home/images/home.jpg
Binary files differ
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json
new file mode 100644
index 0000000..34e8f4b
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet.json
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Item",
+ "title":"My Pet",
+ "description":"Always hungry...but never gets fat"
+}
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg
new file mode 100644
index 0000000..eb3656a
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/pet/images/pet.jpg
Binary files differ
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json
new file mode 100644
index 0000000..02785d8
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea.json
@@ -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
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg
new file mode 100644
index 0000000..89bc570
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/sea/images/see.jpg
Binary files differ
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view.json
new file mode 100644
index 0000000..9f89233
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view.json
@@ -0,0 +1,6 @@
+{
+ "jcr:primaryType":"sling:OrderedFolder",
+ "sling:resourceType":"slingshot/Item",
+ "title":"Nice View",
+ "description":"A view from the top of my home"
+}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/images/view.jpg b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/images/view.jpg
new file mode 100644
index 0000000..fcad294
--- /dev/null
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/public/slingshot1/travel/view/images/view.jpg
Binary files differ
diff --git a/slingshot/src/main/resources/SLING-INF/content/slingshot/tags.json b/slingshot/src/main/resources/SLING-INF/content/slingshot/tags.json
index 49248f2..577dd3f 100644
--- a/slingshot/src/main/resources/SLING-INF/content/slingshot/tags.json
+++ b/slingshot/src/main/resources/SLING-INF/content/slingshot/tags.json
@@ -1,15 +1,15 @@
{
"jcr:primaryType":"sling:Folder",
"ApacheCon" : {
- "jcr:primaryType":"slingshot:Tag",
- "jcr:description":"Photos from the ApacheCons."
+ "jcr:primaryType":"sling:Folder",
+ "description":"Photos from the ApacheCons."
},
"Vacation" : {
- "jcr:primaryType":"slingshot:Tag",
- "jcr:description":"Photos shot during vacations."
+ "jcr:primaryType":"sling:Folder",
+ "description":"Photos shot during vacations."
},
"Cool" : {
- "jcr:primaryType":"slingshot:Tag",
- "jcr:description":"Very cool photos."
+ "jcr:primaryType":"sling:Folder",
+ "description":"Very cool photos."
}
}
\ No newline at end of file
diff --git a/slingshot/src/main/resources/SLING-INF/nodetypes/slingshot.cnd b/slingshot/src/main/resources/SLING-INF/nodetypes/slingshot.cnd
deleted file mode 100644
index 2989472..0000000
--- a/slingshot/src/main/resources/SLING-INF/nodetypes/slingshot.cnd
+++ /dev/null
@@ -1,16 +0,0 @@
-<slingshot = 'http://sling.apache.org/sample/slingshot/1.0'>
-<nt = 'http://www.jcp.org/jcr/nt/1.0'>
-<mix = 'http://www.jcp.org/jcr/mix/1.0 '>
-
-[slingshot:Album] > mix:title mixin
-- slingshot:date (date)
-
-[slingshot:Photo] > mix:title mixin
-- slingshot:location (string)
-- slingshot:tags (string) multiple
-
-[slingshot:Tag] > mix:title, nt:base
-
-[mix:title] mixin
- - jcr:title (string)
- - jcr:description (string)