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:52:22 UTC

[sling-org-apache-sling-launchpad-installer] annotated tag org.apache.sling.launchpad.installer-1.0.0 created (now af61b1b)

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

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


      at af61b1b  (tag)
 tagging 8876918f8ad288864e3b400b218fc2c417d9634c (commit)
      by Justin Edelson
      on Tue Feb 15 01:51:52 2011 +0000

- Log -----------------------------------------------------------------
org.apache.sling.launchpad.installer-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new d27b45e  SLING-1597 - adding config installation via launchpad
     new 0da39a1  SLING-1900 - use org.apache.sling.installer.core instead of obsolete org.apache.sling.osgi.installer
     new ab7ecb6  SLING-1901 - integration test and bugfix for LaunchpadConfigInstaller
     new dfe0bb8  Use parent pom V10 which includes emma profile
     new 4518033  SLING-1954 : Launchpad installer should not depend on SCR
     new efc4342  SLING-1953 Support provisioning of all file types
     new ed24c06  Add extra null checks
     new a7daa57  updating pom pre-release
     new e042148  [maven-release-plugin] prepare release org.apache.sling.launchpad.installer-1.0.0
     new 8876918  [maven-scm] copy for tag org.apache.sling.launchpad.installer-1.0.0

The 10 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-launchpad-installer] 09/10: [maven-release-plugin] prepare release org.apache.sling.launchpad.installer-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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit e0421485e8021fe3fc39f33f1fc5f04e0c93e766
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Feb 15 01:51:46 2011 +0000

    [maven-release-plugin] prepare release org.apache.sling.launchpad.installer-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1070739 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0b07c65..806f439 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,8 +10,7 @@
     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/maven-v4_0_0.xsd">
+<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/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
@@ -22,7 +21,7 @@
     </parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>org.apache.sling.launchpad.installer</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
     <name>Apache Sling Launchpad Installer</name>
 
@@ -31,9 +30,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/installer</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/installer</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.launchpad.installer-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.launchpad.installer-1.0.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.launchpad.installer-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-launchpad-installer] 02/10: SLING-1900 - use org.apache.sling.installer.core instead of obsolete org.apache.sling.osgi.installer

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit 0da39a1d8e749c654885ac9cc05a7e6c22de580c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Dec 23 16:07:05 2010 +0000

    SLING-1900 - use org.apache.sling.installer.core instead of obsolete org.apache.sling.osgi.installer
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1052306 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                             | 6 +++---
 .../sling/launchpad/installer/impl/LaunchpadConfigInstaller.java    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3acf186..ed26bd4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,8 +70,8 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.osgi.installer</artifactId>
-            <version>3.0.0-SNAPSHOT</version>
+            <artifactId>org.apache.sling.installer.core</artifactId>
+            <version>3.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -93,4 +93,4 @@
             <scope>provided</scope>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index 4b1d45a..c4ad12e 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -24,8 +24,8 @@ import java.util.Iterator;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
-import org.apache.sling.osgi.installer.InstallableResource;
-import org.apache.sling.osgi.installer.OsgiInstaller;
+import org.apache.sling.installer.api.InstallableResource;
+import org.apache.sling.installer.api.OsgiInstaller;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,6 +63,6 @@ public class LaunchpadConfigInstaller {
 
         }
 
-        installer.registerResources("launchpad", installables);
+        installer.registerResources("launchpad", (InstallableResource[])installables.toArray());
     }
 }

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

[sling-org-apache-sling-launchpad-installer] 03/10: SLING-1901 - integration test and bugfix for LaunchpadConfigInstaller

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit ab7ecb6a120f2473830c82fdacaffbfd5a04ab07
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Dec 24 11:45:05 2010 +0000

    SLING-1901 - integration test and bugfix for LaunchpadConfigInstaller
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1052489 13f79535-47bb-0310-9956-ffa450edef68
---
 .../installer/impl/LaunchpadConfigInstaller.java      | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index c4ad12e..91fa78b 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -33,8 +33,8 @@ import org.slf4j.LoggerFactory;
 @Component
 public class LaunchpadConfigInstaller {
 
-    /**
-     * 
+    /** Resources supplied under this path by 
+     *  LaunchpadContentProvider are considered for installation
      */
     private static final String ROOT_CONFIG_PATH = "resources/config";
 
@@ -47,22 +47,19 @@ public class LaunchpadConfigInstaller {
     private Logger logger = LoggerFactory.getLogger(this.getClass());
 
     protected void activate(ComponentContext componentContext) {
-        logger.info("Activating launchpad config installer.");
-
+        logger.info("Activating launchpad config installer, resources path={}", ROOT_CONFIG_PATH);
         Collection<InstallableResource> installables = new HashSet<InstallableResource>();
 
         Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
         while (configPaths.hasNext()) {
             String path = configPaths.next();
-
-            logger.info("Installing config launchpad file: {}", path);
-
+            logger.info("Config launchpad file will be installed: {}", path);
             InputStream stream = resourceProvider.getResourceAsStream(path);
-
             installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_CONFIG, 0));
-
         }
 
-        installer.registerResources("launchpad", (InstallableResource[])installables.toArray());
+        final InstallableResource [] toInstall = installables.toArray(new InstallableResource []{});
+        installer.registerResources("launchpad", (toInstall));
+        logger.info("{} resources registered with OsgiInstaller", toInstall.length);
     }
-}
+}
\ No newline at end of file

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

[sling-org-apache-sling-launchpad-installer] 04/10: Use parent pom V10 which includes emma profile

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit dfe0bb857df1ffaf1358e6e9bf35acc23bba40c9
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Dec 28 12:19:36 2010 +0000

    Use parent pom V10 which includes emma profile
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1053325 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index ed26bd4..9bdaa82 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>9</version>
+        <version>10</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
     <groupId>org.apache.sling</groupId>
@@ -59,7 +59,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <version>1.0.0</version>
+            <version>1.4.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

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

[sling-org-apache-sling-launchpad-installer] 08/10: updating pom pre-release

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit a7daa578cb4c9cd64a932e2bd606ae0eccf4948b
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Feb 15 01:48:30 2011 +0000

    updating pom pre-release
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1070736 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ac8d459..0b07c65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,6 +30,12 @@
         This module installs the contents of the launchpad archive into the framework.
     </description>
 
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/launchpad/installer</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/launchpad/installer</url>
+    </scm>
+
     <build>
         <plugins>
             <plugin>
@@ -50,7 +56,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.api</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
+            <version>1.0.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

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

[sling-org-apache-sling-launchpad-installer] 01/10: SLING-1597 - adding config installation via launchpad

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit d27b45e861246b5d916804a4dc4766184d237d09
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Mon Dec 20 16:15:25 2010 +0000

    SLING-1597 - adding config installation via launchpad
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1051167 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                                         | 24 ++++++
 pom.xml                                            | 96 ++++++++++++++++++++++
 .../installer/impl/LaunchpadConfigInstaller.java   | 68 +++++++++++++++
 3 files changed, 188 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..ede7dc1
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,24 @@
+    Apache Sling Launchpad Installer
+
+The Launchpad Installer project installs resources from the launchpad archive 
+
+Getting Started
+===============
+
+This component uses a Maven 2 (http://maven.apache.org/) build
+environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
+2.0.7 or later. We recommend to use the latest Maven version.
+
+If you have Maven 2 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 2 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout http://svn.apache.org/repos/asf/sling/trunk/launchpad/installer
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..3acf186
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>9</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+    <groupId>org.apache.sling</groupId>
+    <artifactId>org.apache.sling.launchpad.installer</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Apache Sling Launchpad Installer</name>
+
+    <description>
+        This module installs the contents of the launchpad archive into the framework.
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>generate-scr-scrdescriptor</id>
+                        <goals>
+                            <goal>scr</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.launchpad.api</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.osgi.installer</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.2.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.5.2</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
new file mode 100644
index 0000000..4b1d45a
--- /dev/null
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -0,0 +1,68 @@
+/*
+ * 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.launchpad.installer.impl;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.osgi.installer.InstallableResource;
+import org.apache.sling.osgi.installer.OsgiInstaller;
+import org.osgi.service.component.ComponentContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component
+public class LaunchpadConfigInstaller {
+
+    /**
+     * 
+     */
+    private static final String ROOT_CONFIG_PATH = "resources/config";
+
+    @Reference
+    private OsgiInstaller installer;
+
+    @Reference
+    private LaunchpadContentProvider resourceProvider;
+
+    private Logger logger = LoggerFactory.getLogger(this.getClass());
+
+    protected void activate(ComponentContext componentContext) {
+        logger.info("Activating launchpad config installer.");
+
+        Collection<InstallableResource> installables = new HashSet<InstallableResource>();
+
+        Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
+        while (configPaths.hasNext()) {
+            String path = configPaths.next();
+
+            logger.info("Installing config launchpad file: {}", path);
+
+            InputStream stream = resourceProvider.getResourceAsStream(path);
+
+            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_CONFIG, 0));
+
+        }
+
+        installer.registerResources("launchpad", installables);
+    }
+}

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

[sling-org-apache-sling-launchpad-installer] 10/10: [maven-scm] copy for tag org.apache.sling.launchpad.installer-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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit 8876918f8ad288864e3b400b218fc2c417d9634c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Feb 15 01:51:52 2011 +0000

    [maven-scm] copy for tag org.apache.sling.launchpad.installer-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.launchpad.installer-1.0.0@1070740 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-launchpad-installer] 06/10: SLING-1953 Support provisioning of all file types

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit efc43423ab9583ded2035a078b1679ea1ec7fabf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jan 28 10:26:29 2011 +0000

    SLING-1953 Support provisioning of all file types
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1064622 13f79535-47bb-0310-9956-ffa450edef68
---
 .../installer/impl/LaunchpadConfigInstaller.java   | 42 ++++++++++++++++------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index 82ce5c2..c2f6435 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -29,28 +29,48 @@ import org.slf4j.LoggerFactory;
 
 public class LaunchpadConfigInstaller {
 
-    /** Resources supplied under this path by
-     *  LaunchpadContentProvider are considered for installation
+    /**
+     * Resources supplied under this path by
+     * LaunchpadContentProvider are considered for installation
+     * as configurations
      */
     private static final String ROOT_CONFIG_PATH = "resources/config";
 
-    private static Logger LOGGER = LoggerFactory.getLogger(LaunchpadConfigInstaller.class);
+    /**
+     * Resources supplied under this path by
+     * LaunchpadContentProvider are considered for installation
+     * as files
+     */
+    private static final String ROOT_INSTALL_PATH = "resources/install";
 
     public static void install(final OsgiInstaller installer,
             final LaunchpadContentProvider resourceProvider) {
-        LOGGER.info("Activating launchpad config installer, resources path={}", ROOT_CONFIG_PATH);
-        Collection<InstallableResource> installables = new HashSet<InstallableResource>();
+        final Logger logger = LoggerFactory.getLogger(LaunchpadConfigInstaller.class);
+        logger.info("Activating launchpad config installer, configuration path={}, install path={}",
+                ROOT_CONFIG_PATH, ROOT_INSTALL_PATH);
+
+        final Collection<InstallableResource> installables = new HashSet<InstallableResource>();
 
-        Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
+        // configurations
+        final Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
         while (configPaths.hasNext()) {
-            String path = configPaths.next();
-            LOGGER.info("Config launchpad file will be installed: {}", path);
-            InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, 0));
+            final String path = configPaths.next();
+            logger.info("Config launchpad file will be installed: {}", path);
+            final InputStream stream = resourceProvider.getResourceAsStream(path);
+            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, null));
+        }
+
+        // files
+        final Iterator<String> filePaths = resourceProvider.getChildren(ROOT_INSTALL_PATH);
+        while (filePaths.hasNext()) {
+            final String path = filePaths.next();
+            logger.info("Launchpad file will be installed: {}", path);
+            final InputStream stream = resourceProvider.getResourceAsStream(path);
+            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_FILE, null));
         }
 
         final InstallableResource [] toInstall = installables.toArray(new InstallableResource []{});
         installer.registerResources("launchpad", (toInstall));
-        LOGGER.info("{} resources registered with OsgiInstaller", toInstall.length);
+        logger.info("{} resources registered with OsgiInstaller", toInstall.length);
     }
 }
\ No newline at end of file

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

[sling-org-apache-sling-launchpad-installer] 05/10: SLING-1954 : Launchpad installer should not depend on SCR

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit 451803363dc49825b13d65ba3eb4721bc520fbab
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jan 25 10:19:13 2011 +0000

    SLING-1954 : Launchpad installer should not depend on SCR
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1063204 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  33 +----
 .../sling/launchpad/installer/impl/Activator.java  |  46 +++++++
 .../installer/impl/LaunchpadConfigInstaller.java   |  31 ++---
 .../launchpad/installer/impl/ServicesListener.java | 135 +++++++++++++++++++++
 4 files changed, 196 insertions(+), 49 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9bdaa82..ac8d459 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,31 +38,16 @@
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
+                        <Bundle-Activator>
+                            org.apache.sling.launchpad.installer.impl.Activator
+                        </Bundle-Activator>
                     </instructions>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>generate-scr-scrdescriptor</id>
-                        <goals>
-                            <goal>scr</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
     <dependencies>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <version>1.4.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.api</artifactId>
             <version>0.0.1-SNAPSHOT</version>
@@ -71,26 +56,16 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.installer.core</artifactId>
-            <version>3.0.0</version>
+            <version>3.1.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>4.2.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <version>4.2.0</version>
-            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
-            <version>1.5.2</version>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>
diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/Activator.java b/src/main/java/org/apache/sling/launchpad/installer/impl/Activator.java
new file mode 100644
index 0000000..4363e19
--- /dev/null
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/Activator.java
@@ -0,0 +1,46 @@
+/*
+ * 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.launchpad.installer.impl;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The <code>Activator</code>
+ */
+public class Activator implements BundleActivator {
+
+    /** The services listener will activate the installer. */
+    private ServicesListener servicesListener;
+
+    /**
+     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+     */
+    public void start(final BundleContext context) {
+        this.servicesListener = new ServicesListener(context);
+    }
+
+    /**
+     * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+     */
+    public void stop(final BundleContext context) {
+        this.servicesListener.deactivate();
+        this.servicesListener = null;
+    }
+}
diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index 91fa78b..82ce5c2 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -5,9 +5,9 @@
  * 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
@@ -21,45 +21,36 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.installer.api.InstallableResource;
 import org.apache.sling.installer.api.OsgiInstaller;
-import org.osgi.service.component.ComponentContext;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Component
 public class LaunchpadConfigInstaller {
 
-    /** Resources supplied under this path by 
+    /** Resources supplied under this path by
      *  LaunchpadContentProvider are considered for installation
      */
     private static final String ROOT_CONFIG_PATH = "resources/config";
 
-    @Reference
-    private OsgiInstaller installer;
-
-    @Reference
-    private LaunchpadContentProvider resourceProvider;
-
-    private Logger logger = LoggerFactory.getLogger(this.getClass());
+    private static Logger LOGGER = LoggerFactory.getLogger(LaunchpadConfigInstaller.class);
 
-    protected void activate(ComponentContext componentContext) {
-        logger.info("Activating launchpad config installer, resources path={}", ROOT_CONFIG_PATH);
+    public static void install(final OsgiInstaller installer,
+            final LaunchpadContentProvider resourceProvider) {
+        LOGGER.info("Activating launchpad config installer, resources path={}", ROOT_CONFIG_PATH);
         Collection<InstallableResource> installables = new HashSet<InstallableResource>();
 
         Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
         while (configPaths.hasNext()) {
             String path = configPaths.next();
-            logger.info("Config launchpad file will be installed: {}", path);
+            LOGGER.info("Config launchpad file will be installed: {}", path);
             InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_CONFIG, 0));
+            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, 0));
         }
 
         final InstallableResource [] toInstall = installables.toArray(new InstallableResource []{});
         installer.registerResources("launchpad", (toInstall));
-        logger.info("{} resources registered with OsgiInstaller", toInstall.length);
+        LOGGER.info("{} resources registered with OsgiInstaller", toInstall.length);
     }
 }
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/ServicesListener.java b/src/main/java/org/apache/sling/launchpad/installer/impl/ServicesListener.java
new file mode 100644
index 0000000..170c2d0
--- /dev/null
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/ServicesListener.java
@@ -0,0 +1,135 @@
+/*
+ * 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.launchpad.installer.impl;
+
+import org.apache.sling.installer.api.OsgiInstaller;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * The <code>ServicesListener</code> listens for the required services
+ * and starts/stops the scanners based on the availability of the
+ * services.
+ */
+public class ServicesListener {
+
+    /** The bundle context. */
+    private final BundleContext bundleContext;
+
+    /** The listener for the installer. */
+    private final Listener installerListener;
+
+    /** The listener for the provider. */
+    private final Listener providerListener;
+
+    public ServicesListener(final BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+        this.installerListener = new Listener(OsgiInstaller.class.getName());
+        this.providerListener = new Listener(LaunchpadContentProvider.class.getName());
+        this.installerListener.start();
+        this.providerListener.start();
+    }
+
+    public synchronized void notifyChange() {
+        // check if all services are available
+        final OsgiInstaller installer = (OsgiInstaller)this.installerListener.getService();
+        final LaunchpadContentProvider lcp = (LaunchpadContentProvider)this.providerListener.getService();
+
+        if ( installer != null && lcp != null ) {
+            LaunchpadConfigInstaller.install(installer, lcp);
+        }
+    }
+
+    /**
+     * Deactivate this listener.
+     */
+    public void deactivate() {
+        this.installerListener.deactivate();
+        this.providerListener.deactivate();
+    }
+
+    protected final class Listener implements ServiceListener {
+
+        private final String serviceName;
+
+        private ServiceReference reference;
+        private Object service;
+
+        public Listener(final String serviceName) {
+            this.serviceName = serviceName;
+        }
+
+        public void start() {
+            this.retainService();
+            try {
+                bundleContext.addServiceListener(this, "("
+                        + Constants.OBJECTCLASS + "=" + serviceName + ")");
+            } catch (final InvalidSyntaxException ise) {
+                // this should really never happen
+                throw new RuntimeException("Unexpected exception occured.", ise);
+            }
+        }
+
+        public void deactivate() {
+            bundleContext.removeServiceListener(this);
+        }
+
+        public synchronized Object getService() {
+            return this.service;
+        }
+        private synchronized void retainService() {
+            if ( this.reference == null ) {
+                this.reference = bundleContext.getServiceReference(this.serviceName);
+                if ( this.reference != null ) {
+                    this.service = bundleContext.getService(this.reference);
+                    if ( this.service == null ) {
+                        this.reference = null;
+                    } else {
+                        notifyChange();
+                    }
+                }
+            }
+        }
+
+        private synchronized void releaseService() {
+            if ( this.reference != null ) {
+                this.service = null;
+                bundleContext.ungetService(this.reference);
+                this.reference = null;
+                notifyChange();
+            }
+        }
+
+        /**
+         * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent)
+         */
+        public void serviceChanged(ServiceEvent event) {
+            if (event.getType() == ServiceEvent.REGISTERED && this.service == null ) {
+                this.retainService();
+            } else if ( event.getType() == ServiceEvent.UNREGISTERING && this.service != null ) {
+                this.releaseService();
+            }
+        }
+    }
+}

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

[sling-org-apache-sling-launchpad-installer] 07/10: Add extra null checks

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.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit ed24c0628f7aa793b0435d730db3b4558e3ec74e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 31 13:12:07 2011 +0000

    Add extra null checks
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1065593 13f79535-47bb-0310-9956-ffa450edef68
---
 .../installer/impl/LaunchpadConfigInstaller.java   | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index c2f6435..1455d1d 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -53,20 +53,24 @@ public class LaunchpadConfigInstaller {
 
         // configurations
         final Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
-        while (configPaths.hasNext()) {
-            final String path = configPaths.next();
-            logger.info("Config launchpad file will be installed: {}", path);
-            final InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, null));
+        if ( configPaths != null ) {
+            while (configPaths.hasNext()) {
+                final String path = configPaths.next();
+                logger.info("Config launchpad file will be installed: {}", path);
+                final InputStream stream = resourceProvider.getResourceAsStream(path);
+                installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, null));
+            }
         }
 
         // files
         final Iterator<String> filePaths = resourceProvider.getChildren(ROOT_INSTALL_PATH);
-        while (filePaths.hasNext()) {
-            final String path = filePaths.next();
-            logger.info("Launchpad file will be installed: {}", path);
-            final InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_FILE, null));
+        if ( filePaths != null ) {
+            while (filePaths.hasNext()) {
+                final String path = filePaths.next();
+                logger.info("Launchpad file will be installed: {}", path);
+                final InputStream stream = resourceProvider.getResourceAsStream(path);
+                installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_FILE, null));
+            }
         }
 
         final InstallableResource [] toInstall = installables.toArray(new InstallableResource []{});

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