Return-Path: Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: (qmail 73748 invoked from network); 7 Apr 2011 10:06:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2011 10:06:31 -0000 Received: (qmail 27927 invoked by uid 500); 7 Apr 2011 10:06:31 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 27889 invoked by uid 500); 7 Apr 2011 10:06:31 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 27881 invoked by uid 99); 7 Apr 2011 10:06:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 10:06:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Apr 2011 10:06:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 89ECC2388906; Thu, 7 Apr 2011 10:06:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1089796 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main: java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java webapp/index.jsp Date: Thu, 07 Apr 2011 10:06:06 -0000 To: commits@chemistry.apache.org From: jens@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110407100606.89ECC2388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jens Date: Thu Apr 7 10:06:06 2011 New Revision: 1089796 URL: http://svn.apache.org/viewvc?rev=1089796&view=rev Log: improve date/time formatting add relative clear time add license header CMIS-351 Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/index.jsp Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java?rev=1089796&r1=1089795&r2=1089796&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryServiceFactoryImpl.java Thu Apr 7 10:06:06 2011 @@ -82,7 +82,7 @@ public class InMemoryServiceFactoryImpl storeManager = StoreManagerFactory.createInstance(repositoryClassName); Date deploymentTime = new Date(); - String strDate = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US).format(deploymentTime); + String strDate = new SimpleDateFormat("EEE MMM dd hh:mm:ss a z yyyy", Locale.US).format(deploymentTime); parameters.put(ConfigConstants.DEPLOYMENT_TIME, strDate); Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/index.jsp URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/index.jsp?rev=1089796&r1=1089795&r2=1089796&view=diff ============================================================================== --- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/index.jsp (original) +++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/webapp/index.jsp Thu Apr 7 10:06:06 2011 @@ -1,3 +1,23 @@ + <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -79,6 +99,7 @@ td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } + <%! private StoreManager getStoreManager(HttpServletRequest request) { @@ -93,13 +114,12 @@ td { } %> - Apache Chemistry Logo

OpenCMIS InMemory Server

-

Your server is up an running.

+

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. @@ -128,6 +148,15 @@ in properties (createdBy, etc.), passwor not perform any kind of secure authentication.

+

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: @@ -177,7 +206,12 @@ not perform any kind of secure authentic Max. allowed content size <% - out.println("" + ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.MAX_CONTENT_SIZE_KB) + "KB"); + String maxSize = ConfigurationSettings.getConfigurationValueAsString(ConfigConstants.MAX_CONTENT_SIZE_KB); + if (null == maxSize) + maxSize = "unlimited"; + else + maxSize += "KB"; + out.println("" + maxSize + ""); %> @@ -201,6 +235,8 @@ not perform any kind of secure authentic <% String dateStr; Long interval = ConfigurationSettings.getConfigurationValueAsLong(ConfigConstants.CLEAN_REPOSITORY_INTERVAL); + long diff = 0; + if (null == interval) dateStr = "Never"; else { @@ -210,17 +246,22 @@ not perform any kind of secure authentic Calendar calNextClean = Calendar.getInstance(); calNow.setTime(now); SimpleDateFormat formatter ; - Date deploy; - formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US); + 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("" + dateStr + ""); %>