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
[14/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/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
deleted file mode 100644
index 8da2256..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * 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 kiwi.core.webservices.resource;
-
-import kiwi.core.api.config.ConfigurationService;
-import kiwi.core.services.templating.TemplatingHelper;
-import org.apache.marmotta.commons.http.ContentType;
-import org.openrdf.model.URI;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Helper methods shared accross the difference resource web services
- *
- * @author Sergio Fernández
- *
- */
-public class ResourceWebServiceHelper {
-
- public static void addHeader(Response response, String name, String value) {
- response.getMetadata().add(name, value);
- }
-
- public static String appendTypes(List<String> datamimes, String mime) {
- StringBuilder sb = new StringBuilder();
- sb.append(appendContentTypes(mime));
- sb.append(appendMetaTypes(datamimes));
- return sb.toString();
- }
-
- public static String appendMetaTypes(List<String> datamimes) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < datamimes.size(); i++) {
- sb.append(datamimes.get(i));
- sb.append(";rel=meta");
- if (i < datamimes.size() - 1) {
- sb.append(",");
- }
- }
- return sb.toString();
- }
-
- public static String appendContentTypes(String mime) {
- if (mime != null) {
- return mime + ";rel=content";
- } else {
- return "";
- }
- }
-
- public static String buildContentLink(URI resource, String uuid, String mime, ConfigurationService configurationService) {
- // test if there is content
- StringBuffer b = new StringBuffer();
- if (mime != null) {
- b.append("<");
- // b.append(configurationService.getBaseUri() + "content/" + mime +
- // appendix);
- b.append(buildResourceLink(resource, ConfigurationService.CONTENT_PATH, mime, configurationService));
- b.append(">");
- b.append(";type=");
- b.append(mime);
- b.append(";rel=content");
- }
- return b.toString();
- }
-
- public static String buildMetaLinks(URI resource, String uuid, List<String> datamimes, ConfigurationService configurationService) {
- StringBuilder b = new StringBuilder();
- for (int i = 0; i < datamimes.size(); i++) {
- b.append("<");
- // b.append(configurationService.getBaseUri() + "meta/" +
- // datamimes.get(i) + appendix);
- b.append(buildResourceLink(resource, ConfigurationService.META_PATH, datamimes.get(i), configurationService));
- b.append(">");
- b.append(";type=");
- b.append(datamimes.get(i));
- b.append(";rel=meta");
- if (i < datamimes.size() - 1) {
- b.append(",");
- }
- }
- return b.toString();
- }
-
- public static String buildResourceLink(URI resource, ContentType cType, ConfigurationService configurationService) {
- return buildResourceLink(resource, cType.getParameter("rel"),
- cType.getMime(), configurationService);
- }
-
- public static String buildResourceLink(URI resource, String rel, String mime, ConfigurationService configurationService) {
- final String src = configurationService.getServerUri(), base = configurationService
- .getBaseUri();
-
- if (src.equals(base)
- && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
- final String uuid;
- uuid = resource.stringValue().substring(
- (base + "resource/").length());
- return String.format("%s%s/%s/%s", base, rel, mime, uuid);
-
- } else {
- try {
- return String.format("%s%s/%s?uri=%s", src, rel, mime,
- URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
- } catch (UnsupportedEncodingException e) {
- return String.format("%s%s/%s?uri=%s", src, rel, mime,
- resource.stringValue());
- }
- }
- }
-
- public static Response buildErrorPage(String uri, String base, Status status, String message) {
- Map<String, Object> data = new HashMap<String, Object>();
- data.put("uri", uri);
- data.put("baseUri", base);
- data.put("message", message);
- try {
- data.put("encoded_uri", URLEncoder.encode(uri, "UTF-8"));
- } catch (UnsupportedEncodingException uee) {
- data.put("encoded_uri", uri);
- }
- try {
- return Response.status(status)
- .entity(TemplatingHelper.processTemplate("404.ftl", data))
- .build();
- } catch (Exception e) {
- return Response.status(Response.Status.NOT_FOUND)
- .entity("Not Found").build();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
deleted file mode 100644
index 73221ce..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * 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 kiwi.core.webservices.statistics;
-
-import kiwi.core.api.statistics.StatisticsModule;
-import kiwi.core.api.statistics.StatisticsService;
-import org.slf4j.Logger;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-@ApplicationScoped
-@Path("/statistics")
-public class StatisticsWebService {
-
- @Inject
- private Logger log;
-
- @Inject
- private StatisticsService statisticsService;
-
-
- /**
- * Enable or disable the statistics gathering. If enabled, might cause additional overhead in execution.
- *
- * @param enabled if true, statistics gathering will be enabled, if false, it will be disabled
- * @HTTP 200 when the statistics gathering has been enabled or disabled successfully
- * @return OK when changing the statistics setting was successful
- */
- @PUT
- @Path("/enabled")
- public Response setEnabled(@QueryParam("value") boolean enabled) {
- if(enabled) {
- log.info("enabling statistics gathering ...");
- statisticsService.enableAll();
- } else {
- log.info("disabling statistics gathering ...");
- statisticsService.disableAll();
- }
- return Response.ok().entity("statistics gathering "+(enabled?"enabled":"disabled")).build();
- }
-
- /**
- * Return the status of statistics gathering.
- *
- * @return Returns true if statistics gathering is enabled, false if it is disabled.
- */
- @GET
- @Path("/enabled")
- public boolean isEnabled() {
- return statisticsService.isEnabled();
- }
-
- /**
- * Retrieve the statistics information of all statistics modules.
- * @return a JSON-formatted map with an entry for each statistics module, where the value is a map of
- * (key,value) entries for the statistics properties that are collected by the module
- */
- @GET
- @Produces("application/json")
- @Path("/list")
- public Map<String,Map<String,String>> getStatistics() {
- Map<String,Map<String,String>> result = new HashMap<String, Map<String, String>>();
-
- for(String module : statisticsService.listModules()) {
- result.put(module, statisticsService.getModule(module).getStatistics());
- }
-
- return result;
- }
-
- /**
- * Retrieve the statistics information of the statistics module with the name passed as path argument. The
- * result format is identical to the result returned by /list
- *
- * @param module the module for which to return the statistics
- * @return a JSON-formatted map with an entry for each statistics module, where the value is a map of
- * (key,value) entries for the statistics properties that are collected by the module
- * @HTTP 200 if the statistics module exists
- * @HTTP 404 if the statistics module does not exist
- */
- @GET
- @Produces("application/json")
- @Path("/{module}")
- public Response getStatistics(@PathParam("module") String module) {
- if(statisticsService.getModule(module) != null) {
- Map<String,Map<String,String>> result = new HashMap<String, Map<String, String>>();
-
- result.put(module, statisticsService.getModule(module).getStatistics());
-
- return Response.ok().entity(result).build();
- } else
- return Response.status(404).entity("module with name "+module+" does not exist; available modules: "+statisticsService.listModules()).build();
- }
-
- @PUT
- @Path("/{module}/enabled")
- public Response setEnabled(@PathParam("module") String module, @QueryParam("value") boolean enabled) {
- final StatisticsModule mod = statisticsService.getModule(module);
- if (mod != null) {
- if (enabled) {
- mod.enable();
- } else {
- mod.disable();
- }
- return Response.ok().entity(enabled).build();
- }
- else
- return Response.status(404)
- .entity("module with name " + module + " does not exist; available modules: " + statisticsService.listModules()).build();
- }
-
- @GET
- @Path("/{module}/enabled")
- public boolean isEnabled(@PathParam("module") String module) {
- final StatisticsModule mod = statisticsService.getModule(module);
- if (mod != null)
- return mod.isEnabled();
- else
- return false;
- }
-
- /**
- * Return a JSON-formatted list of all statistics modules that are available in the system.
- *
- * @return a JSON-formatted list of strings, each representing the name of a statistics module
- */
- @GET
- @Produces("application/json")
- @Path("/modules")
- public List<String> getModules() {
- return statisticsService.listModules();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
deleted file mode 100644
index ca925b6..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * 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 kiwi.core.webservices.system;
-
-import kiwi.core.api.config.ConfigurationService;
-import kiwi.core.api.triplestore.SesameService;
-import org.slf4j.Logger;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-/**
- * Perform various system actions like restarting database access or rebuilding indexes.
- */
-@ApplicationScoped
-@Path("/system")
-public class SystemWebService {
-
- @Inject
- private Logger log;
-
- @Inject
- private ConfigurationService configurationService;
-
- @Inject
- private SesameService sesameService;
-
- /**
- * Reinitialise the database configuration. Will close the database connection and
- * reopen it, possibly with new settings.
- *
- * @return ok if successful, 500 if not
- * @HTTP 200 if database was reinitialised successfully
- * @HTTP 500 if there was an error while reinitialising database (see log)
- */
- @POST
- @Path("/database/reinit")
- public Response reinitDatabase() {
- log.info("Reinitialising database after admin user request ...");
- try {
- sesameService.shutdown();
- sesameService.initialise();
-
- return Response.ok().entity("database reinitialised successfully").build();
- } catch(Exception ex) {
- log.error("Error while reinitalising database ...",ex);
- return Response.status(500).entity("error while reinitialising database").build();
- }
- }
-
- @POST
- @Path("/database/ping")
- public Response pingDatabase(@QueryParam("type")String type,@QueryParam("url")String url,@QueryParam("user")String user,@QueryParam("pwd")String pwd) {
- if(type==null||url==null||user==null||pwd==null) {
- return Response.status(400).entity("one or more values are not defined").build();
- }
-
- //get driver
- String db_driver = configurationService.getStringConfiguration("database."+type+".driver");
- if(db_driver==null) {
- return Response.serverError().entity("driver for "+type+" not defined").build();
- }
-
- //try if type matches url
- if(!url.startsWith("jdbc:"+type)) {
- return Response.serverError().entity("database and url do not match properly").build();
- }
-
- //try to connect
- try {
- Class.forName(db_driver);
- Connection conn = DriverManager.getConnection(url,user,pwd);
- conn.close();
- return Response.ok().build();
- } catch (ClassNotFoundException e) {
- return Response.serverError().entity("Can't load driver " + e).build();
- } catch (SQLException e) {
- return Response.serverError().entity("Database access failed " + e).build();
- }
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
deleted file mode 100644
index 43c8163..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * 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 kiwi.core.webservices.task;
-
-import kiwi.core.api.task.Task;
-import kiwi.core.api.task.TaskInfo;
-import kiwi.core.api.task.TaskManagerService;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-
-import java.lang.ref.WeakReference;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-/**
- * A webservice for listing and managing currently active background tasks of services that support the task manager
- * interface.
- *
- * <p/>
- * User: sschaffe
- */
-@ApplicationScoped
-@Path("/tasks")
-public class TaskManagerWebService {
-
- private static Logger log = LoggerFactory.getLogger(TaskManagerWebService.class);
-
- @Inject
- private TaskManagerService taskManagerService;
-
- /**
- * List all tasks in all groups currently running in the system. The result
- * is a map from group to list of tasks, each task formatted as a key-value
- * map.
- *
- * @return List of {@link TaskInfo}s boxed in {@link JSONObject}s
- */
- @GET
- @Path("/")
- @Produces("application/json")
- public Map<String, List<TaskInfo>> list() {
- log.debug("Listing all running tasks.");
-
- return taskManagerService.getTasksByGroup();
- }
-
- @GET
- @Path("/byThread")
- @Produces("application/json")
- public Map<String, List<TaskInfo>> listByThread() {
- HashMap<String, List<TaskInfo>> result = new HashMap<String, List<TaskInfo>>();
- final Map<WeakReference<Thread>, Stack<TaskInfo>> tasksByThread = taskManagerService.getTasksByThread();
- for (Map.Entry<WeakReference<Thread>, Stack<TaskInfo>> e : tasksByThread.entrySet()) {
- Thread t = e.getKey().get();
- if (t != null) {
- result.put(t.getName(), e.getValue());
- }
- }
-
- return result;
- }
-
- /**
- * List all tasks in the group given as argument. The result is a map from
- * group to list of tasks, each task formatted as a key-value map.
- *
- * @param group
- * the group to list the running tasks
- * @return List of {@link TaskInfo}s boxed in {@link JSONObject}s
- */
- @GET
- @Path("/{group}")
- @Produces("application/json")
- public Map<String, List<TaskInfo>> list(@PathParam("group") String group) {
- log.debug("Listing all tasks of group '{}'", group);
-
- Map<String, List<TaskInfo>> result = new HashMap<String, List<TaskInfo>>();
-
- Map<String, List<TaskInfo>> allTasks = taskManagerService.getTasksByGroup();
- if (allTasks.containsKey(group)) {
- result.put(group, allTasks.get(group));
- }
-
- return result;
- }
-
-
- /**
- * Return the task identified by the id given as argument.
- *
- * @param id
- * the id of the task to return (long value)
- * @return The {@link Task} boxed in a {@link JSONObject}
- */
- @GET
- @Path("/{group}/{name}")
- @Produces("application/json")
- public Response get(@PathParam("group") String group, @PathParam("name") String name) {
- Map<String, List<TaskInfo>> gList = list(group);
- if (gList.containsKey(group)) return Response.status(404).entity("Group " + group + " not found").build();
-
- for (TaskInfo t : gList.get(group)) {
- if (t != null && t.getName().equals(name)) return Response.ok().entity(t).build();
- }
-
- return Response.status(404).entity("Task " + name + " in Group " + group + " not found").build();
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
deleted file mode 100644
index 1bc65af..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * 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 kiwi.core.webservices.triplestore;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import kiwi.core.api.config.ConfigurationService;
-import kiwi.core.api.triplestore.ContextService;
-import kiwi.core.util.JerseyUtils;
-
-import org.apache.commons.lang.StringUtils;
-
-/**
- * Context Web Service
- *
- * @author Thomas Kurz
- * @author Sebastian Schaffert
- * @author Sergio Fernández
- */
-@ApplicationScoped
-@Path("/" + ConfigurationService.CONTEXT_PATH)
-public class ContextWebService {
-
- @Inject
- private ContextService contextService;
-
- @Inject
- private ConfigurationService configurationService;
-
- private static final String UUID_PATTERN = "{uuid:[^#?]+}";
-
- /**
- * Indirect context identification, listing in case 'graph' is missing
- *
- * @param types
- * @param context uri
- * @return
- * @throws URISyntaxException
- * @see http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification
- */
- @GET
- public Response get(@HeaderParam("Accept") String types, @QueryParam("graph") String context) throws URISyntaxException {
- URI uri;
- if (StringUtils.isBlank(context)) {
- uri = new URI(configurationService.getServerUri() + ConfigurationService.CONTEXT_PATH + "/list");
- } else {
- uri = buildExportUri(context);
- }
- return Response.seeOther(uri).header("Accept", types).build();
- }
-
- /**
- *
- * @return a list of URIs representing contexts
- */
- @GET
- @Path("/list")
- @Produces("application/json")
- public Response listContexts(@QueryParam("labels") String labels, @QueryParam("filter") String filter) {
- try {
- if(labels == null) {
- ArrayList<String> res = new ArrayList<String>();
- for(org.openrdf.model.URI r : contextService.listContexts(filter != null)) {
- res.add(r.stringValue());
- }
- return Response.ok().entity(res).build();
- } else {
- ArrayList<Map<String,String>> result = new ArrayList<Map<String, String>>();
- for(org.openrdf.model.URI r : contextService.listContexts(filter != null)) {
- Map<String,String> ctxDesc = new HashMap<String, String>();
- ctxDesc.put("uri",r.stringValue());
- ctxDesc.put("label", contextService.getContextLabel(r));
- result.add(ctxDesc);
- }
- return Response.ok().entity(result).build();
- }
- } catch(Exception e) {
- return Response.serverError().entity(e.getMessage()).build();
- }
- }
-
- /**
- * Returns the content stored on this context
- *
- * @param types, accepted formats
- * @param uuid, a unique context identifier
- * @return redirects to the export service
- */
- @GET
- @Path(UUID_PATTERN)
- public Response getContext(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException,
- URISyntaxException {
- String context = buildUri(uuid);
- URI uri = buildExportUri(context);
- return Response.seeOther(uri).header("Accept", types).build();
- }
-
- @PUT
- public Response put(@QueryParam("graph") String context, @HeaderParam("Content-Type") String type, @Context HttpServletRequest request) throws IOException {
- if (StringUtils.isBlank(context)) {
- return Response.status(Status.NOT_ACCEPTABLE).entity("missing 'graph' uri for indirect grpah identification").build();
- } else {
- if(type != null && type.lastIndexOf(';') >= 0) {
- type = type.substring(0,type.lastIndexOf(';'));
- }
- Set<String> acceptedFormats = contextService.getAcceptFormats();
- if (type == null || !acceptedFormats.contains(type)) {
- return Response.status(412).entity("define a valid content-type (types: " + acceptedFormats + ")").build();
- }
- final boolean imported = contextService.importContent(context, request.getInputStream(), type);
- return imported ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
- }
- }
-
- @PUT
- public Response putContext(@PathParam("uuid") String uuid, @HeaderParam("Content-Type") String type, @Context HttpServletRequest request) throws IOException {
- return put(buildUri(uuid), type, request);
- }
-
- @DELETE
- public Response delete(@QueryParam("graph") String context) {
- if (StringUtils.isBlank(context)) {
- return Response.status(Status.NOT_ACCEPTABLE).entity("missing 'graph' uri for indirect grpah identification").build();
- } else {
- final boolean deleted = contextService.removeContext(context);
- return deleted ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
- }
- }
-
- /**
- * Deletes a named graph from the system
- *
- * @param types formats accepted
- * @param uuid context identifier
- * @return status code
- * @throws UnsupportedEncodingException
- * @throws URISyntaxException
- */
- @DELETE
- @Path(UUID_PATTERN)
- public Response deleteContext(@PathParam("uuid") String uuid) {
- return delete(buildUri(uuid));
- }
-
- private String buildBaseUri() {
- String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
- }
-
- private String buildUri(String uuid) {
- return buildBaseUri() + uuid;
- }
-
- private URI buildExportUri(String uri) throws URISyntaxException {
- return new URI(configurationService.getBaseUri() + "export/download?context=" + uri);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
deleted file mode 100644
index b70ce26..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * 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 kiwi.core.webservices.triplestore;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import kiwi.core.api.config.ConfigurationService;
-import kiwi.core.api.triplestore.ContextService;
-import kiwi.core.util.JerseyUtils;
-
-/**
- * Knowledge space related services
- *
- * @author Sergio Fernández
- *
- */
-@ApplicationScoped
-@Path("/" + ConfigurationService.KNOWLEDGESPACE_PATH)
-@Deprecated
-public class KnowledgeSpaceWebService {
-
- @Inject
- private ConfigurationService configurationService;
-
- @Inject
- private ContextService contextService;
- private static final String UUID_PATTERN = "{uuid:[^#?]+}";
-
- /**
- * Get all knowledge spaces
- *
- * @return a list of URIs representing the current knowledge spaces
- */
- @GET
- @Produces("application/json")
- public Response listSpaces() {
- try {
- List<org.openrdf.model.URI> l = contextService.listContexts();
- ArrayList<String> res = new ArrayList<String>();
- for(org.openrdf.model.URI r : l) {
- String uri = r.stringValue();
- if (uri.startsWith(buildBaseUri())) {
- res.add(uri);
- }
- }
- return Response.ok().entity(res).build();
- } catch(Exception e) {
- return Response.serverError().entity(e.getMessage()).build();
- }
- }
-
- /**
- * Returns the content stored on this context URI
- *
- * @param types, accepted formats
- * @param uuid, a unique context identifier
- * @return redirects to the export service
- */
- @GET
- @Path(UUID_PATTERN)
- public Response getContent(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException, URISyntaxException {
- String context = buildUri(uuid);
- URI uri = new URI(configurationService.getBaseUri() + "export/download?context=" + context);
- return Response.seeOther(uri).header("Accept", types).build();
- }
-
- /**
- * Deletes a knowledge space from the system
- *
- * @param types formats accepted
- * @param uuid knowledge space uuid
- * @return status code
- * @throws UnsupportedEncodingException
- * @throws URISyntaxException
- */
- @DELETE
- @Path(UUID_PATTERN)
- public Response cleanContent(String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException, URISyntaxException {
- final boolean deleted = contextService.removeContext(buildUri(uuid));
- return deleted ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
- }
-
- private String buildBaseUri() {
- String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
- }
-
- private String buildUri(String uuid) {
- return buildBaseUri() + uuid;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java b/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
deleted file mode 100644
index b5099fe..0000000
--- a/platform/marmotta-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/**
- * 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 kiwi.core.webservices.triplestore;
-
-import static javax.ws.rs.core.Response.status;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import kiwi.core.api.config.ConfigurationService;
-import kiwi.core.api.triplestore.LdpService;
-import kiwi.core.util.JerseyUtils;
-
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryException;
-
-/**
- * LDP Web Service (isolated for the moment for experimenting with
- * the concepts, but at some point it should be merged back to
- * {@link kiwi.core.webservices.resource.ResourceWebService})
- *
- * @author Sergio Fernández
- *
- */
-@ApplicationScoped
-@Path("/" + ConfigurationService.LDP_PATH)
-public class LdpWebService {
-
- @Inject
- private ConfigurationService configurationService;
-
- @Inject
- private LdpService ldpService;
-
- private static final String UUID_PATTERN = "{uuid:[^#?]+}";
-
- /**
- * Produces a list of all containers available
- *
- * @return list of container
- */
- @GET
- @Produces("application/json")
- public Response list() {
- try {
- List<String> l = new ArrayList<String>();
- for(URI container : ldpService.list()) {
- l.add(container.stringValue());
- }
- return Response.ok().entity(l).build();
- } catch(Exception e) {
- return Response.serverError().entity(e.getMessage()).build();
- }
- }
-
- /**
- * Returns the content stored on this resource/container
- *
- * @param types, accepted formats
- * @param uuid, a unique container identifier
- * @return redirect response to the export service
- */
- @GET
- @Path(UUID_PATTERN)
- public Response get(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException,
- URISyntaxException {
- String uri = buildUri(uuid);
- if (ldpService.get(uri) != null) {
- java.net.URI seeAlso = new java.net.URI(configurationService.getBaseUri() + ConfigurationService.RESOURCE_PATH + "?uri=" + uri);
- return Response.seeOther(seeAlso).header("Accept", types).build();
- } else {
- return Response.status(Status.NOT_FOUND).entity("Container not found").header("Accept", types).build();
- }
- }
-
- @POST
- @Path(UUID_PATTERN)
- public Response create(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid, @QueryParam("title") String title) throws UnsupportedEncodingException,
- URISyntaxException {
- String uri = buildUri(uuid);
- if (ldpService.create(uri)) {
- Response response = status(Status.CREATED).entity("Container created").header("Accept", types).build();
- response.getMetadata().add("Location", uri);
- response.getMetadata().add("Vary", "Content-Type");
- return response;
- } else {
- return Response.status(Status.CONFLICT).entity("Container already exists").header("Accept", types).build();
- }
- }
-
- /**
- * Deletes this resource/container
- *
- * @param types formats accepted
- * @param uuid container identifier
- * @return response
- */
- @DELETE
- @Path(UUID_PATTERN)
- public Response delete(String types, @PathParam("uuid") String uuid) {
- String uri = buildUri(uuid);
- try {
- final boolean deleted = ldpService.delete(uri);
- if (deleted) {
- return Response.ok().build();
- } else {
- return Response.status(Response.Status.NOT_FOUND).build();
- }
- } catch (RepositoryException ex) {
- return Response.serverError().entity(ex.getMessage()).build();
- }
- }
-
- private String buildBaseUri() {
- String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
- }
-
- private String buildUri(String uuid) {
- return buildBaseUri() + uuid;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/cache/CachingService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/cache/CachingService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/cache/CachingService.java
new file mode 100644
index 0000000..50ff222
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/cache/CachingService.java
@@ -0,0 +1,39 @@
+/**
+ * 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.api.cache;
+
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Ehcache;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+public interface CachingService {
+
+ public Ehcache getCache(InjectionPoint injectionPoint);
+
+ public String[] getCacheNames();
+
+ public void clearAll();
+
+ Ehcache getCacheByName(String cacheName);
+
+ CacheManager getCacheManager();
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
new file mode 100644
index 0000000..c25cbdd
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/ConfigurationService.java
@@ -0,0 +1,514 @@
+/**
+ * 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.api.config;
+
+import org.apache.commons.configuration.Configuration;
+
+import javax.servlet.ServletContext;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * Manage the system configuration.
+ *
+ * @author Sebastian Schaffert
+ * @author Sergio Fernández
+ *
+ */
+public interface ConfigurationService {
+
+ static final String RESOURCE_PATH = "resource";
+
+ static final String ANONYMOUS_PATH = "anon";
+
+ static final String META_PATH = "meta";
+
+ static final String CONTENT_PATH = "content";
+
+ static final String INSPECT_PATH = "inspect";
+
+ static final String LDP_PATH = "ldp"; //to be removed
+ static final String CONTAINER_PATH = "container";
+
+ @Deprecated
+ static final String KNOWLEDGESPACE_PATH = "knowledgedspace";
+
+ static final String CONTEXT_PATH = "context";
+
+ static final String CONTEXT_DEFAULT = "default";
+
+ static final String CONTEXT_CACHE = "cache";
+
+ static final String CONTEXT_ENHANCEMENT = "enhanced";
+
+ static final String CONTEXT_INFERRED = "inferred";
+
+ static final String CONTEXT_SYSTEM = "system";
+
+ /**
+ * Get the base URI of the system.
+ * The base URI is used by the LMF to create local resource URIs. In this way, all LMF resources
+ * are "Linked Open Data" compatible.
+ *
+ * The base URI is calculated based on the request URI given by the user.
+ * In most cases it is the same as {@link #getServerUri()}, but this is not guaranteed.
+ *
+ * @return the base URI
+ */
+ String getBaseUri();
+
+ /**
+ * Get the base path of the system, which is the relative path from the server host.
+ * For example, in the case of http://localhost:8080/LMF, /LMF would be returned as the path.
+ * @return a String representing the path
+ */
+ String getPath();
+
+ /**
+ * Get the server URI of the system.
+ * The server URI is used to accesses the
+ * server that runs the KiWi (and SOLR) applications.
+ *
+ * Can be used to compute the paths of the web services or
+ * other applications relative to the current application.
+ *
+ * Computed like the base URI.
+ *
+ * @return the server URI
+ */
+ String getServerUri();
+
+ /**
+ * List all configuration keys defined for the system configuration of KiWi.
+ * @return
+ */
+ List<String> listConfigurationKeys();
+
+ /**
+ * List all configuration keys defined for the system configuration of KiWi having prefix.
+ * @param prefix the prefix of keys that should be returned
+ * @return
+ */
+ List<String> listConfigurationKeys(String prefix);
+
+ /**
+ * Check whether a certain configuration property is set.
+ * @param key
+ * @return
+ */
+ boolean isConfigurationSet(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created with empty value (returns null).
+ *
+ * @param key unique configuration key for lookup
+ * @return a configuration object with either the configured value or null as value
+ */
+ Object getConfiguration(String key);
+
+ /**
+ * Return the comment for the configuration with the given key as string. If there is no such
+ * configuration, null is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a string describing the configuration option or null if no comment was given
+ */
+ String getComment(String key);
+
+ /**
+ * Return the comment for the configuration with the given key as string. If there is no such
+ * configuration, null is returned
+ * @param key unique configuration key for lookup
+ * @return a string describing the type for key or DEFAULT_TYPE (String) if no type was given
+ */
+ String getType(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created with empty value (returns null).
+ *
+ * @param key unique configuration key for lookup
+ * @return a configuration object with either the configured value or null as value
+ */
+ String getStringConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as string value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ String getStringConfiguration(String key, String defaultValue);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, 0.0 is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a double value with either the configured value or 0.0
+ */
+
+ double getDoubleConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as double value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ double getDoubleConfiguration(String key, double defaultValue);
+
+ /**
+ * Set the system configuration with the given key to the given double value.
+ *
+ * @param key
+ * @param value
+ */
+ void setDoubleConfiguration(String key, double value);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, 0 is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a int value with either the configured value or 0
+ */
+ int getIntConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as double value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ int getIntConfiguration(String key, int defaultValue);
+
+ /**
+ * Set the system configuration with the given key to the given int value.
+ *
+ * @param key
+ * @param value
+ */
+ void setIntConfiguration(String key, int value);
+
+
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, 0 is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a int value with either the configured value or 0
+ */
+ long getLongConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as double value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ long getLongConfiguration(String key, long defaultValue);
+
+ /**
+ * Set the system configuration with the given key to the given int value.
+ *
+ * @param key
+ * @param value
+ */
+ void setLongConfiguration(String key, long value);
+
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, true is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a int value with either the configured value or true
+ */
+ boolean getBooleanConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as boolean value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ boolean getBooleanConfiguration(String key, boolean defaultValue);
+
+ /**
+ * Set the system configuration with the given key to the given boolean value.
+ *
+ * @param key
+ * @param value
+ */
+ void setBooleanConfiguration(String key, boolean value);
+
+ /**
+ * Get the configuration for the given key as properties. The configuration is persisted in the following form:
+ * key = k=v,k=v,k=v
+ *
+ * @param key unique configuration key for lookup
+ * @return properties with the configured key value pairs
+ */
+ Properties getPropertiesConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, an empty list is returned
+ *
+ * @param key unique configuration key for lookup
+ * @return a list with either the configured value or empty list
+ */
+
+ List<String> getListConfiguration(String key);
+
+ /**
+ * Get the configuration for the given key. If there is no such configuration, a new one is
+ * created using the provided defaultValue as double value.
+ *
+ * @param key unique configuration key for lookup
+ * @param defaultValue default value if configuration not found
+ * @return a configuration object with either the configured value or defaultValue
+ */
+ List<String> getListConfiguration(String key, List<String> defaultValue);
+
+ /**
+ * Set the system configuration with the given key to the given int value.
+ *
+ * @param key
+ * @param value
+ */
+ void setListConfiguration(String key, List<String> value);
+
+ /**
+ * Set a configuration value without firing an event. This is in rare cases needed to avoid
+ * propagation of events.
+ *
+ * @param key
+ * @param value
+ */
+ void setConfigurationWithoutEvent(String key, Object value);
+
+
+ /**
+ * Set the configuration "key" to the string value "value".
+ * @param key
+ * @param value
+ */
+ void setConfiguration(String key, Object value);
+
+ /**
+ * Set the configuration "key" to the string value "value".
+ * @param key
+ * @param value
+ */
+ void setConfiguration(String key, String value);
+
+ /**
+ * Set the configuration "key" to the string value "value".
+ * @param key
+ * @param values
+ */
+ void setConfiguration(String key, List<String> values);
+
+ /**
+ * Remove the configuration identified by "key" from the database.
+ * @param key
+ */
+ void removeConfiguration(String key);
+
+ /**
+ * @return a string representation of work direction
+ */
+ String getWorkDir();
+
+ /**
+ * Initialise the configuration service using the given home directory, and optionally a configuration override
+ * @param lmfHome
+ * @param override
+ */
+ void initialize(String lmfHome, Configuration override);
+
+
+ /**
+ * Set a flag at runtime that is discarded on system shutdown; used e.g. to indicate that certain
+ * processes have already been carried out.
+ * @param value
+ */
+ void setRuntimeFlag(String flag,boolean value);
+
+ /**
+ * Return the value of the runtime flag passed as argument.
+ * @param flag
+ * @return
+ */
+ boolean getRuntimeFlag(String flag);
+
+ /**
+ * Set the LMF_HOME value to the correct path. Used during the initialisation process.
+ *
+ * @param home
+ */
+ void setLMFHome(String home);
+
+ /**
+ * Return the value of the LMF_HOME setting. Used during the initialisation process.
+ * @return
+ */
+ String getLMFHome();
+
+ /**
+ * Get the base URI for contexts
+ * @return
+ */
+ String getBaseContext();
+
+ /**
+ * Return the context used for storing system information.
+ *
+ * @return a URI representing the system context
+ */
+ String getSystemContext();
+
+ /**
+ * Get the uri of the inferred context
+ *
+ * @return uri of this inferred context
+ */
+ String getInferredContext();
+
+ /**
+ * Get the uri of the default context
+ *
+ * @return
+ */
+ String getDefaultContext();
+
+ /**
+ * Get the uri of the context used for caching linked data
+ * @return
+ */
+ String getCacheContext();
+
+ /**
+ * Get the uri of the context used for enhancements.
+ *
+ * @return
+ */
+ String getEnhancerContex();
+
+ /**
+ * Batch update.
+ *
+ * @param values
+ * @see #setConfiguration(String, String)
+ */
+ void setConfigurations(Map<String, ?> values);
+
+ /**
+ * Set type for a configuration key
+ *
+ * @param key key for configuration fields
+ * @param type type for configuratino field
+ */
+ void setType(String key, String type);
+
+ /**
+ * Set type for a configuration key
+ *
+ * @param key key for configuration fields
+ * @param comment type for configuratino field
+ */
+ void setComment(String key, String comment);
+
+ /**
+ * Pass the servlet context over to the configuration service to provide runtime information about
+ * the environment to the rest of the system.
+ * @param context
+ */
+ void setServletContext(ServletContext context);
+
+ /**
+ * Get the servlet context used when initialising the system
+ * @return
+ */
+ ServletContext getServletContext();
+
+ /**
+ * Get a string describing the type and version of the application server running the LMF.
+ *
+ * @return
+ */
+ String getServerInfo();
+
+ /**
+ * Try figuring out on which port the server is running ...
+ */
+ int getServerPort();
+
+ /**
+ * Try figuring out the local name of the server
+ * @return
+ */
+ String getServerName();
+
+ /**
+ * Return the context path of this application
+ * @return
+ */
+ String getServerContext();
+
+ /**
+ * Return true if Jetty 6.x is detected; tests for presence of class org.mortbay.jetty.Server
+ * @return
+ */
+ boolean isJetty6();
+
+ /**
+ * Return true if Jetty 7.x is detected; tests for presence of class org.eclipse.jetty.server.Server
+ * @return
+ */
+ boolean isJetty7();
+
+ /**
+ * Return true if Tomcat 6.x is detected; tests for presence of class org.apache.catalina.ServerFactory
+ * @return
+ */
+ boolean isTomcat6();
+
+ /**
+ * Return true if Tomcat 7.x is detected; tests for presence of class org.apache.catalina.CatalinaFactory
+ * @return
+ */
+ boolean isTomcat7();
+
+ /**
+ * Shutdown the application server running this web application; tries to determine the kind of server we are
+ * running under and send the proper shutdown signal before exiting with System.exit
+ */
+ void performServerShutdown();
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/DependenciesService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/DependenciesService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/DependenciesService.java
new file mode 100644
index 0000000..5c174c8
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/config/DependenciesService.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.api.config;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Provides meta information about the current dependencies
+ *
+ * @author Sergio Fernández
+ *
+ */
+public interface DependenciesService {
+
+ String PATH = "/dependencies.txt";
+ String GROUP = "groupId";
+ String ARTIFACT = "artifactId";
+ String VERSION = "version";
+
+ List<Map<String, String>> getArtifacs();
+
+ List<Map<String, String>> getArtifacs(String groupId);
+
+ String getVersion(String groupId, String artifactId);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentReader.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentReader.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentReader.java
new file mode 100644
index 0000000..430de81
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentReader.java
@@ -0,0 +1,97 @@
+/**
+ * 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.api.content;
+
+import org.openrdf.model.Resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * API for plugins that can read content from some source. All implementing classes must provide
+ * the getContentData method that returns the byte content for a resource.
+ *
+ * <p/>
+ * User: Sebastian Schaffert
+ */
+public interface ContentReader {
+
+ /**
+ * Return the name of the content reader. Used to identify and display the content reader to admin users.
+ * @return
+ */
+ public String getName();
+
+ /**
+ * Retrieve the content of the specified mime type for the specified resource. Returns a byte array containing
+ * the byte data of the content, or null, indicating that a content of the specified mime type does not exist
+ * for the resource.
+ * <p/>
+ * Specialised content readers could even transform the resource content from its original form to the new
+ * mimetype, e.g. converting an image from JPEG to PNG.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimetype the mime type to retrieve of the content
+ * @return a byte array containing the content of the resource, or null if no content exists
+ */
+ public byte[] getContentData(Resource resource, String mimetype) throws IOException;
+
+
+ /**
+ * Retrieve the content of the specified mime type for the specified resource. Returns a input stream containing
+ * the byte data of the content, or null, indicating that a content of the specified mime type does not exist
+ * for the resource.
+ * <p/>
+ * Specialised content readers could even transform the resource content from its original form to the new
+ * mimetype, e.g. converting an image from JPEG to PNG.
+ * <p/>
+ * This method is preferrable for resources with large amounts of data.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimetype the mime type to retrieve of the content
+ * @return a InputStream containing the content of the resource, or null if no content exists
+ */
+ public InputStream getContentStream(Resource resource, String mimetype) throws IOException;
+
+
+ /**
+ * Check whether the specified resource has content of the specified mimetype for this reader. Returns true
+ * in this case, false otherwise.
+ *
+ * @param resource the resource to check
+ * @param mimetype the mimetype to look for
+ * @return true if content of this mimetype is associated with the resource, false otherwise
+ */
+ public boolean hasContent(Resource resource, String mimetype);
+
+
+ /**
+ * Return the MIME content type of the resource passed as argument.
+ *
+ * @param resource resource for which to return the content type
+ * @return the MIME content type of the resource
+ */
+ public String getContentType(Resource resource);
+
+
+ /**
+ * Return the number of bytes the content of this resource contains.
+ *
+ * @param resource resource for which to return the content length
+ * @return byte count for the resource content
+ */
+ public long getContentLength(Resource resource, String mimetype);
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentService.java
new file mode 100644
index 0000000..872afb3
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentService.java
@@ -0,0 +1,121 @@
+/**
+ * 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.api.content;
+
+import org.apache.marmotta.platform.core.exception.LMFException;
+import org.apache.marmotta.platform.core.exception.WritingNotSupportedException;
+import org.openrdf.model.Resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * User: Thomas Kurz
+ * Date: 07.02.11
+ * Time: 12:30
+ */
+public interface ContentService {
+
+ /**
+ * Initialise the content service, setting up all content readers and writers.
+ */
+ public void initialise();
+
+
+ /**
+ * Store the content of the specified mime type for the specified resource. Accepts a byte array containing
+ * the byte data of the content that is then written to the destination configured for this writer.
+ * <p/>
+ * @param resource the resource for which to store the content
+ * @param mimeType the mime type of the content
+ * @param data a byte array containing the content of the resource
+ */
+ public void setContentData(Resource resource, byte[] data, String mimeType) throws WritingNotSupportedException;
+
+
+ /**
+ * Store the content of the specified mime type for the specified resource. Accepts an input stream containing
+ * the byte data of the content that is read and written to the destination configured for this writer.
+ * <p/>
+ * This method is preferrable for resources with large amounts of data.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimeType the mime type to retrieve of the content
+ * @param in a InputStream containing the content of the resource
+ */
+ public void setContentStream(Resource resource, InputStream in, String mimeType) throws WritingNotSupportedException;
+
+
+ /**
+ * Retrieve the content of the specified mime type for the specified resource. Returns a byte array containing
+ * the byte data of the content, or null, indicating that a content of the specified mime type does not exist
+ * for the resource.
+ * <p/>
+ * Specialised content readers could even transform the resource content from its original form to the new
+ * mimetype, e.g. converting an image from JPEG to PNG.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimeType the mime type to retrieve of the content
+ * @return a byte array containing the content of the resource, or null if no content exists
+ */
+ public byte[] getContentData(Resource resource, String mimeType);
+
+
+ /**
+ * Retrieve the content of the specified mime type for the specified resource. Returns a input stream containing
+ * the byte data of the content, or null, indicating that a content of the specified mime type does not exist
+ * for the resource.
+ * <p/>
+ * Specialised content readers could even transform the resource content from its original form to the new
+ * mimetype, e.g. converting an image from JPEG to PNG.
+ * <p/>
+ * This method is preferrable for resources with large amounts of data.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimetype the mime type to retrieve of the content
+ * @return a InputStream containing the content of the resource, or null if no content exists
+ */
+ public InputStream getContentStream(Resource resource, String mimetype) throws IOException;
+
+
+ /**
+ * Check whether the specified resource has content of the specified mimetype for this reader. Returns true
+ * in this case, false otherwise.
+ *
+ * @param resource the resource to check
+ * @param mimetype the mimetype to look for
+ * @return true if content of this mimetype is associated with the resource, false otherwise
+ */
+ public boolean hasContent(Resource resource, String mimetype);
+
+ public String getContentType(Resource resource);
+
+ /**
+ * Return the number of bytes the content of this resource contains.
+ *
+ * @param resource resource for which to return the content length
+ * @return byte count for the resource content
+ */
+
+ public long getContentLength(Resource resource, String mimetype);
+ /**
+ * Delete the content of the specified resource.
+ *
+ * @param resource the resource for which to delete the content
+ */
+ public boolean deleteContent(Resource resource) throws LMFException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentWriter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentWriter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentWriter.java
new file mode 100644
index 0000000..19e2ceb
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/content/ContentWriter.java
@@ -0,0 +1,70 @@
+/**
+ * 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.api.content;
+
+import org.openrdf.model.Resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * API for plugins that allow writing of content to some destination.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public interface ContentWriter {
+
+
+ /**
+ * Return the name of the content reader. Used to identify and display the content reader to admin users.
+ * @return
+ */
+ public String getName();
+
+
+ /**
+ * Store the content of the specified mime type for the specified resource. Accepts a byte array containing
+ * the byte data of the content that is then written to the destination configured for this writer.
+ * <p/>
+ * @param resource the resource for which to store the content
+ * @param mimetype the mime type of the content
+ * @param data a byte array containing the content of the resource
+ */
+ public void setContentData(Resource resource, byte[] data, String mimetype) throws IOException;
+
+
+ /**
+ * Store the content of the specified mime type for the specified resource. Accepts an input stream containing
+ * the byte data of the content that is read and written to the destination configured for this writer.
+ * <p/>
+ * This method is preferrable for resources with large amounts of data.
+ *
+ * @param resource the resource for which to return the content
+ * @param mimetype the mime type to retrieve of the content
+ * @param in a InputStream containing the content of the resource
+ */
+ public void setContentStream(Resource resource, InputStream in, String mimetype) throws IOException;
+
+
+ /**
+ * Delete the content of the speficied mime type for the specified resource.
+ *
+ * @param resource the resource for which to delete the content
+ * @param mimetype the mime type of the content to delete (optional)
+ */
+ public void deleteContent(Resource resource, String mimetype) throws IOException;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d3eebdd/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/exporter/ExportService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/exporter/ExportService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/exporter/ExportService.java
new file mode 100644
index 0000000..6fb766d
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/exporter/ExportService.java
@@ -0,0 +1,171 @@
+/**
+ * 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.api.exporter;
+
+import org.apache.marmotta.platform.core.exception.io.UnsupportedExporterException;
+import org.openrdf.model.URI;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.Set;
+
+/**
+ * Methods for writing triple data into different targets using different exporters.
+ *
+ * @author Sebastian Schaffert
+ *
+ */
+public interface ExportService {
+
+ /**
+ * Get a collection of all mime types accepted by this exporter. Used for automatically
+ * selecting the appropriate exporter in ExportService.
+ *
+ * @return a set of strings representing the mime types accepted by this exporter
+ */
+ public Set<String> getProducedTypes();
+
+
+ /**
+ * Export the triple data contained in the named graph passed as argument "context" and return
+ * it as a Java string using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ */
+ public String exportData(URI context, String mimeType) throws UnsupportedExporterException;
+
+ /**
+ * Export the triple data contained in the named graph passed as argument "context" and write it
+ * to the writer given as first argument using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param writer the writer to write the triples to; will be closed when the triples are written
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ * @throws IOException in case there is an error writing to the output
+ */
+ public void exportData(Writer writer, URI context, String mimeType) throws UnsupportedExporterException, IOException;
+
+
+ /**
+ * Export the triple data contained in the named graph passed as argument "context" and write it
+ * to the output stream given as first argument using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param outputStream the OutputStream to write the triples to; data will be written using UTF-8 encoding;
+ * will be closed when the triples are written
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ * @throws IOException in case there is an error writing to the output
+ */
+ public void exportData(OutputStream outputStream, URI context, String mimeType) throws UnsupportedExporterException, IOException;
+
+
+
+ /**
+ * Export the triple data for the given resource contained in the named graph passed as argument "context" and return
+ * it as a Java string using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ */
+ public String exportData(URI resource, URI context, String mimeType) throws UnsupportedExporterException;
+
+ /**
+ * Export the triple data for the given resource contained in the named graph passed as argument "context" and write it
+ * to the writer given as first argument using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param writer the writer to write the triples to; will be closed when the triples are written
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ * @throws IOException in case there is an error writing to the output
+ */
+ public void exportData(Writer writer, URI resource, URI context, String mimeType) throws UnsupportedExporterException, IOException;
+
+
+ /**
+ * Export the triple data for the given resource contained in the named graph passed as argument "context" and write it
+ * to the output stream given as first argument using the serialisation format specified by "mimeType".
+ * <p/>
+ * The context parameter limits the exported triples to the named graph represented by this
+ * resource. If it is set to null, all named graphs will be exported.
+ * <p/>
+ * The mime type must be supported by at least one of the registered exporters, otherwise an
+ * UnsupportedExporterException. Available mime types can be retrieved using the getProducedTypes()
+ * method.
+ *
+ *
+ * @param outputStream the OutputStream to write the triples to; data will be written using UTF-8 encoding;
+ * will be closed when the triples are written
+ * @param context the named graph to export; if null, all named graphs will be exported
+ * @param mimeType a mime type registered by an exporter
+ *
+ * @throws UnsupportedExporterException in case there is no matching exporter for the given mime type
+ * @throws IOException in case there is an error writing to the output
+ */
+ public void exportData(OutputStream outputStream, URI resource, URI context, String mimeType) throws UnsupportedExporterException, IOException;
+
+}