svn commit: r930851 - in /websites/staging/sling/trunk/content: ./ site/.htaccess site/mime-type-support-commonsmime.data/ site/mime-type-support-commonsmime.html sitemap.html
Author: buildbot Date: Fri Nov 28 08:16:27 2014 New Revision: 930851 Log: Staging update by buildbot for sling Removed: websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.data/ websites/staging/sling/trunk/content/site/mime-type-support-commonsmime.html Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/site/.htaccess websites/staging/sling/trunk/content/sitemap.html Propchange: websites/staging/sling/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Fri Nov 28 08:16:27 2014 @@ -1 +1 @@ -1642173 +1642271 Modified: websites/staging/sling/trunk/content/site/.htaccess == --- websites/staging/sling/trunk/content/site/.htaccess (original) +++ websites/staging/sling/trunk/content/site/.htaccess Fri Nov 28 08:16:27 2014 @@ -76,4 +76,5 @@ Redirect Permanent /site/release-managem Redirect Permanent /site/scheduler-service-commons-scheduler.htm /documentation/bundles/scheduler-service-commons-scheduler.html Redirect Permanent /site/dependency-management.html /documentation/development/dependency-management.html Redirect Permanent /site/issue-tracker.html /documentation/development/issue-tracker.html -Redirect Permanent /site/osgi-installer.html /documentation/bundles/osgi-installer.html \ No newline at end of file +Redirect Permanent /site/osgi-installer.html /documentation/bundles/osgi-installer.html +Redirect Permanent /site/mime-type-support-commonsmime.html /documentation/bundles/mime-type-support-commons-mime.html Modified: websites/staging/sling/trunk/content/sitemap.html == --- websites/staging/sling/trunk/content/sitemap.html (original) +++ websites/staging/sling/trunk/content/sitemap.html Fri Nov 28 08:16:27 2014 @@ -123,6 +123,7 @@ lia href=/documentation/bundles/sling-query.htmlSling Query/a/li lia href=/documentation/bundles/sling-scripting-jsp-taglib.htmlSling Scripting JSP Taglib/a/li lia href=/documentation/bundles/sling-settings-org-apache-sling-settings.htmlSling Settings (org.apache.sling.settings)/a/li +lia href=/documentation/bundles/validation.htmlSling Validation/a/li lia href=/documentation/bundles/web-console-extensions.htmlWeb Console Extensions/a/li lia href=/documentation/bundles/xml-support.htmlXML support/a/li /ul @@ -137,14 +138,18 @@ /ul /li lia href=/documentation/development/issue-tracker.htmlIssue Tracker/a/li +lia href=/documentation/development/jcr-mock.htmlJCR Mocks/a/li lia href=/documentation/development/jspc.htmlMaven JspC Plugin/a/li lia href=/documentation/development/logging.htmlLogging/a/li lia href=/documentation/development/maven-archetypes.htmlMaven Archetypes/a/li lia href=/documentation/development/maven-launchpad-plugin.htmlMaven Launchpad Plugin/a/li lia href=/documentation/development/maventipsandtricks.htmlMavenTipsAndTricks/a/li lia href=/documentation/development/monitoring-requests.htmlMonitoring Requests/a/li +lia href=/documentation/development/osgi-mock.htmlOSGi Mocks/a/li lia href=/documentation/development/release-management.htmlRelease Management/a/li lia href=/documentation/development/repository-based-development.htmlRepository Based Development/a/li +lia href=/documentation/development/resourceresolver-mock.htmlResource Resolver Mock/a/li +lia href=/documentation/development/sling-mock.htmlSling Mocks/a/li lia href=/documentation/development/sling-testing-tools.htmlSling Testing Tools/a/li lia href=/documentation/development/sling.htmlMaven Sling Plugin/a/li lia href=/documentation/development/slingstart.htmlThe Apache Sling Provisioning Model and Apache SlingStart/a/li
svn commit: r1642276 - in /sling/trunk/testing/junit/core/src/main: java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java resources/junit.css
Author: bdelacretaz Date: Fri Nov 28 09:23:41 2014 New Revision: 1642276 URL: http://svn.apache.org/r1642276 Log: SLING-4208 - add links to tests on the JUnit servlet page - contributed by Ben Helleman, thanks! Modified: sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java sling/trunk/testing/junit/core/src/main/resources/junit.css Modified: sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java?rev=1642276r1=1642275r2=1642276view=diff == --- sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java (original) +++ sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/impl/servlet/HtmlRenderer.java Fri Nov 28 09:23:41 2014 @@ -70,7 +70,7 @@ public class HtmlRenderer extends RunLis output.println(ul class='testNames'); for(String str : data) { output.println(li); -HtmlFilter.escape(output, str); +link(str, str + .html, GET); output.println(/li); } output.println(/ul); @@ -98,8 +98,8 @@ public class HtmlRenderer extends RunLis } else { output.print(a href='); output.print(url); -HtmlFilter.escape(output, info); output.print('); +HtmlFilter.escape(output, info); output.println(/a); } Modified: sling/trunk/testing/junit/core/src/main/resources/junit.css URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/src/main/resources/junit.css?rev=1642276r1=1642275r2=1642276view=diff == --- sling/trunk/testing/junit/core/src/main/resources/junit.css (original) +++ sling/trunk/testing/junit/core/src/main/resources/junit.css Fri Nov 28 09:23:41 2014 @@ -51,4 +51,13 @@ h2,h3,h4 { .note { font-size:80%; +} + +ul li .link a { +font-size: 90%; +text-decoration: none; +} + +ul li .link a:visited { +color: rgb(0, 0, 238); } \ No newline at end of file
svn commit: r1642281 [5/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/SightlyJavaCompilerService.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/SightlyJavaCompilerService.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/SightlyJavaCompilerService.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/SightlyJavaCompilerService.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,322 @@ +/*** + * 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.scripting.sightly.impl.compiler; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.List; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +import org.apache.felix.scr.annotations.Activate; +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; +import org.apache.sling.api.resource.LoginException; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ResourceResolverFactory; +import org.apache.sling.commons.classloader.ClassLoaderWriter; +import org.apache.sling.commons.compiler.CompilationResult; +import org.apache.sling.commons.compiler.CompilationUnit; +import org.apache.sling.commons.compiler.CompilerMessage; +import org.apache.sling.commons.compiler.Options; +import org.apache.sling.jcr.compiler.JcrJavaCompiler; +import org.apache.sling.scripting.sightly.ResourceResolution; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * The {@code SightlyJavaCompiler} allows for simple instantiation of arbitrary classes that are either stored in the repository + * or in regular OSGi bundles. It also compiles Java sources on-the-fly and can discover class' source files based on + * {@link Resource}s (typically Sling components). It supports Sling Resource type inheritance. + */ +@Component +@Service(SightlyJavaCompilerService.class) +public class SightlyJavaCompilerService { + +private static final Logger LOG = LoggerFactory.getLogger(SightlyJavaCompilerService.class); + +@Reference +private ClassLoaderWriter classLoaderWriter = null; + +@Reference +private JcrJavaCompiler jcrJavaCompiler = null; + +@Reference +private ResourceResolverFactory rrf = null; + +private Options options; + +private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); +private Lock readLock = lock.readLock(); +private Lock writeLock = lock.writeLock(); + +/** + * This method returns an Object instance based on a class that is either found through regular classloading mechanisms or on-the-fly + * compilation. In case the requested class does not denote a fully qualified classname, this service will try to find the class through + * Sling's servlet resolution mechanism and compile the class on-the-fly if required. + * + * @param resource the lookup will be performed based on this resource + * @param className name of class to use for object instantiation + * @return object instance of the requested class + * @throws CompilerException in case of any runtime exception + */ +public Object getInstance(Resource resource, String className) { + +LOG.debug(Attempting to obtain bean instance of resource '{}' and class '{}', resource.getPath(), className); + +// assume fully qualified class name +if (className.contains(.)) { +Resource pojoResource = checkIfPojoIsInRepo(className); +if (pojoResource != null) { +
svn commit: r1642281 [1/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Author: fmeschbe Date: Fri Nov 28 10:18:01 2014 New Revision: 1642281 URL: http://svn.apache.org/r1642281 Log: SLING-4206 Refactor Sightly and Sightly JS - Cleanup API - Structure API - Move implementations into impl folders Applying patch by Radu Cotescu (thank you very much) Added: sling/trunk/contrib/scripting/sightly/SLING-4206.patch sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyLexer.g4 sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyParser.g4 sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/ResourceResolution.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/SightlyException.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/extension/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/extension/ExtensionInstance.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/extension/RuntimeExtension.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/extension/RuntimeExtensionException.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/extension/package-info.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/CompilationOutput.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/ExpressionTranslator.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/GenHelper.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/JavaClassBackend.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/JavaSource.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/SourceGenConstants.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/Type.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/TypeInference.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/TypeInfo.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/UnitBuilder.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableAnalyzer.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableDescriptor.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableScope.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/operator/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/operator/BinaryOpGen.java (with props) sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/operator/ComparisonOpGen.java (with props)
svn commit: r1642281 [3/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Modified: sling/trunk/contrib/scripting/sightly/engine/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/pom.xml?rev=1642281r1=1642280r2=1642281view=diff == --- sling/trunk/contrib/scripting/sightly/engine/pom.xml (original) +++ sling/trunk/contrib/scripting/sightly/engine/pom.xml Fri Nov 28 10:18:01 2014 @@ -78,9 +78,6 @@ configuration instructions Embed-Dependencyantlr4-runtime,org.abego.treelayout.core/Embed-Dependency -Export-Package -org.apache.sling.scripting.sightly.api -/Export-Package ScriptEngine-Name${project.name}/ScriptEngine-Name ScriptEngine-Version${project.version}/ScriptEngine-Version /instructions Added: sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyLexer.g4 URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyLexer.g4?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyLexer.g4 (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyLexer.g4 Fri Nov 28 10:18:01 2014 @@ -0,0 +1,120 @@ +/*** + * 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. + **/ +lexer grammar SightlyLexer; + +ESC_EXPR: '\${'.*? '}'; + +EXPR_START: '${' - pushMode(ExpressionMode); + +TEXT_PART: .; //$hello ${expr} + + +mode ExpressionMode; + +EXPR_END: '}' - popMode; + + +BOOL_CONSTANT: 'true' | 'false'; + +DOT: '.'; + +LBRACKET: '('; + +RBRACKET: ')'; + +AND_OP: ''; + +OR_OP: '||'; + +NOT_OP: '!'; + +COMMA: ','; + +ARRAY_START: '['; + +ARRAY_END: ']'; + +ASSIGN: '='; + +OPTION_SEP: '@'; + +TERNARY_Q_OP: '?'; + +TERNARY_BRANCHES_OP: ':'; + +LT: ''; + +LEQ: '='; + +GEQ: '='; + +GT: ''; + +EQ: '=='; + +NEQ: '!='; + +// tokens + +ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|':')* +; + +INT : '0'..'9'+ +; + +FLOAT +: ('0'..'9')+ '.' ('0'..'9')+ EXPONENT? +//| '.' ('0'..'9')+ EXPONENT? -- conflicts with a.2 notation +| ('0'..'9')+ EXPONENT +; + +COMMENT: '!--/*' .*? '*/--' - skip; + +WS : ( ' ' +| '\t' +| '\r' +| '\n' +) - skip +; + + +STRING +: '' ( ESC_SEQ | ~('\\'|'') )* '' +| '\'' ( ESC_SEQ | ~('\\'|'\'') )* '\'' +; + +//CHAR: '\'' ( ESC_SEQ | ~('\''|'\\') ) '\'' +//; + +fragment +EXPONENT : ('e'|'E') ('+'|'-')? ('0'..'9')+ ; + +fragment +HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ; + +fragment +ESC_SEQ +: '\\' ('b'|'t'|'n'|'f'|'r'|'\'|'\''|'\\') +| UNICODE_ESC +; + +fragment +UNICODE_ESC +: '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT +; Added: sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyParser.g4 URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyParser.g4?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyParser.g4 (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/scripting/sightly/impl/parser/expr/generated/SightlyParser.g4 Fri Nov 28 10:18:01 2014 @@ -0,0 +1,139 @@ +/*** + * Licensed to the Apache Software
svn commit: r1642281 [6/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/TernaryOperator.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/TernaryOperator.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/TernaryOperator.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/TernaryOperator.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,65 @@ +/*** + * 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.scripting.sightly.impl.compiler.expression.node; + +import org.apache.sling.scripting.sightly.impl.compiler.expression.ExpressionNode; +import org.apache.sling.scripting.sightly.impl.compiler.expression.NodeVisitor; + +/** + * Defines the Sightly ternary operator: {@code condition ? then : else}. + */ +public class TernaryOperator implements ExpressionNode { + +private ExpressionNode condition; +private ExpressionNode thenBranch; +private ExpressionNode elseBranch; + +public TernaryOperator(ExpressionNode condition, ExpressionNode thenBranch, ExpressionNode elseBranch) { +this.condition = condition; +this.thenBranch = thenBranch; +this.elseBranch = elseBranch; +} + +public ExpressionNode getCondition() { +return condition; +} + +public ExpressionNode getThenBranch() { +return thenBranch; +} + +public ExpressionNode getElseBranch() { +return elseBranch; +} + +@Override +public T T accept(NodeVisitorT visitor) { +return visitor.evaluate(this); +} + +@Override +public String toString() { +return TernaryOperator{ + +condition= + condition + +, thenBranch= + thenBranch + +, elseBranch= + elseBranch + +'}'; +} +} Propchange: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/TernaryOperator.java -- svn:mime-type = text/plain Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/UnaryOperation.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/UnaryOperation.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/UnaryOperation.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/expression/node/UnaryOperation.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,58 @@ +/*** + * 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
svn commit: r1642281 [8/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Propchange: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/util/expression/HomogenousNodeVisitor.java -- svn:mime-type = text/plain Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/util/expression/NodeTransformer.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/util/expression/NodeTransformer.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/util/expression/NodeTransformer.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/util/expression/NodeTransformer.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,125 @@ +/*** + * 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.scripting.sightly.impl.compiler.util.expression; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.sling.scripting.sightly.impl.compiler.expression.ExpressionNode; +import org.apache.sling.scripting.sightly.impl.compiler.expression.NodeVisitor; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.ArrayLiteral; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.BinaryOperation; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.BooleanConstant; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.Identifier; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.MapLiteral; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.NullLiteral; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.NumericConstant; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.PropertyAccess; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.RuntimeCall; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.StringConstant; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.TernaryOperator; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.UnaryOperation; + +public class NodeTransformer implements NodeVisitorExpressionNode { + +public final ExpressionNode transform(ExpressionNode node) { +return node.accept(this); +} + +@Override +public ExpressionNode evaluate(PropertyAccess propertyAccess) { +return new PropertyAccess(transform(propertyAccess.getTarget()), transform(propertyAccess.getProperty())); +} + +@Override +public ExpressionNode evaluate(Identifier identifier) { +return identifier; +} + +@Override +public ExpressionNode evaluate(StringConstant text) { +return text; +} + +@Override +public ExpressionNode evaluate(BinaryOperation binaryOperation) { +return new BinaryOperation(binaryOperation.getOperator(), +transform(binaryOperation.getLeftOperand()), +transform(binaryOperation.getRightOperand())); +} + +@Override +public ExpressionNode evaluate(BooleanConstant booleanConstant) { +return booleanConstant; +} + +@Override +public ExpressionNode evaluate(NumericConstant numericConstant) { +return numericConstant; +} + +@Override +public ExpressionNode evaluate(UnaryOperation unaryOperation) { +return new UnaryOperation(unaryOperation.getOperator(), transform(unaryOperation.getTarget())); +} + +@Override +public ExpressionNode evaluate(TernaryOperator ternaryOperator) { +return new TernaryOperator( +transform(ternaryOperator.getCondition()), +
svn commit: r1642281 [9/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/UnitLoader.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/UnitLoader.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/UnitLoader.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/UnitLoader.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,448 @@ +/*** + * 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.scripting.sightly.impl.engine; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import javax.script.Bindings; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.felix.scr.annotations.Activate; +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Properties; +import org.apache.felix.scr.annotations.Property; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; +import org.apache.sling.api.SlingConstants; +import org.apache.sling.api.SlingHttpServletResponse; +import org.apache.sling.api.resource.LoginException; +import org.apache.sling.api.resource.PersistenceException; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ResourceResolverFactory; +import org.apache.sling.api.resource.ResourceUtil; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.api.scripting.SlingBindings; +import org.apache.sling.scripting.sightly.SightlyException; +import org.apache.sling.scripting.sightly.impl.compiled.CompilationOutput; +import org.apache.sling.scripting.sightly.impl.compiled.JavaClassBackend; +import org.apache.sling.scripting.sightly.impl.compiler.SightlyJavaCompilerService; +import org.apache.sling.scripting.sightly.impl.compiler.SightlyParsingException; +import org.apache.sling.scripting.sightly.impl.compiler.SightlyCompilerService; +import org.apache.sling.scripting.sightly.impl.compiler.util.GlobalShadowCheckBackend; +import org.apache.sling.scripting.sightly.impl.engine.compiled.JavaClassTemplate; +import org.apache.sling.scripting.sightly.impl.engine.compiled.SourceIdentifier; +import org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl; +import org.apache.sling.scripting.sightly.impl.engine.runtime.RenderUnit; +import org.apache.sling.scripting.sightly.impl.engine.runtime.SightlyRenderException; +import org.apache.sling.settings.SlingSettingsService; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.event.Event; +import org.osgi.service.event.EventConstants; +import org.osgi.service.event.EventHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Create rendering units from resources. + */ +@Component +@Service({UnitLoader.class, EventHandler.class}) +@Properties({ +@Property( +name = EventConstants.EVENT_TOPIC, +value = {SlingConstants.TOPIC_RESOURCE_ADDED, SlingConstants.TOPIC_RESOURCE_CHANGED, SlingConstants.TOPIC_RESOURCE_REMOVED} +), +@Property( +name = EventConstants.EVENT_FILTER, +value = (|( + SlingConstants.PROPERTY_PATH + =/apps/**/*. + SightlyScriptEngineFactory.EXTENSION + )( + +SlingConstants.PROPERTY_PATH + =/libs/**/*. +
svn commit: r1642281 [11/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ e
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/html/dom/HtmlParser.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/html/dom/HtmlParser.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/html/dom/HtmlParser.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/html/dom/HtmlParser.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,468 @@ +/*** + * 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.scripting.sightly.impl.html.dom; + +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.Reader; + +/** + * HTML parser. Invokes a codeDocumentHandler/code whenever an event occurs. + */ +public final class HtmlParser { + +/** Internal character buffer */ +private final CharArrayWriter buffer = new CharArrayWriter(256); + +/** Tag tokenizer */ +private final TagTokenizer tokenizer = new TagTokenizer(); + +/** Tag name buffer */ +private final CharArrayWriter tagNameBuffer = new CharArrayWriter(30); + +/** Tag name */ +private String tagName; + +/** Registered document handler */ +private final DocumentHandler documentHandler; + +private enum PARSE_STATE { +OUTSIDE, +TAG, +SCRIPT, +COMMENT, +STRING, +EXPRESSION +} + +/** Tag type constant */ +private final static int TT_NONE = 0; + +/** Tag type constant */ +private final static int TT_MAYBE = 1; + +/** Tag type constant */ +private final static int TT_TAG = 2; + +/** Expression state constant */ +private final static int EXPR_NONE = 0; + +/** Expression state constant */ +private final static int EXPR_MAYBE = 1; + +/** Parse state */ +private PARSE_STATE parseState = PARSE_STATE.OUTSIDE; + +/** Parse substate */ +private int parseSubState; + +/** Previous parse state */ +private PARSE_STATE prevParseState; + +/** Current tag type */ +private int tagType; + +/** Expression type */ +private int exprType; + +/** Quote character */ +private char quoteChar; + +public static void parse(final Reader reader, final DocumentHandler documentHandler) +throws IOException { +final HtmlParser parser = new HtmlParser(documentHandler); +parser.parse(reader); +} + +/** + * Default constructor. + */ +private HtmlParser(final DocumentHandler documentHandler) { +this.documentHandler = documentHandler; +} + +private void parse(final Reader reader) +throws IOException { +try { +this.documentHandler.onStart(); +final char[] readBuffer = new char[2048]; +int readLen = 0; +while ( (readLen = reader.read(readBuffer)) 0 ) { +this.update(readBuffer, readLen); +} +this.flushBuffer(); +this.documentHandler.onEnd(); +} finally { +try { +reader.close(); +} catch ( final IOException ignore) { +// ignore +} +} +} + +/** + * Feed characters to the parser. + * + * @param buf character buffer + * @param len length of affected buffer + */ +private void update(final char[] buf, int len) throws IOException { +int start = 0; +final int end = len; + +for (int curr = start; curr end; curr++) { +final char c = buf[curr]; + +switch (parseState) { +case OUTSIDE: +if (c == '') { +if (curr start) { +documentHandler.onCharacters(buf, start, curr - start); +} +start = curr; +
svn commit: r1642281 [14/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ e
Added: sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoop.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoop.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoop.java (added) +++ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoop.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,78 @@ +/*** + * 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.scripting.sightly.js.impl.loop; + +import java.util.LinkedList; +import java.util.Queue; + +import org.apache.sling.scripting.sightly.use.SightlyUseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * Simulates an event loop for the Rhino JS engine. + */ +public class EventLoop { + +private static final Logger log = LoggerFactory.getLogger(EventLoop.class); + +private QueueTask taskQueue = new LinkedListTask(); +private boolean isRunning; + +/** + * Add a task to the queue. If the queue is empty, start running tasks. If it + * isn't empty, continue running the available tasks + * @param task the task to be added + */ +public void schedule(Task task) { +taskQueue.offer(task); +run(); +} + +private void run() { +if (isRunning) { +return; +} +isRunning = true; +try { +// Holds the first exception encountered. If there is such a first exception, it will be +// rethrown +Exception thrownException = null; +while (!taskQueue.isEmpty()) { +Task task = taskQueue.poll(); +try { +task.run(); +} catch (Exception e) { +if (thrownException == null) { +thrownException = e; //first exception +} else { +log.error(Additional error occurred while running JS script: , e); +} +} +} +if (thrownException != null) { +throw new SightlyUseException(thrownException); +} +} finally { +isRunning = false; +} +} + +} Propchange: sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoop.java -- svn:mime-type = text/plain Added: sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoopInterop.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoopInterop.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoopInterop.java (added) +++ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/impl/loop/EventLoopInterop.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,53 @@ +/*** + * 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
svn commit: r1642281 [10/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ e
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,105 @@ +/*** + * 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.scripting.sightly.impl.engine.extension.use; + +import javax.script.Bindings; + +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Properties; +import org.apache.felix.scr.annotations.Property; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.resource.LoginException; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ResourceResolver; +import org.apache.sling.api.resource.ResourceResolverFactory; +import org.apache.sling.api.scripting.SlingBindings; +import org.apache.sling.api.scripting.SlingScriptHelper; +import org.apache.sling.scripting.sightly.ResourceResolution; +import org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngineFactory; +import org.apache.sling.scripting.sightly.impl.engine.UnitLoader; +import org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl; +import org.apache.sling.scripting.sightly.impl.engine.runtime.RenderUnit; +import org.apache.sling.scripting.sightly.render.RenderContext; +import org.apache.sling.scripting.sightly.use.ProviderOutcome; +import org.apache.sling.scripting.sightly.use.SightlyUseException; +import org.apache.sling.scripting.sightly.use.UseProvider; +import org.osgi.framework.Constants; + +/** + * Interprets identifiers as paths to other Sightly templates + */ +@Component( +metatype = true, +label = Apache Sling Scripting Sightly Render Unit Use Provider, +description = The Render Unit Use Provider is responsible for instantiating Sightly templates through the Use-API. +) +@Service(UseProvider.class) +@Properties({ +@Property( +name = Constants.SERVICE_RANKING, +label = Service Ranking, +description = The Service Ranking value acts as the priority with which this Use Provider is queried to return an + +Use-object. A higher value represents a higher priority., +intValue = 100, +propertyPrivate = false +) +}) +public class RenderUnitProvider implements UseProvider { + +@Reference +private UnitLoader unitLoader = null; + +@Reference +private ResourceResolverFactory rrf = null; + +@Override +public ProviderOutcome provide(String identifier, RenderContext renderContext, Bindings arguments) { +if (identifier.endsWith(. + SightlyScriptEngineFactory.EXTENSION)) { +Bindings globalBindings = renderContext.getBindings(); +Resource renderUnitResource = locateResource(globalBindings, identifier); +RenderUnit renderUnit = unitLoader.createUnit(renderUnitResource, globalBindings, (RenderContextImpl) renderContext); +return ProviderOutcome.notNullOrFailure(renderUnit); +} +return ProviderOutcome.failure(); +} + +private Resource locateResource(Bindings bindings, String script) { +ResourceResolver adminResolver = null; +try { +adminResolver = rrf.getAdministrativeResourceResolver(null); +
svn commit: r1642281 [2/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/SLING-4206.patch URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/SLING-4206.patch?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/SLING-4206.patch (added) +++ sling/trunk/contrib/scripting/sightly/SLING-4206.patch Fri Nov 28 10:18:01 2014 @@ -0,0 +1,43730 @@ +From d554d612423a2a95c679b270abbc961571e7e51a Mon Sep 17 00:00:00 2001 +From: Radu Cotescu r...@apache.org +Date: Thu, 27 Nov 2014 18:02:21 +0200 +Subject: [PATCH] SLING-4206 - [Sightly Engine] Refactor the Sightly Engine API + +* refactored exported API to expose only the bare minimum +* refactored implementation to remove unneeded abstractions +--- + contrib/scripting/sightly/engine/pom.xml | 3 - + .../sling/parser/expr/generated/SightlyLexer.g4| 120 - + .../sling/parser/expr/generated/SightlyParser.g4 | 139 -- + .../impl/parser/expr/generated/SightlyLexer.g4 | 120 + + .../impl/parser/expr/generated/SightlyParser.g4| 139 ++ + .../org/apache/sling/scripting/sightly/Record.java | 47 ++ + .../scripting/sightly/ResourceResolution.java | 176 +++ + .../sling/scripting/sightly/SightlyException.java | 42 ++ + .../scripting/sightly/api/BaseRenderUnit.java | 144 -- + .../scripting/sightly/api/ExtensionInstance.java | 36 -- + .../sling/scripting/sightly/api/ObjectModel.java | 111 - + .../scripting/sightly/api/ProviderOutcome.java | 95 + .../apache/sling/scripting/sightly/api/Record.java | 47 -- + .../sling/scripting/sightly/api/RenderContext.java | 111 - + .../sling/scripting/sightly/api/RenderUnit.java| 39 -- + .../scripting/sightly/api/ResourceResolution.java | 179 --- + .../scripting/sightly/api/RuntimeExtension.java| 41 -- + .../sightly/api/RuntimeExtensionComponent.java | 65 --- + .../sightly/api/RuntimeExtensionException.java | 41 -- + .../sightly/api/SightlyEngineException.java| 40 -- + .../sightly/api/SightlyParsingException.java | 57 --- + .../sightly/api/SightlyRenderException.java| 41 -- + .../scripting/sightly/api/SightlyRuntime.java | 40 -- + .../scripting/sightly/api/SightlyUseException.java | 40 -- + .../sling/scripting/sightly/api/StackedWriter.java | 83 + .../sling/scripting/sightly/api/UnitLocator.java | 37 -- + .../apache/sling/scripting/sightly/api/Use.java| 30 -- + .../sling/scripting/sightly/api/UseProvider.java | 51 -- + .../sightly/api/UseProviderComponent.java | 73 --- + .../sling/scripting/sightly/api/package-info.java | 22 - + .../sling/scripting/sightly/common/Dynamic.java| 203 + .../scripting/sightly/common/ObjectModelImpl.java | 406 + .../sightly/common/SightlyRuntimeImpl.java | 71 --- + .../scripting/sightly/compiled/CodeGenVisitor.java | 277 --- + .../sightly/compiled/CompilationOutput.java| 44 -- + .../sightly/compiled/ExpressionTranslator.java | 192 + .../scripting/sightly/compiled/GenHelper.java | 117 - + .../sightly/compiled/JavaClassBackend.java | 51 -- + .../scripting/sightly/compiled/JavaSource.java | 264 --- + .../sightly/compiled/SourceGenConstants.java | 61 --- + .../sling/scripting/sightly/compiled/Type.java | 48 -- + .../scripting/sightly/compiled/TypeInference.java | 159 --- + .../sling/scripting/sightly/compiled/TypeInfo.java | 50 -- + .../scripting/sightly/compiled/UnitBuilder.java| 65 --- + .../sightly/compiled/VariableAnalyzer.java | 223 - + .../sightly/compiled/VariableDescriptor.java | 107 - + .../scripting/sightly/compiled/VariableScope.java | 27 -- + .../sightly/compiled/operator/BinaryOpGen.java | 36 -- + .../sightly/compiled/operator/ComparisonOpGen.java | 87 + .../compiled/operator/ConcatenateOpGen.java| 48 -- + .../compiled/operator/EquivalenceOpGen.java| 91 + .../sightly/compiled/operator/IsWhiteSpaceGen.java | 55 --- + .../sightly/compiled/operator/LengthOpGen.java | 51 -- + .../sightly/compiled/operator/LogicalOpGen.java| 83 + .../sightly/compiled/operator/LongOpGen.java | 38 -- + .../sightly/compiled/operator/NotOpGen.java| 47 -- + .../sightly/compiled/operator/NumericOpGen.java| 58 --- + .../sightly/compiled/operator/OpHelper.java| 40 -- + .../sightly/compiled/operator/Operators.java | 88 + .../sightly/compiled/operator/StrictEqGenOp.java | 57 --- + .../sightly/compiled/operator/TypedNode.java | 45 -- + .../sightly/compiled/operator/UnaryOpGen.java | 35 -- + .../scripting/sightly/compiler/BaseCompiler.java | 61 --- + .../sightly/compiler/CompilerBackend.java | 35 -- + .../sightly/compiler/CompilerException.java| 38 -- + .../sightly/compiler/CompilerFrontend.java | 35 -- +
svn commit: r1642281 [7/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/UnusedVariableRemoval.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/UnusedVariableRemoval.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/UnusedVariableRemoval.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiler/optimization/UnusedVariableRemoval.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,161 @@ +/*** + * 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.scripting.sightly.impl.compiler.optimization; + +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; + +import org.apache.sling.scripting.sightly.impl.compiler.ris.Command; +import org.apache.sling.scripting.sightly.impl.compiler.ris.CommandStream; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.VariableBinding; +import org.apache.sling.scripting.sightly.impl.compiler.util.stream.EmitterVisitor; +import org.apache.sling.scripting.sightly.impl.compiler.util.stream.PushStream; +import org.apache.sling.scripting.sightly.impl.compiler.util.stream.Streams; +import org.apache.sling.scripting.sightly.impl.compiler.visitor.TrackingVisitor; + +/** + * This optimization removes variables which are bound but + * never used in the command stream + */ +public final class UnusedVariableRemoval extends TrackingVisitorUnusedVariableRemoval.VariableActivity implements EmitterVisitor { + +public static final StreamTransformer TRANSFORMER = new StreamTransformer() { +@Override +public CommandStream transform(CommandStream inStream) { +return Streams.map(inStream, new UnusedVariableRemoval()); +} +}; + +private final PushStream outputStream = new PushStream(); +private final StackListCommand storedCommandsStack = new StackListCommand(); + +private UnusedVariableRemoval() { +} + +@Override +public PushStream getOutputStream() { +return outputStream; +} + +@Override +public void visit(VariableBinding.Start variableBindingStart) { +//push a new buffer where we will store the following commands +//these commands will be emitted only if this variable will be used in +//it's scope +storedCommandsStack.push(new ArrayListCommand()); +//start tracking the variable +tracker.pushVariable(variableBindingStart.getVariableName(), new VariableActivity(variableBindingStart)); +} + +@Override +public void visit(VariableBinding.End variableBindingEnd) { +// Get the activity of the exiting variable +VariableActivity variableActivity = tracker.peek().getValue(); +tracker.popVariable(); +boolean emitBindingEnd = true; +if (variableActivity != null) { +//this was a tracked variable. Popping all the commands +//which were delayed for this variable +ListCommand commands = storedCommandsStack.pop(); +//if the variable binding is emitted than this binding +//end must be emitted as well +emitBindingEnd = variableActivity.isUsed(); +if (variableActivity.isUsed()) { +VariableBinding.Start variableBindingStart = variableActivity.getCommand(); +//variable was used. we can let it pass through +emit(variableBindingStart); +//register the usage of all the variables that appear in the bound expression +registerUsage(variableBindingStart); +} +//emit all the delayed commands +for (Command command : commands) { +emit(command); +}
svn commit: r1642281 [4/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ en
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableAnalyzer.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableAnalyzer.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableAnalyzer.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/compiled/VariableAnalyzer.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,222 @@ +/*** + * 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.scripting.sightly.impl.compiled; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; + +import org.apache.sling.scripting.sightly.impl.compiler.util.VariableTracker; + +/** + * Data structure used in the analysis of variables + * during the compilation process + */ +public class VariableAnalyzer { + +private static final HashSetString javaKeywords = new HashSetString(); +private final VariableTrackerVariableDescriptor tracker = new VariableTrackerVariableDescriptor(); +private final ListVariableDescriptor variables = new ArrayListVariableDescriptor(); +private final HashMapString, VariableDescriptor dynamicVariables = new HashMapString, VariableDescriptor(); +private final HashMapString, VariableDescriptor staticVariables = new HashMapString, VariableDescriptor(); +private static final String DYNAMIC_PREFIX = _dynamic_; +private static final String GLOBAL_PREFIX = _global_; + +/** + * Mark the declaration of a variable in the Java code + * @param originalName - the original name of the variable + * @return - a variable descriptor uniquely assigned to this variable + */ +public VariableDescriptor declareVariable(String originalName, Type type) { +originalName = originalName.toLowerCase(); +String assignedName = findSafeName(originalName); +VariableDescriptor descriptor = new VariableDescriptor(originalName, assignedName, type, VariableScope.SCOPED); +tracker.pushVariable(originalName, descriptor); +variables.add(descriptor); +return descriptor; +} + +/** + * Declare a global variable. Redundant declarations are ignored + * @param originalName - the original name of the variable + * @return a variable descriptor + */ +public VariableDescriptor declareGlobal(String originalName) { +originalName = originalName.toLowerCase(); +VariableDescriptor descriptor = staticVariables.get(originalName); +if (descriptor == null) { +String assignedName = findGlobalName(originalName); +descriptor = new VariableDescriptor(originalName, assignedName, Type.UNKNOWN, VariableScope.GLOBAL); +variables.add(descriptor); +staticVariables.put(originalName, descriptor); +} +return descriptor; +} + +/** + * Mark this variable as a template + * @param originalName - the original name of the variable + * @return a variable descriptor + */ +public VariableDescriptor declareTemplate(String originalName) { +originalName = originalName.toLowerCase(); +VariableDescriptor descriptor = dynamicDescriptor(originalName); +descriptor.markAsTemplate(); +return descriptor; +} + +/** + * Mark the end of a variable scope + */ +public VariableDescriptor endVariable() { +VariableDescriptor descriptor = tracker.peek().getValue(); +tracker.popVariable(); +return descriptor; +} + +/** + * Get a the descriptor for the given variable + * @param name the original lowerName of the variable + * @return the
svn commit: r1642281 [12/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ e
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/plugin/AttributePlugin.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,356 @@ +/*** + * 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.scripting.sightly.impl.plugin; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Properties; +import org.apache.felix.scr.annotations.Property; +import org.apache.felix.scr.annotations.Service; +import org.apache.sling.scripting.sightly.impl.compiler.Syntax; +import org.apache.sling.scripting.sightly.impl.compiler.expression.Expression; +import org.apache.sling.scripting.sightly.impl.compiler.expression.ExpressionNode; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.BinaryOperation; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.BinaryOperator; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.BooleanConstant; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.Identifier; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.MapLiteral; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.PropertyAccess; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.RuntimeCall; +import org.apache.sling.scripting.sightly.impl.compiler.expression.node.StringConstant; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.Conditional; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.Loop; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.OutText; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.OutVariable; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.Patterns; +import org.apache.sling.scripting.sightly.impl.compiler.ris.command.VariableBinding; +import org.apache.sling.scripting.sightly.impl.compiler.common.DefaultPluginInvoke; +import org.apache.sling.scripting.sightly.impl.compiler.frontend.CompilerContext; +import org.apache.sling.scripting.sightly.impl.compiler.util.stream.PushStream; +import org.apache.sling.scripting.sightly.impl.html.MarkupUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implementation for the attribute plugin + */ +@Component +@Service +@Properties({ +@Property(name = service.description, value = Sightly Resource Block Plugin), +@Property(name = Plugin.SCR_PROP_NAME_BLOCK_NAME, value = attribute), +@Property(name = Plugin.SCR_PROP_NAME_PRIORITY, intValue = 150) +}) +public class AttributePlugin extends PluginComponent { + +private static final Logger log = LoggerFactory.getLogger(AttributePlugin.class); + +@Override +public PluginInvoke invoke(Expression expression, PluginCallInfo callInfo, CompilerContext compilerContext) { +String attributeName = decodeAttributeName(callInfo); +if (attributeName != null MarkupUtils.isSensitiveAttribute(attributeName)) { +log.warn(Refusing to generate attribute {} for security reasons, attributeName); +return new DefaultPluginInvoke(); //no-op invocation +} +return (attributeName != null) +? new SingleAttributeInvoke(attributeName, expression, compilerContext) +: new
svn commit: r1642281 [13/14] - in /sling/trunk/contrib/scripting/sightly: ./ engine/ engine/src/main/antlr4/org/apache/sling/parser/expr/generated/ engine/src/main/antlr4/org/apache/sling/scripting/ e
Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,50 @@ +/*** + * 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.scripting.sightly.pojo; + +import javax.script.Bindings; + +import aQute.bnd.annotation.ConsumerType; + +/** + * The codeUse/code interface can be implemented by Java objects + * which are instantiated as part of processing {@code data-sly-use} + * attributes. + * + * @see a href=http://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html#use;Sightly Block Statements - Use/a + */ +@ConsumerType +public interface Use { + +/** + * Called to initialize the Java object with the current Java Scripting + * API bindings. + * p + * This method is called only if the object has been instantiated by + * Sightly as part of processing the {@code data-sly-use} attribute. + * p + * The Java Scripting API bindings provide all the global variables + * known to a script being executed. Consider these bindings of a map + * from variable name to the variable's value. + * + * @param bindings The Java Scripting API bindings. + */ +public void init(Bindings bindings); + +} Propchange: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java -- svn:mime-type = text/plain Added: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/package-info.java?rev=1642281view=auto == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/package-info.java (added) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/package-info.java Fri Nov 28 10:18:01 2014 @@ -0,0 +1,22 @@ +/*** + * 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.scripting.sightly.pojo; + +import aQute.bnd.annotation.Version; Propchange: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/package-info.java -- svn:mime-type = text/plain Added:
svn commit: r1642283 - in /sling/trunk/contrib/scripting/sightly: engine/src/main/antlr4/org/apache/sling/parser/ engine/src/main/java/org/apache/sling/scripting/sightly/api/ engine/src/main/java/org/
Author: fmeschbe Date: Fri Nov 28 10:34:47 2014 New Revision: 1642283 URL: http://svn.apache.org/r1642283 Log: SLING-4206 Refactor Sightly and Sightly JS Remove empty folders after committing the refactoring Removed: sling/trunk/contrib/scripting/sightly/engine/src/main/antlr4/org/apache/sling/parser/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/api/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/common/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/compiled/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/compiler/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/engine/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/filter/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/html/ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/plugin/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/async/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/cjs/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/jsapi/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/loop/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/rhino/ sling/trunk/contrib/scripting/sightly/js-use-provider/src/main/java/org/apache/sling/scripting/sightly/js/use/
svn commit: r1642284 - /sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java
Author: fmeschbe Date: Fri Nov 28 10:44:20 2014 New Revision: 1642284 URL: http://svn.apache.org/r1642284 Log: SLING-4206 Fixing one minor glitch: Record is a @ConsumerType, of course Modified: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java Modified: sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java?rev=1642284r1=1642283r2=1642284view=diff == --- sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java (original) +++ sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/Record.java Fri Nov 28 10:44:20 2014 @@ -21,13 +21,13 @@ package org.apache.sling.scripting.sight import java.util.Set; -import aQute.bnd.annotation.ProviderType; +import aQute.bnd.annotation.ConsumerType; /** * A key-value immutable object understood by the Sightly runtime * @param T the type of values for this record */ -@ProviderType +@ConsumerType public interface RecordT { /**
svn commit: r1642292 - in /sling/trunk/contrib/scripting/sightly: engine/pom.xml js-use-provider/pom.xml
Author: fmeschbe Date: Fri Nov 28 13:21:26 2014 New Revision: 1642292 URL: http://svn.apache.org/r1642292 Log: SLING-4182 Downgrade Sling API dependencies to the minimum required API (2.4 instead of 2.8) Modified: sling/trunk/contrib/scripting/sightly/engine/pom.xml sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml Modified: sling/trunk/contrib/scripting/sightly/engine/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/pom.xml?rev=1642292r1=1642291r2=1642292view=diff == --- sling/trunk/contrib/scripting/sightly/engine/pom.xml (original) +++ sling/trunk/contrib/scripting/sightly/engine/pom.xml Fri Nov 28 13:21:26 2014 @@ -161,7 +161,7 @@ dependency groupIdorg.apache.sling/groupId artifactIdorg.apache.sling.api/artifactId -version2.8.0/version +version2.4.0/version scopeprovided/scope /dependency dependency Modified: sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml?rev=1642292r1=1642291r2=1642292view=diff == --- sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml (original) +++ sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml Fri Nov 28 13:21:26 2014 @@ -95,7 +95,7 @@ dependency groupIdorg.apache.sling/groupId artifactIdorg.apache.sling.api/artifactId -version2.8.0/version +version2.4.0/version scopeprovided/scope /dependency dependency
svn commit: r1642293 - /sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml
Author: fmeschbe Date: Fri Nov 28 13:27:03 2014 New Revision: 1642293 URL: http://svn.apache.org/r1642293 Log: SLING-4209 Expose required JavaScript files through the BundleResourceProvider Modified: sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml Modified: sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml?rev=1642293r1=1642292r2=1642293view=diff == --- sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml (original) +++ sling/trunk/contrib/scripting/sightly/js-use-provider/pom.xml Fri Nov 28 13:27:03 2014 @@ -68,7 +68,7 @@ extensionstrue/extensions configuration instructions - Sling-Initial-ContentSLING-INF;overwrite=true/Sling-Initial-Content + Sling-Bundle-Resources/libs/sling/sightly/js;path:=/SLING-INF/libs/sling/sightly/js/Sling-Bundle-Resources /instructions /configuration /plugin
svn commit: r1642306 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apa
Author: kwin Date: Fri Nov 28 14:50:39 2014 New Revision: 1642306 URL: http://svn.apache.org/r1642306 Log: SLING-4013 allow optional properties/child resources within validation model Modified: sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ResourcePropertyImpl.java sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java Modified: sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java?rev=1642306r1=1642305r2=1642306view=diff == --- sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java (original) +++ sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java Fri Nov 28 14:50:39 2014 @@ -44,6 +44,13 @@ public interface ChildResource { Pattern getNamePattern(); /** + * Returns {@code true} if at least one resource matching the name/namePattern is required. + * + * @return {@code true} if the resource is required, {@code false} otherwise + */ +boolean isRequired(); + +/** * Returns the properties this child resource is expected to have. * * @return the properties set Modified: sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java?rev=1642306r1=1642305r2=1642306view=diff == --- sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java (original) +++ sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java Fri Nov 28 14:50:39 2014 @@ -49,6 +49,13 @@ public interface ResourceProperty { boolean isMultiple(); /** + * Returns {@code true} if at least one property matching the name/namePattern is required. + * + * @return {@code true} if the property is required, {@code false} otherwise + */ +boolean isRequired(); + +/** * Returns a list of {@link ParameterizedValidator}s which should be applied on this property. * * @return the list of validators Modified: sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java?rev=1642306r1=1642305r2=1642306view=diff == --- sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java (original) +++ sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java Fri Nov 28 14:50:39 2014 @@ -8,6 +8,7 @@ import java.util.regex.PatternSyntaxExce import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.commons.osgi.PropertiesUtil; import org.apache.sling.validation.api.ChildResource; import org.apache.sling.validation.api.ResourceProperty; import org.apache.sling.validation.api.Validator; @@ -22,6 +23,7 @@ public class ChildResourceImpl implement private final Pattern namePattern; private final SetResourceProperty properties; private final ListChildResource children; +private final boolean isRequired; public ChildResourceImpl(Resource modelResource, Resource childResource, MapString, Validator? validatorsMap, ListChildResource children) { String root = modelResource.getPath(); @@ -46,7 +48,7 @@ public class ChildResourceImpl implement name =
svn commit: r930881 - /websites/production/sling/content/
Author: kwin Date: Fri Nov 28 15:01:56 2014 New Revision: 930881 Log: Publishing svnmucc operation to sling site by kwin Added: websites/production/sling/content/ - copied from r930880, websites/staging/sling/trunk/content/
svn commit: r1642308 - /sling/site/trunk/content/documentation/bundles/validation.mdtext
Author: kwin Date: Fri Nov 28 15:01:24 2014 New Revision: 1642308 URL: http://svn.apache.org/r1642308 Log: SLING-4013 document optional properties/child resources for validation models Modified: sling/site/trunk/content/documentation/bundles/validation.mdtext Modified: sling/site/trunk/content/documentation/bundles/validation.mdtext URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/validation.mdtext?rev=1642308r1=1642307r2=1642308view=diff == --- sling/site/trunk/content/documentation/bundles/validation.mdtext (original) +++ sling/site/trunk/content/documentation/bundles/validation.mdtext Fri Nov 28 15:01:24 2014 @@ -35,12 +35,14 @@ The resources should have the following `validatedResourceType` | Property | `String` | The resource type of the resource for which this validation model should be applied. | yes | `my/own/resourcetype` `applicablePaths` | Property | `String[]` | Path prefixes which restrict the validation model to resources which are below one of the given prefixes. No wildcards are supported. If not given, there is not path restriction. | no | `/content/mysite` `properties\propertyName` | Resource | - | This resource ensures that the property with the name `propertyName` is there. The resource name has no longer a meaning if the property `nameRegex` is set on this node. | no | `false` +`properties\propertyName\optional` | Property | `Boolean` | If `true` it is not an error if there is no property with the given `propertyName` or none matching the `nameRegex`. If not set or `false` the property must be there. | no | `false` `properties\propertyName\propertyMultiple` | Property | `Boolean` | If `true` only multivalue properties are allowed with the name `propertyName` or matching the `nameRegex`. If not set or `false`, multi- and single-value properties are accepted. | no | `false` `properties\propertyName\nameRegex` | Property | `String` | If set the `propertyName` has no longer a meaning. Rather all properties which match the given regular expression are considered. At least one match is required, otherwise the validated resource/valuemap is considered invalid. | no | `property[0-8]` `properties\propertyName\validators\validatorName` | Resource | - | The `validatorName` must be the OSGi component name of a validator. Each validators node might have arbitrarily many subnodes (one per validator). | no | `false` `properties\propertyName\validators\validatorName\validatorArguments` | Property | `String[]` | The parametrization for the validator with the name `validatorName`. Each value must have the pattern `key=value`. The parametrization differs per validator. | no | `regex=^[a-z]*$` `children\resourceName` | Resource | - | This resource ensures that the resource with the name `resourceName` is there. The resource name has no longer a meaning if the property `nameRegex` is set on this node. | no | `child1` `children\resourceName\nameRegex` | Property | `String` | If set the `resourceName` has no longer a meaning. Rather all resources whose name match the given regular expression are considered. At least one match is required, otherwise the validated resource/valuemap is considered invalid. | no | `child[1-9]` +`children\resourceName\optional` | Property | `Boolean` | If `true` it is not an error if there is no resource with the given `resourceName` or none matching the `nameRegex`. If not set or `false` the resource must be there. | no | `false` `children\resourceName\properties` | Resource | - | The properties can be configured on the child level in the same way as on the root level. | no | -
svn commit: r930880 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/validation.html
Author: buildbot Date: Fri Nov 28 15:01:38 2014 New Revision: 930880 Log: Staging update by buildbot for sling Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/documentation/bundles/validation.html Propchange: websites/staging/sling/trunk/content/ -- --- cms:source-revision (original) +++ cms:source-revision Fri Nov 28 15:01:38 2014 @@ -1 +1 @@ -1642271 +1642308 Modified: websites/staging/sling/trunk/content/documentation/bundles/validation.html == --- websites/staging/sling/trunk/content/documentation/bundles/validation.html (original) +++ websites/staging/sling/trunk/content/documentation/bundles/validation.html Fri Nov 28 15:01:38 2014 @@ -163,6 +163,13 @@ This documentation is still work in prog tdno/td /tr tr +tdcodeproperties\lt;propertyNamegt;\optional/code/td +tdProperty/td +tdcodeBoolean/code/td +tdIf codetrue/code it is not an error if there is no property with the given codelt;propertyNamegt;/code or none matching the codenameRegex/code. If not set or codefalse/code the property must be there./td +tdno/td +/tr +tr tdcodeproperties\lt;propertyNamegt;\propertyMultiple/code/td tdProperty/td tdcodeBoolean/code/td @@ -205,6 +212,13 @@ This documentation is still work in prog tdno/td /tr tr +tdcodechildren\lt;resourceNamegt;\optional/code/td +tdProperty/td +tdcodeBoolean/code/td +tdIf codetrue/code it is not an error if there is no resource with the given codelt;resourceNamegt;/code or none matching the codenameRegex/code. If not set or codefalse/code the resource must be there./td +tdno/td +/tr +tr tdcodechildren\lt;resourceNamegt;\properties/code/td tdResource/td td-/td @@ -246,7 +260,7 @@ That interface defines the method code lia href=http://www.slideshare.net/raducotescu/apache-sling-generic-validation-framework;Apache Sling Generic Validation Framework, adaptTo 2014/a/li /ol div class=timestamp style=margin-top: 30px; font-size: 80%; text-align: right; -Rev. 1642173 by kwin on Thu, 27 Nov 2014 15:15:47 + +Rev. 1642308 by kwin on Fri, 28 Nov 2014 15:01:24 + /div div class=trademarkFooter Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
svn commit: r1642313 - in /sling/trunk/testing/junit/remote: pom.xml src/main/java/org/apache/sling/junit/remote/exported/package-info.java src/main/java/org/apache/sling/junit/remote/ide/package-info
Author: bdelacretaz Date: Fri Nov 28 15:45:44 2014 New Revision: 1642313 URL: http://svn.apache.org/r1642313 Log: SLING-4210 - move to package-info files Added: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/package-info.java sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java Modified: sling/trunk/testing/junit/remote/pom.xml Modified: sling/trunk/testing/junit/remote/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/pom.xml?rev=1642313r1=1642312r2=1642313view=diff == --- sling/trunk/testing/junit/remote/pom.xml (original) +++ sling/trunk/testing/junit/remote/pom.xml Fri Nov 28 15:45:44 2014 @@ -52,10 +52,6 @@ extensionstrue/extensions configuration instructions -Export-Package -org.apache.sling.junit.remote.exported.*, -org.apache.sling.junit.remote.ide.* -/Export-Package Import-Package org.apache.http.*; resolution:=optional, org.apache.sling.testing.tools.http; resolution:=optional, @@ -78,7 +74,7 @@ dependency groupIdorg.apache.sling/groupId artifactIdorg.apache.sling.junit.core/artifactId -version1.0.8/version +version1.0.9-SNAPSHOT/version /dependency dependency groupIdorg.apache.felix/groupId Added: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/package-info.java?rev=1642313view=auto == --- sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/package-info.java (added) +++ sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/exported/package-info.java Fri Nov 28 15:45:44 2014 @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +@Version(1.0.8) +package org.apache.sling.junit.remote.exported; + +import aQute.bnd.annotation.Version; + Added: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java?rev=1642313view=auto == --- sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java (added) +++ sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java Fri Nov 28 15:45:44 2014 @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +@Version(1.0.8) +package org.apache.sling.junit.remote.ide; + +import aQute.bnd.annotation.Version; +
svn commit: r1642314 - in /sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide: SerializedRenderer.java package-info.java
Author: bdelacretaz Date: Fri Nov 28 15:47:17 2014 New Revision: 1642314 URL: http://svn.apache.org/r1642314 Log: SLING-4210 - SerializedRenderer implements RendererFactory Modified: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java Modified: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java?rev=1642314r1=1642313r2=1642314view=diff == --- sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java (original) +++ sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java Fri Nov 28 15:47:17 2014 @@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRes import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Service; import org.apache.sling.junit.Renderer; +import org.apache.sling.junit.RendererFactory; import org.apache.sling.junit.TestSelector; import org.junit.runner.Result; import org.junit.runner.notification.RunListener; @@ -39,13 +40,18 @@ import org.slf4j.LoggerFactory; */ @Component(immediate=false) @Service -public class SerializedRenderer extends RunListener implements Renderer { +public class SerializedRenderer extends RunListener implements Renderer,RendererFactory { public static final String EXTENSION = serialized; private ObjectOutputStream outputStream; private final Logger log = LoggerFactory.getLogger(getClass()); /** @inheritDoc */ +public Renderer createRenderer() { +return new SerializedRenderer(); +} + +/** @inheritDoc */ public boolean appliesTo(TestSelector s) { return EXTENSION.equals(s.getExtension()); } Modified: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java?rev=1642314r1=1642313r2=1642314view=diff == --- sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java (original) +++ sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/package-info.java Fri Nov 28 15:47:17 2014 @@ -17,7 +17,7 @@ * under the License. */ -@Version(1.0.8) +@Version(1.1.0) package org.apache.sling.junit.remote.ide; import aQute.bnd.annotation.Version;
svn commit: r1642316 - in /sling/trunk: pom.xml testing/pom.xml
Author: bdelacretaz Date: Fri Nov 28 16:11:39 2014 New Revision: 1642316 URL: http://svn.apache.org/r1642316 Log: SLING-4211 - testing/pom.xml added Added: sling/trunk/testing/pom.xml Modified: sling/trunk/pom.xml Modified: sling/trunk/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/pom.xml?rev=1642316r1=1642315r2=1642316view=diff == --- sling/trunk/pom.xml (original) +++ sling/trunk/pom.xml Fri Nov 28 16:11:39 2014 @@ -188,18 +188,7 @@ modulebundles/extensions/models/integration-tests/module !-- Testing Support -- -moduletesting/tools/module -moduletesting/junit/core/module -moduletesting/junit/scriptable/module -moduletesting/junit/healthcheck/module -moduletesting/junit/remote/module -moduletesting/junit/performance/module -moduletesting/mocks/resourceresolver-mock/module -moduletesting/mocks/jcr-mock/module -moduletesting/mocks/osgi-mock/module -moduletesting/mocks/sling-mock/module -moduletesting/mocks/sling-mock-jackrabbit/module -moduletesting/sling-pax-util/module +moduletesting/module !-- Installer -- moduleinstaller/core/module @@ -218,10 +207,6 @@ modulelaunchpad/content/module modulelaunchpad/builder/module -!-- Testing Samples -- -moduletesting/samples/sample-tests/module -moduletesting/samples/failing-tests/module -moduletesting/samples/integration-tests/module /modules profiles Added: sling/trunk/testing/pom.xml URL: http://svn.apache.org/viewvc/sling/trunk/testing/pom.xml?rev=1642316view=auto == --- sling/trunk/testing/pom.xml (added) +++ sling/trunk/testing/pom.xml Fri Nov 28 16:11:39 2014 @@ -0,0 +1,65 @@ +?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/maven-v4_0_0.xsd; + modelVersion4.0.0/modelVersion + + parent +groupIdorg.apache.sling/groupId +artifactIdsling/artifactId +version8/version + /parent + + groupIdorg.apache.sling/groupId + artifactIdorg.apache.sling.testing.reactor/artifactId + packagingpom/packaging + version1-SNAPSHOT/version + + nameApache Sling Testing Modules Reactor/name + inceptionYear2014/inceptionYear + + scm +connection +scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing +/connection +developerConnection +scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing +/developerConnection +urlhttp://svn.apache.org/viewvc/sling/trunk/testing/url + /scm + + modules +moduletools/module +modulejunit/core/module +modulejunit/scriptable/module +modulejunit/healthcheck/module +modulejunit/remote/module +modulejunit/performance/module +modulemocks/resourceresolver-mock/module +modulemocks/jcr-mock/module +modulemocks/osgi-mock/module +modulemocks/sling-mock/module +modulemocks/sling-mock-jackrabbit/module +modulesling-pax-util/module +modulesamples/sample-tests/module +modulesamples/failing-tests/module +modulesamples/integration-tests/module + /modules + +/project