Skip to content
Snippets Groups Projects
Commit d73aa0c2 authored by srosse's avatar srosse
Browse files

FXOLAT-243: backport the clean-up of third party libraries to OpenOLAT (remove...

FXOLAT-243: backport the clean-up of third party libraries to OpenOLAT (remove HSQLDB from WAR, cluster libs if not wanted...)
parent fdf6cbb3
No related branches found
No related tags found
No related merge requests found
......@@ -831,7 +831,38 @@
<cargo.container.wait>true</cargo.container.wait>
</properties>
</profile>
<profile>
<id>cluster</id>
<activation>
<property>
<name>cluster</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.8.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>2.0.5.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.2.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jbosscache2</artifactId>
<version>3.3.2.GA</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<profile>
<!-- activate this profile to run Selenium based Integration Tests against a cluster running locally
......@@ -1300,6 +1331,30 @@
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.8.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>2.0.5.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.2.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jbosscache2</artifactId>
<version>3.3.2.GA</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
......@@ -2022,21 +2077,7 @@
<version>0.6.0</version>
</dependency>
<!-- fxdiff: FXOLAT-243 remove dependency to jbosscache (only for cluster + deprecated by JBoss) -->
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.8.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>2.0.5.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
<version>3.2.2.GA</version>
</dependency>
<!-- cluster -->
<dependency>
<groupId>reload-diva</groupId>
<artifactId>reload-diva</artifactId>
......@@ -2196,6 +2237,12 @@
<groupId>org.apache.woden</groupId>
<artifactId>woden-api</artifactId>
<version>1.0M8</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- /Dependencys for onyx plugin -->
<dependency>
......@@ -2269,12 +2316,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jbosscache2</artifactId>
<version>3.3.2.GA</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
......@@ -2385,6 +2426,7 @@
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.0.0-rc8</version>
<scope>test</scope>
</dependency>
<!-- Spring dependencies -->
<dependency>
......@@ -2668,7 +2710,6 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
<version>2.0-beta-2</version>
</plugin>
</plugins>
</reporting>
......
/**
* JGS goodsolutions GmbH<br>
* http://www.goodsolutions.ch
* <p>
* This software is protected by the goodsolutions software license.<br>
* <p>
* Copyright (c) 2005-2006 by JGS goodsolutions GmbH, Switzerland.<br>
* All rights reserved.
* <p>
*/
package ch.goodsolutions.olat.jfreechart;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.image.ImageComponent;
import org.olat.core.gui.control.DefaultController;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
/**
* Description:<br>
* This is a simple Controller wrapper to JFreeChart charts. Drop in a JFreeChart chart, set its width
* and height and the Controller's initial component will render the chart as a PNG.
*
* For JFreeChart reference please see http://www.jfree.org/jfreechart/index.php
* <P>
* Initial Date: 18.04.2006 <br>
*
* @author Mike Stock
*/
public class JFreeChartController extends DefaultController {
ImageComponent imgComponent;
/**
* @param wControl
*/
public JFreeChartController(Object chart, Long height, Long width, WindowControl wControl) {
super(wControl);
imgComponent = new ImageComponent("jfreechartwrapper");
imgComponent.setWidth(width);
imgComponent.setHeight(height);
imgComponent.setMediaResource(new JFreeChartMediaResource(chart, width, height));
setInitialComponent(imgComponent);
}
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Component source, Event event) {
// nothing to do...
}
/**
* @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
*/
protected void doDispose() {
// nothing to do...
}
}
/**
* JGS goodsolutions GmbH<br>
* http://www.goodsolutions.ch
* <p>
* This software is protected by the goodsolutions software license.<br>
* <p>
* Copyright (c) 2005-2006 by JGS goodsolutions GmbH, Switzerland.<br>
* All rights reserved.
* <p>
*/
package ch.goodsolutions.olat.jfreechart;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import javax.servlet.http.HttpServletResponse;
import org.olat.core.gui.media.MediaResource;
/**
* Description:<br>
* TODO: Mike Stock Class Description for JFreeChartMediaResource
*
* <P>
* Initial Date: 18.04.2006 <br>
*
* @author Mike Stock
*/
public class JFreeChartMediaResource implements MediaResource {
private static final String CONTENT_TYPE = "image/png";
private static final Long UNDEF_SIZE = new Long(-1);
private static final Long UNDEF_LAST_MODIFIED = new Long(-1);
private Object chart;
private Long width, height;
public JFreeChartMediaResource(Object chart, Long width, Long height) {
this.chart = chart;
this.width = width;
this.height = height;
}
/**
* @see org.olat.core.gui.media.MediaResource#getContentType()
*/
public String getContentType() {
return CONTENT_TYPE;
}
/**
* @see org.olat.core.gui.media.MediaResource#getSize()
*/
public Long getSize() {
return UNDEF_SIZE;
}
/**
* @see org.olat.core.gui.media.MediaResource#getInputStream()
*/
public InputStream getInputStream() {
ByteArrayInputStream pIn = null;
try {
ByteArrayOutputStream pOut = new ByteArrayOutputStream();
//ChartUtilities.writeChartAsPNG(pOut, chart, width.intValue(), height.intValue());
pIn = new ByteArrayInputStream(pOut.toByteArray());
} catch (Exception e) {
// bummer...
}
return pIn;
}
/**
* @see org.olat.core.gui.media.MediaResource#getLastModified()
*/
public Long getLastModified() {
return UNDEF_LAST_MODIFIED;
}
/**
* @see org.olat.core.gui.media.MediaResource#prepare(javax.servlet.http.HttpServletResponse)
*/
public void prepare(HttpServletResponse hres) {
// nothing to do...
}
/**
* @see org.olat.core.gui.media.MediaResource#release()
*/
public void release() {
// nothing to do...
}
}
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <p>
*/
package org.olat.core.commons.persistence;
import org.hsqldb.util.DatabaseManagerSwing;
import org.olat.core.configuration.Destroyable;
import org.olat.core.configuration.Initializable;
/**
* Description:<br>
* opens a GUI for accessing the database
* see http://hsqldb.org/web/hsqlDocsFrame.html for more documentation about this feature
*
* Usage: java DatabaseManagerSwing [--options]
where options include:
--help show this message
--driver <classname> jdbc driver class
--url <name> jdbc url
--user <name> username used for connection
--password <password> password for this user
--urlid <urlid> use url/user/password/driver in rc file
--rcfile <file> (defaults to 'dbmanager.rc' in home dir)
--dir <path> default directory
--script <file> reads from script file
--noexit do not call system.exit()
*
* <P>
* Initial Date: 02.03.2010 <br>
* @author guido
*/
public class HsqldbDatabaseManagerGUI implements Initializable, Destroyable{
private Thread thread;
private String dbVendor;
private String datasourceUrl;
private boolean debug;
public HsqldbDatabaseManagerGUI(String dbVendor, final String datasourceUrl, boolean debug) {
this.dbVendor = dbVendor;
this.datasourceUrl = datasourceUrl;
this.debug = debug;
}
@Override
public void destroy() {
thread.interrupt();
}
@Override
public void init() {
if (dbVendor.equals("hsqldb") && debug) {
Runnable r = new Runnable() {
@Override
public void run() {
System.out.println("LAUNCHING HSQL DBMANAGERSWING");
String[] args = {"--user", "SA", "--url", datasourceUrl};
try {
DatabaseManagerSwing.main(args);
} catch (Exception e) {
System.out.println("Could not start hsqldb database manager GUI: "+e.getMessage());
}
}
};
thread = new Thread(r);
thread.start();
}
}
}
......@@ -260,13 +260,6 @@
<property name="password"><value></value></property>
</bean>
<bean id="hsqldbDatabaseManagerGUI" class="org.olat.core.commons.persistence.HsqldbDatabaseManagerGUI" init-method="init" destroy-method="destroy" lazy-init="true">
<constructor-arg value="${db.vendor}" />
<constructor-arg><value>jdbc:hsqldb:file:${java.io.tmpdir}/olatdata/database/${db.name}</value></constructor-arg>
<constructor-arg value="${olat.debug}"/>
</bean>
<!-- The mysql datasource checks upon startup whether the tables are of type InnoDB, if not it will not start. If you have an other type of transactional tables just switch back the spring config
to the normal org.springframework.jdbc.datasource.DriverManagerDataSource and the check is gone.-->
<bean id="mysqlDataSource" class="org.olat.core.commons.persistence.InnoDBAwareDriverManagerDataSource" lazy-init="true" init-method="init">
......
......@@ -33,8 +33,6 @@ import org.olat.core.CoreSpringFactory;
import org.olat.core.commons.persistence.OLATLocalSessionFactoryBean;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.panel.Panel;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Event;
......@@ -59,7 +57,6 @@ public class SetupPropertiesController extends BasicController {
VelocityContainer content = createVelocityContainer("setup");
private List<OLATProperty> defaultProps = new ArrayList<OLATProperty>();
private List<OLATProperty> overwriteProps = new ArrayList<OLATProperty>();
private Link showDBManager;
/**
*
......@@ -95,11 +92,6 @@ public class SetupPropertiesController extends BasicController {
String hibernateConnectionURL = getHibernateConnectionUrl();
content.contextPut("hibernateConnectionUrl",hibernateConnectionURL);
content.contextPut("userDataRoot",WebappHelper.getUserDataRoot());
//add button to start hsqldbmanager gui when hsqldb is in use
if (hibernateConnectionURL.contains("hsqldb")) {
showDBManager = LinkFactory.createButton("show.hsqldb", content, this);
}
main.setContent(content);
......@@ -198,11 +190,7 @@ public class SetupPropertiesController extends BasicController {
@Override
@SuppressWarnings("unused")
protected void event(UserRequest ureq, Component source, Event event) {
if (source == showDBManager) {
//accessing the bean will create it
CoreSpringFactory.getBean("hsqldbDatabaseManagerGUI");
}
//
}
public class OLATProperty implements Comparable<OLATProperty> {
......
Database Url: <span style=color:blue>$hibernateConnectionUrl</span>
#if ($r.available("show.hsqldb"))
<span style="padding-left:10px">$r.render("show.hsqldb")</span>
#end
<br/>
Userdata are stored under: <span style=color:blue>$userDataRoot</span>
<hr/>
......
......@@ -29,7 +29,6 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.hsqldb.util.DatabaseManagerSwing;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment