Permalink
Browse files

No commit message

  • Loading branch information...
leo
leo committed Mar 8, 2006
1 parent fd927aa commit eb48fb53360aa1ad2b664494054ed8f300e9b5a4
View
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
** @author Matthias L. Jugel
** @version $Id$
-->
<project basedir="." default="bundle" name="SnipSnap.launcher">
<description>
Bundle SnipSnap with Application Server launcher.
</description>
<property file="conf/build.properties"/>
<property file="conf/libs.properties"/>
<target name="bundle"
description="bundles ${appname}.war and database libs with the launcher">
<mkdir dir="${dir.build}"/>
<copy file="${dir.libs.snipsnap}/${launcher.jar}" tofile="${dir.build}/${appname}.jar" overwrite="true"/>
<jar destfile="${dir.build}/${appname}.jar" excludes="**/CVS,**/.svn" update="true">
<fileset dir="${dir.build}" includes="${appname}-installer.war"/>
<fileset dir="${dir.build}" includes="${appname}.war"/>
<fileset dir="${dir.libs}" includes="${mckoidb.jar}"/>
</jar>
</target>
</project>
View
434 build.xml

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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
View
@@ -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
rss-ng.jar=rss-ng-1.0-alpha-1.jar
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
@@ -1,4 +1,12 @@
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
View
@@ -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
@@ -1,4 +1,3 @@
<%@ page import="org.radeox.util.Encoder"%>
<%--
** Template for editing Snips.
** @author Matthias L. Jugel
@@ -50,7 +49,7 @@
<c:if test="${error == 'snip.name.empty'}"><span class="error"><fmt:message key="snip.name.empty"/></span></c:if>
</td>
</tr>
</div>
</table>
</c:if>
<table>
<tr><td>
@@ -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.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.prefs.Preferences;
public class AdminInitFilter implements Filter {
@@ -62,24 +55,15 @@
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 ...)
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);
serverConf = (Properties) config.getServletContext().getAttribute("server.config");
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 void doFilter(ServletRequest req, ServletResponse response, FilterChain c
// 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 void doFilter(ServletRequest req, ServletResponse response, FilterChain c
}
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);
@@ -110,7 +110,6 @@ public void init(FilterConfig filterConfig) throws ServletException {
configParam = context.getRealPath("/WEB-INF/application.conf");
}
// create globals configuration by getting an instance and loading application.conf
globals = ConfigurationProxy.getInstance();
try {
@@ -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 @@
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 AdminXmlRpcClient(String url, String user, String password) throws Malfor
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 {
@@ -36,7 +36,7 @@
/**
* 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 @@
// 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();

0 comments on commit eb48fb5

Please sign in to comment.