You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2015/03/22 13:11:06 UTC
[10/51] [partial] clerezza git commit: CLEREZZA-966: started
hierarchical project structure, moved platform bundles to platform,
only moved RDF artifacts ported to use commons to the rdf folder.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting.scriptmanager/src/main/resources/org/apache/clerezza/platform/scripting/scriptmanager/staticweb/js/scriptmanager.js
----------------------------------------------------------------------
diff --git a/platform.scripting.scriptmanager/src/main/resources/org/apache/clerezza/platform/scripting/scriptmanager/staticweb/js/scriptmanager.js b/platform.scripting.scriptmanager/src/main/resources/org/apache/clerezza/platform/scripting/scriptmanager/staticweb/js/scriptmanager.js
deleted file mode 100644
index dd2f3cc..0000000
--- a/platform.scripting.scriptmanager/src/main/resources/org/apache/clerezza/platform/scripting/scriptmanager/staticweb/js/scriptmanager.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- *
- * 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.
- *
-*/
-
-var ACTUALSCRIPT = null;
-
-function showInformation(script){
- setActualScript(script);
- var url = document.location.href;
- if(url.indexOf("execution-uri-overview") != -1){
- statusMessage.add("load-execution-uri", "loading execution uri");
- $("#tx-list").load("./get-execution-uri?script="+script+"&mode=naked", function(){
- statusMessage.remove("load-execution-uri");
- showExecutionUriTabActions();
- });
- } else if(url.indexOf("script-overview") != -1){
- statusMessage.add("get-scripts", "loading scripts");
- $("#tx-list").load("./get-script?script="+script+"&mode=naked", function() {
- statusMessage.remove("get-scripts");
- });
- }
-}
-
-function countNamedElements(name) {
- var cnt = 0;
- var o = document.getElementsByName(name);
- for(var i = 0 ; i < o.length; i++){
- cnt++;
- }
-
- return cnt;
-}
-
-function showExecutionUriTabActions() {
- $('#tx-contextual-buttons').empty();
- if(countNamedElements('executionUriCheckBox') > 0) {
- $('#tx-contextual-buttons').append('<ol><li><a href="javascript:deleteExecutionUris()" class="tx-button tx-button-remove">Delete</a></li>'+
- '<li><a href="javascript:showAddExecutionUriForm();" class="tx-button tx-button-create">Add</a></li></ol>');
- } else {
- $('#tx-contextual-buttons').append('<ol><li><a href="javascript:showAddExecutionUriForm();" class="tx-button tx-button-create">Add</a></li></ol>');
- }
-}
-
-function setActualScript(script){
- ACTUALSCRIPT = script;
-}
-
-function getQueryParam(name) {
-
- var query = window.location.search.substring(1);
- var parms = query.split('&');
- for (var i=0; i<parms.length; i++) {
- var pos = parms[i].indexOf('=');
- if (pos > 0) {
- var key = parms[i].substring(0,pos);
- if(key == name) {
- setActualScript(parms[i].substring(pos+1));
- break;
- }
- }
- }
-}
-
-function updateScript(){
- $("#updateform").submit();
-}
-
-function deleteScript(){
- var options = new AjaxOptions("delete-script", "deleting script", function(obj) {
- $("#tx-list").empty();
- $("#tx-result").load("./script-list?mode=naked");
- });
- options.type = "POST"
- options.url = "delete";
- options.data = "script=" + encodeURIComponent(ACTUALSCRIPT);
- $.ajax(options);
-}
-
-function installScript(){
- $("#installform").submit();
-}
-
-function executeScript(){
- var options = new AjaxOptions("execute-script", "executing script", function(obj) {
- $('#scriptConsole').empty();
- $('#scriptConsole').append('<h4>Script Output</h4><pre>'
- +obj+'</pre>');
- $('#scriptConsole').slideDown('slow');
- });
- options.url = "execute";
- options.data = "script=" + encodeURIComponent(ACTUALSCRIPT);
- $.ajax(options);
-}
-
-function showAddExecutionUriForm(){
- $('#addExecutionUriForm').empty();
- $('#addExecutionUriForm').append('<form id="addExecutionUri"><input type="hidden" id="scriptUri" name="scriptUri" value="'+ACTUALSCRIPT+'"></input>'
- +'<label for="executionUri">Execution URI</label> <input type="text" name="executionUri"></input> '
- +'<input type="button" value="add" onclick="javascript:addExecutionUri()"></input> </form>');
- $('#addExecutionUriForm').slideDown('slow');
-}
-
-function deleteExecutionUris(){
- $(':checked').each(
- function() {
- var options = new AjaxOptions("delete-execution-uri", "deleting execution uri", function(obj) {
- $("#tx-list").load("./get-execution-uri?script="+ACTUALSCRIPT+"&mode=naked", function(){
- showExecutionUriTabActions();
- });
- });
- options.type = "POST"
- options.url = "delete-executionUri";
- options.data = "executionUri="+$(this).val()+"&scriptUri="+encodeURIComponent(ACTUALSCRIPT);
- $.ajax(options);
- }
- );
-}
-
-function addExecutionUri(){
- var serialized = $('#addExecutionUri').serialize();
- var options = new AjaxOptions("add-execution-uri", "saving execution uri", function(obj) {
- $('#addExecutionUriForm').slideUp('slow');
- $("#tx-list").load("./get-execution-uri?script="+$('#scriptUri').val()+"&mode=naked", function(){
- showExecutionUriTabActions();
- });
- });
- options.type = "POST"
- options.url = "add-execution-uri";
- options.data = serialized;
- $.ajax(options);
-}
-
-function fileChoiceSelected() {
- if(document.getElementById('fileButton').checked) {
- $('#choiceCell').empty();
- $('#choiceCell').append('<input type="radio" name="fileChoice" id="fileButton" value="file" checked="checked" onclick="fileChoiceSelected()" /> Upload a File '+
- '<input type="radio" name="fileChoice" id="textButton" value="text" onclick="fileChoiceSelected()"/> Enter Script');
- $('#nameRow').remove();
- $('#fileCell').empty();
- $('#fileCellLabel').empty();
- $('#fileCellLabel').append('<label for="scriptFile">Script File:</label>');
- $('#fileCell').append('<input type="file" name="scriptFile" />');
- } else if(document.getElementById('textButton').checked) {
- $('#choiceCell').empty();
- $('#choiceCell').append('<input type="radio" name="fileChoice" id="fileButton" value="file" onclick="fileChoiceSelected()" /> Upload a File '+
- '<input type="radio" name="fileChoice" id="textButton" value="text" checked="checked" onclick="fileChoiceSelected()"/> Enter Script');
- $('#fileRow').before('<tr id="nameRow"><td><label for="scriptName">Script Name:</label></td><td><input type="text" name="scriptName" /></td></tr>');
- $('#fileCellLabel').empty();
- $('#fileCellLabel').append('<label for="scriptFile">Script:</label>');
- $('#fileCell').empty();
- $('#fileCell').append('<textarea name="scriptCode" id="scriptCode" rows="10" style="font-size:12px; width:70%;"></textarea>');
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/LICENSE
----------------------------------------------------------------------
diff --git a/platform.scripting/LICENSE b/platform.scripting/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform.scripting/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/pom.xml
----------------------------------------------------------------------
diff --git a/platform.scripting/pom.xml b/platform.scripting/pom.xml
deleted file mode 100644
index 193f0a3..0000000
--- a/platform.scripting/pom.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><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">
-<!--
-
- 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.
-
--->
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>clerezza</artifactId>
- <version>0.5</version>
- <relativePath>../parent</relativePath>
- </parent>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>platform.scripting</artifactId>
- <packaging>bundle</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>Clerezza - Platform Scripting</name>
- <description>A bundle to manage script engines</description>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>platform.typehandlerspace</artifactId>
- <version>0.9</version>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>platform.content</artifactId>
- <version>0.14</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/JRubyScriptEngineFactoryWrapper.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/JRubyScriptEngineFactoryWrapper.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/JRubyScriptEngineFactoryWrapper.java
deleted file mode 100644
index dabd40c..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/JRubyScriptEngineFactoryWrapper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-import java.util.List;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-
-/**
- *
- * @author hasan
- */
-public class JRubyScriptEngineFactoryWrapper implements ScriptEngineFactory {
-
- private ScriptEngineFactory wrappedFactory;
-
- public JRubyScriptEngineFactoryWrapper(ScriptEngineFactory wrappedFactory) {
- this.wrappedFactory = wrappedFactory;
- }
-
- @Override
- public String getEngineName() {
- return wrappedFactory.getEngineName();
- }
-
- @Override
- public String getEngineVersion() {
- return wrappedFactory.getEngineVersion();
- }
-
- @Override
- public List<String> getExtensions() {
- return wrappedFactory.getExtensions();
- }
-
- @Override
- public List<String> getMimeTypes() {
- return wrappedFactory.getMimeTypes();
- }
-
- @Override
- public List<String> getNames() {
- return wrappedFactory.getNames();
- }
-
- @Override
- public String getLanguageName() {
- return wrappedFactory.getLanguageName();
- }
-
- @Override
- public String getLanguageVersion() {
- return wrappedFactory.getLanguageVersion();
- }
-
- @Override
- public Object getParameter(String key) {
- return wrappedFactory.getParameter(key);
- }
-
- @Override
- public String getMethodCallSyntax(String obj, String m, String... args) {
- return wrappedFactory.getMethodCallSyntax(obj, m, args);
- }
-
- @Override
- public String getOutputStatement(String toDisplay) {
- return wrappedFactory.getOutputStatement(toDisplay);
- }
-
- @Override
- public String getProgram(String... statements) {
- return wrappedFactory.getProgram(statements);
- }
-
- @Override
- public ScriptEngine getScriptEngine() {
- ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(null);
- ScriptEngine engine = wrappedFactory.getScriptEngine();
- Thread.currentThread().setContextClassLoader(oldClassLoader);
- return engine;
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/NoEngineException.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/NoEngineException.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/NoEngineException.java
deleted file mode 100644
index ef7d69f..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/NoEngineException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-/**
- * This exception is thrown if no script engine can be found for the specified
- * language description.
- *
- * @author hasan
- */
-public class NoEngineException extends RuntimeException {
- private ScriptLanguageDescription languageDescription;
-
- NoEngineException(ScriptLanguageDescription languageDescription) {
- super("No script engine found for "+languageDescription);
- this.languageDescription = languageDescription;
- }
-
- /**
- * @return the ScriptLanguageDescription for which no script engine could be found
- */
- public ScriptLanguageDescription getLanguageDescription() {
- return languageDescription;
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptEngineFactoryManager.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptEngineFactoryManager.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptEngineFactoryManager.java
deleted file mode 100644
index a8ffc11..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptEngineFactoryManager.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import javax.script.ScriptEngineFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @scr.component
- *
- * @author hasan
- */
-public class ScriptEngineFactoryManager implements BundleListener {
-
- final Logger logger = LoggerFactory.getLogger(getClass());
-
- private ComponentContext componentContext = null;
-
- private Map<Long, List<ServiceRegistration>> registeredFactories =
- new HashMap<Long, List<ServiceRegistration>>();
-
- private final String SERVICE_DEF_PATH = "/META-INF/services/";
- private final String SERVICE_DEF_FILE = "javax.script.ScriptEngineFactory";
-
- protected void activate(final ComponentContext componentContext) {
- this.componentContext = componentContext;
- registerExistingEngineFactories();
- componentContext.getBundleContext().addBundleListener(this);
- }
-
- private void registerExistingEngineFactories() {
- if (componentContext == null) {
- logger.warn("componentContext is null while trying to register" +
- "script engine factories in started bundles");
- return;
- }
- Bundle[] bundles = componentContext.getBundleContext().getBundles();
- for (Bundle bundle : bundles) {
- if (bundle.getState() == Bundle.ACTIVE) {
- List<String> engineFactoryNames = getEngineFactoryNames(bundle);
- registerEngineFactories(bundle, engineFactoryNames);
- }
- }
- }
-
- private List<String> getEngineFactoryNames(Bundle bundle) {
- List<String> engineFactoryNames = new ArrayList<String>();
- BufferedReader in = null;
- try {
- URL entry = bundle.getEntry(SERVICE_DEF_PATH+SERVICE_DEF_FILE);
- if (entry == null) {
- return null;
- }
- in = new BufferedReader(new InputStreamReader(entry.openStream()));
- String engineFactoryName;
- while ((engineFactoryName = in.readLine()) != null) {
- engineFactoryName = engineFactoryName.trim();
- if (!engineFactoryName.isEmpty()) {
- engineFactoryNames.add(engineFactoryName);
- }
- }
- in.close();
- } catch (IOException ex) {
- // ignored, since this bundle seems to not contain a script engine
- logger.info("Cannot read {} in bundle {}",
- SERVICE_DEF_PATH + SERVICE_DEF_FILE, bundle.getSymbolicName());
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException ex) {
- // ignored
- }
- }
- }
- return engineFactoryNames;
- }
-
- private void registerEngineFactories(Bundle bundle, List<String> engineFactoryNames) {
- if (engineFactoryNames == null || engineFactoryNames.isEmpty()) {
- return;
- }
- List<ServiceRegistration> serviceRegList = new ArrayList<ServiceRegistration>();
- for (String engineFactoryName : engineFactoryNames) {
- try {
- Class factoryClass = Class.forName(engineFactoryName);
- ScriptEngineFactory factory = (ScriptEngineFactory) factoryClass.newInstance();
- String[] clazzes = {engineFactoryName, SERVICE_DEF_FILE};
- ServiceRegistration serviceReg = componentContext.getBundleContext().registerService(clazzes, factory, null);
- serviceRegList.add(serviceReg);
-
- if (engineFactoryName.equals("com.sun.script.jruby.JRubyScriptEngineFactory")) {
- factory = new JRubyScriptEngineFactoryWrapper(
- (ScriptEngineFactory) factoryClass.newInstance());
- String[] wrappedClazzes = {
- "org.apache.clerezza.platform.scripting.JRubyScriptEngineFactoryWrapper",
- SERVICE_DEF_FILE
- };
- serviceRegList.add(componentContext.getBundleContext().registerService(wrappedClazzes, factory, null));
- }
-
- } catch (InstantiationException ex) {
- logger.warn("Cannot instantiate {}", engineFactoryName);
- throw new RuntimeException(ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex);
- } catch (ClassNotFoundException ex) {
- logger.warn("Cannot find class {}", engineFactoryName);
- throw new RuntimeException(ex);
- }
- }
- long bundleId = bundle.getBundleId();
- registeredFactories.put(bundleId, serviceRegList);
- }
-
- protected void deactivate(final ComponentContext componentContext) {
- deregisterEngineFactories();
- componentContext.getBundleContext().removeBundleListener(this);
- this.componentContext = null;
- }
-
- private void deregisterEngineFactories() {
- Iterator<List<ServiceRegistration>> serviceRegLists =
- registeredFactories.values().iterator();
- while (serviceRegLists.hasNext()) {
- for (ServiceRegistration serviceReg : serviceRegLists.next()) {
- serviceReg.unregister();
- }
- }
- registeredFactories.clear();
- }
-
- @Override
- public void bundleChanged(BundleEvent event) {
- Bundle bundle = event.getBundle();
- switch (event.getType()) {
- case BundleEvent.STARTED:
- registerEngineFactories(bundle, getEngineFactoryNames(bundle));
- break;
- case BundleEvent.STOPPED:
- long bundleId = bundle.getBundleId();
- List<ServiceRegistration> serviceRegList = registeredFactories.get(bundleId);
- if (serviceRegList != null && !serviceRegList.isEmpty()) {
- for (ServiceRegistration serviceReg : serviceRegList) {
- serviceReg.unregister();
- }
- registeredFactories.remove(bundleId);
- }
- break;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptExecution.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptExecution.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptExecution.java
deleted file mode 100644
index 62d5ec2..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptExecution.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import javax.script.Bindings;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-import javax.script.ScriptException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.platform.content.DiscobitsHandler;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Resource;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.serializedform.Parser;
-import org.apache.clerezza.rdf.ontologies.SCRIPT;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * This class executes scripts, binds {@code ScriptEngineFactory}ies
- * of installed {@code ScriptEngine}s.
- *
- * It provides a facade to the installed {@code ScriptEngine}s
- * that implement {@code javax.script.ScriptEngine}.
- *
- * The services {@code ContentGraphProvider}, {@code DiscobitsHandler}, and
- * {@code TcManager} are provided to the ScriptEngine's eval method through
- * the parameter {@code Bindings}. In a script, they are accessible under the
- * names contentGraphProvider, contentHandler, and tcManager respectively.
- *
- * @scr.component
- * @scr.service
- * interface="org.apache.clerezza.platform.scripting.ScriptExecution"
- * @scr.reference name="scriptEngineFactory" cardinality="0..n"
- * interface="javax.script.ScriptEngineFactory"
- *
- * @author hasan, daniel
- *
- * @see javax.script.ScriptEngineManager
- * @see javax.script.ScriptEngine
- */
-public class ScriptExecution {
-
- /**
- * @scr.reference
- */
- private ContentGraphProvider cgProvider;
-
- /**
- * @scr.reference
- */
- private DiscobitsHandler contentHandler;
-
- /**
- * @scr.reference
- */
- private TcManager tcManager;
-
- /**
- * @scr.reference
- */
- private Parser parser;
-
- private Map<ScriptLanguageDescription, List<ScriptEngineFactory>>
- languageToFactoryMap =
- new HashMap<ScriptLanguageDescription, List<ScriptEngineFactory>>();
-
- private static final Logger logger = LoggerFactory.getLogger(ScriptExecution.class);
-
- /**
- * @see #execute(org.apache.clerezza.rdf.core.NonLiteral, javax.script.Bindings)
- */
- public Object execute(NonLiteral scriptResource)
- throws ScriptException, NoEngineException {
- return execute(scriptResource, null);
- }
-
- /**
- * Executes the specified {@code scriptResource}.
- *
- * The output is either a GraphNode or a response with
- * the media type specified by the producedType property
- * of the associated script.
- *
- * GraphNodes can be rendered by Renderlets registered for the type
- * of the GraphNode.
- *
- * @param scriptResource
- * The resource (URI).
- * @param bindings
- * Name/Value pairs of Java {@code Object}s made accessible
- * to script
- * @return
- * The value returned from the execution of the script.
- * Either a GraphNode or a Response.
- * @throws ScriptException
- * If an error occurrs in the script.
- * @throws NoEngineException
- * If no engine can be found
- *
- * @see org.apache.clerezza.rdf.ontologies.SCRIPT#Script
- * @see org.apache.clerezza.rdf.ontologies.SCRIPT#producedType
- * @see org.apache.clerezza.platform.typerendering.Renderlet
- */
- public Object execute(NonLiteral scriptResource, Bindings bindings)
- throws ScriptException, NoEngineException {
-
- MGraph contentGraph = cgProvider.getContentGraph();
-
- String scriptString = null;
- String scriptLanguage = null;
- String scriptLanguageVersion = null;
- String scriptProducedType = "text/plain";
-
- GraphNode scriptNode = new GraphNode(scriptResource, contentGraph);
- Iterator<Resource> it = scriptNode.getObjects(SCRIPT.scriptLanguage);
- scriptLanguage = LiteralFactory.getInstance().createObject(
- String.class, (TypedLiteral) it.next());
-
- it = scriptNode.getObjects(SCRIPT.scriptLanguageVersion);
- scriptLanguageVersion = LiteralFactory.getInstance().createObject(
- String.class, (TypedLiteral) it.next());
-
- it = scriptNode.getObjects(SCRIPT.producedType);
- if(it.hasNext()) {
- scriptProducedType = LiteralFactory.getInstance().createObject(
- String.class, (TypedLiteral) it.next());
- }
-
- scriptString = new String(
- contentHandler.getData((UriRef) scriptResource));
-
- Object result = execute(
- scriptString, bindings, scriptLanguage, scriptLanguageVersion);
- if (result instanceof GraphNode) {
- return result;
- }
- return Response.ok(result, MediaType.valueOf(scriptProducedType)).build();
- }
-
- /**
- * Executes the specified {@code script} with the {@code ScriptEngine}
- * that is registered for {@code language} and {@code languageVersion}.
- * <p>
- * The default {@link ScriptContext} for the {@link ScriptEngine} is used.
- * It uses {@code bindings} as the {@link ScriptContext#ENGINE_SCOPE}
- * Bindings of the ScriptEngine during the script execution.
- * Three new attributes are added to the bindings: contentGraphProvider,
- * contentHandler, and tcManager.
- * The Reader, Writer and non-ENGINE_SCOPE Bindings of the default
- * ScriptContext are used. The ENGINE_SCOPE Bindings of the ScriptEngine
- * is not changed, and its mappings are unaltered by the script execution.
- * </p>
- *
- * @param script
- * The script language source to be executed.
- * @param bindings
- * The Bindings of attributes to be used for script execution.
- * @param language
- * The script language.
- * It is used to determine the ScriptEngine.
- * @param languageVersion
- * The version of the script language.
- * It is used to determine the ScriptEngine.
- * @return
- * The value returned from the execution of {@code script}.
- * @throws ScriptException
- * If an error occurrs in the script.
- * @throws NoEngineException
- * If no engine can be found for the specified language
- *
- * @see javax.script.ScriptEngine#eval(java.lang.String, javax.script.Bindings)
- */
- public Object execute(String script, Bindings bindings,
- String language, String languageVersion)
- throws ScriptException, NoEngineException {
- ScriptEngine engine = getScriptEngine(language, languageVersion);
- if (engine == null) {
- logger.warn("Cannot execute script: " +
- "No engine available for language {}({})",
- language, languageVersion);
- throw new NoEngineException(new ScriptLanguageDescription(language,
- languageVersion));
- }
- if (bindings == null) {
- bindings = engine.createBindings();
- }
- addBindings(bindings);
- return engine.eval(script, bindings);
- }
-
- private void addBindings(Bindings bindings) {
- bindings.put("contentGraphProvider", cgProvider);
- bindings.put("contentHandler", contentHandler);
- bindings.put("tcManager", tcManager);
- bindings.put("parser", parser);
- }
-
- private ScriptEngine getScriptEngine(String language, String languageVersion) {
- List<ScriptEngineFactory> factoryList = null;
-
- try {
- factoryList = languageToFactoryMap.get(
- new ScriptLanguageDescription(language, languageVersion));
- } catch (IllegalArgumentException ex) {
- return null;
- }
-
- if (factoryList == null || factoryList.isEmpty()) {
- return null;
- }
- return factoryList.get(factoryList.size() - 1).getScriptEngine();
- }
-
- /**
- * Returns all installed script language descriptions.
- *
- * @return
- * All script language descriptions
- * of the currently installed script engines.
- *
- * @see ScriptLanguageDescription
- */
- public Iterator<ScriptLanguageDescription> getInstalledScriptLanguages() {
- return languageToFactoryMap.keySet().iterator();
- }
-
- /**
- * Binds a ScriptEngineFactory.
- * If script engine factories for the same language and/or language version
- * already exist, they are shadowed.
- *
- * @param factory
- * the script engine factory to bind
- */
- protected void bindScriptEngineFactory(ScriptEngineFactory factory) {
- String language = factory.getLanguageName();
- String languageVersion = factory.getLanguageVersion();
-
- addScriptEngineFactory(
- new ScriptLanguageDescription(language, languageVersion),
- factory);
- }
-
- private void addScriptEngineFactory(ScriptLanguageDescription language,
- ScriptEngineFactory factory) {
-
- List<ScriptEngineFactory> factoryList = languageToFactoryMap.get(language);
- if (factoryList == null) {
- factoryList = new ArrayList<ScriptEngineFactory>();
- } else {
- if (factoryList.contains(factory)) {
- return;
- }
- }
- factoryList.add(factory);
- languageToFactoryMap.put(language, factoryList);
- }
-
- /**
- * Unbinds a ScriptEngineFactory.
- *
- * @param factory
- * the script engine factory to unbind
- */
- protected void unbindScriptEngineFactory(ScriptEngineFactory factory) {
- String language = factory.getLanguageName();
- String languageVersion = factory.getLanguageVersion();
-
- removeScriptEngineFactory(
- new ScriptLanguageDescription(language, languageVersion),
- factory);
- }
-
- private void removeScriptEngineFactory(ScriptLanguageDescription language,
- ScriptEngineFactory factory) {
-
- List<ScriptEngineFactory> factoryList = languageToFactoryMap.get(language);
- if (factoryList != null) {
- factoryList.remove(factory);
- if (factoryList.isEmpty()) {
- languageToFactoryMap.remove(language);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptGeneratedResourceTypeHandler.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptGeneratedResourceTypeHandler.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptGeneratedResourceTypeHandler.java
deleted file mode 100644
index ff262a2..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptGeneratedResourceTypeHandler.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-import java.util.Iterator;
-import javax.script.Bindings;
-import javax.script.ScriptException;
-import javax.script.SimpleBindings;
-import javax.ws.rs.GET;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Request;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.clerezza.jaxrs.utils.TrailingSlash;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typehandlerspace.SupportedTypes;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.SCRIPT;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-
-/**
- * This class handles HTTP GET requests to resources of type ScriptGeneratedResource.
- *
- * @author daniel, hasan
- *
- * @see org.apache.clerezza.rdf.ontologies.SCRIPT#ScriptGeneratedResource
- *
- */
-@Component
-@Service(Object.class)
-@Property(name="org.apache.clerezza.platform.typehandler", boolValue=true)
-@SupportedTypes(types = { "http://clerezza.org/2009/07/script#ScriptGeneratedResource" }, prioritize = true)
-public class ScriptGeneratedResourceTypeHandler {
-
- private static final Logger logger =
- LoggerFactory.getLogger(ScriptGeneratedResourceTypeHandler.class);
-
- @Reference
- private ContentGraphProvider cgProvider;
-
- @Reference
- private ScriptExecution scriptExecution;
-
- /**
- * Handles HTTP GET requests for resources of type ScriptGeneratedResource.
- *
- * The generated resource is either a GraphNode or a response with
- * the media type specified by the producedType property
- * of the associated script.
- *
- * GraphNodes can be rendered by Renderlets registered for the type
- * of the GraphNode.
- *
- * {@code UriInfo}, {@code Request}, and {@code HttpHeaders} are provided
- * to the generating script for use in execution. In a script, they are
- * accessible under the names: uriInfo, request, and httpHeaders respectively.
- *
- * @param uriInfo
- * info about the request URI.
- * @param request
- * helper for request processing
- * @param httpHeaders
- * provides access to HTTP header information
- *
- * @return The generated resource. If no script is found, a NOT FOUND (404)
- * response is returned.
- *
- * @see org.apache.clerezza.rdf.ontologies.SCRIPT#producedType
- * @see org.apache.clerezza.platform.typerendering.Renderlet
- */
- @GET
- public Object get(@Context UriInfo uriInfo, @Context Request request,
- @Context HttpHeaders httpHeaders) {
- TrailingSlash.enforceNotPresent(uriInfo);
-
- UriRef requestUri = new UriRef(uriInfo.getAbsolutePath().toString());
- Iterator<Triple> it = cgProvider.getContentGraph().
- filter(requestUri, SCRIPT.scriptSource, null);
-
- if(it.hasNext()) {
- NonLiteral scriptResource = (NonLiteral) it.next().getObject();
- try {
- Bindings bindings = new SimpleBindings();
- bindings.put("uriInfo", uriInfo);
- bindings.put("request", request);
- bindings.put("httpHeaders", httpHeaders);
- return scriptExecution.execute(scriptResource, bindings);
- } catch (ScriptException ex) {
- logger.warn("Exception while executing script {}",
- ((UriRef) scriptResource).getUnicodeString());
- throw new WebApplicationException(
- Response.status(Status.INTERNAL_SERVER_ERROR).
- entity(ex.getMessage()).build());
- }
- }
-
- logger.warn("There is no script associated with {}",
- requestUri.getUnicodeString());
- return Response.status(Status.NOT_FOUND).build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptLanguageDescription.java
----------------------------------------------------------------------
diff --git a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptLanguageDescription.java b/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptLanguageDescription.java
deleted file mode 100644
index 74f6b44..0000000
--- a/platform.scripting/src/main/java/org/apache/clerezza/platform/scripting/ScriptLanguageDescription.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.clerezza.platform.scripting;
-
-/**
- * This class describes a script language in terms of language name and
- * language version.
- *
- * @author daniel
- */
-public class ScriptLanguageDescription {
- private final String language;
- private final String version;
-
- /**
- * Creates an new script language description.
- *
- * @param language the script language.
- * @param version the script version.
- * @throws IllegalArgumentException if <code>language</code> is null.
- */
- public ScriptLanguageDescription(String language, String version)
- throws IllegalArgumentException {
- if(language == null) {
- throw new IllegalArgumentException("Script Language can not be null");
- }
- if(version == null) {
- version = "";
- }
- this.language = language;
- this.version = version;
- }
-
- /**
- * Returns the script language (e.g. "Scala").
- *
- * @return the script language
- */
- public String getLanguage() {
- return language;
- }
-
- /**
- * Returns the script version (e.g. "1.8.6" if the described
- * script language is "Ruby 1.8.6".
- *
- * @return the script version
- */
- public String getVersion() {
- return version;
- }
-
- @Override
- public int hashCode() {
- return (language + version).hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if(obj.getClass().getName().equals(this.getClass().getName())) {
- ScriptLanguageDescription sld = (ScriptLanguageDescription) obj;
- return (this.language.equals(sld.language) &&
- this.version.equals(sld.version));
- }
- return false;
- }
-
- @Override
- public String toString() {
- return language+" "+version;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.security.conditions/LICENSE
----------------------------------------------------------------------
diff --git a/platform.security.conditions/LICENSE b/platform.security.conditions/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform.security.conditions/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.security.conditions/pom.xml
----------------------------------------------------------------------
diff --git a/platform.security.conditions/pom.xml b/platform.security.conditions/pom.xml
deleted file mode 100644
index 4806b54..0000000
--- a/platform.security.conditions/pom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><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">
-<!--
-
- 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.
-
--->
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>clerezza</artifactId>
- <groupId>org.apache.clerezza</groupId>
- <version>0.5</version>
- <relativePath>../parent</relativePath>
- </parent>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>platform.security.conditions</artifactId>
- <packaging>bundle</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>Clerezza - Platform Security Conditions</name>
- <description>Fragment bundle for System Bundle that contains
- conditions for the Conditional Permission Admin</description>
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <version>2.0.0</version>
- <configuration>
- <instructions>
- <Import-Package>!*</Import-Package>
- <Fragment-Host>system.bundle; extension:=framework</Fragment-Host>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.security.conditions/src/main/java/org/apache/clerezza/platform/security/conditions/NotBundleLocationCondition.java
----------------------------------------------------------------------
diff --git a/platform.security.conditions/src/main/java/org/apache/clerezza/platform/security/conditions/NotBundleLocationCondition.java b/platform.security.conditions/src/main/java/org/apache/clerezza/platform/security/conditions/NotBundleLocationCondition.java
deleted file mode 100644
index 4c0c842..0000000
--- a/platform.security.conditions/src/main/java/org/apache/clerezza/platform/security/conditions/NotBundleLocationCondition.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.clerezza.platform.security.conditions;
-
-import org.osgi.framework.Bundle;
-import org.osgi.service.condpermadmin.BundleLocationCondition;
-import org.osgi.service.condpermadmin.Condition;
-import org.osgi.service.condpermadmin.ConditionInfo;
-
-/**
- *
- * @author mir
- */
-public class NotBundleLocationCondition {
-
- /**
- * Returns the negated <code>Condition</code> of
- * <code>BundleLocationCondition</code>.
- *
- * @param bundle The Bundle being evaluated.
- * @param info The ConditionInfo to construct the condition for.
- * @return Condition object for the requested condition.
- */
- static public Condition getCondition(final Bundle bundle, ConditionInfo info) {
- ConditionInfo bundleLocationInfo = new ConditionInfo(
- BundleLocationCondition.class.getName(), info.getArgs());
- Condition result = BundleLocationCondition.getCondition(bundle,
- bundleLocationInfo);
- return result == Condition.TRUE ? Condition.FALSE: Condition.TRUE;
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/af0d99b2/platform.security.foafssl/LICENSE
----------------------------------------------------------------------
diff --git a/platform.security.foafssl/LICENSE b/platform.security.foafssl/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/platform.security.foafssl/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.