Author: cmailleux
Date: Fri Jul 13 11:46:07 2007
New Revision: 404
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D404&repname=
=3Desi_server
Log:
Change the way of handling buildnumber to avoid conflict during svn update
Added:
trunk/buildnumber.properties
Modified:
trunk/build.xml
trunk/esiadmin/inc/footer.jsp
trunk/src/org/jahia/esi/Utils.java
Modified: trunk/build.xml
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/build.xml&rev=
=3D404&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/build.xml (original)
+++ trunk/build.xml Fri Jul 13 11:46:07 2007
@@ -474,7 +474,8 @@
<exec executable=3D"svnversion" spawn=3D"false" dir=3D"${basedir}"=
outputproperty=3D"buildversion" failifexecutionfails=3D"false">
<arg line=3D"."/>
</exec>
- <replaceregexp file=3D"${src.home}/org/jahia/esi/Utils.java"
+ <copy file=3D"${basedir}/buildnumber.properties" tofile=3D"${targe=
tapp.dir}/WEB-INF/classes/buildnumber.properties"/>
+ <replaceregexp file=3D"${targetapp.dir}/WEB-INF/classes/buildnumbe=
r.properties"
match=3D"buildnumber_([0-9M:]*)"
replace=3D"buildnumber_${buildversion}"
byline=3D"false"/>
Added: trunk/buildnumber.properties
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/buildnum=
ber.properties&rev=3D404&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/buildnumber.properties (added)
+++ trunk/buildnumber.properties Fri Jul 13 11:46:07 2007
@@ -0,0 +1,3 @@
+esiversion =3D 0.9
+copyright =3D © Copyright 2002-2007 <a href=3D"http://www.jahia.org" =
target=3D"newJahia">Jahia Ltd</a> -
+buildnumber=3D buildnumber_379:401M
\ No newline at end of file
Modified: trunk/esiadmin/inc/footer.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/esiadmin/inc/fo=
oter.jsp&rev=3D404&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/esiadmin/inc/footer.jsp (original)
+++ trunk/esiadmin/inc/footer.jsp Fri Jul 13 11:46:07 2007
@@ -1,8 +1,12 @@
-<% String[] strings =3D org.jahia.esi.Utils.BUILDNUMBER.split(":");%>
+<%@ page import=3D"java.util.Properties" %>
+<%
+ String s =3D org.jahia.esi.Utils.getBuildNumber();
+ String[] strings =3D s.substring(s.indexOf("_")+1).split(":");
+%>
<div id=3D"footer">
=
<em>
- <p><h4><%=3Dorg.jahia.esi.Utils.COPYRIGHT%> Jahia ESI WebCach=
e Server - version <%=3Dorg.jahia.esi.Utils.ESIVERSION%> - build <%=3Dstrin=
gs.length>1?strings[1]:strings[0]%></h4></p>
+ <p><h4><%=3Dorg.jahia.esi.Utils.getCopyright()%> Jahia ESI We=
bCache Server - version <%=3Dorg.jahia.esi.Utils.getEsiVersion()%> - build =
<%=3Dstrings.length>1?strings[1]:strings[0]%></h4></p>
</em>
=
</div>
Modified: trunk/src/org/jahia/esi/Utils.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/Utils.java&rev=3D404&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/org/jahia/esi/Utils.java (original)
+++ trunk/src/org/jahia/esi/Utils.java Fri Jul 13 11:46:07 2007
@@ -61,6 +61,8 @@
import javax.servlet.http.Cookie;
import java.util.*;
import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.io.InputStream;
=
/**
* Created by IntelliJ IDEA.
@@ -71,14 +73,18 @@
*/
public class Utils {
=
- private static final transient Log log =3D LogFactory.getLog(Utils.cla=
ss);
-
- public static String ESIVERSION =3D "0.9";
- public static final String COPYRIGHT =3D
- "© Copyright 2002-2007 <a href=3D\"http://www.jahia.org\"=
target=3D\"newJahia\">Jahia Ltd</a> -";
-
- public static final String BUILDNUMBER=3D"buildnumber_379:401M";
-
+ private static final transient Log log =3D LogFactory.getLog(Utils.cla=
ss); =
+ private static final Properties buildProperties;
+ static {
+ buildProperties =3D new Properties();
+ try {
+ InputStream asStream =3D
+ Thread.currentThread().getContextClassLoader().getReso=
urceAsStream("buildnumber.properties");
+ buildProperties.load(asStream);
+ } catch (IOException e) {
+ e.printStackTrace();//To change body of catch statement use Fi=
le | Settings | File Templates.
+ }
+ }
public static String stackTraceToString(Exception ex) {
// Append stack trace if not null
if(ex.getCause() !=3D null) {
@@ -769,8 +775,16 @@
return 0;
}
=
- public static String getESIVERSION() {
- return ESIVERSION;
+ public static String getEsiVersion() {
+ return buildProperties.getProperty("esiversion");
+ }
+
+ public static String getBuildNumber() {
+ return buildProperties.getProperty("buildnumber");
+ }
+
+ public static String getCopyright() {
+ return buildProperties.getProperty("copyright");
}
=
//TODO: move to external text file
@@ -782,7 +796,7 @@
StringBuffer msg =3D new StringBuffer ("\n\n\n\n");
msg.append ("\n");
msg.append (getJahiaWebCacheLogo());
- msg.append (" . . . s t a r t i n g j a h i a W e b c a c=
h e b u i l d " + ESIVERSION + " . . .\n");
+ msg.append (" . . . s t a r t i n g j a h i a W e b c a c=
h e b u i l d " + getEsiVersion() + " . . .\n");
msg.append ("\n\n");
msg.append (" Copyright 2002-2006 - jahia http://www.jahia.org -=
all rights reserved\n");
msg.append ("\n\n");
@@ -825,7 +839,7 @@
page.append("] cannot be retrieve as it is declared in a forbidden=
-rule by the ESI server configuration.\n" );
page.append("\n" );
page.append("<hr>\n" );
- page.append("<p><h3>Jahia ESI Cache Server - version "+ ESIVERSION=
+"</h3></p>\n" );
+ page.append("<p><h3>Jahia ESI Cache Server - version "+ getEsiVers=
ion() +"</h3></p>\n" );
page.append("</fieldset>\n" );
page.append("</body> </html>");
return page.toString();
@@ -859,7 +873,7 @@
page.append("</p>\n" );
page.append("\n" );
page.append("<hr>\n" );
- page.append("<p><h3>Jahia ESI Cache Server - version "+ ESIVERSION=
+"</h3></p>\n" );
+ page.append("<p><h3>Jahia ESI Cache Server - version "+ getEsiVers=
ion() +"</h3></p>\n" );
page.append("</fieldset>\n" );
page.append("</body> </html>");
return page.toString();
@@ -915,7 +929,7 @@
page.append("</p>\n" );
page.append("\n" );
page.append("<hr>\n" );
- page.append("<p><h3>Jahia ESI Cache Server - version "+ ESIVERSION=
+"</h3></p>\n" );
+ page.append("<p><h3>Jahia ESI Cache Server - version "+ getEsiVers=
ion() +"</h3></p>\n" );
page.append("</fieldset>\n" );
page.append("</body> </html>");
return page.toString();
@@ -944,7 +958,7 @@
page.append("<p><center> <form><input type=3Dbutton value=3D\"Forc=
e Retry Now\" onClick=3D\"window.location.reload( true )\"></form></center>=
<p>");
page.append("\n" );
page.append("<hr>\n" );
- page.append("<p><h3>Jahia ESI Cache Server - version "+ ESIVERSION=
+"</h3></p>\n" );
+ page.append("<p><h3>Jahia ESI Cache Server - version "+ getEsiVers=
ion() +"</h3></p>\n" );
page.append("</fieldset>\n" );
page.append("</body> </html>");
return page.toString();
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list