You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sh...@apache.org on 2005/08/10 23:50:47 UTC

svn commit: r231336 - in /portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container: ContainerInfo.java JetspeedPortletContext.java resources/ resources/ContainerInfo.properties

Author: shinsuke
Date: Wed Aug 10 14:50:43 2005
New Revision: 231336

URL: http://svn.apache.org/viewcvs?rev=231336&view=rev
Log:
fixed http://issues.apache.org/jira/browse/JS2-325

Added:
    portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java   (with props)
    portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/
    portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties   (with props)
Modified:
    portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java

Added: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java?rev=231336&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java (added)
+++ portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java Wed Aug 10 14:50:43 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * 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.jetspeed.container;
+
+import java.util.ResourceBundle;
+
+/**
+ * Container Information
+ *
+ * @author <a href="mailto:shinsuke@yahoo.co.jp">Shinsuke Sugaya</a>
+ */
+public final class ContainerInfo
+{
+    public static final ResourceBundle CONTAINER_INFO;
+
+    static
+    {
+        CONTAINER_INFO = ResourceBundle.getBundle("org.apache.jetspeed.container.resources.ContainerInfo");
+    }
+
+    public static final String getPortletContainerName()
+    {
+        return CONTAINER_INFO.getString("jetspeed.container.name");
+    }
+
+    public static final String getPortletContainerMajorVersion()
+    {
+        return CONTAINER_INFO.getString("jetspeed.container.version.major");
+    }
+
+    public static final String getPortletContainerMinorVersion()
+    {
+        return CONTAINER_INFO.getString("jetspeed.container.version.minor");
+    }
+
+    public static final int getMajorSpecificationVersion()
+    {
+        return Integer.parseInt(CONTAINER_INFO.getString("javax.portlet.version.major"));
+    }
+
+    public static final int getMinorSpecificationVersion()
+    {
+        return Integer.parseInt(CONTAINER_INFO.getString("javax.portlet.version.minor"));
+    }
+
+    public static final String getServerInfo()
+    {
+        StringBuffer sb = new StringBuffer(getPortletContainerName()).append(
+                CONTAINER_INFO.getString("jetspeed.container.separator")).append(getPortletContainerMajorVersion())
+                .append(".").append(getPortletContainerMinorVersion());
+        return sb.toString();
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/ContainerInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java?rev=231336&r1=231335&r2=231336&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java (original)
+++ portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/JetspeedPortletContext.java Wed Aug 10 14:50:43 2005
@@ -48,11 +48,6 @@
      */
     public static final String LOCAL_PA_ROOT = "/WEB-INF/apps";
 
-    private static final int MAJOR_VERSION = 2;
-    private static final int MINOR_VERSION = 0;
-    private static final String JETSPEED_APPLICATION_INFO =
-        "Jakarta Jetspeed Portal Server, Version " + MAJOR_VERSION + "." + MINOR_VERSION;
-
     private ServletContext servletContext;
     private MutablePortletApplication application;
 
@@ -64,12 +59,12 @@
 
     public int getMajorVersion()
     {
-        return MAJOR_VERSION;
+        return ContainerInfo.getMajorSpecificationVersion();
     }
 
     public int getMinorVersion()
     {
-        return MINOR_VERSION;
+        return ContainerInfo.getMinorSpecificationVersion();
     }
 
     // Delegated methods
@@ -203,7 +198,7 @@
 
     public String getServerInfo()
     {
-        return JETSPEED_APPLICATION_INFO;
+        return ContainerInfo.getServerInfo();
     }
 
     // internal portlet context implementation

Added: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties?rev=231336&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties (added)
+++ portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties Wed Aug 10 14:50:43 2005
@@ -0,0 +1,23 @@
+#
+#  Copyright 2003,2004 The Apache Software Foundation.
+#
+#  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.
+#
+
+jetspeed.container.name=Jetspeed Portal Server
+jetspeed.container.separator=, Version\u0020
+jetspeed.container.version.major=2
+jetspeed.container.version.minor=0
+
+javax.portlet.version.major=1
+javax.portlet.version.minor=0

Propchange: portals/jetspeed-2/trunk/commons/src/java/org/apache/jetspeed/container/resources/ContainerInfo.properties
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org