<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.util.Date, java.text.SimpleDateFormat, java.util.Locale, java.util.Calendar" %> <%@ page import="org.apache.chemistry.opencmis.inmemory.storedobj.api.StoreManager" %> <%@ page import="org.apache.chemistry.opencmis.commons.server.CallContext" %> <%@ page import="org.apache.chemistry.opencmis.inmemory.DummyCallContext" %> <%@ page import="org.apache.chemistry.opencmis.commons.server.CmisServiceFactory" %> <%@ page import="org.apache.chemistry.opencmis.commons.server.CmisService" %> <%@ page import="org.apache.chemistry.opencmis.inmemory.server.InMemoryService" %> <%@ page import="org.apache.chemistry.opencmis.inmemory.ConfigConstants" %> <%@ page import="org.apache.chemistry.opencmis.inmemory.ConfigurationSettings" %> <%! private static final String OPENCMIS_VERSION; static { Package p = Package.getPackage("org.apache.chemistry.opencmis.inmemory"); if (p == null) { OPENCMIS_VERSION = "(unofficial dev or snapshot build)"; } else { String ver = p.getImplementationVersion(); OPENCMIS_VERSION = (null == ver ? "(unofficial dev or snapshot build)" : ver); } } %> Apache Chemistry OpenCMIS-InMemory Server <%! private StoreManager getStoreManager(HttpServletRequest request) { CallContext context = new DummyCallContext(); CmisServiceFactory servicesFactory = (CmisServiceFactory) request.getSession().getServletContext().getAttribute( "org.apache.chemistry.opencmis.servicesfactory"); // AbstractServiceFactory factory = (AbstractServiceFactory) CmisService service = servicesFactory.getService(context); if (!(service instanceof InMemoryService)) throw new RuntimeException("Illegal configuration, service must be of type InMemoryService."); return ((InMemoryService) service).getStoreManager(); } %> Apache Chemistry Logo

OpenCMIS InMemory Server

Your server is up and running.

The OpenCMIS InMemory Server is a CMIS server for development and test purposes. All objects are hold in memory and will be lost after shutdown.

You have to use a CMIS client to use this application. An example for such a client is the CMIS Workbench.

Server-NameApache-Chemistry-OpenCMIS-InMemory
Version <% out.println(OPENCMIS_VERSION); %>

Access Information

CMIS 1.1

WS (SOAP) Binding: <% String reqStr = request.getRequestURL().toString(); out.println(reqStr.substring(0, reqStr.lastIndexOf('/')+1) + "services11/cmis?wsdl"); %>

AtomPub Binding: <% reqStr = request.getRequestURL().toString(); out.println(reqStr.substring(0, reqStr.lastIndexOf('/')+1) + "atom11"); %>

Browser Binding: <% out.println(reqStr.substring(0, reqStr.lastIndexOf('/')+1) + "browser"); %>

CMIS 1.0

WS (SOAP) Binding: <% reqStr = request.getRequestURL().toString(); out.println(reqStr.substring(0, reqStr.lastIndexOf('/')+1) + "services/cmis?wsdl"); %>

AtomPub Binding: <% reqStr = request.getRequestURL().toString(); out.println(reqStr.substring(0, reqStr.lastIndexOf('/')+1) + "atom"); %>

Authentication

Basic Authentication (user name and password are arbitrary)
Note: Authentication is optional and only informational. User names are stored in properties (createdBy, etc.), password is not required. The server does not perform any kind of secure authentication.

Web Interface

The OpenCMIS web interface is simple web interface to access the repository. Please note that this is not the usual way to access the repository. Usually you will use a client application supporting the CMIS specification like the CMIS workbench.

NOTICE

This is an unsupported and experimental service. Any use is at your own risk.

This service is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the license below for more information.

Monitor

Current state of the server:

<% StoreManager sm = getStoreManager(request); for (String repId: sm.getAllRepositoryIds() ) { out.println(""); out.println(""); } %>
Repository Id No. of objects
" + repId + "" + sm.getObjectStore(repId).getObjectCount() + "

 

<% Runtime runtime = Runtime.getRuntime (); long mb = 1048576; long value; value = runtime.totalMemory (); value = (value + mb/2) / mb; out.println(""); out.println(""); value = runtime.maxMemory (); value = (value + mb/2) / mb; out.println(""); out.println(""); value = runtime.freeMemory (); value = (value + mb/2) / mb; out.println(""); out.println(""); out.println(""); out.println(""); %>
Java VM Size
Used Memory " + value + "MB
Max Memory " + value + "MB
Free Memory " + value + "MB
Processors " + runtime.availableProcessors() + "

Configuration

Important configuration settings

<% String maxSize = ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.MAX_CONTENT_SIZE_KB); if (null == maxSize) maxSize = "unlimited"; else maxSize += "KB"; out.println(""); %> <% String cleanInterValStr = ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.CLEAN_REPOSITORY_INTERVAL); if (null == cleanInterValStr) out.println(""); else out.println(""); %> <% out.println(""); %> <% String dateStr; Long interval = ConfigurationSettings.getConfigurationValueAsLong(ConfigConstants.CLEAN_REPOSITORY_INTERVAL); long diff = 0; if (null == interval) dateStr = "Never"; else { try { Date now = new Date(); Calendar calNow = Calendar.getInstance(); Calendar calNextClean = Calendar.getInstance(); calNow.setTime(now); SimpleDateFormat formatter ; Date deploy; formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss a z yyyy", Locale.US); deploy = formatter.parse(ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.DEPLOYMENT_TIME)); calNextClean.setTime(deploy); while (calNextClean.before(calNow)) calNextClean.add(Calendar.MINUTE, interval.intValue()); dateStr = formatter.format(calNextClean.getTime()); diff = calNextClean.getTimeInMillis() - calNow.getTimeInMillis(); } catch (Exception e) { dateStr = e.getMessage(); } } if (diff > 0) dateStr += " (in " + diff / 60000 + "min, " + ((diff / 1000) % 60) + "s)"; // Date deploy = new Date(Date.parse(); out.println(""); %>
Setting Value
Max. allowed content size " + maxSize + "
Auto clean every - " + cleanInterValStr + " minutes
Time of deployment" + ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.DEPLOYMENT_TIME) + "
Next cleanup" + dateStr + "

More Information

Apache Chemistry web site

CMIS page at OASIS


License Information

This software is licensed under the Apache 2.0 License
ASF Logo