You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:36:29 UTC

[sling-org-apache-sling-hapi] annotated tag org.apache.sling.hapi-1.0.0 created (now 9f2d967)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git.


      at 9f2d967  (tag)
 tagging 35942435ee4e1cb8a94c369a8b27891c6680f7ee (commit)
      by Carsten Ziegeler
      on Tue Feb 2 14:34:48 2016 +0000

- Log -----------------------------------------------------------------
org.apache.sling.hapi-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 0d016df  SLING-4513 - import donated HApi tools
     new 55ba426  SLING-4513 - fix build error
     new 66e05cd  SLING-4513 - change copyright header as authorized in SLING-4778
     new ef543d2  SLING-5055 - avoid infinite recursion - patch contributed by Andrei Dulvac, thanks!
     new 6a6dde6  SLING-5061 - HApiType.getUrl() should be an absolute URL - contributed by Andrei Dulvac, thanks!
     new ad9d6d4  hapi: depend on released version of Sightly
     new ecc8283  Switch to parent pom 26
     new d9e56c6  Minor code clean up
     new e60ffd4  Minor code clean up
     new 28adc2e  SLING-5474 : Move sightly use objects to a different package. Apply patch from Andrei Dulvac
     new 9a3e086  [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0
     new badf1ed  Add scm info
     new 20e06fc  Add scm info
     new a2d6993  [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0
     new 3594243  [maven-release-plugin] copy for tag org.apache.sling.hapi-1.0.0

The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-hapi] 05/15: SLING-5061 - HApiType.getUrl() should be an absolute URL - contributed by Andrei Dulvac, thanks!

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 6a6dde6bfd3b64feafb24e0a33dfa22453e18ead
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Sep 25 13:30:05 2015 +0000

    SLING-5061 - HApiType.getUrl() should be an absolute URL - contributed by Andrei Dulvac, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1705296 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java    | 11 ++++++++---
 src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java    | 11 ++++++++---
 .../apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java  |  3 ++-
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
index 8648179..0d25645 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
@@ -22,6 +22,7 @@ import org.apache.sling.hapi.HApiProperty;
 import org.apache.sling.hapi.HApiType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import java.util.*;
 
 /**
@@ -30,32 +31,36 @@ import java.util.*;
 public class HApiTypeImpl implements HApiType {
 
     public static final Logger LOG = LoggerFactory.getLogger(HApiTypeImpl.class);
-
     private HApiType parent;
 
     private String name;
 
     private String description;
+
+    private final String serverUrl;
     private String path;
     private String fqdn;
     private List<String> parameters;
     private Map<String, HApiProperty> properties;
     private boolean isAbstract;
 
+
     /**
      * A new HApiType
      * @param name
      * @param description
+     * @param serverUrl
      * @param path
      * @param fqdn
      * @param parameters
      * @param properties
      * @param parent
      */
-    public HApiTypeImpl(String name, String description, String path, String fqdn, List<String> parameters, Map<String,
+    public HApiTypeImpl(String name, String description, String serverUrl, String path, String fqdn, List<String> parameters, Map<String,
             HApiProperty> properties, HApiType parent, boolean isAbstract) {
         this.name = name;
         this.description = description;
+        this.serverUrl = serverUrl.substring(0, serverUrl.length() - (serverUrl.endsWith("/") ? 1 : 0));
         this.path = path;
         this.fqdn = fqdn;
         this.parameters = parameters;
@@ -94,7 +99,7 @@ public class HApiTypeImpl implements HApiType {
      */
     @Override
     public String getUrl() {
-        return getPath() + ".html";
+        return this.serverUrl + getPath() + ".html";
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
index 7b448f5..c6810ea 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
@@ -46,18 +46,24 @@ public class HApiUtilImpl implements HApiUtil {
     @Property(label = "HApi Resource Type", cardinality = 0, value = DEFAULT_RESOURCE_TYPE)
     public static final String HAPI_RESOURCE_TYPE = "org.apache.sling.hapi.tools.resourcetype";
 
-
     @Property(label = "HApi Types Search Paths", cardinality=50, value = {"/libs/sling/hapi/types"})
     public static final String HAPI_PATHS = "org.apache.sling.hapi.tools.searchpaths";
 
+
+    private static final String DEFAULT_SERVER_URL = "http://localhost:8080";
+    @Property(label = "External server URL", cardinality = 0, value = DEFAULT_SERVER_URL)
+    public static final String HAPI_EXTERNAL_URL = "org.apache.sling.hapi.tools.externalurl";
+
     public static String resourceType;
     public static String[] hApiPaths;
+    public static String serverContextPath;
 
 
     @Activate
     private void activate(ComponentContext context, Map<String, Object> configuration) {
         resourceType = PropertiesUtil.toString(configuration.get(HAPI_RESOURCE_TYPE), DEFAULT_RESOURCE_TYPE);
         hApiPaths = PropertiesUtil.toStringArray(configuration.get(HAPI_PATHS));
+        serverContextPath = PropertiesUtil.toString(configuration.get(HAPI_EXTERNAL_URL), DEFAULT_SERVER_URL);
     }
 
     /**
@@ -133,7 +139,7 @@ public class HApiUtilImpl implements HApiUtil {
         for (Value p : Arrays.asList(parameterValues)) {
             parameters.add(p.getString());
         }
-        HApiTypeImpl newType = new HApiTypeImpl(name, description, path, fqdn, parameters, null, null, false);
+        HApiTypeImpl newType = new HApiTypeImpl(name, description, serverContextPath, path, fqdn, parameters, null, null, false);
         TypesCache.getInstance(this).addType(newType);
 
         try {
@@ -151,7 +157,6 @@ public class HApiUtilImpl implements HApiUtil {
             Iterator<Node> it = typeNode.getNodes();
             while (it.hasNext()) {
                 Node propNode = it.next();
-                System.out.println("Node=" + propNode);
                 String propName = propNode.getName();
                 String propDescription = propNode.hasProperty("description") ? propNode.getProperty("description").getString() : "";
 
diff --git a/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
index 4d3b8b7..85ae13d 100644
--- a/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
@@ -35,6 +35,7 @@ public class MicrodataAttributeHelperImpl implements MicrodataAttributeHelper {
     private final ResourceResolver resolver;
     HApiType type;
 
+
     /**
      * Get a new microdata html attributes helper for the given HApiType object.
      * <p>Provides convenience methods to get the html attributes needed for instrumenting the markup with a Hypermedia API</p>
@@ -58,7 +59,7 @@ public class MicrodataAttributeHelperImpl implements MicrodataAttributeHelper {
      */
     public Map<String, String> itemtypeMap() {
         Map<String, String> attrMap = new AttrMap(2);
-        attrMap.put("itemtype", type.getPath() + ".html");
+        attrMap.put("itemtype", type.getUrl());
         attrMap.put("itemscope", String.valueOf(!type.getAllProperties().isEmpty()));
         
         return attrMap;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 12/15: Add scm info

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit badf1eddaac3745463aeac5e1cbfd61e547fd0ef
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 2 14:33:44 2016 +0000

    Add scm info
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1728129 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 60490e9..c83cb48 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.hapi</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>HApi - Sling Hypermedia API tools</name>
@@ -38,6 +38,12 @@
         <sling.java.version>6</sling.java.version>
     </properties>
 
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/hapi/core</url>
+    </scm>
+
     <build>
         <plugins>
             <plugin>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 02/15: SLING-4513 - fix build error

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 55ba4268f874d08e6f665243d8f85bd0a3401f7b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Aug 24 14:58:07 2015 +0000

    SLING-4513 - fix build error
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1697422 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
index 8b06163..4d3b8b7 100644
--- a/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
@@ -59,7 +59,7 @@ public class MicrodataAttributeHelperImpl implements MicrodataAttributeHelper {
     public Map<String, String> itemtypeMap() {
         Map<String, String> attrMap = new AttrMap(2);
         attrMap.put("itemtype", type.getPath() + ".html");
-        attrMap.put("itemscope", !type.getAllProperties().isEmpty());
+        attrMap.put("itemscope", String.valueOf(!type.getAllProperties().isEmpty()));
         
         return attrMap;
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 06/15: hapi: depend on released version of Sightly

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit ad9d6d4864848f6907642e8a4ac1ae9f125160e0
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Dec 18 20:35:56 2015 +0000

    hapi: depend on released version of Sightly
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1720845 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 59d7fb5..10e2d5d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.scripting.sightly</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 01/15: SLING-4513 - import donated HApi tools

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 0d016df08bbff861571f2c2f00877b078dd7560e
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Aug 24 14:53:16 2015 +0000

    SLING-4513 - import donated HApi tools
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1697419 13f79535-47bb-0310-9956-ffa450edef68
---
 .gitignore                                         |  15 ++
 pom.xml                                            | 127 ++++++++++++
 .../java/org/apache/sling/hapi/HApiException.java  |  52 +++++
 .../java/org/apache/sling/hapi/HApiProperty.java   |  73 +++++++
 src/main/java/org/apache/sling/hapi/HApiType.java  |  93 +++++++++
 src/main/java/org/apache/sling/hapi/HApiUse.java   | 113 +++++++++++
 src/main/java/org/apache/sling/hapi/HApiUtil.java  | 103 ++++++++++
 .../sling/hapi/MicrodataAttributeHelper.java       |  83 ++++++++
 src/main/java/org/apache/sling/hapi/TypeView.java  | 104 ++++++++++
 .../sling/hapi/impl/AbstractHapiTypeImpl.java      |  86 +++++++++
 .../apache/sling/hapi/impl/HApiPropertyImpl.java   | 112 +++++++++++
 .../org/apache/sling/hapi/impl/HApiTypeImpl.java   | 146 ++++++++++++++
 .../org/apache/sling/hapi/impl/HApiUtilImpl.java   | 212 +++++++++++++++++++++
 .../hapi/impl/MicrodataAttributeHelperImpl.java    | 169 ++++++++++++++++
 .../java/org/apache/sling/hapi/package-info.java   |  23 +++
 .../libs/sling/hapi/components/type/type.html      |  78 ++++++++
 .../resources/SLING-INF/libs/sling/hapi/types.json | 110 +++++++++++
 17 files changed, 1699 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..518c151
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+target/
+.project
+.classpath
+.settings/
+/sling/
+derby.log
+*.iml
+*.ipr
+*.iws
+coverage.em
+coverage.ec
+coverage/
+.DS_Store
+.idea/
+bundles/extensions/models/integration-tests/sling
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..59d7fb5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+~ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>20</version>
+        <relativePath/>
+    </parent>
+
+    <artifactId>org.apache.sling.hapi</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>HApi - Sling Hypermedia API tools</name>
+    <description>Sling tools for adding support for defining, maintaining and consuming a Hypermedia API in sling components</description>
+
+    <properties>
+        <sling.java.version>6</sling.java.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>maven-sling-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Category>sling</Bundle-Category>
+                        <Sling-Initial-Content>SLING-INF;overwrite=true</Sling-Initial-Content>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.osgi</artifactId>
+            <version>2.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.3.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.api</artifactId>
+            <version>2.1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.json</artifactId>
+            <version>2.0.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.9.6</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.sightly</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/src/main/java/org/apache/sling/hapi/HApiException.java b/src/main/java/org/apache/sling/hapi/HApiException.java
new file mode 100644
index 0000000..b9922e0
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/HApiException.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.hapi;
+
+/**
+ * A Hypermedia API exception
+ */
+public class HApiException extends RuntimeException {
+    public HApiException() {
+    }
+
+    /**
+     *
+     * @param message
+     */
+    public HApiException(String message) {
+        super(message);
+    }
+
+    /**
+     *
+     * @param message
+     * @param cause
+     */
+    public HApiException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     *
+     * @param cause
+     */
+    public HApiException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/src/main/java/org/apache/sling/hapi/HApiProperty.java b/src/main/java/org/apache/sling/hapi/HApiProperty.java
new file mode 100644
index 0000000..7cbe6a2
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/HApiProperty.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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.hapi;
+
+/**
+ * A Hypermedia API property for a {@link HApiType}
+ */
+public interface HApiProperty {
+
+    /**
+     * Get the name of this property
+     * @return
+     */
+    String getName();
+
+    /**
+     * Set the name of this property
+     * @param name
+     */
+    void setName(String name);
+
+    /**
+     * Get the description of this property
+     * @return
+     */
+    String getDescription();
+
+    /**
+     * Set the description of this property
+     * @return
+     */
+    void setDescription(String description);
+
+    /**
+     * Get the type of this property
+     * @return
+     */
+    HApiType getType();
+
+    /**
+     * Set the type of this property
+     * @return
+     */
+    void setType(HApiType type);
+
+    /**
+     * Whether this property is a multiple value
+     * @return
+     */
+    Boolean getMultiple();
+
+    /**
+     * Set the boolean value for multiple
+     * @param multiple
+     */
+    void setMultiple(Boolean multiple);
+}
diff --git a/src/main/java/org/apache/sling/hapi/HApiType.java b/src/main/java/org/apache/sling/hapi/HApiType.java
new file mode 100644
index 0000000..e562187
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/HApiType.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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.hapi;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A Hypermedia API type.
+ */
+public interface HApiType {
+
+    /**
+     * The name of this type
+     * @return
+     */
+    String getName();
+
+
+    /**
+     * The description of this type
+     * @return
+     */
+    String getDescription();
+
+    /**
+     * The JCR path of the node representing this type
+     * @return
+     */
+    String getPath();
+
+    /**
+     * The URL of the node representing this type
+     * @return
+     */
+    String getUrl();
+
+    /**
+     * The fully qualified domain name of this type
+     * @return
+     */
+    String getFqdn();
+
+    /**
+     * A list of {@link String} representing java-like generic types that can be used as types for the properties belonging to this type
+     * @return
+     */
+    List<String> getParameters();
+
+    /**
+     * A map with the names of the properties as keys and the HApiProperty object as values defined for this type
+     * <p>This list does not include properties inherited from the parent type</p>
+     * @return
+     */
+    Map<String, HApiProperty> getProperties();
+
+    /**
+     * A map with the names of the properties as keys and the HApiProperty object as values defined for this type,
+     * including the properties inherited from the parent type
+     * @return
+     */
+    Map<String, HApiProperty> getAllProperties();
+
+    /**
+     * Returns the parent type object
+     * @return
+     */
+    HApiType getParent();
+
+    /**
+     * Whether this type is abstract or not.
+     * An abstract type is an identifier that does not map to a jcr node as a path or as a FQDN
+     * @return
+     */
+    boolean isAbstract();
+}
diff --git a/src/main/java/org/apache/sling/hapi/HApiUse.java b/src/main/java/org/apache/sling/hapi/HApiUse.java
new file mode 100644
index 0000000..1dfe348
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/HApiUse.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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.hapi;
+
+import org.apache.sling.scripting.sightly.pojo.Use;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import java.util.Map;
+
+/**
+ * Sightly use class helper to provide the hypermedia API microdata attributes for the type configured throught the 'type' binding.
+ * <p>The type can be a JCR path or a fully qualified domain name like in
+ * {@link HApiUtil#getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)}</p>
+ * <p>The convenience get methods are meant to be used in the 'data-sly-attribute' in the sightly script.</p>
+ */
+public class HApiUse implements Use {
+    private static final Logger LOG = LoggerFactory.getLogger(HApiUse.class);
+
+    private HApiUtil hapi;
+    private MicrodataAttributeHelper helper;
+    private SlingHttpServletRequest request;
+    private SlingScriptHelper sling;
+    private Resource resource;
+    private ResourceResolver resourceResolver;
+    private String typeId;
+    private Map<String, String> itemTypeAttr;
+    private Map<String, Map<String, String>> itemPropAttrs;
+    private Map<String, String> itemPropTypes;
+
+    /**
+     * {@inheritDoc}
+     * @param bindings
+     */
+    public void init(Bindings bindings) {
+        request = (SlingHttpServletRequest) bindings.get(SlingBindings.REQUEST);
+        sling = (SlingScriptHelper) bindings.get(SlingBindings.SLING);
+        resource = (Resource)bindings.get(SlingBindings.RESOURCE);
+        resourceResolver = request.getResourceResolver();
+        typeId = (String) bindings.get("type");
+        LOG.debug("init type: {}", typeId);
+
+        try {
+            activate();
+        } catch (Exception e) {
+            LOG.error("Failed to activate Use class", e);
+        }
+    }
+
+    /**
+     * Initializes the helper and the attribute maps for the given type though the bindings
+     * @throws Exception
+     */
+    public void activate() throws Exception {
+        hapi = sling.getService(HApiUtil.class);
+        helper = hapi.getHelper(resourceResolver, typeId);
+        itemTypeAttr = helper.itemtypeMap();
+        itemPropAttrs = helper.allItemPropMap();
+        itemPropTypes = helper.allPropTypesMap();
+    }
+
+    /**
+     * Get the itemtype html attributes map for the type
+     * @return
+     */
+    public Map<String, String> getItemtype() {
+        LOG.debug("itemtype attrs: {}", itemTypeAttr);
+        return itemTypeAttr;
+    }
+
+    /**
+     * Get the itemprop attributes map for the type, for each property.
+     * The key is the property name and the value is a map of html attributes for the property
+     * @return
+     */
+    public Map<String, Map<String, String>> getItemprop() {
+        LOG.debug("itemprop attrs: {}", itemPropAttrs);
+        return itemPropAttrs;
+    }
+
+    /**
+     * Get a map of the type for each property name of the type
+     * The key is the property name and the value is the type path in JCR
+     * @return
+     */
+    public Map<String, String> getProptype() {
+        LOG.debug("property type attrs: {}", itemPropTypes);
+        return itemPropTypes;
+    }
+}
diff --git a/src/main/java/org/apache/sling/hapi/HApiUtil.java b/src/main/java/org/apache/sling/hapi/HApiUtil.java
new file mode 100644
index 0000000..c262b74
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/HApiUtil.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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.hapi;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+public interface HApiUtil {
+    public static final Logger LOG = LoggerFactory.getLogger(HApiUtil.class);
+
+    public static final String DEFAULT_RESOURCE_TYPE = "sling/hapi/components/type";
+
+    /**
+     * <p>Get a HApi type object from a type identifier.</p>
+     * <p>The JCR node must be [nt:unstructured], a descendant of any of the HAPi search path defined by the
+     * {@see HAPI_PATHS} config and the sling:resourceType should be set to the value defined by the {@see HAPI_RESOURCE_TYPE} config</p>
+     * <p>The first result is returned</p>
+     * @param resolver The sling resource resolver object
+     * @param type The type identifier, which is either in the form of a jcr path,
+     *             same as the path for {@link: ResourceResolver#getResource(String)}. If the path cannot be resolved, type is treated like
+     *             a fully qualified domain name, which has to match the "fqdn" property on the JCR node which represents the type.
+     * @return The first node that matches that type or null if none is found.
+     * @throws RepositoryException
+     */
+    public Node getTypeNode(ResourceResolver resolver, String type) throws RepositoryException;
+
+
+    /**
+     * <p>Get a HApi type object from a type identifier.</p>
+     * <p>The type identifier is resolved to a {@link javax.jcr.Node} and then
+     * {@link #fromNode(org.apache.sling.api.resource.ResourceResolver, javax.jcr.Node)} is called.</p>
+     * <p>For restrictions on the {@link javax.jcr.Node}
+     * see {@link HApiUtil#getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)}</p>
+     * @param resolver The sling resource resolver object
+     * @param type The type identifier, which is either in the form of a jcr path,
+     *             same as the path for{@link: ResourceResolver#getResource(String)}. If the path cannot be resolved, type is treated like
+     *             a fully qualified domain name, which has to match the "fqdn" property on the JCR node which represents the type.
+     * @return The HApiType resolved from the type identifier
+     * @throws javax.jcr.RepositoryException
+     */
+    public HApiType fromPath(ResourceResolver resolver, String type) throws RepositoryException;
+
+    /**
+     * <p>Get a HApi type object from the {@link javax.jcr.Node}.</p>
+     * The Node has the following properties:
+     * <ul>
+     *     <li>name: A 'Name' of the type (mandatory)</li>
+     *     <li>description: A 'String' with the description text for this type (mandatory)</li>
+     *     <li>fqdn: A 'String' with the fully qualified domain name; A namespace like a java package (mandatory)</li>
+     *     <li>extends: A type identifier (either a path or a fqdn); (optional). This defines the parent type of this type</li>
+     *     <li>parameter: A multivalue property to define a list of java-like generic types
+     *     that can be used as types for properties; (optional)</li>
+     * </ul>
+     *
+     * <p>The properties of this type are defined as children nodes.</p>
+     * <p>The name of property node defines the name of the property for this type. </p>
+     * The children property nodes have the following properties:
+     * <ul>
+     *     <li>type: The type identifier (mandatory). Can be of type 'Name' or 'Path'
+     *      See {@link HApiUtil#getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)}
+     *      for the format of this value</li>
+     *     <li>description: A 'String' with the description for this property (mandatory)</li>
+     *     <li>multiple: A 'Boolean' that defines whether this property can exist multiple times on an object of this type (optional)</li>
+     * </ul>
+     *
+     * @param resolver The resource resolver
+     * @param typeNode The jcr node of the HApi type
+     * @return The HApiType
+     * @throws RepositoryException
+     */
+    public HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException;
+
+    /**
+     * Get a new instance of AttributeHelper for the type identified by 'type'
+     * @param resolver
+     * @param type See {@link #getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)}
+     *             for the format of the type identifier
+     * @return
+     * @throws RepositoryException
+     */
+    public MicrodataAttributeHelper getHelper(ResourceResolver resolver, String type) throws RepositoryException;
+}
diff --git a/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java b/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java
new file mode 100644
index 0000000..c52f068
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * 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.hapi;
+
+import org.apache.sling.api.resource.ResourceResolver;
+
+import java.util.Map;
+
+public interface MicrodataAttributeHelper {
+
+    /**
+     * Calls {@link #itemtypeMap()} and normalizes the map into a String of the form 'attr1="val1" attr2="val2"'
+     * @return
+     */
+    String itemtype();
+
+    /**
+     * Get a map with the HTMl attributes for a new item of the type defined through
+     * a new {@link MicrodataAttributeHelper} object
+     * <p>The key is the HTMl attribute name and the value is the HTML attribute value</p>
+     * @return
+     */
+    Map<String, String> itemtypeMap();
+
+    /**
+     * Calls {@link #itemprop(String, boolean)} with 'withType' true
+     * @param propName
+     * @return
+     */
+    String itemprop(String propName);
+
+    /**
+     * Calls {@link #itempropMap(String, boolean)} and normalizes the map into a String of the form 'attr1="val1" attr2="val2"'
+     * @param propName
+     * @param withType
+     * @return
+     */
+    String itemprop(String propName, boolean withType);
+
+    /**
+     * Get a map with the HTMl attributes for the given property of the type defined through
+     * a new {@link MicrodataAttributeHelper}
+     * <p>The key is the HTMl attribute name and the value is the HTML attribute value</p>
+     * <p> Will through a {@link HApiException}
+     * runtime exception if the property propName does not exist for the type</p>
+     * @param propName the name of the property
+     * @param withType whether to include the 'itemtype' attribute
+     * @return
+     */
+    Map<String, String> itempropMap(String propName, boolean withType);
+
+    /**
+     *  Get a map of maps with the HTMl attributes for each property of the type defined through
+     *  a new {@link MicrodataAttributeHelper}
+     *  <p>The key is the property name and the value is a map of attributes like the one returned
+     *  by {@link #itempropMap(String, boolean)}</p>
+     * @return
+     */
+    Map<String, Map<String, String>> allItemPropMap();
+
+    /**
+     * Get a map of types for each type property.
+     * <p> The key is the property name and the value is the type path identifier of that property</p>
+     * @return
+     */
+    Map<String, String> allPropTypesMap();
+}
diff --git a/src/main/java/org/apache/sling/hapi/TypeView.java b/src/main/java/org/apache/sling/hapi/TypeView.java
new file mode 100644
index 0000000..3fb0d33
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/TypeView.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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.hapi;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.scripting.sightly.pojo.Use;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.script.Bindings;
+import java.util.*;
+
+public class TypeView implements Use {
+    private static final Logger LOG = LoggerFactory.getLogger(TypeView.class);
+
+    private HApiUtil hapi;
+    private HApiType me;
+    private HApiType parent;
+
+    private String description;
+    private SlingHttpServletRequest request;
+    private SlingScriptHelper sling;
+    private Resource resource;
+    private ResourceResolver resourceResolver;
+
+    public void init(Bindings bindings) {
+        request = (SlingHttpServletRequest) bindings.get(SlingBindings.REQUEST);
+        sling =   (SlingScriptHelper) bindings.get(SlingBindings.SLING);
+        resource = (Resource)bindings.get(SlingBindings.RESOURCE);
+        resourceResolver = request.getResourceResolver();
+
+        try {
+            activate();
+        } catch (Exception e) {
+            LOG.error("Failed to activate Use class", e);
+        }
+    }
+
+    public void activate() throws Exception {
+        hapi = sling.getService(HApiUtil.class);
+        me = hapi.fromPath(resourceResolver, resource.getPath());
+        LOG.debug("me: {}  resource: {}", me, resource.getPath());
+        description = me.getDescription();
+        parent = me.getParent();
+    }
+
+    public String getTitle() {
+        return me.getFqdn();
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public String getParentUrl() {
+        if (null != parent) {
+            return parent.getUrl();
+        } else {
+            return null;
+        }
+    }
+
+    public String getParentFqdn() {
+        if (null != parent) {
+            return parent.getFqdn();
+        } else {
+            return null;
+        }
+    }
+
+    public List<String> getParameters() {
+        return me.getParameters();
+    }
+
+    public List<HApiProperty> getProps() {
+        List<HApiProperty> props = new ArrayList<HApiProperty>(me.getAllProperties().values());
+        LOG.debug("props: ", props);
+        return props;
+    }
+
+    public boolean getHasProps() {
+        return getProps().size() > 0;
+    }
+}
diff --git a/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java b/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java
new file mode 100644
index 0000000..6469522
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * ADOBE CONFIDENTIAL
+ * __________________
+ *
+ *  Copyright 2014 Adobe Systems Incorporated
+ *  All Rights Reserved.
+ *
+ * NOTICE:  All information contained herein is, and remains
+ * the property of Adobe Systems Incorporated and its suppliers,
+ * if any.  The intellectual and technical concepts contained
+ * herein are proprietary to Adobe Systems Incorporated and its
+ * suppliers and may be covered by U.S. and Foreign Patents,
+ * patents in process, and are protected by trade secret or copyright law.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe Systems Incorporated.
+ **************************************************************************/
+package org.apache.sling.hapi.impl;
+
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class AbstractHapiTypeImpl implements HApiType {
+
+    public static final String ABSTRACT = "Abstract";
+    private final String name;
+
+    public AbstractHapiTypeImpl(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String getDescription() {
+        return ABSTRACT;
+    }
+
+    @Override
+    public String getPath() {
+        return null;
+    }
+
+    @Override
+    public String getUrl() {
+        return null;
+    }
+
+    @Override
+    public String getFqdn() {
+        return null;
+    }
+
+    @Override
+    public List<String> getParameters() {
+        return null;
+    }
+
+    @Override
+    public Map<String, HApiProperty> getProperties() {
+        return new HashMap<String, HApiProperty>();
+    }
+
+    @Override
+    public Map<String, HApiProperty> getAllProperties() {
+        return getProperties();
+    }
+
+    @Override
+    public HApiType getParent() {
+        return null;
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return true;
+    }
+}
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiPropertyImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiPropertyImpl.java
new file mode 100644
index 0000000..cb3a280
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiPropertyImpl.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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.hapi.impl;
+
+import org.apache.sling.hapi.HApiType;
+import org.apache.sling.hapi.HApiProperty;
+
+/**
+ * {@inheritDoc}
+ */
+public class HApiPropertyImpl implements HApiProperty {
+    private String name;
+    private String description;
+    private HApiType type;
+    private Boolean multiple;
+
+    /**
+     *
+     * @param name
+     * @param description
+     * @param type
+     * @param multiple
+     */
+    public HApiPropertyImpl(String name, String description, HApiType type, Boolean multiple) {
+        this.name = name;
+        this.description = description;
+        this.type = type;
+        this.multiple = multiple;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public HApiType getType() {
+        return type;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setType(HApiType type) {
+        this.type = type;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Boolean getMultiple() {
+        return multiple;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setMultiple(Boolean multiple) {
+        this.multiple = multiple;
+    }
+
+    @Override
+    public String toString() {
+        return "HApiProperty{" +
+                "name='" + name + '\'' +
+                ", description='" + description + '\'' +
+                ", type=" + type +
+                ", multiple=" + multiple +
+                '}';
+    }
+}
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
new file mode 100644
index 0000000..faa6e1e
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * 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.hapi.impl;
+
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.*;
+
+/**
+ * {@inheritDoc}
+ */
+public class HApiTypeImpl implements HApiType {
+
+    public static final Logger LOG = LoggerFactory.getLogger(HApiTypeImpl.class);
+
+    private final HApiType parent;
+
+    private String name;
+
+    private String description;
+    private String path;
+    private String fqdn;
+    private List<String> parameters;
+    private Map<String, HApiProperty> properties;
+    private boolean isAbstract;
+
+    /**
+     * A new HApiType
+     * @param name
+     * @param description
+     * @param path
+     * @param fqdn
+     * @param parameters
+     * @param properties
+     * @param parent
+     */
+    public HApiTypeImpl(String name, String description, String path, String fqdn, List<String> parameters, Map<String,
+            HApiProperty> properties, HApiType parent, boolean isAbstract) {
+        this.name = name;
+        this.description = description;
+        this.path = path;
+        this.fqdn = fqdn;
+        this.parameters = parameters;
+        this.properties = properties;
+        this.parent = parent;
+        this.isAbstract = isAbstract;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getUrl() {
+        return getPath() + ".html";
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getFqdn() {
+        return fqdn;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public List<String> getParameters() {
+        return parameters;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, HApiProperty> getProperties() {
+        return properties;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, HApiProperty> getAllProperties() {
+        Map<String, HApiProperty> allProps = new HashMap<String, HApiProperty>();
+        LOG.debug("parent: {}", parent);
+        if (null != parent) {
+            Map<String, HApiProperty> parentProps = parent.getAllProperties();
+            LOG.debug("parent props: {}", parentProps);
+            allProps.putAll(parentProps);
+        }
+        allProps.putAll(getProperties());
+        return allProps;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public HApiType getParent() {
+        return parent;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isAbstract() {
+        return isAbstract;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
new file mode 100644
index 0000000..a8f3d51
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * 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.hapi.impl;
+
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+import org.apache.sling.hapi.MicrodataAttributeHelper;
+import org.apache.sling.hapi.HApiUtil;
+import org.apache.felix.scr.annotations.*;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.jcr.*;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+import java.util.*;
+
+
+@Component(label = "Apache Sling Hypermedia API tools", metatype = true)
+@Service()
+
+public class HApiUtilImpl implements HApiUtil {
+
+    @Property(label = "HApi Resource Type", cardinality = 0, value = DEFAULT_RESOURCE_TYPE)
+    public static final String HAPI_RESOURCE_TYPE = "org.apache.sling.hapi.tools.resourcetype";
+
+
+    @Property(label = "HApi Types Search Paths", cardinality=50, value = {"/libs/sling/hapi/types"})
+    public static final String HAPI_PATHS = "org.apache.sling.hapi.tools.searchpaths";
+
+    public static String resourceType;
+    public static String[] hApiPaths;
+
+
+    @Activate
+    private void activate(ComponentContext context, Map<String, Object> configuration) {
+        resourceType = PropertiesUtil.toString(configuration.get(HAPI_RESOURCE_TYPE), DEFAULT_RESOURCE_TYPE);
+        hApiPaths = PropertiesUtil.toStringArray(configuration.get(HAPI_PATHS));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Node getTypeNode(ResourceResolver resolver, String type) throws RepositoryException {
+        Session session = resolver.adaptTo(Session.class);
+
+        // Try to resolve the resource as a path
+        Resource res = resolver.getResource(type);
+        if (null != res) {
+            LOG.debug("res = " + res.getName() + " " + res.getPath());
+            return res.adaptTo(Node.class);
+        } else {
+            for (String path : new HashSet<String>(Arrays.asList(hApiPaths))) {
+                // Remove trailing slash from path
+                path = (path.endsWith("/")) ? path.substring(0,path.length() - 1) : path;
+
+                // Get the query manager for the session
+                QueryManager queryManager = session.getWorkspace().getQueryManager();
+
+                // Build query for the search paths
+                StringBuilder queryString = new StringBuilder("SELECT * FROM [nt:unstructured] WHERE ");
+                queryString.append(String.format("ISDESCENDANTNODE([%s]) ", path));
+                queryString.append(String.format("AND [sling:resourceType]='%s' AND fqdn = '%s'", resourceType, type));
+
+                // Execute query
+                Query query = queryManager.createQuery(queryString.toString(), Query.JCR_SQL2);
+                LOG.debug("Querying HAPi: {}", queryString.toString());
+                QueryResult result = query.execute();
+
+                NodeIterator nodeIter = result.getNodes();
+                if (nodeIter.hasNext()) {
+                    return nodeIter.nextNode();
+                } else {
+                    // continue
+                }
+            }
+
+            // Type has to be abstract
+            return null;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public HApiType fromPath(ResourceResolver resolver, String type) throws RepositoryException {
+        Node typeNode = this.getTypeNode(resolver, type);
+        LOG.debug("typeNode=" + typeNode);
+        if (null == typeNode) {
+            return new AbstractHapiTypeImpl(type);
+        } else {
+            return fromNode(resolver, typeNode);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException {
+        if (null == typeNode) return null;
+        String name = typeNode.getProperty("name").getValue().getString();
+        String description = typeNode.getProperty("description").getValue().getString();
+        String path = typeNode.getPath();
+        String fqdn = typeNode.getProperty("fqdn").getValue().getString();
+
+        // get parent if it exists
+        HApiType parent = null;
+        String parentPath = typeNode.hasProperty("extends") ? typeNode.getProperty("extends").getString() : null;
+        if (null != parentPath) {
+            parent = this.fromPath(resolver, parentPath);
+        }
+
+        // get parameters
+        Value[] parameterValues = typeNode.hasProperty("parameters") ? typeNode.getProperty("parameters").getValues() : new Value[]{};
+        List<String> parameters = new ArrayList<String>(parameterValues.length);
+
+        for (Value p : Arrays.asList(parameterValues)) {
+            parameters.add(p.getString());
+        }
+
+        // Get properties
+        Map<String, HApiProperty> properties = new HashMap<String, HApiProperty>();
+
+        // Add the properties from this node
+        Iterator<Node> it = typeNode.getNodes();
+        while (it.hasNext()) {
+            Node propNode = it.next();
+            String propName  = propNode.getName();
+            String propDescription = propNode.hasProperty("description") ? propNode.getProperty("description").getString() : "";
+
+            // TODO: maybe create adapter and use adaptTo()
+            // TODO: this could be slow, the types can be instantiated externally in a service activate()
+            String type = propNode.getProperty("type").getValue().getString();
+            HApiType propType = this.fromPath(resolver, type);
+            Boolean propMultiple = propNode.hasProperty("multiple") ? propNode.getProperty("multiple").getBoolean() : false;
+
+            HApiProperty prop = new HApiPropertyImpl(propName, propDescription, propType, propMultiple);
+            properties.put(prop.getName(), prop);
+        }
+        return new HApiTypeImpl(name, description, path, fqdn, parameters, properties, parent, false);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public MicrodataAttributeHelper getHelper(ResourceResolver resolver, String type) throws RepositoryException {
+        return new MicrodataAttributeHelperImpl(resolver, TypesCache.getInstance(this).getType(resolver, type));
+    }
+}
+
+/**
+ * <p>Cache for types</p>
+ *
+ */
+class TypesCache {
+    private static final Logger LOG = LoggerFactory.getLogger(TypesCache.class);
+    Map<String, HApiType> types;
+    private static TypesCache singleton = null;
+    private HApiUtil hApiUtil;
+
+    public static TypesCache getInstance(HApiUtil hApiUtil) {
+        if (null == singleton) {
+            singleton = new TypesCache(hApiUtil);
+        }
+        LOG.debug("singleton: {}", singleton);
+        return singleton;
+    }
+
+    private TypesCache(HApiUtil hApiUtil) {
+        this.types = new HashMap<String, HApiType>();
+        this.hApiUtil = hApiUtil;
+    }
+
+    public HApiType getType(ResourceResolver resolver, String typePath) throws RepositoryException {
+        if (types.containsKey(typePath)) {
+            return this.types.get(typePath);
+        } else {
+
+            HApiType type = hApiUtil.fromPath(resolver, typePath);
+            types.put(type.getPath(), type);
+            return type;
+        }
+    }
+
+    public void addType(HApiType type) {
+        this.types.put(type.getPath(), type);
+    }
+}
+
diff --git a/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
new file mode 100644
index 0000000..8b06163
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/impl/MicrodataAttributeHelperImpl.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * 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.hapi.impl;
+
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+import org.apache.sling.hapi.MicrodataAttributeHelper;
+import org.apache.sling.hapi.HApiException;
+import org.apache.sling.api.resource.ResourceResolver;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Helper class for HTML microdata attributes
+ */
+public class MicrodataAttributeHelperImpl implements MicrodataAttributeHelper {
+    private final ResourceResolver resolver;
+    HApiType type;
+
+    /**
+     * Get a new microdata html attributes helper for the given HApiType object.
+     * <p>Provides convenience methods to get the html attributes needed for instrumenting the markup with a Hypermedia API</p>
+     * @param resolver
+     * @param type
+     */
+    public MicrodataAttributeHelperImpl(ResourceResolver resolver, HApiType type) {
+        this.resolver = resolver;
+        this.type = type;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String itemtype() {
+        return itemtypeMap().toString();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, String> itemtypeMap() {
+        Map<String, String> attrMap = new AttrMap(2);
+        attrMap.put("itemtype", type.getPath() + ".html");
+        attrMap.put("itemscope", !type.getAllProperties().isEmpty());
+        
+        return attrMap;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String itemprop(String propName) {
+        return itemprop(propName, true);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String itemprop(String propName, boolean withType) {
+        return itempropMap(propName, withType).toString();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, String> itempropMap(String propName, boolean withType) {
+        HApiProperty prop = this.type.getAllProperties().get(propName);
+        if (null == prop) throw new HApiException("Property " + propName + " does not exist for type " + type.getPath());
+
+        Map<String, String> attrMap = new AttrMap(3);
+        attrMap.put("itemprop", propName);
+        if (withType) {
+            attrMap.putAll(new MicrodataAttributeHelperImpl(resolver, prop.getType()).itemtypeMap());
+        }
+        return attrMap;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, Map<String, String>> allItemPropMap() {
+        Map<String, Map<String, String>> m = new PropMap(type);
+        for (String prop: type.getAllProperties().keySet()) {
+            m.put(prop, itempropMap(prop, true));
+        }
+        return m;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, String> allPropTypesMap() {
+        Map<String, HApiProperty> props = type.getAllProperties();
+        Map<String, String> types = new HashMap<String, String>(props.size());
+        for (String propName : props.keySet()) {
+            types.put(propName, props.get(propName).getType().getPath());
+        }
+        return types;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    private class PropMap extends HashMap<String, Map<String, String>> {
+
+        private final HApiType type;
+
+        public PropMap(HApiType type) {
+            super();
+            this.type = type;
+        }
+
+        @Override
+        public Map<String, String> get(Object key) {
+            Map<String, String> val = super.get(key);
+            if (null == val) {
+                throw new HApiException("Property " + key + " does not exist for type " + type.getPath());
+            }
+            return val;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    private class AttrMap extends HashMap<String, String> {
+
+        public AttrMap(int i) {
+            super(i);
+        }
+
+        public AttrMap() {
+            super();
+        }
+
+        public AttrMap(int initialCapacity, float loadFactor) {
+            super(initialCapacity, loadFactor);
+        }
+
+        @Override
+        public String toString() {
+            String norm = "";
+            for (Map.Entry<String, String> entry : this.entrySet()) {
+                norm += entry.getKey() + "=\"" + entry.getValue() + "\"" + " ";
+            }
+            return norm;
+        }
+    }
+}
+
diff --git a/src/main/java/org/apache/sling/hapi/package-info.java b/src/main/java/org/apache/sling/hapi/package-info.java
new file mode 100644
index 0000000..fcded2d
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/package-info.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.0")
+package org.apache.sling.hapi;
+
+import aQute.bnd.annotation.Version;
diff --git a/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html b/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html
new file mode 100644
index 0000000..b24977c
--- /dev/null
+++ b/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ 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.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<html data-sly-use.type="org.apache.sling.hapi.TypeView" lang="${type.lang}">
+
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+
+        <!-- Bootstrap -->
+        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
+
+        <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
+        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+        <!--[if lt IE 9]>
+          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+        <![endif]-->
+
+        <title>${type.title}</title>
+
+    </head>
+    <body>
+        <div class="container">
+
+            <h1>${type.title}</h1>
+            <div>
+                <p>${type.description}</p>
+            </div>
+            <h2 data-sly-test.parentUrl="${type.parentUrl}"> extends
+                <a href="${parentUrl}" >${type.parentFqdn}</a>
+            </h2>
+            <h3 data-sly-test="${type.parameters}">Parameters: </h3>
+                <ul data-sly-list.param="${type.parameters}" title="Parameters" class="list-inline">
+                <li>${param}</li>
+            </ul>
+            <h3>Properties: </h3>
+            <table class="table" data-sly-test.props="${type.props}">
+                <thead>
+                    <tr>
+                        <th>Property</th>
+                        <th>Expected Type</th>
+                        <th>Multiple</th>
+                        <th>Description</th>
+                    </tr>
+                </thead>
+                <tbody data-sly-list.prop="${type.props}">
+                    <tr>
+                        <th>${prop.name}</th>
+                        <td>
+                            <a href="${prop.type.url}">${prop.type.name}</a>
+                        </td>
+                        <td>${prop.multiple}</td>
+                        <td>${prop.description}</td>
+                    </tr>
+                </tbody>
+            </table>
+            <div data-sly-test="${!props}">None</div>
+        </div>
+    </body>
+</html>
diff --git a/src/main/resources/SLING-INF/libs/sling/hapi/types.json b/src/main/resources/SLING-INF/libs/sling/hapi/types.json
new file mode 100644
index 0000000..7984006
--- /dev/null
+++ b/src/main/resources/SLING-INF/libs/sling/hapi/types.json
@@ -0,0 +1,110 @@
+{
+  "jcr:primaryType": "sling:Folder",
+  "image": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "An image src",
+    "fqdn": "org.apache.sling.hapi.common.Image",
+    "name": "Image",
+    "sling:resourceType": "sling/hapi/components/type"
+  },
+  "date": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "a date value; format has to be described in each property of this type",
+    "fqdn": "org.apache.sling.hapi.common.Date",
+    "name": "Date",
+    "sling:resourceType": "sling/hapi/components/type"
+  },
+  "text": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "A text value",
+    "fqdn": "org.apache.sling.hapi.common.Text",
+    "name": "Text",
+    "sling:resourceType": "sling/hapi/components/type"
+  },
+  "collection": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "Generic collection type. Can be parameterized with a generic type.",
+    "fqdn": "org.apache.sling.hapi.common.collection",
+    "name": "collection",
+    "parameters": [
+      "T"
+    ],
+    "sling:resourceType": "sling/hapi/components/type",
+    "item": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "",
+      "type": "T",
+      "multiple": true
+    }
+  },
+  "boolean": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "true or false",
+    "fqdn": "org.apache.sling.hapi.common.Boolean",
+    "name": "Boolean",
+    "sling:resourceType": "sling/hapi/components/type"
+  },
+  "pair": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "The key-value pair. Usually used to indicate a Map entry.",
+    "fqdn": "org.apache.sling.hapi.common.pair",
+    "name": "pair",
+    "parameters": [
+      "K",
+      "V"
+    ],
+    "sling:resourceType": "sling/hapi/components/type",
+    "key": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "The key of the pair",
+      "type": "K",
+      "multiple": false
+    },
+    "value": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "The value of the pair",
+      "type": "V",
+      "multiple": false
+    }
+  },
+  "number": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "A number value",
+    "fqdn": "org.apache.sling.hapi.common.Number",
+    "name": "Number",
+    "sling:resourceType": "sling/hapi/components/type"
+  },
+  "demo_type": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "A demo HApi type to show a more advanced structure",
+    "demo_description": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "The description of the demo object",
+      "type": "org.apache.sling.hapi.common.Text",
+      "multiple": false
+    },
+    "fqdn": "org.apache.sling.hapi.common.collection",
+    "name": "collection",
+    "parameters": [],
+    "sling:resourceType": "sling/hapi/components/type",
+    "title": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "The title of the demo object",
+      "type": "org.apache.sling.hapi.common.Text",
+      "multiple": false
+    },
+    "entries": {
+      "jcr:primaryType": "nt:unstructured",
+      "description": "An entry of type pair in the demo object",
+      "type": "org.apache.sling.hapi.common.pair",
+      "multiple": true
+    }
+  },
+  "url": {
+    "jcr:primaryType": "nt:unstructured",
+    "description": "A URL value type",
+    "fqdn": "org.apache.sling.hapi.common.URL",
+    "name": "URL",
+    "sling:resourceType": "sling/hapi/components/type"
+  }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 13/15: Add scm info

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 20e06fc2d9aa0e7bcbf898287cd300fcd8c2fab9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 2 14:34:15 2016 +0000

    Add scm info
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1728130 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index c83cb48..da11ab1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -129,11 +129,4 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-
-
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</developerConnection>
-    <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.hapi-1.0.0</url>
-  </scm>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 07/15: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit ecc82831f6927f2c3c7308c85c15cfc5ad823cd8
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

    Switch to parent pom 26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1722720 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 10e2d5d..b12930a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>26</version>
         <relativePath/>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 11/15: [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 9a3e086bddc6a626057f0520f754b0cc01d5dfff
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 2 14:32:20 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1728128 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index b12930a..60490e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,11 +24,11 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>26</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.hapi</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
 
     <name>HApi - Sling Hypermedia API tools</name>
@@ -124,4 +124,10 @@
         </dependency>
     </dependencies>
 
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</developerConnection>
+    <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.hapi-1.0.0</url>
+  </scm>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 04/15: SLING-5055 - avoid infinite recursion - patch contributed by Andrei Dulvac, thanks!

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit ef543d290478e514c71e8f0db52cc2db498010d2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Sep 23 12:17:20 2015 +0000

    SLING-5055 - avoid infinite recursion - patch contributed by Andrei Dulvac, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1704829 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/hapi/impl/HApiTypeImpl.java   | 20 ++++++-
 .../org/apache/sling/hapi/impl/HApiUtilImpl.java   | 65 ++++++++++++++--------
 2 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
index faa6e1e..8648179 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiTypeImpl.java
@@ -31,7 +31,7 @@ public class HApiTypeImpl implements HApiType {
 
     public static final Logger LOG = LoggerFactory.getLogger(HApiTypeImpl.class);
 
-    private final HApiType parent;
+    private HApiType parent;
 
     private String name;
 
@@ -68,6 +68,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getName() {
         return name;
     }
@@ -75,6 +76,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getDescription() {
         return description;
     }
@@ -82,6 +84,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getPath() {
         return path;
     }
@@ -89,6 +92,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getUrl() {
         return getPath() + ".html";
     }
@@ -96,6 +100,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getFqdn() {
         return fqdn;
     }
@@ -103,6 +108,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public List<String> getParameters() {
         return parameters;
     }
@@ -110,6 +116,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<String, HApiProperty> getProperties() {
         return properties;
     }
@@ -117,6 +124,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<String, HApiProperty> getAllProperties() {
         Map<String, HApiProperty> allProps = new HashMap<String, HApiProperty>();
         LOG.debug("parent: {}", parent);
@@ -132,6 +140,7 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public HApiType getParent() {
         return parent;
     }
@@ -139,8 +148,17 @@ public class HApiTypeImpl implements HApiType {
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isAbstract() {
         return isAbstract;
     }
 
+
+    public void setParent(HApiType parent) {
+        this.parent = parent;
+    }
+
+    public void setProperties(Map<String, HApiProperty> properties) {
+        this.properties = properties;
+    }
 }
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
index a8f3d51..7b448f5 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
@@ -126,13 +126,6 @@ public class HApiUtilImpl implements HApiUtil {
         String path = typeNode.getPath();
         String fqdn = typeNode.getProperty("fqdn").getValue().getString();
 
-        // get parent if it exists
-        HApiType parent = null;
-        String parentPath = typeNode.hasProperty("extends") ? typeNode.getProperty("extends").getString() : null;
-        if (null != parentPath) {
-            parent = this.fromPath(resolver, parentPath);
-        }
-
         // get parameters
         Value[] parameterValues = typeNode.hasProperty("parameters") ? typeNode.getProperty("parameters").getValues() : new Value[]{};
         List<String> parameters = new ArrayList<String>(parameterValues.length);
@@ -140,27 +133,49 @@ public class HApiUtilImpl implements HApiUtil {
         for (Value p : Arrays.asList(parameterValues)) {
             parameters.add(p.getString());
         }
+        HApiTypeImpl newType = new HApiTypeImpl(name, description, path, fqdn, parameters, null, null, false);
+        TypesCache.getInstance(this).addType(newType);
+
+        try {
+            // get parent if it exists
+            HApiType parent = null;
+            String parentPath = typeNode.hasProperty("extends") ? typeNode.getProperty("extends").getString() : null;
+            if (null != parentPath) {
+                parent = TypesCache.getInstance(this).getType(resolver, parentPath);
+            }
 
-        // Get properties
-        Map<String, HApiProperty> properties = new HashMap<String, HApiProperty>();
+            // Get properties
+            Map<String, HApiProperty> properties = new HashMap<String, HApiProperty>();
 
-        // Add the properties from this node
-        Iterator<Node> it = typeNode.getNodes();
-        while (it.hasNext()) {
-            Node propNode = it.next();
-            String propName  = propNode.getName();
-            String propDescription = propNode.hasProperty("description") ? propNode.getProperty("description").getString() : "";
+            // Add the properties from this node
+            Iterator<Node> it = typeNode.getNodes();
+            while (it.hasNext()) {
+                Node propNode = it.next();
+                System.out.println("Node=" + propNode);
+                String propName = propNode.getName();
+                String propDescription = propNode.hasProperty("description") ? propNode.getProperty("description").getString() : "";
 
-            // TODO: maybe create adapter and use adaptTo()
-            // TODO: this could be slow, the types can be instantiated externally in a service activate()
-            String type = propNode.getProperty("type").getValue().getString();
-            HApiType propType = this.fromPath(resolver, type);
-            Boolean propMultiple = propNode.hasProperty("multiple") ? propNode.getProperty("multiple").getBoolean() : false;
+                String typePath = propNode.getProperty("type").getValue().getString();
+                HApiType propType = TypesCache.getInstance(this).getType(resolver, typePath);
+                Boolean propMultiple = propNode.hasProperty("multiple") ? propNode.getProperty("multiple").getBoolean() : false;
 
-            HApiProperty prop = new HApiPropertyImpl(propName, propDescription, propType, propMultiple);
-            properties.put(prop.getName(), prop);
+                HApiProperty prop = new HApiPropertyImpl(propName, propDescription, propType, propMultiple);
+                properties.put(prop.getName(), prop);
+            }
+            newType.setParent(parent);
+            newType.setProperties(properties);
+
+        } catch (RuntimeException t) {
+            // Remove type from cache if it wasn't created successfully
+            TypesCache.getInstance(this).removeType(newType.getPath());
+            throw t;
+        } catch (RepositoryException e) {
+            // Remove type from cache if it wasn't created successfully
+            TypesCache.getInstance(this).removeType(newType.getPath());
+            throw e;
         }
-        return new HApiTypeImpl(name, description, path, fqdn, parameters, properties, parent, false);
+
+        return newType;
     }
 
     /**
@@ -208,5 +223,9 @@ class TypesCache {
     public void addType(HApiType type) {
         this.types.put(type.getPath(), type);
     }
+
+    public void removeType(String path) {
+        this.types.remove(path);
+    }
 }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 10/15: SLING-5474 : Move sightly use objects to a different package. Apply patch from Andrei Dulvac

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 28adc2e2b1f32d0fad192bcf896b25c45f1fc0d1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 1 17:14:22 2016 +0000

    SLING-5474 : Move sightly use objects to a different package. Apply patch from Andrei Dulvac
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1727976 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/hapi/{ => sightly}/HApiUse.java   |  4 +++-
 .../apache/sling/hapi/{ => sightly}/TypeView.java  |  5 ++++-
 .../apache/sling/hapi/sightly/package-info.java    | 23 ++++++++++++++++++++++
 .../libs/sling/hapi/components/type/type.html      |  2 +-
 4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/HApiUse.java b/src/main/java/org/apache/sling/hapi/sightly/HApiUse.java
similarity index 96%
rename from src/main/java/org/apache/sling/hapi/HApiUse.java
rename to src/main/java/org/apache/sling/hapi/sightly/HApiUse.java
index 112bd1a..c000143 100644
--- a/src/main/java/org/apache/sling/hapi/HApiUse.java
+++ b/src/main/java/org/apache/sling/hapi/sightly/HApiUse.java
@@ -17,7 +17,7 @@
  * under the License.
  ******************************************************************************/
 
-package org.apache.sling.hapi;
+package org.apache.sling.hapi.sightly;
 
 import java.util.Map;
 
@@ -27,6 +27,8 @@ import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.hapi.HApiUtil;
+import org.apache.sling.hapi.MicrodataAttributeHelper;
 import org.apache.sling.scripting.sightly.pojo.Use;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/src/main/java/org/apache/sling/hapi/TypeView.java b/src/main/java/org/apache/sling/hapi/sightly/TypeView.java
similarity index 95%
rename from src/main/java/org/apache/sling/hapi/TypeView.java
rename to src/main/java/org/apache/sling/hapi/sightly/TypeView.java
index 3fb0d33..927deb5 100644
--- a/src/main/java/org/apache/sling/hapi/TypeView.java
+++ b/src/main/java/org/apache/sling/hapi/sightly/TypeView.java
@@ -16,13 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  ******************************************************************************/
-package org.apache.sling.hapi;
+package org.apache.sling.hapi.sightly;
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+import org.apache.sling.hapi.HApiUtil;
 import org.apache.sling.scripting.sightly.pojo.Use;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/src/main/java/org/apache/sling/hapi/sightly/package-info.java b/src/main/java/org/apache/sling/hapi/sightly/package-info.java
new file mode 100644
index 0000000..45c370c
--- /dev/null
+++ b/src/main/java/org/apache/sling/hapi/sightly/package-info.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.0")
+package org.apache.sling.hapi.sightly;
+
+import aQute.bnd.annotation.Version;
diff --git a/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html b/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html
index b24977c..39d8f18 100644
--- a/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html
+++ b/src/main/resources/SLING-INF/libs/sling/hapi/components/type/type.html
@@ -17,7 +17,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<html data-sly-use.type="org.apache.sling.hapi.TypeView" lang="${type.lang}">
+<html data-sly-use.type="org.apache.sling.hapi.sightly.TypeView" lang="${type.lang}">
 
     <head>
         <meta charset="utf-8">

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 09/15: Minor code clean up

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit e60ffd46c6e9c3f422bd3c52e369c601d03fd6d5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 1 15:51:45 2016 +0000

    Minor code clean up
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1727961 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
index eac29e5..043ce0c 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
@@ -46,7 +46,6 @@ import org.apache.sling.hapi.HApiProperty;
 import org.apache.sling.hapi.HApiType;
 import org.apache.sling.hapi.HApiUtil;
 import org.apache.sling.hapi.MicrodataAttributeHelper;
-import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -74,7 +73,7 @@ public class HApiUtilImpl implements HApiUtil {
 
 
     @Activate
-    private void activate(ComponentContext context, Map<String, Object> configuration) {
+    private void activate(Map<String, Object> configuration) {
         resourceType = PropertiesUtil.toString(configuration.get(HAPI_RESOURCE_TYPE), DEFAULT_RESOURCE_TYPE);
         hApiPaths = PropertiesUtil.toStringArray(configuration.get(HAPI_PATHS));
         serverContextPath = PropertiesUtil.toString(configuration.get(HAPI_EXTERNAL_URL), DEFAULT_SERVER_URL);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 15/15: [maven-release-plugin] copy for tag org.apache.sling.hapi-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 35942435ee4e1cb8a94c369a8b27891c6680f7ee
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 2 14:34:48 2016 +0000

    [maven-release-plugin] copy for tag org.apache.sling.hapi-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0@1728132 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 14/15: [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit a2d6993124e5d26955a261f6d8d7ad33de46e4b3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 2 14:34:33 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.hapi-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1728131 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index da11ab1..1d8f9b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>org.apache.sling.hapi</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
 
     <name>HApi - Sling Hypermedia API tools</name>
@@ -39,9 +39,9 @@
     </properties>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/hapi/core</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.hapi-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.hapi-1.0.0</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 08/15: Minor code clean up

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit d9e56c65b61f3a366a31ba01bf94163d2adb49e4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 1 13:26:59 2016 +0000

    Minor code clean up
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1727933 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/hapi/HApiException.java  |  3 ++
 src/main/java/org/apache/sling/hapi/HApiUse.java   | 13 +++---
 src/main/java/org/apache/sling/hapi/HApiUtil.java  | 17 ++++----
 .../sling/hapi/MicrodataAttributeHelper.java       |  2 -
 .../org/apache/sling/hapi/impl/HApiUtilImpl.java   | 46 +++++++++++++++-------
 5 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/HApiException.java b/src/main/java/org/apache/sling/hapi/HApiException.java
index b9922e0..67cc5ec 100644
--- a/src/main/java/org/apache/sling/hapi/HApiException.java
+++ b/src/main/java/org/apache/sling/hapi/HApiException.java
@@ -22,6 +22,9 @@ package org.apache.sling.hapi;
  * A Hypermedia API exception
  */
 public class HApiException extends RuntimeException {
+
+    private static final long serialVersionUID = 2626376214501558054L;
+
     public HApiException() {
     }
 
diff --git a/src/main/java/org/apache/sling/hapi/HApiUse.java b/src/main/java/org/apache/sling/hapi/HApiUse.java
index 1dfe348..112bd1a 100644
--- a/src/main/java/org/apache/sling/hapi/HApiUse.java
+++ b/src/main/java/org/apache/sling/hapi/HApiUse.java
@@ -19,18 +19,18 @@
 
 package org.apache.sling.hapi;
 
-import org.apache.sling.scripting.sightly.pojo.Use;
+import java.util.Map;
+
+import javax.script.Bindings;
+
 import org.apache.sling.api.SlingHttpServletRequest;
-import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScriptHelper;
+import org.apache.sling.scripting.sightly.pojo.Use;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.script.Bindings;
-import java.util.Map;
-
 /**
  * Sightly use class helper to provide the hypermedia API microdata attributes for the type configured throught the 'type' binding.
  * <p>The type can be a JCR path or a fully qualified domain name like in
@@ -44,7 +44,6 @@ public class HApiUse implements Use {
     private MicrodataAttributeHelper helper;
     private SlingHttpServletRequest request;
     private SlingScriptHelper sling;
-    private Resource resource;
     private ResourceResolver resourceResolver;
     private String typeId;
     private Map<String, String> itemTypeAttr;
@@ -55,10 +54,10 @@ public class HApiUse implements Use {
      * {@inheritDoc}
      * @param bindings
      */
+    @Override
     public void init(Bindings bindings) {
         request = (SlingHttpServletRequest) bindings.get(SlingBindings.REQUEST);
         sling = (SlingScriptHelper) bindings.get(SlingBindings.SLING);
-        resource = (Resource)bindings.get(SlingBindings.RESOURCE);
         resourceResolver = request.getResourceResolver();
         typeId = (String) bindings.get("type");
         LOG.debug("init type: {}", typeId);
diff --git a/src/main/java/org/apache/sling/hapi/HApiUtil.java b/src/main/java/org/apache/sling/hapi/HApiUtil.java
index c262b74..b1cebdd 100644
--- a/src/main/java/org/apache/sling/hapi/HApiUtil.java
+++ b/src/main/java/org/apache/sling/hapi/HApiUtil.java
@@ -19,17 +19,14 @@
 
 package org.apache.sling.hapi;
 
-import org.apache.sling.api.resource.ResourceResolver;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
+import org.apache.sling.api.resource.ResourceResolver;
+
 public interface HApiUtil {
-    public static final Logger LOG = LoggerFactory.getLogger(HApiUtil.class);
 
-    public static final String DEFAULT_RESOURCE_TYPE = "sling/hapi/components/type";
+    String DEFAULT_RESOURCE_TYPE = "sling/hapi/components/type";
 
     /**
      * <p>Get a HApi type object from a type identifier.</p>
@@ -43,7 +40,7 @@ public interface HApiUtil {
      * @return The first node that matches that type or null if none is found.
      * @throws RepositoryException
      */
-    public Node getTypeNode(ResourceResolver resolver, String type) throws RepositoryException;
+    Node getTypeNode(ResourceResolver resolver, String type) throws RepositoryException;
 
 
     /**
@@ -59,7 +56,7 @@ public interface HApiUtil {
      * @return The HApiType resolved from the type identifier
      * @throws javax.jcr.RepositoryException
      */
-    public HApiType fromPath(ResourceResolver resolver, String type) throws RepositoryException;
+    HApiType fromPath(ResourceResolver resolver, String type) throws RepositoryException;
 
     /**
      * <p>Get a HApi type object from the {@link javax.jcr.Node}.</p>
@@ -89,7 +86,7 @@ public interface HApiUtil {
      * @return The HApiType
      * @throws RepositoryException
      */
-    public HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException;
+    HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException;
 
     /**
      * Get a new instance of AttributeHelper for the type identified by 'type'
@@ -99,5 +96,5 @@ public interface HApiUtil {
      * @return
      * @throws RepositoryException
      */
-    public MicrodataAttributeHelper getHelper(ResourceResolver resolver, String type) throws RepositoryException;
+    MicrodataAttributeHelper getHelper(ResourceResolver resolver, String type) throws RepositoryException;
 }
diff --git a/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java b/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java
index c52f068..e3f21d3 100644
--- a/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java
+++ b/src/main/java/org/apache/sling/hapi/MicrodataAttributeHelper.java
@@ -18,8 +18,6 @@
  ******************************************************************************/
 package org.apache.sling.hapi;
 
-import org.apache.sling.api.resource.ResourceResolver;
-
 import java.util.Map;
 
 public interface MicrodataAttributeHelper {
diff --git a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
index c6810ea..eac29e5 100644
--- a/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java
@@ -18,31 +18,45 @@
  ******************************************************************************/
 package org.apache.sling.hapi.impl;
 
-import org.apache.sling.hapi.HApiProperty;
-import org.apache.sling.hapi.HApiType;
-import org.apache.sling.hapi.MicrodataAttributeHelper;
-import org.apache.sling.hapi.HApiUtil;
-import org.apache.felix.scr.annotations.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Value;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
-import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.hapi.HApiProperty;
+import org.apache.sling.hapi.HApiType;
+import org.apache.sling.hapi.HApiUtil;
+import org.apache.sling.hapi.MicrodataAttributeHelper;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.*;
-import javax.jcr.query.Query;
-import javax.jcr.query.QueryManager;
-import javax.jcr.query.QueryResult;
-import java.util.*;
-
 
 @Component(label = "Apache Sling Hypermedia API tools", metatype = true)
-@Service()
-
+@Service(value = HApiUtil.class)
 public class HApiUtilImpl implements HApiUtil {
 
+    private final Logger LOG = LoggerFactory.getLogger(HApiUtil.class);
+
     @Property(label = "HApi Resource Type", cardinality = 0, value = DEFAULT_RESOURCE_TYPE)
     public static final String HAPI_RESOURCE_TYPE = "org.apache.sling.hapi.tools.resourcetype";
 
@@ -69,6 +83,7 @@ public class HApiUtilImpl implements HApiUtil {
     /**
      * {@inheritDoc}
      */
+    @Override
     public Node getTypeNode(ResourceResolver resolver, String type) throws RepositoryException {
         Session session = resolver.adaptTo(Session.class);
 
@@ -112,6 +127,7 @@ public class HApiUtilImpl implements HApiUtil {
     /**
      * {@inheritDoc}
      */
+    @Override
     public HApiType fromPath(ResourceResolver resolver, String type) throws RepositoryException {
         Node typeNode = this.getTypeNode(resolver, type);
         LOG.debug("typeNode=" + typeNode);
@@ -125,6 +141,7 @@ public class HApiUtilImpl implements HApiUtil {
     /**
      * {@inheritDoc}
      */
+    @Override
     public HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException {
         if (null == typeNode) return null;
         String name = typeNode.getProperty("name").getValue().getString();
@@ -186,6 +203,7 @@ public class HApiUtilImpl implements HApiUtil {
     /**
      * {@inheritDoc}
      */
+    @Override
     public MicrodataAttributeHelper getHelper(ResourceResolver resolver, String type) throws RepositoryException {
         return new MicrodataAttributeHelperImpl(resolver, TypesCache.getInstance(this).getType(resolver, type));
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-hapi] 03/15: SLING-4513 - change copyright header as authorized in SLING-4778

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.hapi-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-hapi.git

commit 66e05cd45104728f1a50681f6f8236ee02aa8cb3
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Aug 24 15:01:45 2015 +0000

    SLING-4513 - change copyright header as authorized in SLING-4778
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/hapi/core@1697427 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/hapi/impl/AbstractHapiTypeImpl.java      | 32 +++++++++++-----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java b/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java
index 6469522..90cabce 100644
--- a/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java
+++ b/src/main/java/org/apache/sling/hapi/impl/AbstractHapiTypeImpl.java
@@ -1,21 +1,21 @@
-/*************************************************************************
+/*******************************************************************************
+ * 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
  *
- * ADOBE CONFIDENTIAL
- * __________________
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Copyright 2014 Adobe Systems Incorporated
- *  All Rights Reserved.
- *
- * NOTICE:  All information contained herein is, and remains
- * the property of Adobe Systems Incorporated and its suppliers,
- * if any.  The intellectual and technical concepts contained
- * herein are proprietary to Adobe Systems Incorporated and its
- * suppliers and may be covered by U.S. and Foreign Patents,
- * patents in process, and are protected by trade secret or copyright law.
- * Dissemination of this information or reproduction of this material
- * is strictly forbidden unless prior written permission is obtained
- * from Adobe Systems Incorporated.
- **************************************************************************/
+ * 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.hapi.impl;
 
 import org.apache.sling.hapi.HApiProperty;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.