Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/marmotta into develop
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/jetty-web.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/jetty-web.xml
deleted file mode 100644
index a5c38d0..0000000
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/META-INF/jetty-web.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?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.
-
--->
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-
-<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
- <Call class="org.jboss.weld.environment.jetty.WeldServletHandler" name="process">
- <Arg><Ref id="webAppCtx"/></Arg>
- </Call>
-</Configure>
diff --git a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jetty-web.xml b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jetty-web.xml
index 0ec4d0e..8e6b96a 100644
--- a/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jetty-web.xml
+++ b/build/archetypes/marmotta-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jetty-web.xml
@@ -18,20 +18,26 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
- "http://jetty.mortbay.org/configure.dtd">
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
+ "http://www.eclipse.org/jetty/configure.dtd">
-<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
+<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
+
+ <Set name="serverClasses">
+ <Array type="java.lang.String">
+ <Item>-org.eclipse.jetty.servlet.ServletContextHandler.Decorator</Item>
+ </Array>
+ </Set>
<Array id="annotationConfig" type="java.lang.String">
- <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
- <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
- <Item>org.mortbay.jetty.annotations.Configuration</Item> <!-- Enables annotation support -->
- <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
- <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
+ <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
+ <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
+ <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item> <!-- Enables annotation support -->
+ <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
+ <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
</Array>
- <Call class="org.jboss.weld.environment.jetty.MortbayWeldServletHandler" name="process">
+ <Call class="org.jboss.weld.environment.jetty.EclipseWeldServletHandler" name="process">
<Arg><Ref id="webAppCtx"/></Arg>
</Call>
</Configure>
diff --git a/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/SPARQL_SD.java b/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/SPARQL_SD.java
index ef5b221..c0e2592 100644
--- a/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/SPARQL_SD.java
+++ b/commons/marmotta-sesame-tools/marmotta-model-vocabs/src/main/java/org/apache/marmotta/commons/vocabulary/SPARQL_SD.java
@@ -22,7 +22,7 @@
/**
* Namespace SPARQL_SD - SparqlServiceDescription.
- * @see http://www.w3.org/TR/sparql11-service-description/
+ * @see <a href="http://www.w3.org/TR/sparql11-service-description/">http://www.w3.org/TR/sparql11-service-description/</a>
*/
public class SPARQL_SD {
diff --git a/launchers/marmotta-webapp/src/main/webapp/META-INF/jetty-web.xml b/launchers/marmotta-webapp/src/main/webapp/META-INF/jetty-web.xml
deleted file mode 100644
index db9e86e..0000000
--- a/launchers/marmotta-webapp/src/main/webapp/META-INF/jetty-web.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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.
-
--->
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
-
-<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
- <Call class="org.jboss.weld.environment.jetty.WeldServletHandler" name="process">
- <Arg><Ref id="webAppCtx"/></Arg>
- </Call>
-</Configure>
diff --git a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/jetty-web.xml
index df4c63e..f9658d0 100644
--- a/launchers/marmotta-webapp/src/main/webapp/WEB-INF/jetty-web.xml
+++ b/launchers/marmotta-webapp/src/main/webapp/WEB-INF/jetty-web.xml
@@ -17,20 +17,26 @@
limitations under the License.
-->
-<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
- "http://jetty.mortbay.org/configure.dtd">
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
+ "http://www.eclipse.org/jetty/configure.dtd">
-<Configure id="webAppCtx" class="org.mortbay.jetty.webapp.WebAppContext">
+<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
+
+ <Set name="serverClasses">
+ <Array type="java.lang.String">
+ <Item>-org.eclipse.jetty.servlet.ServletContextHandler.Decorator</Item>
+ </Array>
+ </Set>
<Array id="annotationConfig" type="java.lang.String">
- <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
- <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
- <Item>org.mortbay.jetty.annotations.Configuration</Item> <!-- Enables annotation support -->
- <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
- <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
+ <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
+ <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
+ <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item> <!-- Enables annotation support -->
+ <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>
+ <Item>org.eclipse.jetty.webapp.TagLibConfiguration</Item>
</Array>
- <Call class="org.jboss.weld.environment.jetty.MortbayWeldServletHandler" name="process">
+ <Call class="org.jboss.weld.environment.jetty.EclipseWeldServletHandler" name="process">
<Arg><Ref id="webAppCtx"/></Arg>
</Call>
</Configure>
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index 3e8a6fe..54b7859 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -80,6 +80,11 @@
<artifactId>sesame-rio-rdfxml</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
index 6929501..f45c4c6 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
@@ -118,6 +118,7 @@
log.info("Apache Marmotta Core (Development Version) starting up ... ");
}
+ //TODO: refactor this code
if(StringUtils.isBlank(home)) {
home = System.getProperty("marmotta.home");
if(StringUtils.isNotBlank(home)) {
@@ -131,48 +132,48 @@
if(StringUtils.isNotBlank(home)) {
log.info("Configured working directory {} from system property kiwi.home", home);
} else {
- home = System.getenv("MARMOTTA_HOME");
- if(StringUtils.isNotBlank(home)) {
- log.info("Configured working directory {} from environment variable MARMOTTA_HOME", home);
- } else {
- home = System.getenv("LMF_HOME");
- if(StringUtils.isNotBlank(home)) {
- log.info("Configured working directory {} from environment variable LMF_HOME", home);
- } else {
- home = System.getenv("KIWI_HOME");
- if(StringUtils.isNotBlank(home)) {
- log.info("Configured working directory {} from environment variable KIWI_HOME", home);
- } else {
- if (context != null) {
- home = context.getInitParameter("marmotta.home");
- if(StringUtils.isNotBlank(home)) {
- log.info("Configured working directory {} from servlet context parameter marmotta.home", home);
- }
- } else {
- log.error("could not determine Apache Marmotta home directory, please set the environment variable MARMOTTA_HOME");
- }
- }
- }
- }
+ home = System.getenv("MARMOTTA_HOME");
+ if(StringUtils.isNotBlank(home)) {
+ log.info("Configured working directory {} from environment variable MARMOTTA_HOME", home);
+ } else {
+ home = System.getenv("LMF_HOME");
+ if(StringUtils.isNotBlank(home)) {
+ log.info("Configured working directory {} from environment variable LMF_HOME", home);
+ } else {
+ home = System.getenv("KIWI_HOME");
+ if(StringUtils.isNotBlank(home)) {
+ log.info("Configured working directory {} from environment variable KIWI_HOME", home);
+ } else {
+ if (context != null) {
+ home = context.getInitParameter("marmotta.home");
+ if(StringUtils.isNotBlank(home)) {
+ log.info("Configured working directory {} from servlet context parameter marmotta.home", home);
+ }
+ } else {
+ log.error("could not determine Apache Marmotta home directory, please set the environment variable MARMOTTA_HOME");
+ }
+ }
+ }
+ }
}
}
}
}
if(StringUtils.isNotBlank(home)) {
- if (home.startsWith("~" + File.separator)) {
- home = System.getProperty("user.home") + home.substring(1);
- }
+ if (home.startsWith("~" + File.separator)) {
+ home = System.getProperty("user.home") + home.substring(1);
+ }
configurationService.setHome(home);
} else {
- log.error("home directory not properly initialized!!!");
+ log.error("home directory not properly initialized!!!");
}
if(context != null) {
configurationService.setServletContext(context);
}
- configurationService.initialize(home,configurationOverride);
+ configurationService.initialize(home, configurationOverride);
configurationService.setConfiguration("kiwi.version", versionNumber);
@@ -181,8 +182,8 @@
configurationService.setConfiguration("kiwi.path", context.getContextPath());
// register the systray links provided by the different components
- Map<String, String> demoLinks = new HashMap<String, String>();
- Map<String, String> adminLinks = new HashMap<String, String>();
+ Map<String, String> demoLinks = new HashMap<>();
+ Map<String, String> adminLinks = new HashMap<>();
for(MarmottaSystrayLink link : CDIContext.getInstances(MarmottaSystrayLink.class)) {
if(link.getSection() == MarmottaSystrayLink.Section.DEMO) {
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
index c35e570..3ad71ac 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/CDIContext.java
@@ -32,11 +32,12 @@
import java.util.List;
/**
- * KiWi (LMF) Content Util
+ * Marmotta CDI Context Util
*
* @author Sebastian Schaffert
*/
public class CDIContext {
+
private static BeanManager beanManager;
private static final List<String> beanManagerLocations;
@@ -44,7 +45,7 @@
private static Logger log = LoggerFactory.getLogger(CDIContext.class);
static {
- beanManagerLocations = new ArrayList<String>();
+ beanManagerLocations = new ArrayList<>();
beanManagerLocations.add("java:comp/env/BeanManager");
beanManagerLocations.add("java:comp/BeanManager");
beanManagerLocations.add("java:app/BeanManager");
@@ -52,8 +53,7 @@
protected static BeanManager getBeanManager() {
- if (beanManager == null)
- {
+ if (beanManager == null) {
beanManager = lookupBeanManager();
}
return beanManager;
@@ -85,7 +85,6 @@
@SuppressWarnings("unchecked")
public static <T> T getInstance(Class<T> type) {
-
BeanManager beanManager = getBeanManager();
Bean<T> bean = (Bean<T>) beanManager.getBeans(type).iterator().next();
CreationalContext<T> context = beanManager.createCreationalContext(bean);
@@ -172,5 +171,4 @@
}catch ( NamingException ex ) {}
}
-
}
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
index b4de8b3..b818c71 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/JettyMarmotta.java
@@ -55,9 +55,9 @@
private Server jetty;
- private int port;
+ private final int port;
- private String context;
+ private final String context;
public JettyMarmotta(String context) {
this(context, getRandomPort());
@@ -80,7 +80,7 @@
}
public JettyMarmotta(String context, int port, Class<?>... webservices) {
- this(context,port, new HashSet<Class<?>>(Arrays.asList(webservices)));
+ this(context,port, new HashSet<>(Arrays.asList(webservices)));
}
public JettyMarmotta(Configuration override, String context, Set<Class<?>> webservices) {
@@ -171,6 +171,7 @@
@Override
public void shutdown() {
+ container = null;
try {
jetty.stop();
} catch (Exception e) {
diff --git a/pom.xml b/pom.xml
index 3031160..32ecba3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,6 +123,12 @@
<name>Chris Beer</name>
<url>http://cbeer.info/</url>
</contributor>
+ <contributor>
+ <name>Mark A. Matienzo</name>
+ <url>http://matienzo.org/</url>
+ <organization>Digital Public Library of America</organization>
+ <organizationUrl>http://dp.la/</organizationUrl>
+ </contributor>
</contributors>
<organization>