You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2013/11/11 11:14:19 UTC
[1/5] git commit: updated to sesame 2.7.8
Updated Branches:
refs/heads/develop 7b1bd673f -> c0620f7f8
updated to sesame 2.7.8
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/cb68e273
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/cb68e273
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/cb68e273
Branch: refs/heads/develop
Commit: cb68e2735d7df1b96c129eeb9a28129b67e7fef8
Parents: 7b1bd67
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon Nov 11 09:27:52 2013 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Nov 11 09:27:52 2013 +0100
----------------------------------------------------------------------
parent/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/cb68e273/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 7f9af3d..08242b4 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -36,7 +36,7 @@
<url>http://marmotta.incubator.apache.org</url>
<properties>
- <sesame.version>2.7.7</sesame.version>
+ <sesame.version>2.7.8</sesame.version>
<junit.version>4.11</junit.version>
<weld.version>2.1.Final</weld.version>
<weld.core.version>2.1.0.Final</weld.core.version>
[3/5] git commit: safer code for the templates initialization
Posted by wi...@apache.org.
safer code for the templates initialization
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/31ec52d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/31ec52d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/31ec52d7
Branch: refs/heads/develop
Commit: 31ec52d7aa22a58004bb0a8ea3da7c95c738ba20
Parents: b2c7945
Author: Sergio Fernández <wi...@apache.org>
Authored: Sun May 19 22:33:18 2013 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Nov 11 10:11:46 2013 +0100
----------------------------------------------------------------------
.../core/api/templating/TemplatingService.java | 6 +++++
.../templating/TemplatingServiceImpl.java | 28 +++++++++++---------
2 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/31ec52d7/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
index 7a17f87..0ee9a8b 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
@@ -38,6 +38,12 @@ public interface TemplatingService {
public final static String DEFAULT_REST_FILE = "overview-index.html";
+ final static String ADMIN_TPL = "admin.ftl";
+
+ final static String ERROR_404_TPL = "404.ftl";
+
+ final static String RDF_HTML_TPL = "rdfhtml.ftl";
+
static final String DEFAULT_PROJECT = "marmotta";
static final String DEFAULT_STYLE = "blue";
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/31ec52d7/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
index 1d78adf..e19b770 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
@@ -80,21 +80,25 @@ public class TemplatingServiceImpl implements TemplatingService {
common.put("LOGO", configurationService.getStringConfiguration("kiwi.pages.project."+project+".logo", project+".png"));
common.put("FOOTER", configurationService.getStringConfiguration("kiwi.pages.project."+project+".footer", "(footer not properly configured for project "+project+")"));
- templateDir =new File(configurationService.getHome()+TemplatingService.PATH);
+ templateDir = new File(configurationService.getHome(), TemplatingService.PATH);
if (!templateDir.exists()) templateDir.mkdirs();
- for (String fName: new String[] {"admin.ftl", "404.ftl", "rdfhtml.ftl"}) {
- final File dT = new File(templateDir, fName);
- if (!dT.exists()) {
- try {
- log.info("Default Template not found, using fallback...");
- final InputStream str = this.getClass().getResourceAsStream(TemplatingService.PATH+fName);
- FileUtils.copyInputStreamToFile(str, dT);
- } catch (IOException e) {
- log.error("Could not create fallback template, templating might react weird!", e);
- }
- } }
+ for (String fName: new String[] {
+ TemplatingService.ADMIN_TPL,
+ TemplatingService.ERROR_404_TPL,
+ TemplatingService.RDF_HTML_TPL }) {
+ final File dT = new File(templateDir, fName);
+ if (!dT.exists()) {
+ try {
+ log.warn("Default template not found at {}, copying fallback...", dT.getAbsolutePath());
+ final InputStream str = this.getClass().getResourceAsStream(TemplatingService.PATH + fName);
+ FileUtils.copyInputStreamToFile(str, dT);
+ } catch (IOException e) {
+ log.error("Could not create fallback template, templating might react weird!", e);
+ }
+ }
+ }
}
/**
[2/5] git commit: copy template files to home directory
Posted by wi...@apache.org.
copy template files to home directory
Conflicts:
platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/b2c7945b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/b2c7945b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/b2c7945b
Branch: refs/heads/develop
Commit: b2c7945bdeadd7af616d753b5ef843e2159afc68
Parents: cb68e27
Author: tkurz <tk...@apache.org>
Authored: Fri May 17 12:10:13 2013 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Nov 11 10:11:25 2013 +0100
----------------------------------------------------------------------
.../templating/TemplatingServiceImpl.java | 43 ++++++++++++++++----
1 file changed, 36 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b2c7945b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
index 6942443..1d78adf 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/TemplatingServiceImpl.java
@@ -17,12 +17,7 @@
*/
package org.apache.marmotta.platform.core.services.templating;
-import java.io.BufferedWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
+import java.io.*;
import java.util.HashMap;
import java.util.Map;
@@ -31,7 +26,11 @@ import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
+
import com.google.common.base.Preconditions;
+
+import org.apache.commons.io.FileUtils;
+
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
import org.apache.marmotta.platform.core.api.templating.TemplatingService;
import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
@@ -39,7 +38,10 @@ import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
+
import org.apache.marmotta.platform.core.startup.MarmottaStartupService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Template Service Implementation
@@ -57,6 +59,10 @@ public class TemplatingServiceImpl implements TemplatingService {
@Inject
private MarmottaStartupService startupService;
+ private static Logger log = LoggerFactory.getLogger(ConfigurationService.class);
+
+ private File templateDir;
+
public TemplatingServiceImpl() {
super();
common = new HashMap<String,String>();
@@ -73,6 +79,22 @@ public class TemplatingServiceImpl implements TemplatingService {
common.put("BASIC_URL", configurationService.getBaseUri());
common.put("LOGO", configurationService.getStringConfiguration("kiwi.pages.project."+project+".logo", project+".png"));
common.put("FOOTER", configurationService.getStringConfiguration("kiwi.pages.project."+project+".footer", "(footer not properly configured for project "+project+")"));
+
+ templateDir =new File(configurationService.getHome()+TemplatingService.PATH);
+
+ if (!templateDir.exists()) templateDir.mkdirs();
+
+ for (String fName: new String[] {"admin.ftl", "404.ftl", "rdfhtml.ftl"}) {
+ final File dT = new File(templateDir, fName);
+ if (!dT.exists()) {
+ try {
+ log.info("Default Template not found, using fallback...");
+ final InputStream str = this.getClass().getResourceAsStream(TemplatingService.PATH+fName);
+ FileUtils.copyInputStreamToFile(str, dT);
+ } catch (IOException e) {
+ log.error("Could not create fallback template, templating might react weird!", e);
+ }
+ } }
}
/**
@@ -96,10 +118,17 @@ public class TemplatingServiceImpl implements TemplatingService {
@Override
public Configuration getConfiguration(Class<?> cls) {
Configuration cfg = new Configuration();
- cfg.setClassForTemplateLoading(cls, TemplatingService.PATH);
+ try {
+ cfg.setDirectoryForTemplateLoading(templateDir);
+ } catch (IOException e) {
+ log.warn("not a directory");
+ cfg.setClassForTemplateLoading(cls, TemplatingService.PATH);
+ }
return cfg;
}
+
+
@Override
public Template getTemplate(String name) throws IOException {
return getConfiguration().getTemplate(name);
[5/5] git commit: MARMOTTA-356: fixed wrong conflict resolution
Posted by wi...@apache.org.
MARMOTTA-356: fixed wrong conflict resolution
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/c0620f7f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/c0620f7f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/c0620f7f
Branch: refs/heads/develop
Commit: c0620f7f8cf15da5d8430d059c593b0a897997bf
Parents: 6560c23
Author: Sergio Fernández <wi...@apache.org>
Authored: Mon Nov 11 11:07:32 2013 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Nov 11 11:07:32 2013 +0100
----------------------------------------------------------------------
.../platform/core/api/templating/TemplatingService.java | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c0620f7f/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
index ef288be..c930222 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
@@ -44,18 +44,10 @@ public interface TemplatingService {
final static String RDF_HTML_TPL = "rdfhtml.ftl";
- final static String ADMIN_TPL = "admin.ftl";
-
- final static String ERROR_404_TPL = "404.ftl";
-
- final static String RDF_HTML_TPL = "rdfhtml.ftl";
-
static final String DEFAULT_PROJECT = "marmotta";
static final String DEFAULT_STYLE = "blue";
- static final String ADMIN_TPL = "admin.ftl";
-
public final static String DEFAULT_WEBSERVICE_TITLE = "Webservice";
void initDataModel();
[4/5] git commit: safer code for the templates initialization
Posted by wi...@apache.org.
safer code for the templates initialization
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/6560c23c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/6560c23c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/6560c23c
Branch: refs/heads/develop
Commit: 6560c23c632f8e28d103f320df298fcb607315bb
Parents: 31ec52d
Author: Sergio Fernández <wi...@apache.org>
Authored: Sun May 19 22:33:18 2013 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Mon Nov 11 10:11:57 2013 +0100
----------------------------------------------------------------------
.../platform/core/api/templating/TemplatingService.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/6560c23c/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
index 0ee9a8b..ef288be 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/templating/TemplatingService.java
@@ -44,6 +44,12 @@ public interface TemplatingService {
final static String RDF_HTML_TPL = "rdfhtml.ftl";
+ final static String ADMIN_TPL = "admin.ftl";
+
+ final static String ERROR_404_TPL = "404.ftl";
+
+ final static String RDF_HTML_TPL = "rdfhtml.ftl";
+
static final String DEFAULT_PROJECT = "marmotta";
static final String DEFAULT_STYLE = "blue";