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/05/19 22:42:46 UTC
[2/2] git commit: soft-coded admin template name
soft-coded admin template name
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/c3221e6a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/c3221e6a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/c3221e6a
Branch: refs/heads/MARMOTTA-228
Commit: c3221e6ae582e10e55622ba6c3fdef049427ad9a
Parents: 1aacc64
Author: Sergio Fernández <wi...@apache.org>
Authored: Sun May 19 22:34:24 2013 +0200
Committer: Sergio Fernández <wi...@apache.org>
Committed: Sun May 19 22:34:24 2013 +0200
----------------------------------------------------------------------
.../templating/AdminTemplatingServiceImpl.java | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c3221e6a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
index 7cc816e..4bf5ea2 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/templating/AdminTemplatingServiceImpl.java
@@ -19,7 +19,8 @@ package org.apache.marmotta.platform.core.services.templating;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -58,8 +59,6 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
//some statics
private static final String DEFAULT_ICON = "icon-beaker";
- private static final String TEMPLATE_STRING = "admin.ftl";
-
//pattern to filter comments content
private static final Pattern PATTERN = Pattern.compile("\\<!--###BEGIN_([^#]+)###--\\>(.+)\\<!--###END_\\1###--\\>",Pattern.DOTALL);
@@ -75,7 +74,7 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
this.context = context;
try {
//try-run to check it from the very beginning
- templatingService.getTemplate(TEMPLATE_STRING);
+ templatingService.getTemplate(TemplatingService.ADMIN_TPL);
} catch (Exception e) {
throw new TemplatingException("Severe Error: admin template cannot be found: " + e.getMessage());
}
@@ -121,7 +120,7 @@ public class AdminTemplatingServiceImpl implements AdminInterfaceService {
//make magic happen
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
- templatingService.process(TEMPLATE_STRING, datamodel, new OutputStreamWriter(bos));
+ templatingService.process(TemplatingService.ADMIN_TPL, datamodel, new OutputStreamWriter(bos));
bytes = bos.toByteArray();
bos.flush();
bos.close();