You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2019/08/02 09:35:42 UTC

[GitHub] [sling-org-apache-sling-distribution-journal] tmaret commented on a change in pull request #9: GRANITE-26607 - Add package extraction logic

tmaret commented on a change in pull request #9: GRANITE-26607 - Add package extraction logic
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/9#discussion_r310055728
 
 

 ##########
 File path: src/main/java/org/apache/sling/distribution/journal/impl/subscriber/ContentPackageExtractor.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * 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.distribution.journal.impl.subscriber;
+
+import static java.util.Objects.requireNonNull;
+
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.jackrabbit.vault.fs.io.ImportOptions;
+import org.apache.jackrabbit.vault.packaging.JcrPackage;
+import org.apache.jackrabbit.vault.packaging.JcrPackageManager;
+import org.apache.jackrabbit.vault.packaging.Packaging;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.osgi.service.component.annotations.Component;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Hook that can be added to a DistributionPackageBuilder.
+ * Each distribution package is inspected for possible content packages in /etc/packages.
+ * Such content packages are installed via the Packaging service.
+ */
+@Component
+public class ContentPackageExtractor {
+    private static final String PACKAGE_BASE_PATH = "/etc/packages/";
+
+    private Logger log = LoggerFactory.getLogger(this.getClass());
+
+    private Packaging packageService;
+    private PackageHandling packageHandling;
+    
+    public ContentPackageExtractor(Packaging packageService, PackageHandling packageHandling) {
+        this.packageService = packageService;
+        this.packageHandling = packageHandling;
+    }
+    
+    public void handle(ResourceResolver resourceResolver, List<String> paths) {
 
 Review comment:
   PackageHandling.Extract and PackageHandling.Install are not handled differently.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services