commit eb48fb53360aa1ad2b664494054ed8f300e9b5a4 from: leo date: Wed Mar 8 09:53:29 2006 UTC commit - fd927aab445ad88006ae9ac70783927523f5ae8a commit + eb48fb53360aa1ad2b664494054ed8f300e9b5a4 blob - e86862a28e464828cb71b81ea128aa5125deb316 blob + 45f18aabbef7dca1d9ac5a7cfd9048d48bb8605d --- build.xml +++ build.xml @@ -10,63 +10,62 @@ - - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -76,7 +75,7 @@ - + @@ -149,9 +148,9 @@ - + - + @@ -172,14 +171,14 @@ - + - - - - - + + + + + @@ -188,9 +187,9 @@ - + + srcdir="${dir.src}" destdir="${dir.out}/ant"> @@ -198,30 +197,30 @@ + classpath="${dir.out}/ant"/> - - + + - - + + @@ -229,16 +228,16 @@ - - + + - + @@ -246,10 +245,10 @@ - + @@ -263,22 +262,22 @@ - - + + - + - - + @@ -288,13 +287,13 @@ - - - + + + - - - + + + @@ -303,8 +302,8 @@ - - + + @@ -316,10 +315,10 @@ - + @@ -329,21 +328,21 @@ - - + + - - + + - + + destdir="${dir.out}/util"> @@ -368,117 +367,117 @@ - + - + - + - + - - - - - - + + + + + + - - - + + + - - - + + + webinc="${dir.out}/jsp/web.inc"> - + + destdir="${dir.out}/jsp/classes"> - - - + + + destdir="${dir.out}/jsp/classes"> - - - + + + - - + + - - - - + + + + - + - + @@ -486,25 +485,25 @@ + tofile="${dir.out}/webapp/WEB-INF/web.xml" + file="${dir.src}/apps/default/WEB-INF/web-xml.tmpl" overwrite="true"> - + + todir="${dir.out}/webapp/WEB-INF/classes/defaults"> - - + + @@ -525,8 +524,8 @@ - - + + @@ -540,45 +539,46 @@ + - - + + - - - + + + webinc="${dir.out}/installer/jsp/web.inc"> - + + destdir="${dir.out}/installer/jsp/classes"> - + + destdir="${dir.out}/installer/servlets"> @@ -586,96 +586,61 @@ - - - + + + - - - + + + - - + + - - - + + + - + - - + + - + + tofile="${dir.out}/installer/webapp/WEB-INF/web.xml" + file="${dir.src}/apps/installer/WEB-INF/web-xml.tmpl" overwrite="true"> - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - SnipSnap]]> - Copyright © 2001-2004 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved + Copyright © 2001-2006 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved .]]> - blob - /dev/null blob + a9843d17026dcc2aafcd57623b77e9ebff4f5595 (mode 644) --- /dev/null +++ build.launcher.xml @@ -0,0 +1,27 @@ + + + + + + Bundle SnipSnap with Application Server launcher. + + + + + + + + + + + + + + + + + blob - 39e95e76eb1cf5320a0b56f03c90a1fce4767049 blob + 58d0daaedbfed810a925f97d190f677ba082b563 --- conf/build.properties +++ conf/build.properties @@ -14,10 +14,12 @@ debug=true precompile.jsp=true # lib directory containing jar and war files -jar=${basedir}/lib +dir.libs=${basedir}/lib +dir.libs.snipsnap=${basedir}/lib/snipsnap -# sourcer and target directory for compiled classes -src=${basedir}/src -target=${basedir}/cls +# source and target directory for compiled classes +dir.src=${basedir}/src +dir.out=${basedir}/cls +dir.build=${basedir}/build check_rules=rulesets/imports.xml,rulesets/braces.xml,rulesets/junit.xml blob - 9033ca3bbf50b8fbbfbadd95ff0b22c58fc673c3 blob + c2553a52b8690dd1c50ed4321c48799d0d9f148f --- conf/libs.properties +++ conf/libs.properties @@ -1,7 +1,18 @@ +# SnipSnap libs and plugins +launcher.jar=launcher.jar + +# database connectors +mckoidb.jar=mckoidb.jar +mysql.jar=mysql-connector.jar + +# third party libs rome.jar=rome-0.5.jar jdom.jar=jdom-1.0.jar spring-core.jar=spring-core.jar spring-beans.jar=spring-beans.jar +xmlrpc.jar=xmlrpc-2.0-beta.jar + +# snipsnap plugins jdbcstorage.jar=jdbcstorage-1.0-alpha-1.jar search-ng.jar=search-ng-1.0-alpha-1.jar -rss-ng.jar=rss-ng-1.0-alpha-1.jar \ No newline at end of file +rss-ng.jar=rss-ng-1.0-alpha-1.jar blob - 554f80e4c1cbc259c14d7413d226c937b60497d6 blob + 8ce53f16e83ec994e476521e86ac80e60460efbf Binary files lib/jdbcstorage-1.0-alpha-1.jar and lib/jdbcstorage-1.0-alpha-1.jar differ blob - /dev/null blob + 55069d9922e8ebef78b3b59d8ab2065ae6d6eea2 (mode 644) Binary files /dev/null and lib/snipsnap/launcher.jar differ blob - 991edc29a25590de80fa91a382bdc7348134bf62 (mode 644) blob + /dev/null Binary files lib/xmlrpc-2.0.jar and /dev/null differ blob - /dev/null blob + 86aaa3e99ab2c24815c7d2f27516764862566b63 (mode 644) Binary files /dev/null and lib/xmlrpc-2.0-beta.jar differ blob - 33c39728b3bd2ef7bdda7f157c19d4f13042d394 blob + 59f3379f7f0f3f5821bb00444d48196a70253d37 --- src/Changes.txt +++ src/Changes.txt @@ -1,5 +1,13 @@ -0.5.2 +1.0 +- more componentization +- extracted JDBC storage plugin +- extracted RSS feed plugin +- extracted search engine plugin +- extracted launcher code + +0.5.2 + - Improvement: Dropped mocking classes for jMock - Created new sub project Gabriel for security with ACLs and interceptors - Removed last traces of our AOP solution, replaced with Dynaop blob - eb704d5dbd1175dada54f28c48628a037feba66f blob + 075026a8a8d8a26ef9318b892406ce197938e758 --- src/Todo.txt +++ src/Todo.txt @@ -1,3 +1,2 @@ -@TODO: Add Timezone, e.g. +1.00 to Appconfiguration. Needed e.g. for RSS, DublinCore. @TODO: Snip with list version of all external libs, like Lucene, ORO, xml parser, ... @TODO: markup/highlighting for snipsnap macros blob - 1c2cddbdf5d50d32ab622ca3d8e72a046f178e90 blob + 1d151cb35ddac76ef079d7be078a21569f859c92 --- src/apps/default/edit.jsp +++ src/apps/default/edit.jsp @@ -1,4 +1,3 @@ -<%@ page import="org.radeox.util.Encoder"%> <%-- ** Template for editing Snips. ** @author Matthias L. Jugel @@ -50,7 +49,7 @@ - +
blob - 1f7f619447d6612efb0f60537e05366024f7ec55 blob + 00092c4649f107f35411b7e1c72df586cdd0cbf5 --- src/org/snipsnap/admin/AdminInitFilter.java +++ src/org/snipsnap/admin/AdminInitFilter.java @@ -25,18 +25,12 @@ package org.snipsnap.admin; import org.apache.xmlrpc.XmlRpcException; -import snipsnap.api.config.Configuration; import org.snipsnap.config.ServerConfiguration; import org.snipsnap.net.filter.EncRequestWrapper; import org.snipsnap.server.AdminXmlRpcClient; +import snipsnap.api.config.Configuration; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -46,7 +40,6 @@ import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.Properties; -import java.util.prefs.Preferences; public class AdminInitFilter implements Filter { @@ -62,24 +55,15 @@ public class AdminInitFilter implements Filter { protected final static String PARAM_INSTALL = "install"; protected final static String PARAM_EXPERT = "expert"; - protected Properties serverPrefsDefaults = new Properties(); + protected Properties serverConf = new Properties(); protected AdminXmlRpcClient adminClient; public void init(FilterConfig config) throws ServletException { - // load defaults (should not be necessary ...) + serverConf = (Properties) config.getServletContext().getAttribute("server.config"); try { - serverPrefsDefaults.load(AdminInitFilter.class.getResourceAsStream("/conf/snipsnap.conf")); - } catch (IOException e) { - System.err.println("AdminInitFilter: Unable to read server defaults: " + e.getMessage()); - e.printStackTrace(); - } - - Preferences serverPrefs = Preferences.userNodeForPackage(ServerConfiguration.class); - try { - String url = serverPrefs.get(ServerConfiguration.ADMIN_URL, - serverPrefsDefaults.getProperty(ServerConfiguration.ADMIN_URL)); - String user = serverPrefs.get(ServerConfiguration.ADMIN_USER, "admin"); - String pass = serverPrefs.get(ServerConfiguration.ADMIN_PASS, null); + String url = (String) serverConf.get("snipsnap.server.admin.rpc.url"); + String user = (String) serverConf.get("snipsnap.server.admin.user"); + String pass = (String) serverConf.get("snipsnap.server.admin.password"); adminClient = new AdminXmlRpcClient(url, user, pass); } catch (Exception e) { System.out.println("!! Unable to create XML-RPC client, check system preferences:"); @@ -123,14 +107,13 @@ public class AdminInitFilter implements Filter { // check authentication and verify session if (!"true".equals(session.getAttribute(ATT_AUTHENTICATED))) { - Preferences serverPrefs = Preferences.userNodeForPackage(ServerConfiguration.class); - String serverPass = serverPrefs.get(ServerConfiguration.ADMIN_PASS, ""); + String serverPass = (String) serverConf.get(ServerConfiguration.ADMIN_PASS); String installPass = path; - if (installPass == null || "".equals(installPass) || "/".equals(installPass)) { + if ("".equals(installPass) || "/".equals(installPass)) { installPass = "/" + request.getParameter("password"); } - if (installPass == null || "".equals(installPass) || !serverPass.equals(installPass.substring(1))) { + if ("".equals(installPass) || !serverPass.equals(installPass.substring(1))) { step = "login"; } else { session.setAttribute(ATT_AUTHENTICATED, "true"); @@ -171,14 +154,14 @@ public class AdminInitFilter implements Filter { } if (null != request.getParameter(PARAM_EXPERT) || - (null == request.getParameter(PARAM_INSTALL) && (applications != null && applications.size() > 0))) { + (null == request.getParameter(PARAM_INSTALL) && (applications != null && applications.size() > 0))) { step = "install"; } else { - URL url = null; + URL url; try { url = install(config.getProperty(Configuration.APP_HOST), - config.getProperty(Configuration.APP_PORT), - config.getProperty(Configuration.APP_PATH)); + config.getProperty(Configuration.APP_PORT), + config.getProperty(Configuration.APP_PATH)); if (url != null) { ((HttpServletResponse) response).sendRedirect(url.toString()); session.removeAttribute(ATT_CONFIG); blob - c5c685aa054df3649f9fe4469459285ffc540bc2 blob + 7c3bc9e0c42c39d3c681e3bdf1d80916bdce181d --- src/org/snipsnap/net/filter/InitFilter.java +++ src/org/snipsnap/net/filter/InitFilter.java @@ -110,7 +110,6 @@ public class InitFilter implements Filter { configParam = context.getRealPath("/WEB-INF/application.conf"); } - // create globals configuration by getting an instance and loading application.conf globals = ConfigurationProxy.getInstance(); try { blob - e90b29fcf284b635a0dc5e86a8d3820dd79c8343 blob + a12a5c50842c44473b5956d08650e5cb771cfe30 --- src/org/snipsnap/server/AdminXmlRpcClient.java +++ src/org/snipsnap/server/AdminXmlRpcClient.java @@ -24,8 +24,12 @@ */ package org.snipsnap.server; +import org.apache.xmlrpc.DefaultXmlRpcTransport; import org.apache.xmlrpc.XmlRpcClient; +import org.apache.xmlrpc.XmlRpcClientRequest; import org.apache.xmlrpc.XmlRpcException; +import org.apache.xmlrpc.XmlRpcRequest; +import org.apache.xmlrpc.XmlRpcTransport; import java.io.IOException; import java.net.MalformedURLException; @@ -35,6 +39,7 @@ import java.util.Vector; public class AdminXmlRpcClient { protected XmlRpcClient xmlRpcClient = null; + private DefaultXmlRpcTransport xmlRpcTransport = null; public AdminXmlRpcClient(String url, String user, String password) throws MalformedURLException { this(new URL(url), user, password); @@ -43,11 +48,12 @@ public class AdminXmlRpcClient { public AdminXmlRpcClient(URL url, String user, String password) throws MalformedURLException { URL xmlRpcUrl = new URL(url, "RPC2"); xmlRpcClient = new XmlRpcClient(xmlRpcUrl); - xmlRpcClient.setBasicAuthentication(user != null ? user : "admin", password != null ? password : ""); + xmlRpcTransport = new DefaultXmlRpcTransport(xmlRpcUrl); + xmlRpcTransport.setBasicAuthentication(user != null ? user : "admin", password != null ? password : ""); } public Object execute(String method, Vector args) throws XmlRpcException, IOException { - return xmlRpcClient.execute(method, args); + return xmlRpcClient.execute(new XmlRpcRequest(method, args), xmlRpcTransport); } public Hashtable getApplications() throws XmlRpcException, IOException { blob - 309abf051a1cd0843cce3af7144adebcc0fe4b86 blob + 65b3dac53e39bb8ca097d12e8c256377842d9339 --- src/snipsnap/api/config/Configuration.java +++ src/snipsnap/api/config/Configuration.java @@ -36,7 +36,7 @@ import java.io.File; /** * Interface template for easy usage of the configuration. * @author Matthias L. Jugel - * @version $Id: Configuration.java.tmpl 1606 2004-05-17 10:56:18Z leo $ + * @version $Id: Configuration.java.tmpl 1846 2006-02-07 21:08:46Z leo $ */ public interface Configuration extends Globals { public final static String SNIPSNAP_CONFIG = "SnipSnap/config"; @@ -89,7 +89,7 @@ public interface Configuration extends Globals { // automatically created interface/constants stub from // /Users/leo/src/Projects/SnipSnap/core/trunk/src/org/snipsnap/config/defaults.conf - // generated on 2/7/06 9:58 PM + // generated on 3/8/06 10:51 AM // constant/getter for 'app.admin.email' public final static String APP_ADMIN_EMAIL = "app.admin.email"; public String getAdminEmail();