You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2013/02/22 16:21:36 UTC

[12/37] MARMOTTA-105: renamed packages in marmotta-core

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationChangedEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationChangedEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationChangedEvent.java
new file mode 100644
index 0000000..0fa127a
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationChangedEvent.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * An event indicating that the configuration has been updated. Takes the configuration key as argument
+ *
+ * <p/>
+ * KiWiUser: sschaffe
+ */
+public class ConfigurationChangedEvent {
+
+    private final Set<String> keys;
+
+    public ConfigurationChangedEvent(String key) {
+        this.keys = Collections.singleton(key);
+    }
+
+    public ConfigurationChangedEvent(Set<String> keys) {
+        this.keys = Collections.unmodifiableSet(keys);
+    }
+
+    public Set<String> getKeys() {
+        return keys;
+    }
+
+    public boolean containsChangedKey(String key) {
+        return keys.contains(key);
+    }
+
+    public boolean containsChangedKeyWithPrefix(String prefix) {
+        for (String key : keys) {
+            if (key.startsWith(prefix)) return true;
+        }
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationServiceInitEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationServiceInitEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationServiceInitEvent.java
new file mode 100644
index 0000000..79b0bf5
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ConfigurationServiceInitEvent.java
@@ -0,0 +1,27 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+/**
+ * Raised when the configuration service finishes its initialisation (but before the system has finished startup).
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class ConfigurationServiceInitEvent {
+
+    public ConfigurationServiceInitEvent() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ContentCreatedEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ContentCreatedEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ContentCreatedEvent.java
new file mode 100644
index 0000000..f178e98
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/ContentCreatedEvent.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+import org.openrdf.model.Resource;
+
+/**
+ * User: Thomas Kurz
+ * Date: 06.09.11
+ * Time: 18:15
+ */
+public class ContentCreatedEvent {
+
+	private Resource resource;
+
+	public ContentCreatedEvent(Resource resource) {
+		this.resource = resource;
+	}
+
+	public Resource getResource() {
+		return resource;
+	}
+
+	public void setResource(Resource resource) {
+		this.resource = resource;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SesameStartupEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SesameStartupEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SesameStartupEvent.java
new file mode 100644
index 0000000..b8193d3
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SesameStartupEvent.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class SesameStartupEvent {
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartedEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartedEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartedEvent.java
new file mode 100644
index 0000000..2f37bc9
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartedEvent.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+/**
+ * Thrown when system restart has completed and the database is ready again
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class SystemRestartedEvent {
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartingEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartingEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartingEvent.java
new file mode 100644
index 0000000..b0a289c
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemRestartingEvent.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+/**
+ * This event is raised when the system is restarted (e.g. database reinitialised)
+ * <p/>
+ * User: sschaffe
+ */
+public class SystemRestartingEvent {
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemStartupEvent.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemStartupEvent.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemStartupEvent.java
new file mode 100644
index 0000000..9fa6533
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/events/SystemStartupEvent.java
@@ -0,0 +1,27 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.events;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+public class SystemStartupEvent {
+
+    public SystemStartupEvent() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/InvalidArgumentException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/InvalidArgumentException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/InvalidArgumentException.java
new file mode 100644
index 0000000..1b45edf
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/InvalidArgumentException.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ * @author Sebastian Schaffert
+ *
+ */
+public class InvalidArgumentException extends RuntimeException {
+
+	private static final long serialVersionUID = -4997842359857913880L;
+
+	/**
+	 * 
+	 */
+	public InvalidArgumentException() {
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * @param arg0
+	 */
+	public InvalidArgumentException(String arg0) {
+		super(arg0);
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * @param arg0
+	 */
+	public InvalidArgumentException(Throwable arg0) {
+		super(arg0);
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * @param arg0
+	 * @param arg1
+	 */
+	public InvalidArgumentException(String arg0, Throwable arg1) {
+		super(arg0, arg1);
+		// TODO Auto-generated constructor stub
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFConfigurationException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFConfigurationException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFConfigurationException.java
new file mode 100644
index 0000000..d0b4dde
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFConfigurationException.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ *
+ * @author Sebastian Schaffert
+ */
+public class LMFConfigurationException extends LMFException {
+
+	private static final long serialVersionUID = 5573137610964184957L;
+
+	/**
+     * Creates a new instance of <code>KiWiConfigurationException</code> without detail message.
+     */
+    public LMFConfigurationException() {
+    }
+
+
+    /**
+     * Constructs an instance of <code>KiWiConfigurationException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public LMFConfigurationException(String msg) {
+        super(msg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFException.java
new file mode 100644
index 0000000..f9bb985
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/LMFException.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ *
+ * @author Sebastian Schaffert
+ */
+public class LMFException extends Exception {
+
+    private static final long serialVersionUID = 6193753017649674995L;
+
+
+    /**
+     * Creates a new instance of <code>KiWiException</code> without detail message.
+     */
+    public LMFException() {
+    }
+
+
+    /**
+     * Constructs an instance of <code>KiWiException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public LMFException(String msg) {
+        super(msg);
+    }
+
+    public LMFException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public LMFException(Throwable c) {
+        super(c);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/ResolvingException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/ResolvingException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/ResolvingException.java
new file mode 100644
index 0000000..a80fa6f
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/ResolvingException.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+public class ResolvingException extends Exception {
+
+    private static final long serialVersionUID = 1172696647248144843L;
+
+    public ResolvingException() {
+    }
+
+    public ResolvingException(String s) {
+        super(s);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/TemplatingException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/TemplatingException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/TemplatingException.java
new file mode 100644
index 0000000..6004649
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/TemplatingException.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ * User: Thomas Kurz
+ * Date: 22.07.11
+ * Time: 13:45
+ */
+public class TemplatingException extends Exception {
+
+    private static final long serialVersionUID = 4400229749389036384L;
+
+    public TemplatingException() {
+        super();
+    }
+    public TemplatingException(String msg) {
+        super(msg);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/UserExistsException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/UserExistsException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/UserExistsException.java
new file mode 100644
index 0000000..dd6948e
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/UserExistsException.java
@@ -0,0 +1,59 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ * Thrown to indicate that a user already exists when trying to create a new one.
+ * 
+ * @author Sebastian Schaffert
+ *
+ */
+public class UserExistsException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -8670379009777836957L;
+
+	/**
+	 * 
+	 */
+	public UserExistsException() {
+	}
+
+	/**
+	 * @param message
+	 */
+	public UserExistsException(String message) {
+		super(message);
+	}
+
+	/**
+	 * @param cause
+	 */
+	public UserExistsException(Throwable cause) {
+		super(cause);
+	}
+
+	/**
+	 * @param message
+	 * @param cause
+	 */
+	public UserExistsException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/WritingNotSupportedException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/WritingNotSupportedException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/WritingNotSupportedException.java
new file mode 100644
index 0000000..e6d3b36
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/WritingNotSupportedException.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class WritingNotSupportedException extends LMFException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 7591775138145634253L;
+
+    /**
+     * Creates a new instance of <code>KiWiException</code> without detail message.
+     */
+    public WritingNotSupportedException() {
+    }
+
+    /**
+     * Constructs an instance of <code>KiWiException</code> with the specified detail message.
+     *
+     * @param msg the detail message.
+     */
+    public WritingNotSupportedException(String msg) {
+        super(msg);
+    }
+
+    public WritingNotSupportedException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/authentication/LoginFailedException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/authentication/LoginFailedException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/authentication/LoginFailedException.java
new file mode 100644
index 0000000..14e0575
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/authentication/LoginFailedException.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.authentication;
+
+/**
+ * @author sstroka
+ *         User: sstroka
+ *         Date: 29.09.2011
+ *         Time: 17:16:08
+ */
+public class LoginFailedException extends Exception {
+
+    private static final long serialVersionUID = 672088108405801956L;
+
+    public LoginFailedException(String s) {
+        super(s);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFExportException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFExportException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFExportException.java
new file mode 100644
index 0000000..1fe2dc7
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFExportException.java
@@ -0,0 +1,85 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.io;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class LMFExportException extends Exception {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 2679720143121353080L;
+
+    /**
+     * Constructs a new exception with <code>null</code> as its detail message.
+     * The cause is not initialized, and may subsequently be initialized by a
+     * call to {@link #initCause}.
+     */
+    public LMFExportException() {
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message.  The
+     * cause is not initialized, and may subsequently be initialized by
+     * a call to {@link #initCause}.
+     *
+     * @param message the detail message. The detail message is saved for
+     *                later retrieval by the {@link #getMessage()} method.
+     */
+    public LMFExportException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message and
+     * cause.  <p>Note that the detail message associated with
+     * <code>cause</code> is <i>not</i> automatically incorporated in
+     * this exception's detail message.
+     *
+     * @param message the detail message (which is saved for later retrieval
+     *                by the {@link #getMessage()} method).
+     * @param cause   the cause (which is saved for later retrieval by the
+     *                {@link #getCause()} method).  (A <tt>null</tt> value is
+     *                permitted, and indicates that the cause is nonexistent or
+     *                unknown.)
+     * @since 1.4
+     */
+    public LMFExportException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new exception with the specified cause and a detail
+     * message of <tt>(cause==null ? null : cause.toString())</tt> (which
+     * typically contains the class and detail message of <tt>cause</tt>).
+     * This constructor is useful for exceptions that are little more than
+     * wrappers for other throwables (for example, {@link
+     * java.security.PrivilegedActionException}).
+     *
+     * @param cause the cause (which is saved for later retrieval by the
+     *              {@link #getCause()} method).  (A <tt>null</tt> value is
+     *              permitted, and indicates that the cause is nonexistent or
+     *              unknown.)
+     * @since 1.4
+     */
+    public LMFExportException(Throwable cause) {
+        super(cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFImportException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFImportException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFImportException.java
new file mode 100644
index 0000000..654d334
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/LMFImportException.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.io;
+
+/**
+ * Exception that is thrown if KiWi recognizes problems with the import service.
+ * 
+ * @author Stephanie Stroka
+ *			(stephanie.stroka@salzburgresearch.at)
+ *
+ */
+public class LMFImportException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 8157237047910758443L;
+
+	public LMFImportException() {
+		super();
+	}
+
+	public LMFImportException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public LMFImportException(String message) {
+		super(message);
+	}
+
+	public LMFImportException(Throwable cause) {
+		super(cause);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/UnsupportedExporterException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/UnsupportedExporterException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/UnsupportedExporterException.java
new file mode 100644
index 0000000..3360426
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/io/UnsupportedExporterException.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.io;
+
+
+/**
+ * Thrown if the export format is not supported by the export service.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class UnsupportedExporterException extends LMFExportException {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -557585376003250965L;
+
+    /**
+     * Creates a new instance of <code>KiWiException</code> without detail message.
+     */
+    public UnsupportedExporterException() {
+    }
+
+    /**
+     * Constructs an instance of <code>KiWiException</code> with the specified detail message.
+     *
+     * @param msg the detail message.
+     */
+    public UnsupportedExporterException(String msg) {
+        super(msg);
+    }
+
+    public UnsupportedExporterException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/security/AccessDeniedException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/security/AccessDeniedException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/security/AccessDeniedException.java
new file mode 100644
index 0000000..34ee47d
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/security/AccessDeniedException.java
@@ -0,0 +1,82 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.security;
+
+/**
+ * Thrown by the filter chain in case the access to the resource is denied. Caught by LMFAuthenticationFilter to
+ * send an authorization request.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class AccessDeniedException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Constructs a new runtime exception with <code>null</code> as its
+     * detail message.  The cause is not initialized, and may subsequently be
+     * initialized by a call to {@link #initCause}.
+     */
+    public AccessDeniedException() {
+    }
+
+    /**
+     * Constructs a new runtime exception with the specified detail message.
+     * The cause is not initialized, and may subsequently be initialized by a
+     * call to {@link #initCause}.
+     *
+     * @param message the detail message. The detail message is saved for
+     *                later retrieval by the {@link #getMessage()} method.
+     */
+    public AccessDeniedException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new runtime exception with the specified detail message and
+     * cause.  <p>Note that the detail message associated with
+     * <code>cause</code> is <i>not</i> automatically incorporated in
+     * this runtime exception's detail message.
+     *
+     * @param message the detail message (which is saved for later retrieval
+     *                by the {@link #getMessage()} method).
+     * @param cause   the cause (which is saved for later retrieval by the
+     *                {@link #getCause()} method).  (A <tt>null</tt> value is
+     *                permitted, and indicates that the cause is nonexistent or
+     *                unknown.)
+     * @since 1.4
+     */
+    public AccessDeniedException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new runtime exception with the specified cause and a
+     * detail message of <tt>(cause==null ? null : cause.toString())</tt>
+     * (which typically contains the class and detail message of
+     * <tt>cause</tt>).  This constructor is useful for runtime exceptions
+     * that are little more than wrappers for other throwables.
+     *
+     * @param cause the cause (which is saved for later retrieval by the
+     *              {@link #getCause()} method).  (A <tt>null</tt> value is
+     *              permitted, and indicates that the cause is nonexistent or
+     *              unknown.)
+     * @since 1.4
+     */
+    public AccessDeniedException(Throwable cause) {
+        super(cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/NotFoundException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/NotFoundException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/NotFoundException.java
new file mode 100644
index 0000000..b5a54b2
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/NotFoundException.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.webservice;
+
+import org.apache.marmotta.platform.core.exception.LMFException;
+
+/**
+ * User: Thomas Kurz
+ * Date: 21.02.11
+ * Time: 13:09
+ */
+public class NotFoundException extends LMFException {
+    private static final long serialVersionUID = 4705776110923618486L;
+
+    public NotFoundException() {
+        super();
+    }
+    public NotFoundException(String s) {
+        super(s);
+    }
+
+    public NotFoundException(String s, Throwable throwable) {
+        super(s, throwable);
+    }
+
+    public NotFoundException(Throwable c) {
+        super(c);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/ServerException.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/ServerException.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/ServerException.java
new file mode 100644
index 0000000..eb8662d
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/exception/webservice/ServerException.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.exception.webservice;
+
+import org.apache.marmotta.platform.core.exception.LMFException;
+
+/**
+ * User: Thomas Kurz
+ * Date: 21.02.11
+ * Time: 13:15
+ */
+public class ServerException extends LMFException {
+
+    private static final long serialVersionUID = 8374959314074759653L;
+
+    public ServerException() {
+        super();
+    }
+    public ServerException(String s) {
+        super(s);
+    }
+
+    public ServerException(String s, Throwable c) {
+        super(s, c);
+    }
+
+    public ServerException(Throwable c) {
+        super(c);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/LMFServerNameFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/LMFServerNameFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/LMFServerNameFilter.java
new file mode 100644
index 0000000..eaff5ec
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/LMFServerNameFilter.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.filters;
+
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.modules.LMFHttpFilter;
+import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
+
+import javax.inject.Inject;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Adds the LMF Server Version header to each response
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class LMFServerNameFilter implements LMFHttpFilter {
+
+    @Inject
+    private ConfigurationService configurationService;
+
+    @Inject
+    private ModuleConfiguration moduleConfiguration;
+
+    /**
+     * Return the pattern (regular expression) that a request URI (relative to the LMF base URI) has to match
+     * before triggering this filter.
+     *
+     * @return
+     */
+    @Override
+    public String getPattern() {
+        return "/.*";
+    }
+
+    /**
+     * Return the priority of the filter. Filters that need to be executed before anything else should return
+     * PRIO_FIRST, filters that need to be executed last in the chain should return PRIO_LAST, all other filters
+     * something inbetween (e.g. PRIO_MIDDLE).
+     *
+     * @return
+     */
+    @Override
+    public int getPriority() {
+        return PRIO_MIDDLE;
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being placed into
+     * service. The servlet container calls the init method exactly once after instantiating the
+     * filter. The init method must complete successfully before the filter is asked to do any
+     * filtering work. <br><br>
+     * <p/>
+     * The web container cannot place the filter into service if the init method either<br>
+     * 1.Throws a ServletException <br>
+     * 2.Does not return within a time period defined by the web container
+     */
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+    }
+
+    /**
+     * The <code>doFilter</code> method of the Filter is called by the container
+     * each time a request/response pair is passed through the chain due
+     * to a client request for a resource at the end of the chain. The FilterChain passed in to this
+     * method allows the Filter to pass on the request and response to the next entity in the
+     * chain.<p>
+     * A typical implementation of this method would follow the following pattern:- <br>
+     * 1. Examine the request<br>
+     * 2. Optionally wrap the request object with a custom implementation to
+     * filter content or headers for input filtering <br>
+     * 3. Optionally wrap the response object with a custom implementation to
+     * filter content or headers for output filtering <br>
+     * 4. a) <strong>Either</strong> invoke the next entity in the chain using the FilterChain object (<code>chain.doFilter()</code>), <br>
+     * * 4. b) <strong>or</strong> not pass on the request/response pair to the next entity in the filter chain to block the request processing<br>
+     * * 5. Directly set headers on the response after invocation of the next entity in the filter chain.
+     */
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        HttpServletResponse resp = (HttpServletResponse)response;
+        resp.setHeader("Server","Linked Media Framework/"+moduleConfiguration.getModuleVersion() + " (build "+moduleConfiguration.getBuildRevisionNumber()+")");
+
+        chain.doFilter(request,response);
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being taken out of service. This
+     * method is only called once all threads within the filter's doFilter method have exited or after
+     * a timeout period has passed. After the web container calls this method, it will not call the
+     * doFilter method again on this instance of the filter. <br><br>
+     * <p/>
+     * This method gives the filter an opportunity to clean up any resources that are being held (for
+     * example, memory, file handles, threads) and make sure that any persistent state is synchronized
+     * with the filter's current state in memory.
+     */
+    @Override
+    public void destroy() {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/ModuleResourceFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/ModuleResourceFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/ModuleResourceFilter.java
new file mode 100644
index 0000000..3852997
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/ModuleResourceFilter.java
@@ -0,0 +1,178 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.filters;
+
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.modules.LMFHttpFilter;
+import org.apache.marmotta.platform.core.api.modules.LMFResourceService;
+import org.apache.marmotta.platform.core.api.modules.ResourceEntry;
+import org.slf4j.Logger;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Resolve the resources of LMF modules and deliver them. Proceeds with the chain if not found.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+@ApplicationScoped
+public class ModuleResourceFilter implements LMFHttpFilter {
+
+    @Inject
+    private Logger log;
+
+    @Inject
+    private LMFResourceService resourceService;
+
+    @Inject
+    private ConfigurationService configurationService;
+
+
+    /**
+     * Return the pattern (regular expression) that a request URI (relative to the LMF base URI) has to match
+     * before triggering this filter.
+     *
+     * @return
+     */
+    @Override
+    public String getPattern() {
+        return "^/.*";
+    }
+
+    /**
+     * Return the priority of the filter. Filters that need to be executed before anything else should return
+     * PRIO_FIRST, filters that need to be executed last in the chain should return PRIO_LAST, all other filters
+     * something inbetween (e.g. PRIO_MIDDLE).
+     *
+     * @return
+     */
+    @Override
+    public int getPriority() {
+        return PRIO_LAST;
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being placed into
+     * service. The servlet container calls the init method exactly once after instantiating the
+     * filter. The init method must complete successfully before the filter is asked to do any
+     * filtering work. <br><br>
+     * <p/>
+     * The web container cannot place the filter into service if the init method either<br>
+     * 1.Throws a ServletException <br>
+     * 2.Does not return within a time period defined by the web container
+     */
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    /**
+     * The <code>doFilter</code> method of the Filter is called by the container
+     * each time a request/response pair is passed through the chain due
+     * to a client request for a resource at the end of the chain. The FilterChain passed in to this
+     * method allows the Filter to pass on the request and response to the next entity in the
+     * chain.<p>
+     * A typical implementation of this method would follow the following pattern:- <br>
+     * 1. Examine the request<br>
+     * 2. Optionally wrap the request object with a custom implementation to
+     * filter content or headers for input filtering <br>
+     * 3. Optionally wrap the response object with a custom implementation to
+     * filter content or headers for output filtering <br>
+     * 4. a) <strong>Either</strong> invoke the next entity in the chain using the FilterChain object (<code>chain.doFilter()</code>), <br>
+     * * 4. b) <strong>or</strong> not pass on the request/response pair to the next entity in the filter chain to block the request processing<br>
+     * * 5. Directly set headers on the response after invocation of the next entity in the filter chain.
+     */
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        URL url = null;
+        String prefix = null, path = null;
+        if (request instanceof HttpServletRequest) {
+            url    = new URL(((HttpServletRequest)request).getRequestURL().toString());
+            prefix = ((HttpServletRequest)request).getContextPath();
+            if(url.getPath().startsWith(prefix)) {
+                path = url.getPath().substring(prefix.length());
+            }
+        }
+
+
+        if(path != null) {
+            long starttime = System.currentTimeMillis();
+
+            ResourceEntry data = resourceService.getResource(path);
+
+
+            // if no: proceed with the chain by calling chain.doFilter()
+            if(data != null && data.getLength() > 0) {
+
+
+                HttpServletResponse hresponse = (HttpServletResponse) response;
+
+                if(configurationService.getBooleanConfiguration("resources.browsercache.enabled",true)) {
+                    hresponse.setDateHeader("Expires", System.currentTimeMillis()+configurationService.getIntConfiguration("resources.browsercache.seconds",300)*1000);
+                } else {
+                    hresponse.setHeader("Cache-Control", "no-store");
+                    hresponse.setHeader("Pragma", "no-cache");
+                    hresponse.setDateHeader("Expires", 0);
+                }
+
+                if(data.getContentType() != null && !data.getContentType().contains("unknown")) {
+                    hresponse.setContentType(data.getContentType());
+                }
+                hresponse.setContentLength(data.getLength());
+
+                hresponse.getOutputStream().write(data.getData());
+                hresponse.getOutputStream().flush();
+                hresponse.getOutputStream().close();
+
+                if (log.isDebugEnabled()) {
+                    log.debug("request for {} took {}ms", url, System.currentTimeMillis() - starttime);
+                }
+
+                return;
+            }
+
+
+
+        }
+
+        chain.doFilter(request,response);
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being taken out of service. This
+     * method is only called once all threads within the filter's doFilter method have exited or after
+     * a timeout period has passed. After the web container calls this method, it will not call the
+     * doFilter method again on this instance of the filter. <br><br>
+     * <p/>
+     * This method gives the filter an opportunity to clean up any resources that are being held (for
+     * example, memory, file handles, threads) and make sure that any persistent state is synchronized
+     * with the filter's current state in memory.
+     */
+    @Override
+    public void destroy() {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
new file mode 100644
index 0000000..95a6a22
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/filters/TemplatingFilter.java
@@ -0,0 +1,190 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * 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.
+ */
+package org.apache.marmotta.platform.core.filters;
+
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.modules.LMFHttpFilter;
+import org.apache.marmotta.platform.core.api.modules.LMFResourceService;
+import org.apache.marmotta.platform.core.api.modules.ResourceEntry;
+import org.apache.marmotta.platform.core.api.templating.TemplatingService;
+import org.apache.marmotta.platform.core.exception.TemplatingException;
+import org.slf4j.Logger;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+@ApplicationScoped
+public class TemplatingFilter implements LMFHttpFilter {
+
+    @Inject
+    private Logger log;
+
+    @Inject
+    private LMFResourceService resourceService;
+
+    @Inject
+    private ConfigurationService configurationService;
+
+    @Inject
+    private TemplatingService templatingService;
+
+    /**
+     * Return the pattern (regular expression) that a request URI (relative to the LMF base URI) has to match
+     * before triggering this filter.
+     *
+     * @return
+     */
+    @Override
+    public String getPattern() {
+        return "^/.*";
+    }
+
+    /**
+     * Return the priority of the filter. Filters that need to be executed before anything else should return
+     * PRIO_FIRST, filters that need to be executed last in the chain should return PRIO_LAST, all other filters
+     * something inbetween (e.g. PRIO_MIDDLE).
+     *
+     * @return
+     */
+    @Override
+    public int getPriority() {
+        return PRIO_MIDDLE;
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being placed into
+     * service. The servlet container calls the init method exactly once after instantiating the
+     * filter. The init method must complete successfully before the filter is asked to do any
+     * filtering work. <br><br>
+     * <p/>
+     * The web container cannot place the filter into service if the init method either<br>
+     * 1.Throws a ServletException <br>
+     * 2.Does not return within a time period defined by the web container
+     */
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+        //init templating service
+        try {
+            templatingService.init(filterConfig.getServletContext());
+        } catch (TemplatingException e) {
+            log.error("templating service could not be initialized: " + e.getMessage());
+        }
+    }
+
+    /**
+     * The <code>doFilter</code> method of the Filter is called by the container
+     * each time a request/response pair is passed through the chain due
+     * to a client request for a resource at the end of the chain. The FilterChain passed in to this
+     * method allows the Filter to pass on the request and response to the next entity in the
+     * chain.<p>
+     * A typical implementation of this method would follow the following pattern:- <br>
+     * 1. Examine the request<br>
+     * 2. Optionally wrap the request object with a custom implementation to
+     * filter content or headers for input filtering <br>
+     * 3. Optionally wrap the response object with a custom implementation to
+     * filter content or headers for output filtering <br>
+     * 4. a) <strong>Either</strong> invoke the next entity in the chain using the FilterChain object (<code>chain.doFilter()</code>), <br>
+     * * 4. b) <strong>or</strong> not pass on the request/response pair to the next entity in the filter chain to block the request processing<br>
+     * * 5. Directly set headers on the response after invocation of the next entity in the filter chain.
+     */
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+        URL url = null;
+        String prefix = null, path = null;
+        if (request instanceof HttpServletRequest) {
+            url    = new URL(((HttpServletRequest)request).getRequestURL().toString());
+            prefix = ((HttpServletRequest)request).getContextPath();
+            if(url.getPath().startsWith(prefix)) {
+                path = url.getPath().substring(prefix.length());
+            }
+        }
+        long starttime = System.currentTimeMillis();
+
+
+        if(path != null && templatingService.isMenuEntry(path)) {
+
+            ResourceEntry data = resourceService.getResource(path);
+
+            // if no: proceed with the chain by calling chain.doFilter()
+            if(data != null && data.getLength() > 0) {
+
+                try {
+                    byte [] templatedData = templatingService.process(data.getData(),path);
+                    data = new ResourceEntry(data.getLocation(),templatedData,templatedData.length,data.getContentType());
+
+                    HttpServletResponse hresponse = (HttpServletResponse) response;
+
+                    if(configurationService.getBooleanConfiguration("resources.browsercache.enabled",true)) {
+                        hresponse.setDateHeader("Expires", System.currentTimeMillis()+configurationService.getIntConfiguration("resources.browsercache.seconds",300)*1000);
+                    } else {
+                        hresponse.setHeader("Cache-Control", "no-store");
+                        hresponse.setHeader("Pragma", "no-cache");
+                        hresponse.setDateHeader("Expires", 0);
+                    }
+
+                    if(data.getContentType() != null && !data.getContentType().contains("unknown")) {
+                        hresponse.setContentType(data.getContentType());
+                    }
+                    hresponse.setContentLength(data.getLength());
+
+                    hresponse.getOutputStream().write(data.getData());
+                    hresponse.getOutputStream().flush();
+                    hresponse.getOutputStream().close();
+
+                    if (log.isDebugEnabled()) {
+                        log.debug("request for {} took {}ms", url, System.currentTimeMillis() - starttime);
+                    }
+
+                    return;
+                } catch(TemplatingException e) {
+                    log.error("templating did not work");
+                }
+
+            }
+        }
+
+        chain.doFilter(request,response);
+    }
+
+    /**
+     * Called by the web container to indicate to a filter that it is being taken out of service. This
+     * method is only called once all threads within the filter's doFilter method have exited or after
+     * a timeout period has passed. After the web container calls this method, it will not call the
+     * doFilter method again on this instance of the filter. <br><br>
+     * <p/>
+     * This method gives the filter an opportunity to clean up any resources that are being held (for
+     * example, memory, file handles, threads) and make sure that any persistent state is synchronized
+     * with the filter's current state in memory.
+     */
+    @Override
+    public void destroy() {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}