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:49:13 UTC
[sling-org-apache-sling-jcr-repoinit] 30/43: SLING-5355 -
ProvisioningModelIT passes
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git
commit 4fc1e2130260eaf06f47245ab6edd580be3aa665
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri May 20 09:40:50 2016 +0000
SLING-5355 - ProvisioningModelIT passes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/repoinit/oak-jcr@1744678 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/sling/repoinit/jcr/RepositoryInitializer.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java b/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java
index 3f4f288..648d073 100644
--- a/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java
+++ b/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java
@@ -49,7 +49,10 @@ import org.slf4j.LoggerFactory;
/** SlingRepositoryInitializer that executes repoinit statements read
* from a configurable URL.
*/
-@Component
+@Component(
+ name="Apache Sling Repository Initializer",
+ description="Initializes the JCR content repository using repoinit statements",
+ metatype=true)
@Service(SlingRepositoryInitializer.class)
@Properties({
// SlingRepositoryInitializers are executed in ascending
@@ -69,13 +72,13 @@ public class RepositoryInitializer implements SlingRepositoryInitializer {
public static final String PROP_TEXT_URL = "text.url";
private String textURL;
- public static final String DEFAULT_MODEL_SECTION_NAME = ":repoinit";
+ public static final String DEFAULT_MODEL_SECTION_NAME = "repoinit";
@Property(
label="Model section name",
description=
- "Optional provisioning model section name to used to extract repoinit statements"
- + " from the raw text provided by our text URL. Leave empty to consider the content"
+ "Optional provisioning model additional section name (without leading colon) used to extract"
+ + " repoinit statements from the raw text provided by our text URL. Leave empty to consider the content"
+ " provided by that URL to already be in repoinit format",
value=DEFAULT_MODEL_SECTION_NAME)
public static final String PROP_MODEL_SECTION_NAME = "model.section.name";
@@ -104,6 +107,7 @@ public class RepositoryInitializer implements SlingRepositoryInitializer {
log.info("Executing {}", op);
op.accept(v);
}
+ s.save();
log.info("{} repoinit operations executed", count);
} finally {
s.logout();
@@ -122,6 +126,7 @@ public class RepositoryInitializer implements SlingRepositoryInitializer {
} else {
final StringWriter w = new StringWriter();
IOUtils.copy(is, w, "UTF-8");
+ result = w.toString();
}
} catch(Exception e) {
log.warn("Error reading repoinit statements from " + textURL, e);
@@ -138,6 +143,7 @@ public class RepositoryInitializer implements SlingRepositoryInitializer {
}
String result = getRawRepoInitText();
log.debug("Raw text from {}: \n{}", textURL, result);
+ log.info("Got {} characters from {}", result.length(), textURL);
if(parseRawText) {
final StringReader r = new StringReader(result);
try {
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.