Anoop's major update. Everything has changed location.

This commit is contained in:
amontano 2005-02-21 06:08:29 +00:00
parent 503958bd48
commit c4c899c895
299 changed files with 0 additions and 28329 deletions

View file

@ -1,9 +0,0 @@
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/Lex
hibernate.connection.username=
hibernate.connection.password=
hibernate.connection.useUnicode=true
hibernate.connection.characterEncoding=utf-8
#hibernate.connection.pool_size=10

View file

@ -1,6 +0,0 @@
<codegen>
<meta attribute="scope-class" inherit="false">abstract public </meta>
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
<!-- <generate package="org.thdl.lex.component.peer" suffix="Peer" renderer="net.sf.hibernate.tool.hbm2java.FinderRenderer"/> -->
</codegen>

View file

@ -1,102 +0,0 @@
<Context path="/lex" docBase="/Users/travis/webapps/lex/build" debug="0" reloadable="true" crossContext="true">
<Resource name="jdbc/lex-datasource" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/lex-datasource">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/Lex?useUnicode=true&amp;characterEncoding=UTF-8</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>username</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>7</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>15</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>
<Resource name="jdbc/thdl-users-datasource" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/thdl-users-datasource">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/ThdlUser</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>username</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<parameter>
<name>useUnicode</name>
<value>true</value>
</parameter>
<parameter>
<name>characterEncoding</name>
<value>utf-8</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>7</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>15</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="lex_access_log." suffix=".txt" pattern="combined" resolveHosts="true"/>
</Context>

View file

@ -1,221 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Lex</display-name>
<!--FILTERS-->
<filter>
<filter-name>authentication</filter-name>
<filter-class>org.thdl.lex.AuthenticationFilter</filter-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/login.jsp</param-value>
</init-param>
</filter>
<filter>
<filter-name>guest</filter-name>
<filter-class>org.thdl.lex.GuestFilter</filter-class>
</filter>
<filter>
<filter-name>charEnc</filter-name>
<filter-class>org.thdl.lex.CharEncFilter</filter-class>
</filter>
<filter>
<filter-name>component</filter-name>
<filter-class>org.thdl.lex.LexComponentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>charEnc</filter-name>
<url-pattern>/action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>authentication</filter-name>
<url-pattern>/action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>authentication</filter-name>
<url-pattern>/jsp/*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>authentication</filter-name>
<url-pattern>/jsp/*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>guest</filter-name>
<url-pattern>/public</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>component</filter-name>
<url-pattern>/action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>component</filter-name>
<url-pattern>/public</url-pattern>
</filter-mapping>
<!-- <listener>
<listener-class>org.thdl.lex.LoginSessionListener</listener-class>
</listener> -->
<!--SERVLETS-->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.thdl.lex.LexActionServlet</servlet-class>
<!--These init parameter provide configuration info for the Global object that stores recently modified terms.-->
<init-param>
<param-name>globalDataRefreshDelay</param-name>
<param-value>6</param-value><!--delay in seconds-->
</init-param>
<init-param>
<param-name>recentItems</param-name><!--number of recently modified terms -->
<param-value>6</param-value>
</init-param>
<!--These init parameter provide configuration info for the OAI Metadata Harvesting of Bibliographical entries-->
<init-param>
<param-name>oaiServer</param-name>
<param-value>http://datastore.lib.virginia.edu/tibet/spt/SPT--OAI.php</param-value>
</init-param>
<init-param>
<param-name>oaiMetadataPrefix</param-name>
<param-value>oai_dc</param-value>
</init-param>
<init-param>
<param-name>oaiHome</param-name>
<param-value>/Users/travis/webapps/oai-sources</param-value>
</init-param>
<init-param>
<param-name>oaiLocalCopy</param-name>
<param-value>Thdl_Oai_Bibliography_Sources.xml</param-value>
</init-param>
<init-param>
<param-name>oaiRefreshDelay</param-name><!--Hours between total refresh of sources-->
<param-value>24</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>org.thdl.lex.LoginServlet</servlet-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/login.jsp</param-value>
</init-param>
<init-param>
<param-name>welcomePage</param-name>
<param-value>/jsp/menu.jsp</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>logout</servlet-name>
<servlet-class>org.thdl.lex.LogoutServlet</servlet-class>
<init-param>
<param-name>goodbyePage</param-name>
<param-value>http://iris.lib.virginia.edu/tibet/reference/dictionary.html</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>org.thdl.lex.HibernateTestServlet</servlet-class>
</servlet>
<!--SERVLET MAPPPINGS-->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/public</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>logout</servlet-name>
<url-pattern>/logout</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
<!--TAGLIBS-->
<!--RELEASE TAGLIBS
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/lib/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/request-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/request.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/session-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/session.tld</taglib-location>
</taglib>-->
<!--NIGHTLY TAGLIBS-->
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core_rt</taglib-uri>
<taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/request-1.0</taglib-uri>
<taglib-location>/WEB-INF/tld/taglibs-request.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/response-1.0</taglib-uri>
<taglib-location>/WEB-INF/tld/taglibs-response.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/session-1.0</taglib-uri>
<taglib-location>/WEB-INF/tld/taglibs-session.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/input-1.0</taglib-uri>
<taglib-location>/WEB-INF/tld/taglibs-input.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/string-1.0</taglib-uri>
<taglib-location>/WEB-INF/tld/taglibs-string.tld</taglib-location>
</taglib>
</web-app>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<node>
<testelement class="org.apache.jmeter.testelement.TestPlan">
<testelement class="org.apache.jmeter.config.Arguments" name="TestPlan.user_defined_variables">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.config.gui.ArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.ArrayList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.control.gui.TestPlanGui</property>
<collection class="java.util.LinkedList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="TestPlan.thread_groups"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.testelement.TestPlan</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestPlan.serialize_threadgroups">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Test Plan</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestPlan.functional_mode">false</property>
</testelement>
<node>
<testelement class="org.apache.jmeter.threads.ThreadGroup">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.threads.gui.ThreadGroupGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.LongProperty" name="ThreadGroup.start_time">1068560706000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.threads.ThreadGroup</property>
<testelement class="org.apache.jmeter.control.LoopController" name="ThreadGroup.main_controller">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.control.gui.LoopControlPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="LoopController.loops">250</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.control.LoopController</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Loop Controller</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="LoopController.continue_forever">false</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">/lex/action Thread Group</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.LongProperty" name="ThreadGroup.end_time">1068560706000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ThreadGroup.num_threads">1</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ThreadGroup.scheduler">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ThreadGroup.ramp_time">1</property>
</testelement>
<node>
<testelement class="org.apache.jmeter.config.ConfigTestElement">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.path"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.ConfigTestElement</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">HTTP Request Defaults</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.domain">haley.local</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.protocol">http</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<testelement class="org.apache.jmeter.config.Arguments" name="HTTPsampler.Arguments">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.ArrayList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.port">2020</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.path">/lex/action</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.encoded_path">/lex/action</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.method">GET</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.use_keepalive">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.protocol"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.image_parser">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.follow_redirects">true</property>
<testelement class="org.apache.jmeter.config.Arguments" name="HTTPsampler.Arguments">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.LinkedList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments">
<testelement class="org.apache.jmeter.protocol.http.util.HTTPArgument" name="">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.metadata">=</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.value">menu</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPArgument.use_equals">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.name">cmd</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPArgument.always_encode">false</property>
</testelement>
</collection>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.port"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.mimetype"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.FILE_FIELD"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">cmd=menu</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.domain"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.FILE_NAME"/>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.reporters.ResultCollector">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.visualizers.ViewResultsFullVisualizer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.reporters.ResultCollector</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">View Results Tree</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="filename"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ResultCollector.error_logging">false</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.reporters.ResultCollector">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.visualizers.StatVisualizer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.reporters.ResultCollector</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Aggregate Report</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="filename"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ResultCollector.error_logging">false</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.timers.UniformRandomTimer">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.timers.gui.UniformRandomTimerGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.timers.UniformRandomTimer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Uniform Random Timer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ConstantTimer.delay">2000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="RandomTimer.range">1000</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.protocol.http.control.CookieManager">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.CookiePanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.protocol.http.control.CookieManager</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">HTTP Cookie Manager</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="CookieManager.clearEachIteration">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<collection class="java.util.ArrayList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="CookieManager.cookies"/>
</testelement>
</node>
</node>
</node>

View file

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<node>
<testelement class="org.apache.jmeter.testelement.TestPlan">
<testelement class="org.apache.jmeter.config.Arguments" name="TestPlan.user_defined_variables">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.config.gui.ArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.ArrayList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.control.gui.TestPlanGui</property>
<collection class="java.util.LinkedList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="TestPlan.thread_groups"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.testelement.TestPlan</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestPlan.serialize_threadgroups">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Test Plan</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestPlan.functional_mode">false</property>
</testelement>
<node>
<testelement class="org.apache.jmeter.threads.ThreadGroup">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.threads.gui.ThreadGroupGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.LongProperty" name="ThreadGroup.start_time">1068560706000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.threads.ThreadGroup</property>
<testelement class="org.apache.jmeter.control.LoopController" name="ThreadGroup.main_controller">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.control.gui.LoopControlPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="LoopController.loops">250</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.control.LoopController</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Loop Controller</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="LoopController.continue_forever">false</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">/lex/action Thread Group</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.LongProperty" name="ThreadGroup.end_time">1068560706000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ThreadGroup.num_threads">1</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ThreadGroup.scheduler">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ThreadGroup.ramp_time">1</property>
</testelement>
<node>
<testelement class="org.apache.jmeter.config.ConfigTestElement">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.path"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.ConfigTestElement</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">HTTP Request Defaults</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.domain">haley.local</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.protocol">http</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.port">2020</property>
<testelement class="org.apache.jmeter.config.Arguments" name="HTTPsampler.Arguments">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.ArrayList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.protocol.http.sampler.HTTPSampler">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.path">/lex/action</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.protocol.http.sampler.HTTPSampler</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.encoded_path">/lex/action</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.method">GET</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.use_keepalive">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.protocol"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.image_parser">false</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPSampler.follow_redirects">true</property>
<testelement class="org.apache.jmeter.config.Arguments" name="HTTPsampler.Arguments">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.config.Arguments</property>
<collection class="java.util.LinkedList" propType="org.apache.jmeter.testelement.property.CollectionProperty" name="Arguments.arguments">
<testelement class="org.apache.jmeter.protocol.http.util.HTTPArgument" name="">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.metadata">=</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.value">menu</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPArgument.use_equals">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="Argument.name">cmd</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="HTTPArgument.always_encode">false</property>
</testelement>
</collection>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Argument List</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
</testelement>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.port"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.mimetype"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.FILE_FIELD"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">cmd=menu</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.domain"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="HTTPSampler.FILE_NAME"/>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.reporters.ResultCollector">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.visualizers.ViewResultsFullVisualizer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.reporters.ResultCollector</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">View Results Tree</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="filename"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ResultCollector.error_logging">false</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.reporters.ResultCollector">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.visualizers.StatVisualizer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.reporters.ResultCollector</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Aggregate Report</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="filename"/>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="ResultCollector.error_logging">false</property>
</testelement>
</node>
<node>
<testelement class="org.apache.jmeter.timers.UniformRandomTimer">
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.gui_class">org.apache.jmeter.timers.gui.UniformRandomTimerGui</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.test_class">org.apache.jmeter.timers.UniformRandomTimer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="TestElement.name">Uniform Random Timer</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.BooleanProperty" name="TestElement.enabled">true</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="RandomTimer.range">1000</property>
<property xml:space="preserve" propType="org.apache.jmeter.testelement.property.StringProperty" name="ConstantTimer.delay">2000</property>
</testelement>
</node>
</node>
</node>

View file

@ -1,165 +0,0 @@
/* ID Selectors */
#label
{
}
#message
{
}
#results
{
}
#toc
{
padding: 0;
}
#helper
{
background-color: #99ccff;
border: solid 1px gray;
padding: 2px 0 2px 2px;
}
#recentTerms h3
{
margin-bottom: 2px;
}
#recentTerms p
{
margin-top: 2px;
}
#termChildren, #defChildren, #subdefChildren
{
}
#columnLeft select, #columnLeft input, #columnRight select, #columnRight input
{
width: 120px !important;
}
#columnCenter p
{
text-align: justify;
}
#newCompForm, #preferencesForm
{
background-color: #99ccff;
border: black solid 1px;
margin: 8px 8px 8px 8px !important;
}
#newCompForm input, select, textarea
{
margin: 5px 5px 5px 5px;
}
/* Class Selectors.*/
ul.navLinks
{
list-style-type: none;
margin: 0 0 0 6px !important;
padding: 0 0 0 0;
}
ul.navLinks li
{
display: inline;
margin: 0 0 0 0 !important;
padding: 0 0 0 0;
}
.highlightBox ol
{
margin: 0 0 0 20px;
}
.label
{
font-weight: bold;
}
.compEditOptions
{
padding: 3px 3px 0px 3px;
margin: 0;
float: right;
display: block;
background-color: #99ccff;
border-right: 1px solid gray;
border-bottom: 1px solid gray;
border-left: 1px solid gray;
}
.data
{
border-top: 1px solid gray;
padding-top: 0;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
}
a.meta img, .data img
{
margin-right: 2px;
vertical-align: middle;
}
.metadata
{
display: none;
margin-left: 1.5em;
margin-top: .5em;
}
.data input
{
padding: 0px;
}
/* CSS Rollovers */
p.data a:hover
{
/*
Don't Remove bgcolor and color or rollover will not work on IE Windows
These CSS Rollovers do not work on IE Mac. but they do work on Mozilla Mac
*/
text-decoration: none;
background-color: white;
color: #003366;
}
p.data a:link span.metadata
{
display: none;
}
p.data a:visited span.metadata
{
display: none;
}
p.data a:hover span.metadata
{
text-decoration: none !important;
position: absolute;
margin: 5px 0px 0px 20px;
background-color: beige;
max-width: 300px;
padding: 2px 10px 2px 10px;
border: 1px solid #C0C0C0;
text-align:left;
display: block;
}
/* p.data a:hover span.translation span.metadata, p.data a:hover span.analysis span.metadata
{
width: 300px;
} */
/* END OF CSS*/

View file

@ -1,136 +0,0 @@
/* IMPORTS */
@import url( "thdl-styles.css" );
@import url( "lex-advanced.css" );
#main input, #main textarea, #main p, #main li
{ /*--------- '*' = everything -------------*/
font-family: 'Arial Unicode MS', 'Lucida Grande', sans-serif !important;
}
h1
{
font-size: 1.5em;
text-transform: none;
}
ol
{
list-style-type: none;
}
ol ol
{
list-style-type: decimal;
}
ol ol ol
{
list-style-type: lower-alpha;
}
ol ol ol ol
{
list-style-type: none;
}
#results ol
{
list-style-type: decimal;
}
ol.notes
{
list-style-type: lower-roman;
}
ul
{
list-style-type: disc;
}
ol, ul, li
{
clear: right;
margin-right: 0px !important;
padding-right: 0 !important;
margin-left: 2px !important;
padding-left: 0 !important;
}
#results ol
{
margin-left: 30px !important;
}
li
{
margin-left: 0 !important;
}
/* ol
{
border: solid 2px black;
}
li ol
{
border: solid 2px yellow;
}
li
{
border: solid 2px red;
} */
li li
{
margin-left: 25px !important;
/* border: solid 2px blue; */
}
div.tmw-block, h1.tmw-block, p.tmw-block
{
margin-top: 1ex !important;
text-align: left !important;
/* border: solid 2px red; */
}
.tmw-block span
{
/* vertical-align: middle; */
}
span.tmw-roman
{
/* margin-top: 1ex;
padding-top: 1ex; */
}
span.tmw {font: 24pt TibetanMachineWeb !important; text-transform: none; }
span.tmw1 {font: 24pt TibetanMachineWeb1 !important; text-transform: none; }
span.tmw2 {font: 24pt TibetanMachineWeb2 !important; text-transform: none; }
span.tmw3 {font: 24pt TibetanMachineWeb3 !important; text-transform: none; }
span.tmw4 {font: 24pt TibetanMachineWeb4 !important; text-transform: none; }
span.tmw5 {font: 24pt TibetanMachineWeb5 !important; text-transform: none; }
span.tmw6 {font: 24pt TibetanMachineWeb6 !important; text-transform: none; }
span.tmw7 {font: 24pt TibetanMachineWeb7 !important; text-transform: none; }
span.tmw8 {font: 24pt TibetanMachineWeb8 !important; text-transform: none; }
span.tmw9 {font: 24pt TibetanMachineWeb9 !important; text-transform: none; }
h1 span.tmw {font-size: 32pt !important; }
h1 span.tmw1 {font-size: 32pt !important; }
h1 span.tmw2 {font-size: 32pt !important; }
h1 span.tmw3 {font-size: 32pt !important; }
h1 span.tmw4 {font-size: 32pt !important; }
h1 span.tmw5 {font-size: 32pt !important; }
h1 span.tmw6 {font-size: 32pt !important; }
h1 span.tmw7 {font-size: 32pt !important; }
h1 span.tmw8 {font-size: 32pt !important; }
h1 span.tmw9 {font-size: 32pt !important; }
/* The following child selectors hide this css from IE 6 and lower which can't re-position without screwing up the drawing of the fonts*/
.tmw-block>span.tmw-roman, a>span.tmw-roman
{
vertical-align: sub;
}
a.tmw-link:hover
{
background-color: inherit;
}

View file

@ -1,385 +0,0 @@
/*--------
ID Selectors --primarily used for page layout
----------*/
#banner
{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
height : 55px;
background-color: #E5E5E5;
}
#logo
{
position: absolute;
top: 2px;
left: 0;
border: 0;
background-color: transparent;
margin-left : 5px;
width: 50px;
margin-right: 5%;
z-index: 11;
}
#banner h1 {
margin-right: 25%;
position: absolute;
top: 0px;
left: 65px;
color: #003366;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
#menubar {
position: absolute;
top: 33px;
left: 65px;
height: 21px;
}
body>#menubar {
height: 22px;
}
#MenuPos {
height: 22px;
font-size: .9em;
z-index: 2;
}
#sub_banner
{
top: 50px;
padding: 0px 0px 0px 0px;
height : 25px;
background-color: #CCCCCC;
z-index: 1;
}
#breadcrumbs {
position:absolute;
left: 10px;
top: 60px;
font-size: 12px;
}
#search {
margin-right: 13px;
text-align: right;
}
#search form {
font-size: 9px;
margin: 0;
display: inline;
text-align: right;
}
#search form p
{
margin: 0;
display: inline;
text-align: right;
}
/* #sa, #q - These are Google Search form-parameter names */
#sa
{
margin-top: 5px;
padding: 0;
height: 16px;
width: 50px;
background-color: #666666;
color: white;
font-size: 10px;
border-top: solid 1px white;
border-left: solid 1px white;
border-bottom: solid 1px gray;
border-right: solid 1px gray;
}
p>#sa
{
height: 14px;
}
#q
{
padding: 0;
height: 14px;
width: 90px;
font-size: 10px;
border-top: solid 1px silver;
border-left: solid 1px silver;
border-bottom: solid 1px silver;
border-right: solid 1px silver;
}
#main {
/* width: 800px; */
margin: 2px 0 10px 0;
/*background-color : #ffffff; */
}
body>#main {
margin-top: 6px;
}
#columnLeft {
position: absolute;
left:10px;
top:82px;
width:200px;
}
#columnCenter {
font-size: 1em;
margin-left: 216px;
margin-right:216px;
}
#columnRight {
position: absolute;
right:10px;
top:82px;
width:200px;
margin-right: 0;
margin-top: 0px;
}
#columnMain {
background: #ffffff;
margin-left: 216px;
margin-right: 10px;
}
#main p, #columnMain p{
max-width: 700px;
min-width: 10px;
text-align: justify;
}
#main p.illustratedBlurb
{
max-width: none !important;
}
#main ul, #main dl, #main ol {
max-width: 620px;
min-width: 10px;
text-align: justify;
}
#columnLeft p, #columnCenter p, #columnRight p,
#columnLeft ul, #columnCenter ul, #columnRight ul,
#columnLeft ol, #columnCenter ol, #columnRight ol,
#columnLeft dl, #columnCenter dl, #columnRight dl
{
text-align: left;
}
.low-emph, .low-emph * {
color: gray;
text-decoration: none !important;
}
.caption {
font-size: .9em;
font-style: italic;
font-weight: normal;
color: #000033;
}
.smallgray {
font-size: .9em;
font-weight: normal;
color: #333333;
}
.smalllink {
font-size: .9em;
color: #333399;
}
.bodytext {
font-size: 1em;
text-align: justify;
}
.label, .bold {
font-weight: bold;
color: black;
}
.credits {
font-size: 1.1em;
color: #660033;
text-align: justify;
font-weight: bold;
}
.highlightBox, .spotlightBox {
width: 100%;
margin: 5px 0 0 0;
padding: 0 0 0 0;
background-color: #e1e1e1;
border: solid 1px gray;
}
.spotlightBox {
background-color: white;
}
.highlightBox h2, .spotlightBox h2 {
color: white;
background-color: #336699;
margin: 0;
text-align: center;
}
.highlightBox li
{
margin: 2px 0 2px 10px;
}
.highlightBox ul, .highlightBox ol
{
margin: 0 0 0 10px;
padding-left: 0px;
}
.spotlightBox h2 {
color: #000033;
background-color: #E5E5E5;
}
.highlightBox a:hover, #breadcrumbs a:hover {
background-color: white !important;
}
ul.member {
list-style-type: none;
}
.menu0 {
font-size: 1em;
margin-left: 0em;
text-align: left;
color: #FFFFFF;
background-color: #000066;
}
a.menu {
font-size: 1em;
color: #FFFFFF;
}
.selected {
margin: 0px;
font-size: 1em;
font-weight: 900;
color: #009933;
background-color: #ffff99;
padding: .1em;
}
.selected:hover {
background-color: #ffff99 !important;
}
p.illustratedBlurb {
clear: none;
}
div.caption
{
text-align: left !important;
margin-top: 1px !important;
}
div.captionedImage {
float: right;
clear: right;
margin: 4px 0 10px 10px;
}
div.captionedImage img {
float: left;
border: solid 1px gray;
}
div.captionedImage div {
clear: left;
width: 240px;
text-align: center;
margin-top: 20px;
}
div.captionedImageLeft {
float: left;
clear: left;
margin: 0 10px 10px 5px;
}
div.captionedImageLeft img {
float: left;
border: solid 1px gray;
}
div.captionedImageLeft div {
clear: left;
width: 240px;
}
img
{
border: 0;
}
.footer
{
text-align: center;
font-size: .9em;
margin-right: 240px;
margin-left: 240px;
border-top: 1px dotted gray;
}
#main img
{
border: solid 1px silver;
}
img.text-illustration
{
margin: 8px 8px 8px 8px;
float: right;
}

View file

@ -1,108 +0,0 @@
/*------------------
IMPORT STYLESHEETS
This import hides layout rules from the following older browsers
--------------------*/
@import url( "thdl-advanced.css" );
/*-------------
Element Selectors
---------------*/
body {
margin:0 0 0 0;
padding:0 0 0 0;
color: #000033;
background-color: #FFFFFF;
font-size: small;
font-family: Arial, sans-serif !important;
}
a {
color: #0033CC;
border: 0;
text-decoration: none;
}
a:hover {
background-color: #e1e1e1;
}
p, pre {
color: #000033;
font-size: 1em;
margin: 5px 5px 5px 10px;
}
p {
text-align: justify;
margin: 5px 5px 7px 5px;
}
h1, h2, h3, h4, h5, h6 {
font-family: Verdana, sans-serif !important;
font-style: normal;
font-weight: bold;
font-variant: normal;
font-size: 1em;
margin: 5px 5px 5px 3px;
padding:0;
text-transform: none;
line-height: normal;
border-style: none;
}
h1 {
font-size: 1.2em;
text-transform: uppercase;
}
h2 {
font-size: 1.1em;
}
h3 {
font-size: 1em;
}
form {
margin: 0;
padding: 0;
}
li {
margin-top: 5px;
font-size: 1em;
font-style: normal;
font-weight: normal;
color: #000033;
}
blockquote {
font-style: normal;
font-weight: normal;
}
dt {
font-weight: bold;
}
.alert, .warning, .dangerous {
font-style: normal;
color: red;
}
.alert .label, .warning .label, .dangerous .label {
color: red;
}
.message
{
color: #006666;
}
.inline-help
{
color: #006666;
}

View file

@ -1 +0,0 @@
# Default localized resources for DictionaryImporter dictionaryimporter.driverclassname=org.gjt.mm.mysql.Driver dictionaryimporter.url=jdbc:mysql://localhost:3306/lex?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&user=USERNAME&password=PASSWORD

View file

@ -1,40 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/lex-datasource</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!-- <property name="max_fetch_depth">15</property>
-->
<!-- Mapping files -->
<mapping resource="org/thdl/lex/component/LexComponent.hbm.xml"/>
<!-- <mapping resource="org/thdl/lex/component/child/Author.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Dialect.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/EtymologyType.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Function.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/FunctionsGeneral.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/FunctionsSpecific.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Language.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/LiteraryForm.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/LiteraryGenre.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/LiteraryPeriod.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/LiterarySource.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/MajorDialectFamily.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/PhoneticsType.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/ProjectSubject.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Register.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/RelatedTermType.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Script.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/Source.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/SpecificDialect.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/SpellingType.hbm.xml"/>
<mapping resource="org/thdl/lex/component/child/TransitionalDataLabel.hbm.xml"/> -->
</session-factory>
</hibernate-configuration>

View file

@ -1,36 +0,0 @@
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/usr/local/Dictionary/dictionary-hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file lex.log ###
log4j.appender.lex-out=org.apache.log4j.FileAppender
log4j.appender.lex-out.File=/usr/local/Dictionary/dictionary.log
log4j.appender.lex-out.layout=org.apache.log4j.PatternLayout
log4j.appender.lex-out.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ##
log4j.rootLogger=warn, stdout
log4j.logger.net.sf.hibernate=info, file
log4j.logger.org.thdl.lex=info, lex-out
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace
### log JDBC bind parameters ###
#log4j.logger.net.sf.hibernate.type=info
### log prepared statement cache activity ###
#log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=info

View file

@ -1 +0,0 @@
LexConstantsSecure.java

View file

@ -1,143 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 21, 2003
*/
public class AuthenticationFilter implements Filter
{
//attributes
private String loginPage;
//accessors
/**
* Sets the loginPage attribute of the AuthenticationFilter object
*
* @param loginPage The new loginPage value
*/
public void setLoginPage( String loginPage )
{
this.loginPage = loginPage;
}
/**
* Gets the loginPage attribute of the AuthenticationFilter object
*
* @return The loginPage value
*/
public String getLoginPage()
{
return loginPage;
}
//contract methods
/**
* Description of the Method
*
* @param config Description of the Parameter
* @exception ServletException Description of the Exception
*/
public void init( FilterConfig config ) throws ServletException
{
setLoginPage( config.getInitParameter( "loginPage" ) );
if ( null == getLoginPage() )
{
throw new ServletException( "The loginPage parameter must be specified" );
}
}
/**
* Description of the Method
*
* @param request Description of the Parameter
* @param response Description of the Parameter
* @param chain Description of the Parameter
* @exception IOException Description of the Exception
* @exception ServletException Description of the Exception
*/
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException
{
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse )
{
HttpServletRequest req = (HttpServletRequest) request;
Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) );
ThdlUser user = visit.getUser();
if ( null == user )
{
requireLogin( req, (HttpServletResponse) response, req.getSession( true ) );
}
else
{
chain.doFilter( request, response );
}
}
else
{
throw new ServletException( "Filter only applicable to HTTP and HTTPS requests" );
}
}
/**
* Description of the Method
*/
public void destroy() { }
//helper methods
/**
* Description of the Method
*
* @param request Description of the Parameter
* @param response Description of the Parameter
* @param session Description of the Parameter
* @exception IOException Description of the Exception
*/
public void requireLogin( HttpServletRequest request, HttpServletResponse response, HttpSession session ) throws IOException
{
StringBuffer buffer = request.getRequestURL();
String query = request.getQueryString();
Enumeration params = request.getParameterNames();
boolean paramsExist;
if ( params.hasMoreElements() )
{
paramsExist = true;
buffer.append( '?' );
while ( params.hasMoreElements() )
{
String temp = (String) params.nextElement();
buffer.append( temp + "=" + request.getParameter( temp ) );
if ( params.hasMoreElements() )
{
buffer.append( "&" );
}
}
}
else
{
paramsExist = false;
}
UserSessionManager.getInstance().setSessionLoginTarget( session, buffer.toString() );
UserSessionManager.doRedirect( request, response, loginPage );
}
}

View file

@ -1,71 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 21, 2003
*/
public class CharEncFilter implements Filter
{
/**
* Description of the Method
*
* @param config Description of the Parameter
* @exception ServletException Description of the Exception
*/
public void init( FilterConfig config ) throws ServletException
{
}
/**
* Description of the Method
*
* @param request Description of the Parameter
* @param response Description of the Parameter
* @param chain Description of the Parameter
* @exception IOException Description of the Exception
* @exception ServletException Description of the Exception
*/
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException
{
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse )
{
HttpServletResponse res = (HttpServletResponse) response;
HttpServletRequest req = (HttpServletRequest) request;
res.setContentType( "text/html; charset=UTF-8;" );
req.setCharacterEncoding( "UTF-8" );
chain.doFilter( request, response );
}
else
{
throw new ServletException( "Filter only applicable to HTTP and HTTPS requests" );
}
}
/**
* Description of the Method
*/
public void destroy() { }
//helper methods
}

View file

@ -1,349 +0,0 @@
package org.thdl.lex;
import java.text.DateFormat;
import java.util.*;
import org.apache.commons.beanutils.*;
import org.thdl.lex.component.*;
import org.thdl.tib.text.TibetanHTML;
/**
* Description of the Class
*
* @author travis
* @created October 14, 2003
*/
public class DisplayHelper
{
private Collection collection;
private ILexComponent component;
private ILexComponent note;
private Date date;
private final static DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.LONG );
private boolean showNotes;
private boolean showMeta;
private boolean showEditOptions;
private boolean showTranslations;
private String wylie;
/**
* Sets the wylie attribute of the DisplayHelper object
*
* @param wylie The new wylie value
*/
public void setWylie( String wylie )
{
this.wylie = wylie;
}
/**
* Gets the wylie attribute of the DisplayHelper object
*
* @return The wylie value
*/
public String getWylie()
{
return wylie;
}
/**
* Sets the date attribute of the DisplayHelper object
*
* @param date The new date value
*/
public void setDate( Date date )
{
this.date = date;
}
/**
* Gets the date attribute of the DisplayHelper object
*
* @return The date value
*/
public Date getDate()
{
return date;
}
/**
* Sets the note attribute of the DisplayHelper object
*
* @param note The new note value
*/
public void setNote( ILexComponent note )
{
this.note = note;
}
/**
* Gets the note attribute of the DisplayHelper object
*
* @return The note value
*/
public ILexComponent getNote()
{
return note;
}
/**
* Sets the component attribute of the DisplayHelper object
*
* @param component The new component value
*/
public void setComponent( ILexComponent component )
{
this.component = component;
}
/**
* Gets the component attribute of the DisplayHelper object
*
* @return The component value
*/
public ILexComponent getComponent()
{
return component;
}
/**
* Sets the showEditOptions attribute of the DisplayHelper object
*
* @param showEditOptions The new showEditOptions value
*/
public void setShowEditOptions( boolean showEditOptions )
{
this.showEditOptions = showEditOptions;
}
/**
* Gets the showEditOptions attribute of the DisplayHelper object
*
* @return The showEditOptions value
*/
public boolean getShowEditOptions()
{
return showEditOptions;
}
/**
* Sets the showTranslations attribute of the DisplayHelper object
*
* @param showTranslations The new showTranslations value
*/
public void setShowTranslations( boolean showTranslations )
{
this.showTranslations = showTranslations;
}
/**
* Gets the showTranslations attribute of the DisplayHelper object
*
* @return The showTranslations value
*/
public boolean getShowTranslations()
{
return showTranslations;
}
/**
* Sets the showNotes attribute of the DisplayHelper object
*
* @param showNotes The new showNotes value
*/
public void setShowNotes( boolean showNotes )
{
this.showNotes = showNotes;
}
/**
* Sets the showMeta attribute of the DisplayHelper object
*
* @param showMeta The new showMeta value
*/
public void setShowMeta( boolean showMeta )
{
this.showMeta = showMeta;
}
/**
* Gets the showNotes attribute of the DisplayHelper object
*
* @return The showNotes value
*/
public boolean getShowNotes()
{
return showNotes;
}
/**
* Gets the showMeta attribute of the DisplayHelper object
*
* @return The showMeta value
*/
public boolean getShowMeta()
{
return showMeta;
}
/**
* Sets the collection attribute of the DisplayHelper object
*
* @param collection The new collection value
*/
public void setCollection( Collection collection )
{
this.collection = collection;
}
/**
* Gets the collection attribute of the DisplayHelper object
*
* @return The collection value
*/
public Collection getCollection()
{
return collection;
}
//composite properties
/**
* Gets the collectionSize attribute of the DisplayHelper object
*
* @return The collectionSize value
*/
public int getCollectionSize()
{
int size = 0;
if ( null != getCollection() )
{
size = getCollection().size();
}
return size;
}
/**
* Gets the componentIsTranslation attribute of the DisplayHelper object
*
* @return The componentIsTranslation value
*/
public boolean getComponentIsTranslation()
{
boolean b = false;
if ( null != getComponent() && getComponent() instanceof Translatable )
{
Translatable t = (Translatable) getComponent();
b = t.getTranslationOf() != null ? true : false;
}
return b;
}
/**
* Gets the tibetan attribute of the DisplayHelper object
*
* @return The tibetan value
*/
public String getTibetan()
{
return TibetanHTML.getHTML( getWylie() );
}
/**
* Gets the formattedDate attribute of the DisplayHelper object
*
* @return The formattedDate value
*/
public String getFormattedDate()
{
String date = null;
if ( null != getDate() )
{
date = DATE_FORMAT.format( getDate() );
}
return date;
}
// helpers
/**
* Description of the Method
*/
public void clear()
{
setShowEditOptions( false );
setShowMeta( false );
setShowTranslations( false );
setShowNotes( false );
}
/**
* Description of the Method
*
* @param map Description of the Parameter
* @exception Exception Description of the Exception
*/
public void populate( Map map ) throws Exception
{
clear();
BeanUtils.populate( this, map );
}
/**
* Gets the hashCode attribute of the DisplayHelper object
*
* @return The hashCode value
*/
public int getHashCodeForComponent()
{
return getComponent().hashCode();
}
/**
* Gets the hashCodeForCollection attribute of the DisplayHelper object
*
* @return The hashCodeForCollection value
*/
public int getHashCodeForCollection()
{
return getCollection().hashCode();
}
public String getIndexOfComponent()
{
int i = ((List)getCollection()).indexOf( getComponent() ) + 1;
return "" + i;
}
/**
*Constructor for the DisplayHelper object
*/
public DisplayHelper() { }
}

View file

@ -1,212 +0,0 @@
package org.thdl.lex;
import java.io.*;
import java.util.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 20, 2003
*/
public class Global
{
private static long refreshDelay;
private static int recentTermsCount;
private static long lastRefresh;
private int entryCount;
private List recentTerms;
/**
* Gets the lastUpdateAsDate attribute of the LexComponentRepository class
*
* @return The lastUpdateAsDate value
* @exception LexRepositoryException Description of the Exception
*/
public Date getLastUpdate() throws LexRepositoryException
{
Date date = null;
if ( null != getRecentTerms() && getRecentTerms().size() > 0 )
{
ITerm term = (ITerm) getRecentTerms().get( 0 );
date = term.getMeta().getModifiedOn();
}
return date;
}
/**
* Sets the recentTermsCount attribute of the Global object
*
* @param recentTermsCount The new recentTermsCount value
*/
public void setRecentTermsCount( int recentTermsCount )
{
this.recentTermsCount = recentTermsCount;
}
/**
* Sets the refreshDelay attribute of the Global object
*
* @param refreshDelay The new refreshDelay value
*/
public void setRefreshDelay( long refreshDelay )
{
this.refreshDelay = refreshDelay;
}
/**
* Gets the recentTermsCount attribute of the Global object
*
* @return The recentTermsCount value
*/
public int getRecentTermsCount()
{
return recentTermsCount;
}
/**
* Gets the refreshDelay attribute of the Global object
*
* @return The refreshDelay value
*/
public long getRefreshDelay()
{
return refreshDelay;
}
/**
* Sets the entryCount attribute of the Global object
*
* @param entryCount The new entryCount value
*/
public void setEntryCount( int entryCount )
{
this.entryCount = entryCount;
}
/**
* Sets the lastRefresh attribute of the Global object
*
* @param lastRefresh The new lastRefresh value
*/
public void setLastRefresh( long lastRefresh )
{
this.lastRefresh = lastRefresh;
}
/**
* Sets the recentTerms attribute of the Global object
*
* @param recentTerms The new recentTerms value
*/
public void setRecentTerms( List recentTerms )
{
this.recentTerms = recentTerms;
setLastRefresh( System.currentTimeMillis() );
}
/**
* Gets the lastRefresh attribute of the Global object
*
* @return The lastRefresh value
*/
public long getLastRefresh()
{
return lastRefresh;
}
/**
* Gets the recentTerms attribute of the Global object
*
* @return The recentTerms value
* @exception LexRepositoryException Description of the Exception
*/
public List getRecentTerms() throws LexRepositoryException
{
if ( null == recentTerms || requiresRefresh() )
{
refresh();
}
return recentTerms;
}
//helpers
/**
* Description of the Method
*
* @return Description of the Return Value
*/
public boolean requiresRefresh()
{
boolean requiresRefresh = false;
long now = System.currentTimeMillis();
long lastUpdate = LexComponentRepository.getLastUpdate();
long sinceLastRefresh = now - getLastRefresh();
//LexLogger.debug( "Requires Refresh Logic: if " + sinceLastRefresh + " > " + getRefreshDelay() + " && " + lastUpdate + " > " + getLastRefresh() );
if ( sinceLastRefresh > getRefreshDelay() && lastUpdate > getLastRefresh() )
{
requiresRefresh = true;
LexLogger.debug( "Refresh Required at: " + System.currentTimeMillis() );
}
return requiresRefresh;
}
/**
* Description of the Method
*/
public void refresh()
{
try
{
int limit = getRecentTermsCount();
LexLogger.debug( "GlobalRefresher is starting a refresh for the " + limit + " most recent terms." );
setRecentTerms( LexComponentRepository.getRecentTerms( limit ) );
LexLogger.debug( "GlobalRefresher is finished refreshing..." );
LexLogger.debug( "Here's the new recent terms list: " + getRecentTerms().toString() );
LexComponentRepository.cleanup();
LexLogger.info( "GlobalRefresher finished a refresh..." );
}
catch ( Exception e )
{
StringWriter writer = new StringWriter();
e.printStackTrace( new PrintWriter( writer ) );
String stackTrace = writer.getBuffer().toString();
LexLogger.error( "GlobalRefresher Thread caught an Exception: " + stackTrace );
}
}
/**
*Constructor for the Global object
*/
public Global() { }
/**
*Constructor for the Global object
*
* @param refreshDelay Description of the Parameter
* @param recentItems Description of the Parameter
*/
public Global( int recentItems, long refreshDelay )
{
setRecentTermsCount( recentItems );
setRefreshDelay( refreshDelay );
}
}

View file

@ -1,110 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 9, 2003
*/
public class GuestFilter implements Filter
{
//attributes
private String loginPage;
private UserSessionManager sessionMgr;
//accessors
/**
* Sets the loginPage attribute of the GuestFilter object
*
* @param loginPage The new loginPage value
*/
public void setLoginPage( String loginPage )
{
this.loginPage = loginPage;
}
/**
* Gets the loginPage attribute of the GuestFilter object
*
* @return The loginPage value
*/
public String getLoginPage()
{
return loginPage;
}
//contract methods
/**
* Description of the Method
*
* @param config Description of the Parameter
* @exception ServletException Description of the Exception
*/
public void init( FilterConfig config ) throws ServletException
{
}
/**
* Description of the Method
*
* @param request Description of the Parameter
* @param response Description of the Parameter
* @param chain Description of the Parameter
* @exception IOException Description of the Exception
* @exception ServletException Description of the Exception
*/
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException
{
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse )
{
HttpServletRequest req = (HttpServletRequest) request;
Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) );
ThdlUser user = visit.getUser();
if ( null == user )
{
try
{
user = new LexUser();
}
catch ( Exception e )
{
throw new ServletException( e );
}
user.setRoles( "guest" );
visit.setUser( user );
visit.setDisplayMode( "full" );
}
chain.doFilter( request, response );
}
else
{
throw new ServletException( "Filter only applicable to HTTP and HTTPS requests" );
}
}
/**
* Description of the Method
*/
public void destroy() { }
//helper methods
}

View file

@ -1,73 +0,0 @@
package org.thdl.lex;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
/**
* Description of the Class
*
* @author Hibernate WIKI
* @created October 1, 2003
*/
public class HibernateSession
{
private static SessionFactory sessionFactory;
/**
* Description of the Field
*/
public final static ThreadLocal session = new ThreadLocal();
/**
* Description of the Method
*
* @return Description of the Returned Value
* @exception HibernateException Description of Exception
* @since
*/
public static Session currentSession()
throws HibernateException
{
Session s = (Session) session.get();
if ( s == null )
{
// Don't get from JNDI, use a static SessionFactory
if ( sessionFactory == null )
{
// Use default hibernate.cfg.xml
sessionFactory = new Configuration().configure().buildSessionFactory();
}
s = sessionFactory.openSession();
session.set( s );
}
return s;
}
/**
* Description of the Method
*
* @exception HibernateException Description of Exception
* @since
*/
public static void closeSession()
throws HibernateException
{
Session s = (Session) session.get();
session.set( null );
if ( s != null )
{
s.close();
}
}
}

View file

@ -1,242 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;
import java.util.*;
import javax.servlet.ServletException;
// import net.sf.hibernate.tool.hbm2ddl.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// import org.thdl.lex.component.peers.*;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class HibernateTestServlet
extends HttpServlet
{
private SessionFactory sessionFactory;
private Session session;
private Transaction transaction;
/**
* Sets the sessionFactory attribute of the HibernateTestServlet object
*
* @param sessionFactory The new sessionFactory value
* @since
*/
public void setSessionFactory( SessionFactory sessionFactory )
{
this.sessionFactory = sessionFactory;
}
/**
* Sets the session attribute of the HibernateTestServlet object
*
* @param session The new session value
* @since
*/
public void setSession( Session session )
{
this.session = session;
}
/**
* Sets the transaction attribute of the HibernateTestServlet object
*
* @param transaction The new transaction value
* @since
*/
public void setTransaction( Transaction transaction )
{
this.transaction = transaction;
}
/**
* Gets the sessionFactory attribute of the HibernateTestServlet object
*
* @return The sessionFactory value
* @since
*/
public SessionFactory getSessionFactory()
{
return sessionFactory;
}
/**
* Gets the session attribute of the HibernateTestServlet object
*
* @return The session value
* @since
*/
public Session getSession()
{
return session;
}
/**
* Gets the transaction attribute of the HibernateTestServlet object
*
* @return The transaction value
* @since
*/
public Transaction getTransaction()
{
return transaction;
}
/**
* Description of the Method
*
* @param request Description of Parameter
* @param response Description of Parameter
* @exception ServletException Description of Exception
* @exception IOException Description of Exception
* @since
*/
public void doGet( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
{
try
{
initHibernate();
//response.setContentType( "text/html" );
response.setContentType( "text/html;charset=UTF-8;" );
request.setCharacterEncoding( "UTF-8" );
PrintWriter out = response.getWriter();
out.println( "<html><body>" );
beginTransaction();
testQuery( out );
endTransaction( false );
LexLogger.logRequestState( request );
LexLogger.logResponseState( response );
out.println( "</body></html>" );
}
catch ( SQLException e )
{
try
{
getSession().close();
throw new ServletException( e );
}
catch ( HibernateException he )
{
throw new ServletException( he );
}
}
catch ( HibernateException e )
{
try
{
getSession().close();
throw new ServletException( e );
}
catch ( HibernateException he )
{
throw new ServletException( he );
}
}
}
// Helper Methods
/**
* Description of the Method
*
* @exception HibernateException Description of Exception
* @since
*/
private void initHibernate()
throws HibernateException
{
// Load Configuration and build SessionFactory
setSessionFactory( new Configuration().configure().buildSessionFactory() );
}
/**
* Description of the Method
*
* @exception HibernateException Description of Exception
* @since
*/
private void beginTransaction()
throws HibernateException
{
setSession( getSessionFactory().openSession() );
setTransaction( session.beginTransaction() );
}
/**
* Description of the Method
*
* @param commit Description of Parameter
* @exception HibernateException Description of Exception
* @since
*/
private void endTransaction( boolean commit )
throws HibernateException
{
if ( commit )
{
getTransaction().commit();
}
else
{
// Don't commit the transaction, can be faster for read-only operations
getTransaction().rollback();
}
getSession().close();
}
/**
* A unit test for JUnit
*
* @param out Description of Parameter
* @exception SQLException Description of Exception
* @exception HibernateException Description of Exception
* @since
*/
public void testQuery( PrintWriter out )
throws SQLException, HibernateException
{
String queryString = "FROM org.thdl.lex.component.Pronunciation";
Query query = getSession().createQuery( queryString );
for ( Iterator it = query.iterate(); it.hasNext(); )
{
String s = ( (IPronunciation) it.next() ).getPhonetics();
out.println( s + "<br/>" );
LexLogger.debug( "Diacritics Test: " + s );
}
}
}

View file

@ -1,65 +0,0 @@
package org.thdl.lex;
import net.sf.hibernate.*;
import net.sf.hibernate.cfg.*;
/**
* Description of the Class
*
* @author Hibernate WIKI
* @created October 1, 2003
*/
public class HibernateTransaction
{
/**
* Description of the Field
*/
public final static ThreadLocal transaction = new ThreadLocal();
/**
* Description of the Method
*
* @exception HibernateException Description of Exception
* @since
*/
public static void beginTransaction() throws HibernateException
{
Transaction t = (Transaction) transaction.get();
if ( t == null )
{
t = HibernateSession.currentSession().beginTransaction();
transaction.set( t );
}
}
/**
* Description of the Method
*
* @param commit Description of the Parameter
* @exception HibernateException Description of Exception
* @since
*/
public static void endTransaction( boolean commit ) throws HibernateException
{
Transaction t = (Transaction) transaction.get();
transaction.set( null );
if ( t != null )
{
if ( commit )
{
t.commit();
}
else
{
t.rollback();
}
}
}
}

View file

@ -1,243 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.util.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.*;
import org.thdl.lex.commands.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexActionServlet extends HttpServlet
{
//attributes
private HashMap commands;
//accessors
/**
* Sets the commands attribute of the LexActionServlet object
*
* @param commands The new commands value
* @since
*/
public void setCommands( HashMap commands )
{
this.commands = commands;
}
/**
* Gets the commands attribute of the LexActionServlet object
*
* @return The commands value
* @since
*/
public HashMap getCommands()
{
return commands;
}
//helper methods
/**
* Description of the Method
*
* @param config Description of Parameter
* @exception ServletException Description of Exception
* @since
*/
public void init( ServletConfig config ) throws ServletException
{
try
{
super.init( config );
initCommands();
config.getServletContext().setAttribute( "flatData", new LexFlatDataRepository() );
/* LexSourceRepository sources = LexSourceRepository.getInstance();
sources.setOaiServer( config.getServletContext().getInitParameter( "oaiServer" ) );
sources.setOaiMetadataPrefix( config.getServletContext().getInitParameter( "oaiMetadataPrefix" ) );
sources.setOaiHome( config.getServletContext().getInitParameter( "oaiHome" ) );
sources.setOaiLocalCopy( config.getServletContext().getInitParameter( "oaiLocalCopy" ) );
//int oaiDelay = Integer.parseInt( config.getServletContext().getInitParameter( "oaiRefreshDelay" ) );
sources.setOaiRefreshDelay( 24 );
config.getServletContext().setAttribute( "sources", sources ); */
String delay = config.getInitParameter( "globalDataRefreshDelay" );
long refreshDelay = Long.parseLong( delay ) * 1000;
String recent = config.getInitParameter( "recentItems" );
int recentItems = Integer.parseInt( recent );
Global global = new Global( recentItems, refreshDelay );
config.getServletContext().setAttribute( LexConstants.GLOBAL_CONTEXT_ATTR, global );
LexLogger.debugComponent( global );
System.setProperty( "java.awt.headless", "true" );
}
catch ( Exception e )
{
throw new ServletException( e );
}
}
/**
* Description of the Method
*
* @param req Description of Parameter
* @param res Description of Parameter
* @exception ServletException Description of Exception
* @exception IOException Description of Exception
* @since
*/
public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException
{
/*
LexLogger.debug( "Checking Request state at start of LexActionServlet.service()" );
LexLogger.logRequestState( req );
LexLogger.logSessionState( req );
*/
String next;
try
{
String cmd = req.getParameter( LexConstants.COMMAND_REQ_PARAM );
Command command = lookupCommand( cmd );
LexComponent component = (LexComponent) req.getAttribute( LexConstants.COMPONENT_REQ_ATTR );
next = command.execute( req, component );
CommandToken.set( req );
}
catch ( CommandException e )
{
req.setAttribute( "javax.servlet.jsp.jspException", e );
next = LexConstants.ERROR_PAGE;
try
{
LexComponentRepository.cleanup();
}
catch ( LexRepositoryException lre )
{
Exception ex = new Exception( "LexComponentRepository couldn't clean up after Exception because: " + lre.getMessage(), e );
req.setAttribute( "javax.servlet.jsp.jspException", ex );
}
}
catch ( Exception e )
{
req.setAttribute( "javax.servlet.jsp.jspException", e );
next = LexConstants.ERROR_PAGE;
try
{
LexComponentRepository.cleanup();
}
catch ( LexRepositoryException lre )
{
Exception ex = new Exception( "LexComponentRepository couldn't clean up after Exception because: " + lre.getMessage(), e );
req.setAttribute( "javax.servlet.jsp.jspException", ex );
}
}
RequestDispatcher rd;
rd = getServletContext().getRequestDispatcher( LexConstants.JSP_DIR + next );
rd.forward( req, res );
LexLogger.debug( "Checking Request state at end of LexActionServlet.service()" );
LexLogger.logRequestState( req );
LexLogger.debug( "Checking Session state at end of LexActionServlet.service()" );
LexLogger.logSessionState( req );
LexLogger.debug( "Checking Context state at end of LexActionServlet.service()" );
LexLogger.logContextState( getServletContext() );
}
/**
* Description of the Method
*
* @param cmdKey Description of Parameter
* @return Description of the Returned Value
* @exception CommandException Description of Exception
* @since
*/
private Command lookupCommand( String cmdKey ) throws CommandException
{
if ( cmdKey == null )
{
cmdKey = "menu";
}
if ( getCommands().containsKey( cmdKey ) )
{
return (Command) getCommands().get( cmdKey );
}
else
{
throw new CommandException( "Invalid Command Identifier: '" + cmdKey + "'" );
}
}
/**
* Description of the Method
*
* @since
*/
private void initCommands()
{
HashMap commands = new HashMap();
commands.put( "menu", new NullCommand( "menu.jsp" ) );
commands.put( "search", new NullCommand( "search.jsp" ) );
commands.put( "logout", new NullCommand( "logout.jsp" ) );
commands.put( "getMetaPrefsForm", new NullCommand( "metaPrefsForm.jsp" ) );
commands.put( "getMetaDefaultsForm", new NullCommand( "metaDefaultsForm.jsp" ) );
commands.put( "find", new FindCommand( "displayEntry.jsp" ) );
commands.put( "getInsertForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) );
commands.put( "getInsertTermForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.TRUE ) );
commands.put( "getTranslationForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) );
commands.put( "getAnnotationForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) );
commands.put( "getUpdateForm", new GetUpdateFormCommand( "displayForm.jsp?formMode=update", Boolean.FALSE ) );
commands.put( "getUpdateTermForm", new GetUpdateFormCommand( "displayForm.jsp?formMode=update", Boolean.TRUE ) );
/*
commands.put( "getAnnotationForm", new AnnotateCommand( "displayForm.jsp?formMode=insert" ) );
commands.put( "addAnnotation", new AddAnnotationCommand( "displayEntry.jsp", Boolean.TRUE ) );
*/
commands.put( "insert", new InsertCommand( "displayEntry.jsp", Boolean.FALSE ) );
commands.put( "insertTerm", new InsertCommand( "displayEntry.jsp", Boolean.TRUE ) );
commands.put( "update", new UpdateCommand( "displayEntry.jsp", Boolean.FALSE ) );
commands.put( "updateTerm", new UpdateCommand( "displayEntry.jsp", Boolean.TRUE ) );
commands.put( "display", new DisplayCommand( "displayEntry.jsp" ) );
commands.put( "displayFull", new DisplayCommand( "displayEntry.jsp" ) );
commands.put( "editEntry", new DisplayCommand( "displayEntry.jsp" ) );
commands.put( "getRemoveForm", new GetRemoveFormCommand( "displayForm.jsp?formMode=remove", Boolean.FALSE ) );
commands.put( "getRemoveTermForm", new GetRemoveFormCommand( "displayForm.jsp?formMode=remove", Boolean.TRUE ) );
commands.put( "remove", new RemoveCommand( "displayEntry.jsp", Boolean.FALSE ) );
commands.put( "removeTerm", new RemoveCommand( "menu.jsp", Boolean.TRUE ) );
commands.put( "setMetaPrefs", new PreferencesCommand( "menu.jsp" ) );
commands.put( "setMetaDefaults", new PreferencesCommand( "menu.jsp" ) );
commands.put( "refreshSources", new RefreshSourcesCommand( "test.jsp" ) );
commands.put( "abort", new AbortCommand( "menu.jsp" ) );
setCommands( commands );
}
}

View file

@ -1,227 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import java.util.HashMap;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexComponentFilter implements Filter
{
//attributes
private HashMap blanks;
private UserSessionManager sessionMgr;
//accessors
/**
* Sets the blanks attribute of the LexComponentFilter object
*
* @param blanks The new blanks value
* @since
*/
public void setBlanks( HashMap blanks )
{
this.blanks = blanks;
}
/**
* Sets the sessionMgr attribute of the LexComponentFilter object
*
* @param sessionMgr The new sessionMgr value
* @since
*/
public void setSessionManager( UserSessionManager sessionMgr )
{
this.sessionMgr = sessionMgr;
}
/**
* Gets the blanks attribute of the LexComponentFilter object
*
* @return The blanks value
* @since
*/
public HashMap getBlanks()
{
return blanks;
}
/**
* Gets the sessionMgr attribute of the LexComponentFilter object
*
* @return The sessionMgr value
* @since
*/
public UserSessionManager getSessionManager()
{
if ( null == sessionMgr )
{
setSessionManager( UserSessionManager.getInstance() );
}
return sessionMgr;
}
//contract methods
/**
* Description of the Method
*
* @param config Description of Parameter
* @exception ServletException Description of Exception
* @since
*/
public void init( FilterConfig config ) throws ServletException
{
try
{
setBlanks( new HashMap() );
ITerm term = new Term();
getBlanks().put( LexConstants.TERMLABEL_VALUE, term );
getBlanks().put( LexConstants.PRONUNCIATIONLABEL_VALUE, new Pronunciation() );
getBlanks().put( LexConstants.ETYMOLOGYLABEL_VALUE, new Etymology() );
getBlanks().put( LexConstants.FUNCTIONLABEL_VALUE, new GrammaticalFunction() );
getBlanks().put( LexConstants.SPELLINGLABEL_VALUE, new Spelling() );
getBlanks().put( LexConstants.ENCYCLOPEDIA_ARTICLE_LABEL_VALUE, new EncyclopediaArticle() );
getBlanks().put( LexConstants.DEFINITIONLABEL_VALUE, new Definition() );
getBlanks().put( LexConstants.PASSAGELABEL_VALUE, new Passage() );
getBlanks().put( LexConstants.SUBDEFINITIONLABEL_VALUE, new Subdefinition() );
getBlanks().put( LexConstants.TRANSLATIONLABEL_VALUE, new TranslationEquivalent() );
getBlanks().put( LexConstants.KEYWORDLABEL_VALUE, new Keyword() );
getBlanks().put( LexConstants.RELATEDTERMLABEL_VALUE, new RelatedTerm() );
getBlanks().put( LexConstants.MODELSENTENCELABEL_VALUE, new ModelSentence() );
getBlanks().put( LexConstants.REGISTERLABEL_VALUE, new SpeechRegister() );
getBlanks().put( "analyticalNote", new AnalyticalNote() );
getBlanks().put( "transitionalData", new TransitionalData() );
// getBlanks().put( LexConstants.INPUTSESSIONLABEL_VALUE, new Preferences() );
}
// catch (LexComponentException labe)
catch ( Exception labe )
{
throw new ServletException( labe );
}
}
/**
* Description of the Method
*
* @param request Description of Parameter
* @param response Description of Parameter
* @param chain Description of Parameter
* @exception IOException Description of Exception
* @exception ServletException Description of Exception
* @since
*/
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException
{
long start = System.currentTimeMillis();
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse )
{
HttpServletResponse res = (HttpServletResponse) response;
HttpServletRequest req = (HttpServletRequest) request;
res.setContentType( "text/html; charset=UTF-8;" );
req.setCharacterEncoding( "UTF-8" );
if ( null != req.getParameter( LexConstants.LABEL_REQ_PARAM ) )
{
String labelValue = req.getParameter( LexConstants.LABEL_REQ_PARAM );
try
{
if ( getBlanks().get( labelValue ) != null )
{
Class c = getBlanks().get( labelValue ).getClass();
LexComponent component = (LexComponent) c.newInstance();
component.populate( req.getParameterMap() );
component.getMeta().populate( req.getParameterMap() );
req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component );
}
else
{
LexLogger.error( "componentLabel was not in blank components" );
}
}
catch ( InstantiationException ie )
{
throw new ServletException( ie );
}
catch ( IllegalAccessException iae )
{
throw new ServletException( iae );
}
catch ( LexComponentException lce )
{
throw new ServletException( lce );
}
}
else
{
LexLogger.error( "Required parameter, '" + LexConstants.LABEL_REQ_PARAM + "' was not specified." );
}
chain.doFilter( request, response );
HttpServletResponse resp = (HttpServletResponse) response;
resp.setContentType( "text/html; charset=UTF-8;" );
LexLogger.logResponseState( resp );
try
{
LexComponentRepository.cleanup();
}
catch ( LexRepositoryException lre )
{
throw new ServletException( lre );
}
/*
LexLogger.debug( "Checking Request state at end of LexComponentFilter.doFilter()" );
LexLogger.logRequestState( req );
LexLogger.logSessionState( req );
*/
long dur = System.currentTimeMillis() - start;
LexLogger.debug( "Total Request took: " + dur / 1000 + " seconds.\n\n" );
}
else
{
throw new ServletException( "Filter only applicable to HTTP and HTTPS requests" );
}
}
/**
* Description of the Method
*
* @since
*/
public void destroy() { }
//helper methods
//constructors
/**
* Constructor for the LexComponentFilter object
*
* @since
*/
public LexComponentFilter() { }
}

View file

@ -1,942 +0,0 @@
package org.thdl.lex;
import java.sql.*;
import java.util.*;
import net.sf.hibernate.*;
import org.apache.log4j.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexComponentRepository
{
/**
* Description of the Field
*/
public final static String EXACT = "exact";
/**
* Description of the Field
*/
public final static String STARTS_WITH = "startsWith";
/**
* Description of the Field
*/
public final static String ANYWHERE = "anywhere";
private static long start;
private static long lastUpdate = now();
/**
* Sets the lastUpdate attribute of the LexComponentRepository class
*
* @param last The new lastUpdate value
*/
public static void setLastUpdate( long last )
{
lastUpdate = last;
}
/**
* Gets the lastUpdate attribute of the LexComponentRepository class
*
* @return The lastUpdate value
*/
public static long getLastUpdate()
{
return lastUpdate;
}
/**
* Sets the start attribute of the LexComponentRepository object
*
* @param startTime The new start value
* @since
*/
private static void setStart( long startTime )
{
Logger logger = Logger.getLogger( "org.thdl.lex" );
logger.debug( "Query start time: " + new java.util.Date( startTime ) );
start = startTime;
}
/**
* Gets the start attribute of the LexComponentRepository object
*
* @return The start value
* @since
*/
private static long getStart()
{
return start;
}
/**
* Gets the duration attribute of the LexComponentRepository class
*
* @return The duration value
*/
private static long getDuration()
{
long duration = now() - getStart();
Logger logger = Logger.getLogger( "org.thdl.lex" );
logger.debug( "Query finish: " + new java.util.Date( now() ) );
logger.debug( "Query duration in ms: " + duration );
logger.info( "Query duration: " + duration / 1000 + " seconds." );
return duration;
}
/**
* Gets the session attribute of the LexComponentRepository class
*
* @return The session value
* @exception HibernateException Description of Exception
* @since
*/
protected static Session getSession() throws HibernateException
{
Session session = HibernateSession.currentSession();
if ( !session.isConnected() )
{
//session.reconnect();
}
return session;
}
/**
* Description of the Method
*
* @exception LexRepositoryException Description of the Exception
*/
protected static void beginTransaction() throws LexRepositoryException
{
try
{
HibernateTransaction.beginTransaction();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param commit Description of Parameter
* @exception LexRepositoryException Description of the Exception
* @since
*/
protected static void endTransaction( boolean commit ) throws LexRepositoryException
{
try
{
HibernateTransaction.endTransaction( commit );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @return Description of the Returned Value
* @since
*/
private static long now()
{
return System.currentTimeMillis();
}
/**
* Description of the Method
*
* @param comp Description of Parameter
* @return Description of the Returned Value
* @exception LexRepositoryException Description of Exception
* @since
*/
private static ITerm assertTerm( ILexComponent comp ) throws LexRepositoryException
{
ITerm term = null;
try
{
term = (ITerm) comp;
}
catch ( Exception e )
{
throw new LexRepositoryException( "Query Component was not a term." );
}
return term;
}
/**
* Queries the database for Terms that start with the string in the term
* property of the queryComponent. Sets entry property the first hit returned.
*
* @param lexQuery Description of Parameter
* @exception LexRepositoryException Description of Exception
* @since
*/
public static void findTermsByTerm( LexQuery lexQuery ) throws LexRepositoryException
{
setStart( now() );
beginTransaction();
ITerm term = assertTerm( lexQuery.getQueryComponent() );
if ( null == term.getTerm() )
{
throw new LexRepositoryException( "Query Component term was null." );
}
Query query = null;
Iterator it = null;
/* String termForQuery = LexUtilities.hqlEscape( term.getTerm() );
LexLogger.debug( "Escaped term string: " + termForQuery ); */
String termForQuery = term.getTerm();
if ( lexQuery.getFindMode().equals( LexComponentRepository.STARTS_WITH ) )
{
termForQuery = termForQuery + "%";
}
else if ( lexQuery.getFindMode().equals( LexComponentRepository.ANYWHERE ) )
{
termForQuery = "%" + termForQuery + "%";
}
String queryString = " FROM org.thdl.lex.component.ITerm as term WHERE term.term like :term AND term.deleted=0 ORDER BY term";
try
{
query = getSession().createQuery( queryString );
query.setString( "term", termForQuery );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
try
{
it = query.iterate();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
if ( it.hasNext() )
{
term = (ITerm) it.next();
lexQuery.setEntry( term );
lexQuery.getResults().clear();
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
}
else
{
lexQuery.setEntry( null );
lexQuery.getResults().clear();
}
while ( it.hasNext() )
{
term = (ITerm) it.next();
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
}
endTransaction( false );
lexQuery.setDuration( getDuration() );
}
/**
* Description of the Method
*
* @param pk Description of the Parameter
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
*/
public static ITerm findTermByPk( Integer pk ) throws LexRepositoryException
{
ITerm term = null;
beginTransaction();
String queryString = " FROM org.thdl.lex.component.ITerm as term WHERE term.metaId = " + pk.toString();
try
{
Query query = getSession().createQuery( queryString );
term = (ITerm) query.uniqueResult();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
return term;
}
public static List getAllTerms( ) throws LexRepositoryException
{
List terms = null;
beginTransaction();
String queryString = " FROM org.thdl.lex.component.ITerm";
try
{
Query query = getSession().createQuery( queryString );
terms = query.list();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
return terms;
}
/**
* Description of the Method
*
* @param lexQuery Description of the Parameter
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
*/
public static Map findTermsByMeta( LexQuery lexQuery ) throws LexRepositoryException
{
Logger logger = Logger.getLogger( "org.thdl.lex" );
ITerm term = assertTerm( lexQuery.getQueryComponent() );
Map terms = new HashMap();
ILexComponent comp = null;
ITerm aTerm;
Query query = null;
Iterator it = null;
setStart( now() );
beginTransaction();
if ( null == term.getMeta() )
{
throw new LexRepositoryException( "Query Component term.meta was null." );
}
if ( logger.isDebugEnabled() )
{
logger.debug( "Tibetan Dictionary begin query!" );
}
String queryString = "select term from org.thdl.lex.component.Term as term "
//join term collections
+ " join term.pronunciations as pron "
+ " join term.etymologies as ety "
+ " join term.spellings as sp "
+ " join term.functions as func "
+ " join term.encyclopediaArticles as ency "
+ " join term.transitionalData as transData "
+ " join term.definitions as def "
+ " join term.glosses as glo "
+ " join term.keywords as key "
+ " join term.translationEquivalents as trans "
+ " join term.relatedTerms as rel "
+ " join term.passages as pass "
+ " join term.registers as reg "
//join def collections
+ " join def.subdefinitions as sub "
+ " join def.glosses as gloDef "
+ " join def.keywords as keyDef "
+ " join def.modelSentences as modDef "
+ " join def.translationEquivalents as transDef "
+ " join def.relatedTerms as relDef "
+ " join def.passages as passDef "
+ " join def.registers as regDef "
//join subdef collections
+ " join sub.glosses as gloSub "
+ " join sub.keywords as keySub "
+ " join sub.modelSentences as modSub "
+ " join sub.translationEquivalents as transSub "
+ " join sub.relatedTerms as relSub "
+ " join sub.passages as passSub "
+ " join sub.registers as regSub "
// join translation collections
/* + " join ety.translations as etyTrans "
+ " join term.definitions.translations as defTrans "
+ " join term.modelSentences.translations as modTrans "
+ " join term.passages.translations as passTrans "
+ " join def.subdefinition.translations as subTrans "
+ " join def.modelSentences.translations as modDefTrans "
+ " join def.passages.translations as passDefTrans "
+ " join sub.modelSentences.translations as modSubTrans "
+ " join sub.passages.translations as passSubTrans " */
//restrict by projectSubject in createdByProjSub
+ " where term.meta.createdByProjSub = :projSub"
+ " or pron.meta.createdByProjSub = :projSub"
+ " or ety.meta.createdByProjSub = :projSub"
+ " or sp.meta.createdByProjSub = :projSub"
+ " or func.meta.createdByProjSub = :projSub"
+ " or ency.meta.createdByProjSub = :projSub"
+ " or transData.meta.createdByProjSub = :projSub"
+ " or def.meta.createdByProjSub = :projSub"
+ " or glo.meta.createdByProjSub = :projSub"
+ " or key.meta.createdByProjSub = :projSub"
+ " or trans.meta.createdByProjSub = :projSub"
+ " or rel.meta.createdByProjSub = :projSub"
+ " or pass.meta.createdByProjSub = :projSub"
+ " or reg.meta.createdByProjSub = :projSub"
+ " or sub.meta.createdByProjSub = :projSub"
+ " or gloDef.meta.createdByProjSub = :projSub"
+ " or keyDef.meta.createdByProjSub = :projSub"
+ " or modDef.meta.createdByProjSub = :projSub"
+ " or transDef.meta.createdByProjSub = :projSub"
+ " or relDef.meta.createdByProjSub = :projSub"
+ " or passDef.meta.createdByProjSub = :projSub"
+ " or regDef.meta.createdByProjSub = :projSub"
+ " or gloSub.meta.createdByProjSub = :projSub"
+ " or keySub.meta.createdByProjSub = :projSub"
+ " or modSub.meta.createdByProjSub = :projSub"
+ " or transSub.meta.createdByProjSub = :projSub"
+ " or relSub.meta.createdByProjSub = :projSub"
+ " or passSub.meta.createdByProjSub = :projSub"
+ " or regSub.meta.createdByProjSub = :projSub"
/* + " or etyTrans.meta.createdByProjSub = :projSub"
+ " or defTrans.meta.createdByProjSub = :projSub"
+ " or modTrans.meta.createdByProjSub = :projSub"
+ " or passTrans.meta.createdByProjSub = :projSub"
+ " or subTrans.meta.createdByProjSub = :projSub"
+ " or modDefTrans.meta.createdByProjSub = :projSub"
+ " or passDefTrans.meta.createdByProjSub = :projSub"
+ " or modSubTrans.meta.createdByProjSub = :projSub"
+ " or passSubTrans.meta.createdByProjSub = :projSub" */
//restrict by projectSubject in modifiedByProjSub
+ " or term.meta.modifiedByProjSub = :projSub"
+ " or pron.meta.modifiedByProjSub = :projSub"
+ " or ety.meta.modifiedByProjSub = :projSub"
+ " or sp.meta.modifiedByProjSub = :projSub"
+ " or func.meta.modifiedByProjSub = :projSub"
+ " or ency.meta.modifiedByProjSub = :projSub"
+ " or transData.meta.modifiedByProjSub = :projSub"
+ " or def.meta.modifiedByProjSub = :projSub"
+ " or glo.meta.modifiedByProjSub = :projSub"
+ " or key.meta.modifiedByProjSub = :projSub"
+ " or trans.meta.modifiedByProjSub = :projSub"
+ " or rel.meta.modifiedByProjSub = :projSub"
+ " or pass.meta.modifiedByProjSub = :projSub"
+ " or reg.meta.modifiedByProjSub = :projSub"
+ " or sub.meta.modifiedByProjSub = :projSub"
+ " or gloDef.meta.modifiedByProjSub = :projSub"
+ " or keyDef.meta.modifiedByProjSub = :projSub"
+ " or modDef.meta.modifiedByProjSub = :projSub"
+ " or transDef.meta.modifiedByProjSub = :projSub"
+ " or relDef.meta.modifiedByProjSub = :projSub"
+ " or passDef.meta.modifiedByProjSub = :projSub"
+ " or regDef.meta.modifiedByProjSub = :projSub"
+ " or gloSub.meta.modifiedByProjSub = :projSub"
+ " or keySub.meta.modifiedByProjSub = :projSub"
+ " or modSub.meta.modifiedByProjSub = :projSub"
+ " or transSub.meta.modifiedByProjSub = :projSub"
+ " or relSub.meta.modifiedByProjSub = :projSub"
+ " or passSub.meta.modifiedByProjSub = :projSub"
+ " or regSub.meta.modifiedByProjSub = :projSub"
/* + " or etyTrans.meta.modifiedByProjSub = :projSub"
+ " or defTrans.meta.modifiedByProjSub = :projSub"
+ " or modTrans.meta.modifiedByProjSub = :projSub"
+ " or passTrans.meta.modifiedByProjSub = :projSub"
+ " or subTrans.meta.modifiedByProjSub = :projSub"
+ " or modDefTrans.meta.modifiedByProjSub = :projSub"
+ " or passDefTrans.meta.modifiedByProjSub = :projSub"
+ " or modSubTrans.meta.modifiedByProjSub = :projSub"
+ " or passSubTrans.meta.modifiedByProjSub = :projSub";*/
+"";
try
{
query = getSession().createQuery( queryString );
query.setMaxResults( 100 );
query.setInteger( "projSub", lexQuery.getQueryComponent().getMeta().getCreatedByProjSub().intValue() );
logger.debug( "About to list query" );
List list = query.list();
logger.debug( "results size: " + list.size() );
it = list.iterator();
logger.debug( "Starting to add terms to map" );
while ( it.hasNext() )
{
aTerm = (ITerm) comp;
logger.debug( "successfully cast comp to an ITerm" );
Integer id = aTerm.getMetaId();
String tm = aTerm.getTerm();
terms.put( id, tm );
}
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
lexQuery.setDuration( getDuration() );
return terms;
}
public static Map findTermsByMetaViaLc( LexQuery lexQuery ) throws LexRepositoryException
{
Logger logger = Logger.getLogger( "org.thdl.lex" );
ITerm term = assertTerm( lexQuery.getQueryComponent() );
Map terms = new HashMap();
ILexComponent comp = null;
ITerm aTerm;
Query query = null;
Iterator it = null;
setStart( now() );
beginTransaction();
if ( null == term.getMeta() )
{
throw new LexRepositoryException( "Query Component term.meta was null." );
}
if ( logger.isDebugEnabled() )
{
logger.debug( "Tibetan Dictionary begin query!" );
}
String queryString = "from org.thdl.lex.component.LexComponent as comp where comp.meta.createdByProjSub=:projSub";
try
{
query = getSession().createQuery( queryString );
//query.setMaxResults( 100 );
query.setInteger( "projSub", lexQuery.getQueryComponent().getMeta().getCreatedByProjSub().intValue() );
logger.debug( "About to list query" );
List list = query.list();
logger.debug( "results size: " + list.size() );
it = list.iterator();
while ( it.hasNext() )
{
logger.debug( "Starting quest for a term parent" );
comp = (ILexComponent) it.next();
int safetyFirst = 0;
parentSearch:while ( !( comp instanceof ITerm ) && comp != null )
{
logger.debug( "comp class: " + comp.getClass().getName() );
comp = comp.getParent();
if ( comp instanceof ITerm )
{
try
{
aTerm = (ITerm) comp;
terms.put( aTerm.getMetaId(), aTerm.getTerm() );
logger.debug( "successfully cast comp to an ITerm" );
}
catch ( ClassCastException cce )
{
logger.debug( "LCR caught ClassCastException Failed cast of " +comp.toString() + " to ITerm" );
throw cce;
}
}
safetyFirst++;
if ( safetyFirst > 10 )
{
logger.debug( "could not find an ITerm parent for component: " + comp );
break parentSearch;
}
}
}
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
lexQuery.setDuration( getDuration() );
return terms;
}
/**
* Description of the Method
*
* @param term Description of the Parameter
* @exception LexRepositoryException Description of Exception
* @since
*/
public static void loadTerm( ITerm term ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().load( term, term.getMetaId() );
endTransaction( false );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param lexQuery Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void loadTermByPk( LexQuery lexQuery ) throws LexRepositoryException
{
beginTransaction();
ITerm term = assertTerm( lexQuery.getQueryComponent() );
loadTerm( term );
lexQuery.setEntry( term );
if ( !lexQuery.getResults().containsKey( term.getMetaId() ) )
{
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
}
endTransaction( false );
}
public static ITerm loadTermByTerm( String term ) throws LexRepositoryException
{
ITerm returnTerm = null;
beginTransaction();
String queryString = " FROM org.thdl.lex.component.ITerm as theTerm where theTerm.term = :term";
try
{
Query query = getSession().createQuery( queryString );
query.setString( "term", term );
returnTerm = (ITerm) query.uniqueResult();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
return returnTerm;
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void loadByPk( ILexComponent component ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().load( component, component.getMetaId() );
endTransaction( false );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @param pk Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void loadByPk( ILexComponent component, Integer pk ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().load( component, pk );
endTransaction( false );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Gets the recentTerms attribute of the LexComponentRepository class
*
* @param limit Description of the Parameter
* @return The recentTerms value
* @exception LexRepositoryException Description of the Exception
*/
public static List getRecentTerms( int limit ) throws LexRepositoryException
{
Query query = null;
List results = null;
String queryString = " FROM org.thdl.lex.component.ITerm ORDER BY modifiedOn DESC LIMIT " + limit;
try
{
beginTransaction();
query = getSession().createQuery( queryString );
results = query.list();
endTransaction( false );
getSession().clear();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
return results;
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void save( ILexComponent component ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().saveOrUpdate( component );
endTransaction( true );
setLastUpdate( now() );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void update( ILexComponent component ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().update( component );
endTransaction( true );
setLastUpdate( now() );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void remove( ILexComponent component ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().delete( component );
endTransaction( true );
setLastUpdate( now() );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @param component Description of the Parameter
* @exception LexRepositoryException Description of the Exception
*/
public static void refresh( ILexComponent component ) throws LexRepositoryException
{
try
{
beginTransaction();
getSession().refresh( component );
endTransaction( true );
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
/**
* Description of the Method
*
* @exception LexRepositoryException Description of Exception
* @since
*/
public static void cleanup() throws LexRepositoryException
{
try
{
endTransaction( false );
HibernateSession.closeSession();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
}
}
/*
/join term collections
+ " join term.pronunciations as pron "
+ " join term.etymologies as ety "
+ " join term.spellings as sp "
+ " join term.functions as func "
+ " join term.encyclopediaArticles as ency "
+ " join term.transitionalData as trans "
+ " join term.definitions as def "
+ " join term.glosses as glo "
+ " join term.keywords as key "
+ " join term.translationEquivalents as trans "
+ " join term.relatedTerms as rel "
+ " join term.passages as pass "
+ " join term.registers as reg "
join def collections
+ " join def.subdefinitions as sub "
+ " join def.glosses as gloDef "
+ " join def.keywords as keyDef "
+ " join def.modelSentences as modDef "
+ " join def.translationEquivalents as transDef "
+ " join def.relatedTerms as relDef "
+ " join def.passages as passDef "
+ " join def.registers as regDef "
join subdef collections
+ " join sub.glosses as gloSub "
+ " join sub.keywords as keySub "
+ " join sub.modelSentences as modSub "
+ " join sub.translationEquivalents as transSub "
+ " join sub.relatedTerms as relSub "
+ " join sub.passages as passSub "
+ " join sub.registers as regSub "
join translation collections
+ " join ety.translations as etyTrans "
+ " join term.definitions.translations as defTrans "
+ " join term.modelSentences.translations as modTrans "
+ " join term.passages.translations as passTrans "
+ " join def.subdefinition.translations as subTrans "
+ " join def.modelSentences.translations as modDefTrans "
+ " join def.passages.translations as passDefTrans "
+ " join sub.modelSentences.translations as modSubTrans "
+ " join sub.passages.translations as passSubTrans "
/restrict by projectSubject in createdByProjSub
+ " where term.meta.createdByProjSub = :projSub"
+ " or pron.meta.createdByProjSub = :projSub"
+ " or ety.meta.createdByProjSub = :projSub"
+ " or sp.meta.createdByProjSub = :projSub"
+ " or func.meta.createdByProjSub = :projSub"
+ " or ency.meta.createdByProjSub = :projSub"
+ " or trans.meta.createdByProjSub = :projSub"
+ " or def.meta.createdByProjSub = :projSub"
+ " or glo.meta.createdByProjSub = :projSub"
+ " or key.meta.createdByProjSub = :projSub"
+ " or trans.meta.createdByProjSub = :projSub"
+ " or rel.meta.createdByProjSub = :projSub"
+ " or pass.meta.createdByProjSub = :projSub"
+ " or reg.meta.createdByProjSub = :projSub"
+ " or subDef.meta.createdByProjSub = :projSub"
+ " or gloDef.meta.createdByProjSub = :projSub"
+ " or keyDef.meta.createdByProjSub = :projSub"
+ " or modDef.meta.createdByProjSub = :projSub"
+ " or transDef.meta.createdByProjSub = :projSub"
+ " or relDef.meta.createdByProjSub = :projSub"
+ " or passDef.meta.createdByProjSub = :projSub"
+ " or regDef.meta.createdByProjSub = :projSub"
+ " or gloSub.meta.createdByProjSub = :projSub"
+ " or keySub.meta.createdByProjSub = :projSub"
+ " or modSub.meta.createdByProjSub = :projSub"
+ " or transSub.meta.createdByProjSub = :projSub"
+ " or relSub.meta.createdByProjSub = :projSub"
+ " or passSub.meta.createdByProjSub = :projSub"
+ " or regSub.meta.createdByProjSub = :projSub"
+ " or etyTrans.meta.createdByProjSub = :projSub"
+ " or defTrans.meta.createdByProjSub = :projSub"
+ " or modTrans.meta.createdByProjSub = :projSub"
+ " or passTrans.meta.createdByProjSub = :projSub"
+ " or subTrans.meta.createdByProjSub = :projSub"
+ " or modDefTrans.meta.createdByProjSub = :projSub"
+ " or passDefTrans.meta.createdByProjSub = :projSub"
+ " or modSubTrans.meta.createdByProjSub = :projSub"
+ " or passSubTrans.meta.createdByProjSub = :projSub"
/restrict by projectSubject in modifiedByProjSub
+ " or term.meta.modifiedByProjSub = :projSub"
+ " or pron.meta.modifiedByProjSub = :projSub"
+ " or ety.meta.modifiedByProjSub = :projSub"
+ " or sp.meta.modifiedByProjSub = :projSub"
+ " or func.meta.modifiedByProjSub = :projSub"
+ " or ency.meta.modifiedByProjSub = :projSub"
+ " or trans.meta.modifiedByProjSub = :projSub"
+ " or def.meta.modifiedByProjSub = :projSub"
+ " or glo.meta.modifiedByProjSub = :projSub"
+ " or key.meta.modifiedByProjSub = :projSub"
+ " or trans.meta.modifiedByProjSub = :projSub"
+ " or rel.meta.modifiedByProjSub = :projSub"
+ " or pass.meta.modifiedByProjSub = :projSub"
+ " or reg.meta.modifiedByProjSub = :projSub"
+ " or subDef.meta.modifiedByProjSub = :projSub"
+ " or gloDef.meta.modifiedByProjSub = :projSub"
+ " or keyDef.meta.modifiedByProjSub = :projSub"
+ " or modDef.meta.modifiedByProjSub = :projSub"
+ " or transDef.meta.modifiedByProjSub = :projSub"
+ " or relDef.meta.modifiedByProjSub = :projSub"
+ " or passDef.meta.modifiedByProjSub = :projSub"
+ " or regDef.meta.modifiedByProjSub = :projSub"
+ " or gloSub.meta.modifiedByProjSub = :projSub"
+ " or keySub.meta.modifiedByProjSub = :projSub"
+ " or modSub.meta.modifiedByProjSub = :projSub"
+ " or transSub.meta.modifiedByProjSub = :projSub"
+ " or relSub.meta.modifiedByProjSub = :projSub"
+ " or passSub.meta.modifiedByProjSub = :projSub"
+ " or regSub.meta.modifiedByProjSub = :projSub"
+ " or etyTrans.meta.modifiedByProjSub = :projSub"
+ " or defTrans.meta.modifiedByProjSub = :projSub"
+ " or modTrans.meta.modifiedByProjSub = :projSub"
+ " or passTrans.meta.modifiedByProjSub = :projSub"
+ " or subTrans.meta.modifiedByProjSub = :projSub"
+ " or modDefTrans.meta.modifiedByProjSub = :projSub"
+ " or passDefTrans.meta.modifiedByProjSub = :projSub"
+ " or modSubTrans.meta.modifiedByProjSub = :projSub"
+ " or passSubTrans.meta.modifiedByProjSub = :projSub";
*/

View file

@ -1,249 +0,0 @@
package org.thdl.lex;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexConstants
{
/*
REQUEST PARAM/ATTR NAMES AND VALUES USED BY LexComponentFilter.java
*/
//form field req params
/**
* Description of the Field
*/
public final static String LABEL_REQ_PARAM = "comp";
/**
* Description of the Field
*/
public final static String TERMLABEL_VALUE = "term";
/**
* Description of the Field
*/
public final static String PRONUNCIATIONLABEL_VALUE = new Pronunciation().getLabel();
/**
* Description of the Field
*/
public final static String SPELLINGLABEL_VALUE = new Spelling().getLabel();
/**
* Description of the Field
*/
public final static String ETYMOLOGYLABEL_VALUE = new Etymology().getLabel();
/**
* Description of the Field
*/
public final static String FUNCTIONLABEL_VALUE = new GrammaticalFunction().getLabel();
/**
* Description of the Field
*/
public final static String ENCYCLOPEDIA_ARTICLE_LABEL_VALUE = new EncyclopediaArticle().getLabel();
/**
* Description of the Field
*/
public final static String DEFINITIONLABEL_VALUE = new Definition().getLabel();
/**
* Description of the Field
*/
public final static String SUBDEFINITIONLABEL_VALUE = new Subdefinition().getLabel();
/**
* Description of the Field
*/
public final static String MODELSENTENCELABEL_VALUE = new ModelSentence().getLabel();
/**
* Description of the Field
*/
public final static String PASSAGELABEL_VALUE = new Passage().getLabel();
/**
* Description of the Field
*/
public final static String TRANSLATIONLABEL_VALUE = new TranslationEquivalent().getLabel();
/**
* Description of the Field
*/
public final static String RELATEDTERMLABEL_VALUE = new RelatedTerm().getLabel();
/**
* Description of the Field
*/
public final static String REGISTERLABEL_VALUE = new SpeechRegister().getLabel();
/**
* Description of the Field
*/
public final static String KEYWORDLABEL_VALUE = new Keyword().getLabel();
/**
* Description of the Field
*/
public final static String PREFERENCESLABEL_VALUE = "preferences";
/**
* Description of the Field
*/
public final static String ANALYTICALNOTELABEL_VALUE = new AnalyticalNote().getLabel();
/**
* Description of the Field
*/
public final static String TRANSITIONALDATALABEL_VALUE = new TransitionalData().getLabel();
/**
* Description of the Field
*/
public final static String GLOSSLABEL_VALUE = new Gloss().getLabel();
/*
REQUEST PARAM NAMES AND VALUES USED BY LexActionServlet.java
*/
/**
* Description of the Field
*/
public final static String COMMAND_REQ_PARAM = "cmd";
/*
REQUEST PARAM NAMES AND VALUES USED BY LoginServlet.java
*/
/**
* Description of the Field
*/
public final static String USERNAME_REQ_PARAM = "username";
/**
* Description of the Field
*/
public final static String PASSWORD_REQ_PARAM = "password";
/*
--------------------------
REQUEST PARAM NAMES USED BY LexComponent.scrapeRequest(req) METHODS
--------------------------
*/
//Meta Data Request Params
/**
* Description of the Field
*/
public final static String NOTE_REQ_PARAM = "note";
/**
* Description of the Field
*/
public final static String LANGUAGE_REQ_PARAM = "language";
/**
* Description of the Field
*/
public final static String TRANSLATIONOF_REQ_PARAM = "translationOf";
/**
* Description of the Field
*/
public final static String DIALECT_REQ_PARAM = "dialect";
/**
* Description of the Field
*/
public final static String SOURCE_REQ_PARAM = "source";
/**
* Description of the Field
*/
public final static String PROJSUB_REQ_PARAM = "projectSubject";
/**
* Description of the Field
*/
public final static String SCRIPT_REQ_PARAM = "script";
//Term Data Request Params
/**
* Description of the Field
*/
public final static String TERM_REQ_PARAM = "term";
/**
* Description of the Field
*/
public final static String TERMID_REQ_PARAM = "termId";
// public static final String SPELLINGNOTE_REQ_PARAM = "spellingNote";
/**
* Description of the Field
*/
public final static String PRECEDENCE_REQ_PARAM = "precedence";
//Definition Data Request Params
/**
* Description of the Field
*/
public final static String SUBDEFINITION_REQ_PARAM = "subdefinition";
//outgoing request attributes to jsp
/**
* Description of the Field
*/
public final static String COMPONENT_REQ_ATTR = "component";
/**
* Description of the Field
*/
public final static String ORIGINALBEAN_REQ_ATTR = "original";
/**
* Description of the Field
*/
public final static String MESSAGE_REQ_ATTR = "message";
//session attributes used by filters, servlet, commands and jsp
/**
* Description of the Field
*/
public final static String USER_SESS_ATTR = "user";
/**
* Description of the Field
*/
public final static String PREFERENCES_SESS_ATTR = "preferences";
/**
* Description of the Field
*/
public final static String LOGINTARGET_SESS_PARAM = "loginTarget";
/**
* Description of the Field
*/
public final static String DISPLAYMODE_SESS_ATTR = "displayMode";
/**
* Description of the Field
*/
public final static String QUERY_SESS_ATTR = "query";
/**
* Description of the Field
*/
public final static String TERMENTRYBEAN_SESS_ATTR = "termEntry";
//used by Servlet
/**
* Description of the Field
*/
public final static String JSP_DIR = "/jsp/";
/**
* Description of the Field
*/
public final static String WELCOME_PAGE = "action?cmd=menu";
/**
* Description of the Field
*/
public final static String ERROR_PAGE = "error.jsp";
//used by Repository
/**
* Description of the Field
*/
public final static String DRIVER = "com.mysql.jdbc.Driver";
/**
* Description of the Field
*/
public final static String DATASOURCE_NAME = "java:comp/env/jdbc/lex-datasource";
/**
* Description of the Field
*/
public final static String HIBERNATE_SESSION_KEY = "hib";
/**
* Description of the Field
*/
public final static String VISIT_SESSION_ATTR = "visit";
/**
* Description of the Field
*/
public final static String GLOBAL_CONTEXT_ATTR = "global";
//public final static String URL = "jdbc:mysql://localhost/LexTorque";
}

View file

@ -1,18 +0,0 @@
package org.thdl.lex;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexConstantsSecure
{
final static String USER = "";
final static String PASSWORD = "";
final static String URL = "jdbc:mysql://localhost/Lex";
//public final static String URL = "jdbc:mysql://localhost/LexTorque";
}

View file

@ -1,755 +0,0 @@
package org.thdl.lex;
import org.thdl.users.ThdlUserRepository;
import java.util.HashMap;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
/**
* Description of the Class
*
* @author travis
* @created December 15, 2003
*/
public class LexFlatDataRepository
{
//attributes
int displayLanguage = 1;//this should default to the id for english from Languages table
private static LexFlatDataRepository instance;
HashMap users;
HashMap userRoles;
HashMap projectSubjects;
HashMap sources;
HashMap languages;
HashMap scripts;
HashMap literarySources;
HashMap transitionalDataLabels;
HashMap dialects;//represents merge table
HashMap majorDialectFamilies;
HashMap specificDialects;
HashMap functionsGeneral;
HashMap functionsSpecific;
HashMap spellingTypes;
HashMap phoneticsTypes;
HashMap relatedTermTypes;
HashMap etymologyTypes;
HashMap registers;
HashMap commentTypes;
//accessors
/**
* Gets the instance attribute of the LexFlatDataRepository class
*
* @return The instance value
*/
public static LexFlatDataRepository getInstance()
{
if ( null == instance )
{
instance = new LexFlatDataRepository();
}
return instance;
}
/**
* Sets the transitionalDataLabels attribute of the LexFlatDataRepository object
*/
public void setTransitionalDataLabels()
{
String sql = "SELECT id, transitionalDataLabel FROM TransitionalDataLabels";
setTransitionalDataLabels( createMap( sql ) );
}
/**
* Sets the transitionalDataLabels attribute of the LexFlatDataRepository object
*
* @param transitionalDataLabels The new transitionalDataLabels value
*/
public void setTransitionalDataLabels( HashMap transitionalDataLabels )
{
this.transitionalDataLabels = transitionalDataLabels;
}
/**
* Gets the transitionalDataLabels attribute of the LexFlatDataRepository object
*
* @return The transitionalDataLabels value
*/
public HashMap getTransitionalDataLabels()
{
return transitionalDataLabels;
}
/**
* Sets the literarySources attribute of the LexFlatDataRepository object
*
* @param literarySources The new literarySources value
*/
public void setLiterarySources( HashMap literarySources )
{
this.literarySources = literarySources;
}
/**
* Sets the literarySources attribute of the LexFlatDataRepository object
*/
public void setLiterarySources()
{
String sql = "SELECT id, sourceNormalizedTitle FROM LiterarySources";
setLiterarySources( createMap( sql ) );
}
/**
* Gets the literarySources attribute of the LexFlatDataRepository object
*
* @return The literarySources value
*/
public HashMap getLiterarySources()
{
return literarySources;
}
/**
* Sets the users attribute of the LexFlatDataRepository object
*
* @param users The new users value
*/
public void setUsers( HashMap users )
{
this.users = users;
}
/**
* Sets the users attribute of the LexFlatDataRepository object
*
* @exception LexRepositoryException Description of the Exception
*/
public void setUsers() throws LexRepositoryException
{
try
{
ThdlUserRepository tr = ThdlUserRepository.getInstance();
setUsers( tr.getUsernameMap() );
}
catch ( Exception e )
{
throw new LexRepositoryException( e );
}
}
/**
* Sets the projectSubjects attribute of the LexFlatDataRepository object
*
* @param projectSubjects The new projectSubjects value
*/
public void setProjectSubjects( HashMap projectSubjects )
{
this.projectSubjects = projectSubjects;
}
/**
* Sets the projectSubjects attribute of the LexFlatDataRepository object
*/
public void setProjectSubjects()
{
String sql = "SELECT id, projectSubject FROM projectSubjects";
setProjectSubjects( createMap( sql ) );
}
/**
* Sets the sources attribute of the LexFlatDataRepository object
*
* @param sources The new sources value
*/
public void setSources( HashMap sources )
{
this.sources = sources;
}
/**
* Sets the sources attribute of the LexFlatDataRepository object
*/
public void setSources()
{
String sql = "SELECT id, sourceTitle FROM Sources";
setSources( createMap( sql ) );
}
/**
* Sets the languages attribute of the LexFlatDataRepository object
*
* @param languages The new languages value
*/
public void setLanguages( HashMap languages )
{
this.languages = languages;
}
/**
* Sets the languages attribute of the LexFlatDataRepository object
*/
public void setLanguages()
{
String sql = "SELECT id,Language FROM Languages";
setLanguages( createMap( sql ) );
}
/**
* Sets the scripts attribute of the LexFlatDataRepository object
*
* @param scripts The new scripts value
*/
public void setScripts( HashMap scripts )
{
this.scripts = scripts;
}
/**
* Sets the scripts attribute of the LexFlatDataRepository object
*/
public void setScripts()
{
String sql = "SELECT id,script FROM scripts";
setScripts( createMap( sql ) );
}
/**
* Gets the users attribute of the LexFlatDataRepository object
*
* @return The users value
* @exception LexRepositoryException Description of the Exception
*/
public HashMap getUsers() throws LexRepositoryException
{
if ( null == users )
{
setUsers();
}
return users;
}
/**
* Gets the projectSubjects attribute of the LexFlatDataRepository object
*
* @return The projectSubjects value
*/
public HashMap getProjectSubjects()
{
return projectSubjects;
}
/**
* Gets the sources attribute of the LexFlatDataRepository object
*
* @return The sources value
*/
public HashMap getSources()
{
return sources;
}
/**
* Gets the languages attribute of the LexFlatDataRepository object
*
* @return The languages value
*/
public HashMap getLanguages()
{
return languages;
}
/**
* Gets the scripts attribute of the LexFlatDataRepository object
*
* @return The scripts value
*/
public HashMap getScripts()
{
return scripts;
}
/**
* Sets the etymologyTypes attribute of the LexFlatDataRepository object
*
* @param etymologyTypes The new etymologyTypes value
*/
public void setEtymologyTypes( HashMap etymologyTypes )
{
this.etymologyTypes = etymologyTypes;
}
/**
* Sets the etymologyTypes attribute of the LexFlatDataRepository object
*/
public void setEtymologyTypes()
{
String sql = "SELECT id, etymologyType FROM EtymologyTypes";
setEtymologyTypes( createMap( sql ) );
}
/**
* Gets the etymologyTypes attribute of the LexFlatDataRepository object
*
* @return The etymologyTypes value
*/
public HashMap getEtymologyTypes()
{
return etymologyTypes;
}
/**
* Sets the spellingTypes attribute of the LexFlatDataRepository object
*/
public void setSpellingTypes()
{
String sql = "SELECT id, spellingType FROM SpellingTypes";
setSpellingTypes( createMap( sql ) );
}
/**
* Sets the spellingTypes attribute of the LexFlatDataRepository object
*
* @param spellingTypes The new spellingTypes value
*/
public void setSpellingTypes( HashMap spellingTypes )
{
this.spellingTypes = spellingTypes;
}
/**
* Gets the spellingTypes attribute of the LexFlatDataRepository object
*
* @return The spellingTypes value
*/
public HashMap getSpellingTypes()
{
return spellingTypes;
}
/**
* Sets the phoneticsTypes attribute of the LexFlatDataRepository object
*/
public void setPhoneticsTypes()
{
String sql = "SELECT id, phoneticsType FROM PhoneticsTypes";
setPhoneticsTypes( createMap( sql ) );
}
/**
* Sets the phoneticsTypes attribute of the LexFlatDataRepository object
*
* @param phoneticsTypes The new phoneticsTypes value
*/
public void setPhoneticsTypes( HashMap phoneticsTypes )
{
this.phoneticsTypes = phoneticsTypes;
}
/**
* Gets the phoneticsTypes attribute of the LexFlatDataRepository object
*
* @return The phoneticsTypes value
*/
public HashMap getPhoneticsTypes()
{
return phoneticsTypes;
}
/**
* Sets the relatedTermTypes attribute of the LexFlatDataRepository object
*/
public void setRelatedTermTypes()
{
String sql = "SELECT id, relatedTermType FROM RelatedTermTypes";
setRelatedTermTypes( createMap( sql ) );
}
/**
* Sets the relatedTermTypes attribute of the LexFlatDataRepository object
*
* @param relatedTermTypes The new relatedTermTypes value
*/
public void setRelatedTermTypes( HashMap relatedTermTypes )
{
this.relatedTermTypes = relatedTermTypes;
}
/**
* Gets the relatedTermTypes attribute of the LexFlatDataRepository object
*
* @return The relatedTermTypes value
*/
public HashMap getRelatedTermTypes()
{
return relatedTermTypes;
}
/**
* Sets the registers attribute of the LexFlatDataRepository object
*/
public void setRegisters()
{
String sql = "SELECT id, register FROM Registers";
setRegisters( createMap( sql ) );
}
/**
* Sets the registers attribute of the LexFlatDataRepository object
*
* @param registers The new registers value
*/
public void setRegisters( HashMap registers )
{
this.registers = registers;
}
/**
* Gets the registers attribute of the LexFlatDataRepository object
*
* @return The registers value
*/
public HashMap getRegisters()
{
return registers;
}
/**
* Sets the functionsGeneral attribute of the LexFlatDataRepository object
*/
public void setFunctionsGeneral()
{
String sql = "SELECT id, functionGeneral FROM FunctionsGeneral";
setFunctionsGeneral( createMap( sql ) );
}
/**
* Sets the functionsGeneral attribute of the LexFlatDataRepository object
*
* @param functionsGeneral The new functionsGeneral value
*/
public void setFunctionsGeneral( HashMap functionsGeneral )
{
this.functionsGeneral = functionsGeneral;
}
/**
* Gets the functionsGeneral attribute of the LexFlatDataRepository object
*
* @return The functionsGeneral value
*/
public HashMap getFunctionsGeneral()
{
return functionsGeneral;
}
/**
* Sets the majorDialectFamilies attribute of the LexFlatDataRepository object
*/
public void setMajorDialectFamilies()
{
String sql = "SELECT id, majorDialectFamily FROM MajorDialectFamilies";
setMajorDialectFamilies( createMap( sql ) );
}
/**
* Sets the majorDialectFamilies attribute of the LexFlatDataRepository object
*
* @param majorDialectFamilies The new majorDialectFamilies value
*/
public void setMajorDialectFamilies( HashMap majorDialectFamilies )
{
this.majorDialectFamilies = majorDialectFamilies;
}
/**
* Gets the majorDialectFamilies attribute of the LexFlatDataRepository object
*
* @return The majorDialectFamilies value
*/
public HashMap getMajorDialectFamilies()
{
return majorDialectFamilies;
}
// accessor methods for HashMap items
/**
* Gets the user attribute of the LexFlatDataRepository object
*
* @param userId Description of the Parameter
* @return The user value
* @exception LexRepositoryException Description of the Exception
*/
public String getUser( int userId ) throws LexRepositoryException
{
return (String) getUsers().get( new Integer( userId ) );
}
/**
* Gets the projectSubject attribute of the LexFlatDataRepository object
*
* @param projSubId Description of the Parameter
* @return The projectSubject value
*/
public String getProjectSubject( int projSubId )
{
return (String) getProjectSubjects().get( new Integer( projSubId ) );
}
/**
* Gets the source attribute of the LexFlatDataRepository object
*
* @param sourceId Description of the Parameter
* @return The source value
*/
public String getSource( int sourceId )
{
return (String) getSources().get( new Integer( sourceId ) );
}
/**
* Gets the language attribute of the LexFlatDataRepository object
*
* @param langId Description of the Parameter
* @return The language value
*/
public String getLanguage( int langId )
{
return (String) getLanguages().get( new Integer( langId ) );
}
/**
* Gets the script attribute of the LexFlatDataRepository object
*
* @param scriptId Description of the Parameter
* @return The script value
*/
public String getScript( int scriptId )
{
return (String) getScripts().get( new Integer( scriptId ) );
}
/**
* Gets the literarySource attribute of the LexFlatDataRepository object
*
* @param litSourceId Description of the Parameter
* @return The literarySource value
*/
public String getLiterarySource( int litSourceId )
{
return (String) getLiterarySources().get( new Integer( litSourceId ) );
}
/**
* Gets the etymologyType attribute of the LexFlatDataRepository object
*
* @param etymType Description of the Parameter
* @return The etymologyType value
*/
public String getEtymologyType( int etymType )
{
return (String) getEtymologyTypes().get( new Integer( etymType ) );
}
/**
* Gets the spellingType attribute of the LexFlatDataRepository object
*
* @param varType Description of the Parameter
* @return The spellingType value
*/
public String getSpellingType( int varType )
{
return (String) getSpellingTypes().get( new Integer( varType ) );
}
/**
* Gets the register attribute of the LexFlatDataRepository object
*
* @param reg Description of the Parameter
* @return The register value
*/
public String getRegister( int reg )
{
return (String) getRegisters().get( new Integer( reg ) );
}
/**
* Gets the functionGeneral attribute of the LexFlatDataRepository object
*
* @param funcGen Description of the Parameter
* @return The functionGeneral value
*/
public String getFunctionGeneral( int funcGen )
{
return (String) getFunctionsGeneral().get( new Integer( funcGen ) );
}
/**
* Gets the majorDialectFamily attribute of the LexFlatDataRepository object
*
* @param dial Description of the Parameter
* @return The majorDialectFamily value
*/
public String getMajorDialectFamily( int dial )
{
return (String) getMajorDialectFamilies().get( new Integer( dial ) );
}
/**
* Gets the transitionalDataLabel attribute of the LexFlatDataRepository object
*
* @param label Description of the Parameter
* @return The transitionalDataLabel value
*/
public String getTransitionalDataLabel( int label )
{
return (String) getTransitionalDataLabels().get( new Integer( label ) );
}
//helpers
/**
* Description of the Method
*
* @param sql Description of the Parameter
* @return Description of the Return Value
*/
public HashMap createMap( String sql )
{
ResultSet rs = null;
HashMap map = new HashMap();
try
{
LexRepository lr = LexRepository.getInstance();
Connection con = lr.getDataSource().getConnection();
rs = con.createStatement().executeQuery( sql );
if ( null != rs )
{
int i = 0;
Integer key = null;
String value = "";
while ( rs.next() )
{
i = rs.getInt( 1 );
key = new Integer( i );
value = rs.getString( 2 );
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
for ( int x = 3; x <= columnCount; x++ )
{
value = value + " " + rs.getString( x );
}
map.put( key, value );
}
}
con.close();
}
catch ( LexRepositoryException lre )
{
lre.printStackTrace();
}
catch ( SQLException sqle )
{
sqle.printStackTrace();
}
return map;
}
//constructors
/**
*Constructor for the LexFlatDataRepository object
*/
public LexFlatDataRepository()
{
setProjectSubjects();
setSources();
setLanguages();
setScripts();
setLiterarySources();
setEtymologyTypes();
setSpellingTypes();
setPhoneticsTypes();
setRelatedTermTypes();
setRegisters();
setFunctionsGeneral();
setMajorDialectFamilies();
setTransitionalDataLabels();
}
//main
/**
* The main program for the LexFlatDataRepository class
*
* @param args The command line arguments
*/
public static void main( String[] args )
{
LexFlatDataRepository lfdr = new LexFlatDataRepository();
//System.out.println( lfdr.getUser( 1 ) );
System.out.println( lfdr.getProjectSubject( 6 ) );
System.out.println( lfdr.getSource( 1 ) );
System.out.println( lfdr.getLanguage( 1 ) );
System.out.println( lfdr.getEtymologyType( 1 ) );
}
}

View file

@ -1,222 +0,0 @@
package org.thdl.lex;
import java.io.*;
import java.util.*;
import javax.servlet.ServletContext;
import javax.servlet.http.*;
import org.apache.commons.beanutils.*;
import org.apache.log4j.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 9, 2003
*/
public class LexLogger
{
private final static Logger LOGGER = Logger.getLogger( "org.thdl.lex" );
private final static List EXCLUDED_PARAMS = Arrays.asList( new String[]{"org.apache.catalina.jsp_classpath", "javax.servlet.context.tempdir", "org.apache.catalina.WELCOME_FILES"} );
/**
* Description of the Method
*
* @param req Description of the Parameter
*/
public static void logRequestState( HttpServletRequest req )
{
Iterator it;
LOGGER.debug( "authType: " + req.getAuthType() );
LOGGER.debug( "characterEncoding: " + req.getCharacterEncoding() );
LOGGER.debug( "contentLength: " + req.getContentLength() );
LOGGER.debug( "contentType: " + req.getContentType() );
LOGGER.debug( "method: " + req.getMethod() );
LOGGER.debug( "pathInfo: " + req.getPathInfo() );
LOGGER.debug( "pathTranslated: " + req.getPathTranslated() );
LOGGER.debug( "protocol: " + req.getProtocol() );
LOGGER.debug( "queryString: " + req.getQueryString() );
LOGGER.debug( "remoteAddr: " + req.getRemoteAddr() );
LOGGER.debug( "remoteHost: " + req.getRemoteHost() );
LOGGER.debug( "remoteUser: " + req.getRemoteUser() );
LOGGER.debug( "requestedSessionId: " + req.getRequestedSessionId() );
LOGGER.debug( "requestedSessionIdFromCookie: " + req.isRequestedSessionIdFromCookie() );
LOGGER.debug( "requestedSessionIdFromURL: " + req.isRequestedSessionIdFromURL() );
LOGGER.debug( "requestedSessionIdValid: " + req.isRequestedSessionIdValid() );
LOGGER.debug( "requestURI: " + req.getRequestURI() );
LOGGER.debug( "scheme: " + req.getScheme() );
LOGGER.debug( "serverName: " + req.getServerName() );
LOGGER.debug( "serverPort: " + req.getServerPort() );
LOGGER.debug( "contextPath: " + req.getContextPath() );
LOGGER.debug( "servletPath: " + req.getServletPath() );
Enumeration enum = req.getParameterNames();
while ( enum.hasMoreElements() )
{
String parm = (String) enum.nextElement();
LOGGER.debug( "Request Parameter: " + parm + " = '" + req.getParameter( parm ) + "'" );
}
enum = req.getAttributeNames();
while ( enum.hasMoreElements() )
{
String att = (String) enum.nextElement();
LOGGER.debug( "Request Attribute: " + att + " =: " + req.getAttribute( att ) );
}
}
/**
* Description of the Method
*
* @param resp Description of the Parameter
*/
public static void logResponseState( HttpServletResponse resp )
{
LOGGER.debug( "RESPONSE STATE" );
LOGGER.debug( "characterEncoding: " + resp.getCharacterEncoding() );
}
/**
* Description of the Method
*
* @param req Description of the Parameter
*/
public static void logSessionState( HttpServletRequest req )
{
HttpSession ses = req.getSession( false );
if ( null == ses )
{
LOGGER.debug( "Session was null" );
return;
}
Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) );
Enumeration enum = ses.getAttributeNames();
while ( enum.hasMoreElements() )
{
String att = (String) enum.nextElement();
LOGGER.debug( "Session Attribute: " + att + " =: " + ses.getAttribute( att ) );
}
if ( null == visit )
{
LOGGER.debug( "Visit was null" );
return;
}
debugComponent( visit );
debugComponent( visit.getQuery() );
debugComponent( visit.getUser() );
}
/**
* Description of the Method
*
* @param context Description of the Parameter
*/
public static void logContextState( ServletContext context )
{
Enumeration enum = context.getAttributeNames();
while ( enum.hasMoreElements() )
{
String att = (String) enum.nextElement();
if ( !EXCLUDED_PARAMS.contains( att ) )
{
LOGGER.debug( "Context Attribute: " + att + " =: " + context.getAttribute( att ) );
}
}
debugComponent( context.getAttribute( LexConstants.GLOBAL_CONTEXT_ATTR ) );
}
/**
* Description of the Method
*
* @param msg Description of the Parameter
*/
public static void info( String msg )
{
LOGGER.info( msg );
}
/**
* Description of the Method
*
* @param msg Description of the Parameter
*/
public static void debug( String msg )
{
LOGGER.debug( msg );
}
/**
* Description of the Method
*
* @param msg Description of the Parameter
*/
public static void warn( String msg )
{
LOGGER.warn( msg );
}
/**
* Description of the Method
*
* @param msg Description of the Parameter
*/
public static void error( String msg )
{
LOGGER.error( msg );
}
/**
*Constructor for the debugComponent object
*
* @param component Description of the Parameter
*/
public static void debugComponent( Object component )
{
if ( null == component )
{
debug( "debugComponent was just handed a null component" );
return;
}
try
{
LOGGER.debug( "Describing: " + component );
String label = component instanceof ILexComponent ? ( (ILexComponent) component ).getLabel() : component.toString();
Iterator it = BeanUtils.describe( component ).entrySet().iterator();
while ( it.hasNext() )
{
Map.Entry entry = (Map.Entry) it.next();
LOGGER.debug( label + " property: " + entry.getKey() + " = '" + entry.getValue() + "'" );
}
}
catch ( Exception e )
{
StringWriter writer = new StringWriter();
e.printStackTrace( new PrintWriter( writer ) );
String stackTrace = writer.getBuffer().toString();
LOGGER.debug( "LexLogger caught an Exception: " + stackTrace );
}
}
/**
* Description of the Method
*
* @param term Description of the Parameter
*/
public static void debugTerm( ITerm term )
{
debugComponent( term );
}
}

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="org.thdl.lex.components.LexQuery" proxy="org.thdl.lex.components.ILexQuery" table="Queries" where="deleted=0">
<meta attribute="generated-class" inherit="false">org.thdl.lex.components.BaseLexQuery</meta>
</class>
</hibernate-mapping>

View file

@ -1,248 +0,0 @@
package org.thdl.lex;
import java.sql.*;
import java.util.*;
import net.sf.hibernate.*;
import org.apache.commons.beanutils.BeanUtils;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class LexQuery
{
private ILexComponent queryComponent;
private ILexComponent updateComponent;
private ITerm entry;
private Map results;
private String findMode;
private long duration;
/**
* Sets the updateComponent attribute of the LexQuery object
*
* @param updateComponent The new updateComponent value
*/
public void setUpdateComponent( ILexComponent updateComponent )
{
this.updateComponent = updateComponent;
}
/**
* Sets the duration attribute of the LexQuery object
*
* @param duration The new duration value
* @since
*/
public void setDuration( long duration )
{
this.duration = duration;
}
/**
* Sets the queryComponent attribute of the LexQuery object
*
* @param queryComponent The new queryComponent value
* @since
*/
public void setQueryComponent( ILexComponent queryComponent )
{
this.queryComponent = queryComponent;
}
/**
* Sets the entry attribute of the LexQuery object
*
* @param entry The new entry value
* @since
*/
public void setEntry( ITerm entry )
{
this.entry = entry;
}
/**
* Sets the findMode attribute of the LexQuery object
*
* @param findMode The new findMode value
* @since
*/
public void setFindMode( String findMode )
{
this.findMode = findMode;
}
/**
* Sets the results attribute of the LexQuery object
*
* @param results The new results value
* @since
*/
public void setResults( Map results )
{
this.results = results;
}
/**
* Gets the updateComponent attribute of the LexQuery object
*
* @return The updateComponent value
*/
public ILexComponent getUpdateComponent()
{
return updateComponent;
}
/**
* Gets the duration attribute of the LexQuery object
*
* @return The duration value
* @since
*/
public long getDuration()
{
return duration / 1000;
}
/**
* Gets the queryComponent attribute of the LexQuery object
*
* @return The queryComponent value
* @since
*/
public ILexComponent getQueryComponent()
{
return queryComponent;
}
/**
* Gets the entry attribute of the LexQuery object
*
* @return The entry value
* @since
*/
public ITerm getEntry()
{
return entry;
}
/**
* Gets the findMode attribute of the LexQuery object
*
* @return The findMode value
* @since
*/
public String getFindMode()
{
return findMode;
}
/**
* Gets the results attribute of the LexQuery object
*
* @return The results value
* @since
*/
public Map getResults()
{
if ( null == results )
{
setResults( new HashMap() );
}
return results;
}
//helper methods
/**
* Description of the Method
*
* @param parameters Description of Parameter
* @exception LexRepositoryException Description of Exception
* @since
*/
public void populate( Map parameters ) throws LexRepositoryException
{
try
{
BeanUtils.populate( this, parameters );
}
catch ( IllegalAccessException iae )
{
throw new LexRepositoryException( iae );
}
catch ( java.lang.reflect.InvocationTargetException ite )
{
throw new LexRepositoryException( ite );
}
}
//constructors
/**
* Constructor for the LexQuery object
*
* @param findMode Description of the Parameter
* @since
*/
public LexQuery( String findMode )
{
setFindMode( findMode );
}
/**
*Constructor for the LexQuery object
*/
public LexQuery()
{
this( LexComponentRepository.STARTS_WITH );
}
/**
*Constructor for the LexQuery object
*
* @param component Description of the Parameter
*/
public LexQuery( ILexComponent component )
{
this();
setQueryComponent( component );
}
/**
*Constructor for the LexQuery object
*
* @param component Description of the Parameter
* @param findMode Description of the Parameter
*/
public LexQuery( ILexComponent component, String findMode )
{
this( findMode );
setQueryComponent( component );
}
}

View file

@ -1,176 +0,0 @@
package org.thdl.lex;
import java.sql.*;
import java.util.*;
import javax.naming.*;
import javax.sql.*;
/**
* Description of the Class
*
* @author travis
* @created September 26, 2002
*/
public class LexRepository
{
//attributes
private static LexRepository instance;
private DataSource dataSource;
/**
* Sets the dataSource attribute of the LexRepository object
*
* @param dataSource The new dataSource value
*/
public void setDataSource( DataSource dataSource )
{
this.dataSource = dataSource;
}
/**
* Gets the dataSource attribute of the LexRepository object
*
* @return The dataSource value
*/
public DataSource getDataSource()
{
return dataSource;
}
//accessors
/**
* Gets the instance attribute of the LexRepository class
*
* @return The instance value
* @exception LexRepositoryException Description of the Exception
* @since
*/
public static LexRepository getInstance() throws LexRepositoryException
{
if ( instance == null )
{
instance = new LexRepository();
}
return instance;
}
//helper methods
/**
* doUpdate() performs an INSERT/UPDATE/DROP action
*
* @param sql Description of the Parameter
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
* @since
*/
public int doUpdate( String sql ) throws LexRepositoryException
{
try
{
Connection con = getDataSource().getConnection();
int i = con.createStatement().executeUpdate( sql );
con.close();
return i;
}
catch ( SQLException sqle )
{
throw new LexRepositoryException( sqle );
}
}
/**
* doInsert() is a wrapper for doUpdate() that returns the auto_increment
* primary key value of the newly inserted row
*
* @param sql Description of the Parameter
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
* @since
*/
public int doInsert( String sql ) throws LexRepositoryException
{
if ( null == sql )
{
throw new LexRepositoryException( "SQL String was null" );
}
if ( sql.equals( "" ) )
{
throw new LexRepositoryException( "SQL String was empty" );
}
try
{
ResultSet rs;
int returnVal = 0;
int i;
i = doUpdate( sql );
if ( i > 0 )
{
Connection con = getDataSource().getConnection();
rs = con.createStatement().executeQuery( "SELECT LAST_INSERT_ID()" );
while ( rs.next() )
{
returnVal = rs.getInt( 1 );
}
con.close();
return returnVal;
}
else
{
returnVal = i;
}
throw new LexRepositoryException( "Insert affected 0 rows. Sql String was '" + sql + "'" );
}
catch ( SQLException sqle )
{
throw new LexRepositoryException( sqle );
}
}
//main
/**
* The main program for the LexRepository class. This method tests all other
* methods in this class
*
* @param args The command line arguments
* @since
*/
public static void main( String[] args )
{
}
//constructors
/**
* Default Constructor for the LexRepository object
*
* @exception LexRepositoryException Description of the Exception
* @since
*/
private LexRepository() throws LexRepositoryException
{
try
{
Context context = new InitialContext();
DataSource source = (DataSource) context.lookup( LexConstants.DATASOURCE_NAME );
setDataSource( source );
}
catch ( NamingException ne )
{
throw new LexRepositoryException( ne );
}
}
}

View file

@ -1,59 +0,0 @@
package org.thdl.lex;
/**
* Description of the Class
*
*@author travis
*@created October 1, 2003
*/
public class LexRepositoryException extends Exception
{
/**
* Constructor for the LexRepositoryException object
*
*@since
*/
public LexRepositoryException()
{
super();
}
/**
* Constructor for the LexRepositoryException object
*
*@param msg Description of Parameter
*@since
*/
public LexRepositoryException( String msg )
{
super( msg );
}
/**
* Constructor for the LexRepositoryException object
*
*@param e Description of Parameter
*@since
*/
public LexRepositoryException( Exception e )
{
super( e );
}
/**
* Constructor for the LexRepositoryException object
*
*@param msg Description of Parameter
*@param e Description of Parameter
*@since
*/
public LexRepositoryException( String msg, Exception e )
{
super( msg, e );
}
}

View file

@ -1,299 +0,0 @@
package org.thdl.lex;
import org.thdl.users.ThdlUserRepository;
import java.util.*;
import java.io.*;
import org.dlese.dpc.oai.harvester.*;
import org.dlese.dpc.datamgr.*;
import org.dlese.dpc.index.*;
import org.dlese.dpc.oai.harvester.structs.ScheduledHarvest;
import org.openarchives.oai.x20.oaiDc.DcDocument;
import org.openarchives.oai.x20.oaiDc.OaiDcType;
/**
* Description of the Class
*
* @author travis
* @created December 15, 2003
*/
public class LexSourceRepository
{
//attributes
private static LexSourceRepository instance;
private ScheduledHarvestManager harvestManager;
private ScheduledHarvest harvest;
private String oaiServer;
private String oaiMetadataPrefix;
private String oaiHome;
private String oaiLocalCopy;
private int oaiRefreshDelay;
/**
* Sets the oaiServer attribute of the LexSourceRepository object
*
* @param oaiServer The new oaiServer value
*/
public void setOaiServer( String oaiServer )
{
this.oaiServer = oaiServer;
}
/**
* Sets the oaiMetadataPrefix attribute of the LexSourceRepository object
*
* @param oaiMetadataPrefix The new oaiMetadataPrefix value
*/
public void setOaiMetadataPrefix( String oaiMetadataPrefix )
{
this.oaiMetadataPrefix = oaiMetadataPrefix;
}
/**
* Sets the oaiHome attribute of the LexSourceRepository object
*
* @param oaiHome The new oaiHome value
*/
public void setOaiHome( String oaiHome )
{
this.oaiHome = oaiHome;
}
/**
* Sets the oaiLocalCopy attribute of the LexSourceRepository object
*
* @param oaiLocalCopy The new oaiLocalCopy value
*/
public void setOaiLocalCopy( String oaiLocalCopy )
{
this.oaiLocalCopy = oaiLocalCopy;
}
/**
* Sets the oaiRefreshDelay attribute of the LexSourceRepository object
*
* @param oaiRefreshDelay The new oaiRefreshDelay value
*/
public void setOaiRefreshDelay( int oaiRefreshDelay )
{
this.oaiRefreshDelay = oaiRefreshDelay;
}
/**
* Gets the oaiServer attribute of the LexSourceRepository object
*
* @return The oaiServer value
*/
public String getOaiServer()
{
return oaiServer;
}
/**
* Gets the oaiMetadataPrefix attribute of the LexSourceRepository object
*
* @return The oaiMetadataPrefix value
*/
public String getOaiMetadataPrefix()
{
return oaiMetadataPrefix;
}
/**
* Gets the oaiHome attribute of the LexSourceRepository object
*
* @return The oaiHome value
*/
public String getOaiHome()
{
return oaiHome;
}
/**
* Gets the oaiLocalCopy attribute of the LexSourceRepository object
*
* @return The oaiLocalCopy value
*/
public String getOaiLocalCopy()
{
return oaiLocalCopy;
}
/**
* Gets the oaiRefreshDelay attribute of the LexSourceRepository object
*
* @return The oaiRefreshDelay value
*/
public int getOaiRefreshDelay()
{
return oaiRefreshDelay;
}
/**
* Sets the harvest attribute of the LexSourceRepository object
*
* @param harvest The new harvest value
*/
public void setHarvest( ScheduledHarvest harvest )
{
this.harvest = harvest;
}
/**
* Gets the harvest attribute of the LexSourceRepository object
*
* @return The harvest value
*/
public ScheduledHarvest getHarvest()
{
return harvest;
}
/**
* Sets the harvestManager attribute of the LexSourceRepository object
*
* @param harvestManager The new harvestManager value
*/
public void setHarvestManager( ScheduledHarvestManager harvestManager )
{
this.harvestManager = harvestManager;
}
/**
* Gets the harvestManager attribute of the LexSourceRepository object
*
* @return The harvestManager value
*/
public ScheduledHarvestManager getHarvestManager()
{
return harvestManager;
}
//accessors
/**
* Gets the instance attribute of the LexSourceRepository class
*
* @return The instance value
* @exception Exception Description of the Exception
*/
public static LexSourceRepository getInstance() throws Exception
{
if ( null == instance )
{
instance = new LexSourceRepository();
}
return instance;
}
/**
* Description of the Method
*
* @exception LexRepositoryException Description of the Exception
*/
public void refreshSources() throws LexRepositoryException
{
/*
try
{
getHarvest().
}
catch ( Hexception h )
{
throw new LexRepositoryException( h );
}
catch ( OAIErrorException h )
{
throw new LexRepositoryException( h );
}
*/
}
/**
* Description of the Method
*
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
*/
public String[] xmlTesting() throws LexRepositoryException
{
String[] sa = null;
try
{
File file = new File( "/Users/travis/webapps/lex/dlese-oai/datastore.lib.virginia.edu/tibet/spt/SPT--OAI.php/oai_dc", "oai%3Alib.virginia.edu%3Athdl-267.xml" );
DcDocument dcd = DcDocument.Factory.parse( file );
OaiDcType oaiDc = dcd.getDc();
sa = new String[oaiDc.getTitleArray().length];
for ( int i = 0; i < sa.length; i++ )
{
sa[i] = oaiDc.getTitleArray()[i].toString();
}
}
catch ( Exception e )
{
throw new LexRepositoryException( e );
}
return sa;
}
//constructors
/**
*Constructor for the LexSourceRepository object
*
* @exception Exception Description of the Exception
*/
private LexSourceRepository() throws Exception
{
/* SimpleDataStore dataStore = new SimpleDataStore( "/Users/travis/webapps/lex/dlese-oai/scheduled-harvester", true );
File initialHarvestDir = new File( "/Users/travis/webapps/lex/dlese-oai/datastore.lib.virginia.edu" );
SimpleLuceneIndex harvestLogIndex = new SimpleLuceneIndex( "/Users/travis/webapps/lex/dlese-oai/lucene-index" );
ScheduledHarvestManager manager = new ScheduledHarvestManager( dataStore, initialHarvestDir, harvestLogIndex );
setHarvestManager( manager );
String repositoryName = "SPT";
String setSpec = "";
String baseURL = "http://datastore.lib.virginia.edu/tibet/spt/SPT--OAI.php";
String metadataPrefix = "oai_dc";
int seconds = 1000 * 1;
String harvestingInterval = Integer.toString( seconds );
String intervalGranularity = "YYYY -MM-DDThh:mm:ssZ";
String enabledDisabled = "enabled";
ScheduledHarvest harvest = new ScheduledHarvest( repositoryName, setSpec, baseURL, metadataPrefix, harvestingInterval, intervalGranularity, enabledDisabled );
setHarvest( harvest );
getHarvestManager().addScheduledHarvest( getHarvest() );
*/ }
//main
/**
* The main program for the LexSourceRepository class
*
* @param args The command line arguments
*/
public static void main( String[] args )
{
}
}

View file

@ -1,23 +0,0 @@
package org.thdl.lex;
public class LexUser extends org.thdl.users.ThdlUser
{
public boolean isGuest()
{
boolean bool = false;
if ( hasRole( "guest" ) )
{
bool = true;
}
return bool;
}
public boolean isDeveloper()
{
boolean bool = false;
if ( hasRole( "dev" ) )
{
bool = true;
}
return bool;
}
}

View file

@ -1,192 +0,0 @@
package org.thdl.lex;
import java.util.HashMap;
import java.util.StringTokenizer;
/**
* Description of the Class
*
* @author travis
* @created October 6, 2003
*/
public class LexUtilities
{
/**
* Gets the resultSetSize attribute of the LexUtilities class
*
* @param rs Description of the Parameter
* @return The resultSetSize value
* @exception java.sql.SQLException Description of the Exception
*/
public static int getResultSetSize( java.sql.ResultSet rs ) throws java.sql.SQLException
{
rs.last();
int i = rs.getRow();
rs.beforeFirst();
return i;
}
/*
public static String formatTimestamp( Timestamp time )
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd 'at' hh:mm:ss a zzz");
Date coDate = new Date( getCreatedOn().getTime() );
String dateString = formatter.format( coDate );
}
*/
/**
* Description of the Method
*
* @param fromString Description of the Parameter
* @return Description of the Return Value
*/
public static String escape( String fromString )
{
HashMap map = new HashMap();
map.put( "'", "\\'" );
/*
map.put("%", "\\%");
map.put("_", "\\_");
map.put("\"", "\\\"");
*/
StringBuffer targetString = new StringBuffer( "" );
if ( null != fromString )
{
StringTokenizer tokens = new StringTokenizer( fromString, "'%_\"", true );
while ( tokens.hasMoreTokens() )
{
String temp = tokens.nextToken();
if ( map.containsKey( temp ) )
{
temp = (String) map.get( temp );
}
targetString.append( temp );
}
}
return targetString.toString();
}
/**
* Description of the Method
*
* @param fromString Description of the Parameter
* @return Description of the Return Value
*/
public static String hqlEscape( String fromString )
{
HashMap map = new HashMap();
map.put( "'", "''" );
StringBuffer targetString = new StringBuffer( "" );
if ( null != fromString )
{
StringTokenizer tokens = new StringTokenizer( fromString, "'%_\"", true );
while ( tokens.hasMoreTokens() )
{
String temp = tokens.nextToken();
if ( map.containsKey( temp ) )
{
temp = (String) map.get( temp );
}
targetString.append( temp );
}
}
return targetString.toString();
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static Integer[] convertToIntegerArray( String[] source )
{
if ( null == source )
{
return null;
}
Integer[] target = new Integer[source.length];
for ( int i = 0; i < target.length; i++ )
{
target[i] = new Integer( source[i] );
}
return target;
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static Integer[] convertTokensToIntegerArray( String source )
{
if ( null == source || "null".equals( source ) )
{
return null;
}
StringTokenizer sourceTokens = new StringTokenizer( source, ":" );
Integer[] target = new Integer[sourceTokens.countTokens()];
for ( int i = 0; sourceTokens.hasMoreTokens(); i++ )
{
target[i] = new Integer( sourceTokens.nextToken() );
}
return target;
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static String convertIntegerArrayToTokens( Integer[] source )
{
if ( null == source )
{
return null;
}
StringBuffer target = new StringBuffer( "" );
for ( int i = 0; i < source.length; i++ )
{
target.append( source[i].toString() );
if ( i < ( source.length - 1 ) )
{
target.append( ":" );
}
}
return target.toString();
}
/**
* The main program for the LexUtilities class
*
* @param args The command line arguments
*/
public static void main( String[] args )
{
String s = "It's stupid to use a % or a _ in a SQL Statement";
System.out.println( LexUtilities.escape( s ) );
Integer[] ia = {new Integer( 1 ), new Integer( 3 )};
System.out.println( LexUtilities.convertIntegerArrayToTokens( ia ) );
String str = "9:8:7:6:5";
Integer[] ia2 = LexUtilities.convertTokensToIntegerArray( str );
String newStr = "";
for ( int i = 0; i < 5; i++ )
{
newStr = newStr + ia2[i] + " ";
}
System.out.println( newStr );
}
}

View file

@ -1,229 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.thdl.lex.component.*;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 2, 2003
*/
public class LoginServlet extends HttpServlet
{
//attributes
private String welcomePage;
private String loginPage;
private UserSessionManager sessionManager;
//accessors
/**
* Sets the welcomePage attribute of the LoginServlet object
*
* @param welcomePage The new welcomePage value
* @since
*/
public void setWelcomePage( String welcomePage )
{
this.welcomePage = welcomePage;
}
/**
* Sets the loginPage attribute of the LoginServlet object
*
* @param loginPage The new loginPage value
* @since
*/
public void setLoginPage( String loginPage )
{
this.loginPage = loginPage;
}
/**
* Gets the welcomePage attribute of the LoginServlet object
*
* @return The welcomePage value
* @since
*/
public String getWelcomePage()
{
return welcomePage;
}
/**
* Gets the loginPage attribute of the LoginServlet object
*
* @return The loginPage value
* @since
*/
public String getLoginPage()
{
return loginPage;
}
/**
* Gets the sessionManager attribute of the LoginServlet object
*
* @return The sessionManager value
* @since
*/
public UserSessionManager getSessionManager()
{
if ( null == sessionManager )
{
return UserSessionManager.getInstance();
}
else
{
return sessionManager;
}
}
//helper methods
/**
* Description of the Method
*
* @param config Description of Parameter
* @exception ServletException Description of Exception
* @since
*/
public void init( ServletConfig config ) throws ServletException
{
setWelcomePage( "/action?cmd=menu" );
if ( getWelcomePage() == null )
{
throw new ServletException( "The welcomePage init parameter must be specified." );
}
setLoginPage( config.getInitParameter( "loginPage" ) );
if ( getLoginPage() == null )
{
throw new ServletException( "The loginPage init parameter must be specified." );
}
}
/**
* Description of the Method
*
* @param request Description of Parameter
* @param response Description of Parameter
* @exception ServletException Description of Exception
* @since
*/
public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException
{
String username = request.getParameter( LexConstants.USERNAME_REQ_PARAM );
if ( username == null )
{
throw new ServletException( "No Username Specified" );
}
String password = request.getParameter( LexConstants.PASSWORD_REQ_PARAM );
if ( password == null )
{
throw new ServletException( "No Password Specified" );
}
ThdlUser thdlUser = null;
try
{
ThdlUser lexUser = new LexUser();
lexUser.setUsername( username );
lexUser.setPassword( password );
lexUser = ThdlUserRepository.getInstance().validate( lexUser, "dictionary" );
doLoginSuccess( request, response, lexUser );
}
catch ( ThdlUserRepositoryException ture )
{
doLoginFailure( request, response, username );
//throw new ServletException( ture );
}
catch ( Exception e )
{
throw new ServletException( e );
}
}
/**
* Description of the Method
*
* @param response Description of Parameter
* @param user Description of Parameter
* @param req Description of the Parameter
* @exception IOException Description of Exception
* @exception LexRepositoryException Description of Exception
* @exception LexComponentException Description of Exception
* @since
*/
private void doLoginSuccess( HttpServletRequest req, HttpServletResponse response, ThdlUser user ) throws IOException, LexRepositoryException, LexComponentException
{
Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) );
visit.setUser( user );
Preferences preferences = new Preferences( user );
visit.setPreferences( preferences );
visit.setDisplayMode( "brief" );
String targetPage = UserSessionManager.getInstance().getSessionLoginTarget( req.getSession( true ), true );
if ( targetPage == null )
{
UserSessionManager.doRedirect( req, response, getWelcomePage() );
}
else
{
targetPage = response.encodeRedirectURL( targetPage );
response.sendRedirect( targetPage );
}
}
/**
* Description of the Method
*
* @param request Description of Parameter
* @param response Description of Parameter
* @param username Description of Parameter
* @exception ServletException Description of Exception
* @since
*/
private void doLoginFailure( HttpServletRequest request, HttpServletResponse response, String username ) throws ServletException
{
String loginURL = getLoginPage() + "?retry=true&username=" + username;
try
{
UserSessionManager.doRedirect( request, response, loginURL );
}
catch ( IOException ioe )
{
throw new ServletException( ioe );
}
}
}

View file

@ -1,78 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* Description of the Class
*
* @author travis
* @created October 21, 2003
*/
public class LogoutServlet extends HttpServlet
{
private String goodbyePage;
/**
* Sets the goodbyePage attribute of the LogoutServlet object
*
* @param goodbyePage The new goodbyePage value
*/
public void setGoodbyePage( String goodbyePage )
{
this.goodbyePage = goodbyePage;
}
/**
* Gets the goodbyePage attribute of the LogoutServlet object
*
* @return The goodbyePage value
*/
public String getGoodbyePage()
{
return goodbyePage;
}
/**
* Description of the Method
*
* @param config Description of the Parameter
* @exception ServletException Description of the Exception
*/
public void init( ServletConfig config ) throws ServletException
{
setGoodbyePage( config.getInitParameter( "goodbyePage" ) );
if ( goodbyePage == null )
{
throw new ServletException( "The goodbyePage init parameter must be specified." );
}
}
/**
* Description of the Method
*
* @param request Description of the Parameter
* @param response Description of the Parameter
* @exception ServletException Description of the Exception
*/
public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException
{
HttpSession session = request.getSession( true );
UserSessionManager.getInstance().removeVisit( session );
try
{
String redirect = response.encodeRedirectURL( getGoodbyePage() );
response.sendRedirect( redirect );
}
catch ( IOException e )
{
throw new ServletException( "could not redirect to goodbye page" );
}
}
}

View file

@ -1,700 +0,0 @@
package org.thdl.lex;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.thdl.lex.component.*;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 6, 2003
*/
public class Preferences
{
//attributes
private Integer id;
private Integer userId;
private String preferencesName;
private Integer projectSubject;
private Integer source;
private Integer language;
private Integer script;
private Integer dialect;
private String note;
private boolean useDefaultProjSub;
private boolean useDefaultSource;
private boolean useDefaultLanguage;
private boolean useDefaultScript;
private boolean useDefaultDialect;
private boolean useDefaultNote;
private Integer[] projectSubjectSet;
private Integer[] sourceSet;
private Integer[] languageSet;
private Integer[] scriptSet;
private Integer[] dialectSet;
//accessors
/**
* Sets the id attribute of the Preferences object
*
* @param id The new id value
*/
public void setId( Integer id )
{
this.id = id;
}
/**
* Sets the userId attribute of the Preferences object
*
* @param userId The new userId value
*/
public void setUserId( Integer userId )
{
this.userId = userId;
}
/**
* Sets the preferencesName attribute of the Preferences object
*
* @param preferencesName The new preferencesName value
*/
public void setPreferencesName( String preferencesName )
{
this.preferencesName = preferencesName;
}
/**
* Sets the useDefaultNote attribute of the Preferences object
*
* @param useDefaultNote The new useDefaultNote value
*/
public void setUseDefaultNote( boolean useDefaultNote )
{
this.useDefaultNote = useDefaultNote;
}
/**
* Sets the useDefaultProjSub attribute of the Preferences object
*
* @param useDefaultProjSub The new useDefaultProjSub value
*/
public void setUseDefaultProjSub( boolean useDefaultProjSub )
{
this.useDefaultProjSub = useDefaultProjSub;
}
/**
* Sets the useDefaultSource attribute of the Preferences object
*
* @param useDefaultSource The new useDefaultSource value
*/
public void setUseDefaultSource( boolean useDefaultSource )
{
this.useDefaultSource = useDefaultSource;
}
/**
* Sets the useDefaultLanguage attribute of the Preferences object
*
* @param useDefaultLanguage The new useDefaultLanguage value
*/
public void setUseDefaultLanguage( boolean useDefaultLanguage )
{
this.useDefaultLanguage = useDefaultLanguage;
}
/**
* Sets the useDefaultScript attribute of the Preferences object
*
* @param useDefaultScript The new useDefaultScript value
*/
public void setUseDefaultScript( boolean useDefaultScript )
{
this.useDefaultScript = useDefaultScript;
}
/**
* Sets the useDefaultDialect attribute of the Preferences object
*
* @param useDefaultDialect The new useDefaultDialect value
*/
public void setUseDefaultDialect( boolean useDefaultDialect )
{
this.useDefaultDialect = useDefaultDialect;
}
/**
* Sets the projectSubject attribute of the Preferences object
*
* @param projectSubject The new projectSubject value
*/
public void setProjectSubject( Integer projectSubject )
{
this.projectSubject = projectSubject;
}
/**
* Sets the source attribute of the Preferences object
*
* @param source The new source value
*/
public void setSource( Integer source )
{
this.source = source;
}
/**
* Sets the language attribute of the Preferences object
*
* @param language The new language value
*/
public void setLanguage( Integer language )
{
this.language = language;
}
/**
* Sets the script attribute of the Preferences object
*
* @param script The new script value
*/
public void setScript( Integer script )
{
this.script = script;
}
/**
* Sets the dialect attribute of the Preferences object
*
* @param dialect The new dialect value
*/
public void setDialect( Integer dialect )
{
this.dialect = dialect;
}
/**
* Sets the projectSubjectSet attribute of the Preferences object
*
* @param projectSubjectSet The new projectSubjectSet value
*/
public void setProjectSubjectSet( Integer[] projectSubjectSet )
{
this.projectSubjectSet = projectSubjectSet;
}
/**
* Sets the sourceSet attribute of the Preferences object
*
* @param sourceSet The new sourceSet value
*/
public void setSourceSet( Integer[] sourceSet )
{
this.sourceSet = sourceSet;
}
/**
* Sets the languageSet attribute of the Preferences object
*
* @param languageSet The new languageSet value
*/
public void setLanguageSet( Integer[] languageSet )
{
this.languageSet = languageSet;
}
/**
* Sets the scriptSet attribute of the Preferences object
*
* @param scriptSet The new scriptSet value
*/
public void setScriptSet( Integer[] scriptSet )
{
this.scriptSet = scriptSet;
}
/**
* Sets the dialectSet attribute of the Preferences object
*
* @param dialectSet The new dialectSet value
*/
public void setDialectSet( Integer[] dialectSet )
{
this.dialectSet = dialectSet;
}
/**
* Sets the note attribute of the Preferences object
*
* @param note The new note value
*/
public void setNote( String note )
{
this.note = note;
}
/**
* Gets the id attribute of the Preferences object
*
* @return The id value
*/
public Integer getId()
{
return id;
}
/**
* Gets the userId attribute of the Preferences object
*
* @return The userId value
*/
public Integer getUserId()
{
return userId;
}
/**
* Gets the preferencesName attribute of the Preferences object
*
* @return The preferencesName value
*/
public String getPreferencesName()
{
return preferencesName;
}
/**
* Gets the useDefaultNote attribute of the Preferences object
*
* @return The useDefaultNote value
*/
public boolean getUseDefaultNote()
{
return useDefaultNote;
}
/**
* Gets the useDefaultProjSub attribute of the Preferences object
*
* @return The useDefaultProjSub value
*/
public boolean getUseDefaultProjSub()
{
return useDefaultProjSub;
}
/**
* Gets the useDefaultSource attribute of the Preferences object
*
* @return The useDefaultSource value
*/
public boolean getUseDefaultSource()
{
return useDefaultSource;
}
/**
* Gets the useDefaultLanguage attribute of the Preferences object
*
* @return The useDefaultLanguage value
*/
public boolean getUseDefaultLanguage()
{
return useDefaultLanguage;
}
/**
* Gets the useDefaultScript attribute of the Preferences object
*
* @return The useDefaultScript value
*/
public boolean getUseDefaultScript()
{
return useDefaultScript;
}
/**
* Gets the useDefaultDialect attribute of the Preferences object
*
* @return The useDefaultDialect value
*/
public boolean getUseDefaultDialect()
{
return useDefaultDialect;
}
/**
* Gets the projectSubject attribute of the Preferences object
*
* @return The projectSubject value
*/
public Integer getProjectSubject()
{
return projectSubject;
}
/**
* Gets the source attribute of the Preferences object
*
* @return The source value
*/
public Integer getSource()
{
return source;
}
/**
* Gets the language attribute of the Preferences object
*
* @return The language value
*/
public Integer getLanguage()
{
return language;
}
/**
* Gets the script attribute of the Preferences object
*
* @return The script value
*/
public Integer getScript()
{
return script;
}
/**
* Gets the dialect attribute of the Preferences object
*
* @return The dialect value
*/
public Integer getDialect()
{
return dialect;
}
/**
* Gets the projectSubjectSet attribute of the Preferences object
*
* @return The projectSubjectSet value
*/
public Integer[] getProjectSubjectSet()
{
return projectSubjectSet;
}
/**
* Gets the sourceSet attribute of the Preferences object
*
* @return The sourceSet value
*/
public Integer[] getSourceSet()
{
return sourceSet;
}
/**
* Gets the languageSet attribute of the Preferences object
*
* @return The languageSet value
*/
public Integer[] getLanguageSet()
{
return languageSet;
}
/**
* Gets the scriptSet attribute of the Preferences object
*
* @return The scriptSet value
*/
public Integer[] getScriptSet()
{
return scriptSet;
}
/**
* Gets the dialectSet attribute of the Preferences object
*
* @return The dialectSet value
*/
public Integer[] getDialectSet()
{
return dialectSet;
}
/**
* Gets the note attribute of the Preferences object
*
* @return The note value
*/
public String getNote()
{
return note;
}
//helpers
/**
* Description of the Method
*
* @exception LexRepositoryException Description of the Exception
* @exception LexComponentException Description of the Exception
*/
public void populate() throws LexRepositoryException, LexComponentException
{
String sql = "SELECT * FROM Preferences WHERE userId = " + getUserId();
try
{
LexRepository lr = LexRepository.getInstance();
Connection con = lr.getDataSource().getConnection();
ResultSet results = con.createStatement().executeQuery( sql );
if ( LexUtilities.getResultSetSize( results ) > 0 )
{
results.next();
setId( new Integer( results.getInt( 1 ) ) );
setUserId( new Integer( results.getInt( 2 ) ) );
setPreferencesName( results.getString( 3 ) );
setProjectSubject( new Integer( results.getInt( 4 ) ) );
setSource( new Integer( results.getInt( 5 ) ) );
setLanguage( new Integer( results.getInt( 6 ) ) );
setScript( new Integer( results.getInt( 7 ) ) );
setDialect( new Integer( results.getInt( 8 ) ) );
setNote( results.getString( 9 ) );
Boolean bool = Boolean.valueOf( results.getString( 10 ) );
setUseDefaultProjSub( bool.booleanValue() );
bool = Boolean.valueOf( results.getString( 11 ) );
setUseDefaultSource( bool.booleanValue() );
bool = Boolean.valueOf( results.getString( 12 ) );
setUseDefaultLanguage( bool.booleanValue() );
bool = Boolean.valueOf( results.getString( 13 ) );
setUseDefaultScript( bool.booleanValue() );
bool = Boolean.valueOf( results.getString( 14 ) );
setUseDefaultDialect( bool.booleanValue() );
bool = Boolean.valueOf( results.getString( 15 ) );
setUseDefaultNote( bool.booleanValue() );
setProjectSubjectSet( LexUtilities.convertTokensToIntegerArray( results.getString( 16 ) ) );
setSourceSet( LexUtilities.convertTokensToIntegerArray( results.getString( 17 ) ) );
setLanguageSet( LexUtilities.convertTokensToIntegerArray( results.getString( 18 ) ) );
setScriptSet( LexUtilities.convertTokensToIntegerArray( results.getString( 19 ) ) );
setDialectSet( LexUtilities.convertTokensToIntegerArray( results.getString( 20 ) ) );
}
else
{
insertNew();
}
con.close();
}
catch ( SQLException sqle )
{
throw new LexComponentException( sqle.getMessage() );
}
}
/**
* Description of the Method
*
* @exception LexComponentException Description of the Exception
*/
public void insertNew() throws LexComponentException
{
try
{
String sql = "INSERT INTO Preferences ( id, userId ) VALUES ( NULL, " + getUserId() + " )";
Integer i = new Integer( LexRepository.getInstance().doUpdate( sql ) );
setId( i );
}
catch ( LexRepositoryException lre )
{
throw new LexComponentException( lre.getMessage() );
}
}
/**
* Description of the Method
*
* @exception LexComponentException Description of the Exception
*/
public void save() throws LexComponentException
{
try
{
String sql = "SELECT id FROM Preferences WHERE userId = " + getUserId();
LexRepository lr = LexRepository.getInstance();
Connection con = lr.getDataSource().getConnection();
ResultSet results = con.createStatement().executeQuery( sql );
if ( LexUtilities.getResultSetSize( results ) < 1 )
{
insertNew();
}
con.close();
StringBuffer sqlBuffer = new StringBuffer();
sqlBuffer.append( "UPDATE Preferences SET userId = " );
sqlBuffer.append( getUserId() );
sqlBuffer.append( ", preferencesName = '" );
sqlBuffer.append( getPreferencesName() );
sqlBuffer.append( "', projectSubject = " );
sqlBuffer.append( getProjectSubject() );
sqlBuffer.append( ", source = " );
sqlBuffer.append( getSource() );
sqlBuffer.append( ", language = " );
sqlBuffer.append( getLanguage() );
sqlBuffer.append( ", script = " );
sqlBuffer.append( getScript() );
sqlBuffer.append( ", dialect = " );
sqlBuffer.append( getDialect() );
sqlBuffer.append( ", note = '" );
sqlBuffer.append( LexUtilities.escape( getNote() ) );
sqlBuffer.append( "', useDefaultProjSub = '" );
sqlBuffer.append( getUseDefaultProjSub() );
sqlBuffer.append( "', useDefaultSource = '" );
sqlBuffer.append( getUseDefaultSource() );
sqlBuffer.append( "', useDefaultLanguage = '" );
sqlBuffer.append( getUseDefaultLanguage() );
sqlBuffer.append( "', useDefaultScript = '" );
sqlBuffer.append( getUseDefaultScript() );
sqlBuffer.append( "', useDefaultDialect = '" );
sqlBuffer.append( getUseDefaultDialect() );
sqlBuffer.append( "', useDefaultNote = '" );
sqlBuffer.append( getUseDefaultNote() );
sqlBuffer.append( "', projectSubjectSet = '" );
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getProjectSubjectSet() ) );
sqlBuffer.append( "', sourceSet = '" );
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getSourceSet() ) );
sqlBuffer.append( "', languageSet = '" );
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getLanguageSet() ) );
sqlBuffer.append( "', scriptSet = '" );
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getScriptSet() ) );
sqlBuffer.append( "', dialectSet = '" );
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getDialectSet() ) );
sqlBuffer.append( "' WHERE id = " );
sqlBuffer.append( getId() );
LexRepository.getInstance().doUpdate( sqlBuffer.toString() );
}
catch ( LexRepositoryException lre )
{
throw new LexComponentException( lre.getMessage() );
}
catch ( SQLException sqle )
{
throw new LexComponentException( sqle.getMessage() );
}
}
/**
* The main program for the Preferences class
*
* @param args The command line arguments
*/
public static void main( String[] args )
{
try
{
Preferences component = new Preferences();
component.setUserId( new Integer( 2 ) );
component.save();
System.out.println( component.getId() + " " + component.getUserId() );
}
catch ( Exception e )
{
e.printStackTrace();
}
}
//constructors
/**
*Constructor for the Preferences object
*/
public Preferences()
{
setId( new Integer( 0 ) );
setUserId( new Integer( 1 ) );
setProjectSubject( new Integer( 1 ) );
setSource( new Integer( 1 ) );
setLanguage( new Integer( 1 ) );
setScript( new Integer( 1 ) );
setDialect( new Integer( 1 ) );
Integer[] temp = {getProjectSubject()};
setProjectSubjectSet( temp );
Integer[] temp2 = {getSource()};
setSourceSet( temp2 );
Integer[] temp3 = {getLanguage()};
setLanguageSet( temp3 );
Integer[] temp4 = {getDialect()};
setDialectSet( temp4 );
Integer[] temp5 = {getScript()};
setScriptSet( temp5 );
setNote( "Default Note" );
}
/**
*Constructor for the Preferences object
*
* @param user Description of the Parameter
* @exception LexRepositoryException Description of the Exception
* @exception LexComponentException Description of the Exception
*/
public Preferences( ThdlUser user ) throws LexRepositoryException, LexComponentException
{
this();
setUserId( user.getId() );
populate();
/*
setProjectSubject( user.getDefaultProjSub() );
setSource( user.getDefaultSource() );
setLanguage( user.getDefaultLanguage() );
setScript( user.getDefaultScript() );
setDialect( user.getDefaultDialect() );
*/
}
}

View file

@ -1,164 +0,0 @@
package org.thdl.lex;
import java.util.HashMap;
import java.util.StringTokenizer;
/**
* Description of the Class
*
* @author travis
* @created October 5, 2003
*/
public class ThdlUtilities
{
/**
* Gets the resultSetSize attribute of the ThdlUtilities class
*
* @param rs Description of the Parameter
* @return The resultSetSize value
* @exception java.sql.SQLException Description of the Exception
*/
public static int getResultSetSize( java.sql.ResultSet rs ) throws java.sql.SQLException
{
rs.last();
int i = rs.getRow();
rs.beforeFirst();
return i;
}
/*
public static String formatTimestamp( Timestamp time )
{
/ SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd 'at' hh:mm:ss a zzz");
/ Date coDate = new Date( getCreatedOn().getTime() );
/ String dateString = formatter.format( coDate );
}
*/
/**
* Description of the Method
*
* @param fromString Description of the Parameter
* @return Description of the Return Value
*/
public static String escape( String fromString )
{
HashMap map = new HashMap();
map.put( "'", "\\'" );
/*
map.put("%", "\\%");
map.put("_", "\\_");
map.put("\"", "\\\"");
*/
StringBuffer targetString = new StringBuffer( "" );
if ( null != fromString )
{
StringTokenizer tokens = new StringTokenizer( fromString, "'%_\"", true );
while ( tokens.hasMoreTokens() )
{
String temp = tokens.nextToken();
if ( map.containsKey( temp ) )
{
temp = (String) map.get( temp );
}
targetString.append( temp );
}
}
return targetString.toString();
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static int[] convertToIntArray( String[] source )
{
if ( null == source )
{
return null;
}
int[] target = new int[source.length];
for ( int i = 0; i < target.length; i++ )
{
target[i] = Integer.parseInt( source[i] );
}
return target;
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static int[] convertTokensToIntArray( String source )
{
if ( null == source )
{
return null;
}
StringTokenizer sourceTokens = new StringTokenizer( source, ":" );
int[] target = new int[sourceTokens.countTokens()];
for ( int i = 0; sourceTokens.hasMoreTokens(); i++ )
{
target[i] = Integer.parseInt( sourceTokens.nextToken() );
}
return target;
}
/**
* Description of the Method
*
* @param source Description of the Parameter
* @return Description of the Return Value
*/
public static String convertIntArrayToTokens( int[] source )
{
if ( null == source )
{
return null;
}
StringBuffer target = new StringBuffer( "" );
for ( int i = 0; i < source.length; i++ )
{
target.append( Integer.toString( source[i] ) );
if ( i < ( source.length - 1 ) )
{
target.append( ":" );
}
}
return target.toString();
}
/**
* The main program for the ThdlUtilities class
*
* @param args The command line arguments
*/
public static void main( String[] args )
{
String s = "It's stupid to use a % or a _ in a SQL Statement";
System.out.println( ThdlUtilities.escape( s ) );
int[] ia = {1, 2, 3, 4, 5, 6, 7, 8, 9};
System.out.println( ThdlUtilities.convertIntArrayToTokens( ia ) );
String str = "9:8:7:6:5";
int[] ia2 = ThdlUtilities.convertTokensToIntArray( str );
String newStr = "";
for ( int i = 0; i < 5; i++ )
{
newStr = newStr + ia2[i] + " ";
}
System.out.println( newStr );
}
}

View file

@ -1,131 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import javax.servlet.http.*;
import org.thdl.lex.component.*;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class UserSessionManager
{
//attributes
private static UserSessionManager INSTANCE = new UserSessionManager();
/**
* Gets the visit attribute of the UserSessionManager object
*
* @param session Description of the Parameter
* @return The visit value
*/
public Visit getVisit( HttpSession session )
{
if ( null == session.getAttribute( LexConstants.VISIT_SESSION_ATTR ) )
{
setVisit( session, new Visit( session ) );
}
return (Visit) session.getAttribute( LexConstants.VISIT_SESSION_ATTR );
}
/**
* Sets the visit attribute of the UserSessionManager object
*
* @param session The new visit value
* @param visit The new visit value
*/
public void setVisit( HttpSession session, Visit visit )
{
session.setAttribute( LexConstants.VISIT_SESSION_ATTR, visit );
}
/**
* Description of the Method
*
* @param session Description of the Parameter
*/
public void removeVisit( HttpSession session )
{
session.setAttribute( LexConstants.VISIT_SESSION_ATTR, null );
}
/**
* Sets the sessionLoginTarget attribute of the UserSessionManager object
*
* @param session The new sessionLoginTarget value
* @param loginTarget The new sessionLoginTarget value
* @since
*/
public void setSessionLoginTarget( HttpSession session, String loginTarget )
{
session.setAttribute( LexConstants.LOGINTARGET_SESS_PARAM, loginTarget );
}
/**
* Gets the instance attribute of the UserSessionManager class
*
* @return The instance value
* @since
*/
public static UserSessionManager getInstance()
{
return INSTANCE;
}
/**
* Gets the sessionLoginTarget attribute of the UserSessionManager object
*
* @param session Description of Parameter
* @param clear Description of Parameter
* @return The sessionLoginTarget value
* @since
*/
public String getSessionLoginTarget( HttpSession session, boolean clear )
{
String target = (String) session.getAttribute( LexConstants.LOGINTARGET_SESS_PARAM );
if ( clear )
{
session.removeAttribute( LexConstants.LOGINTARGET_SESS_PARAM );
}
return target;
}
/**
* Description of the Method
*
* @param request Description of Parameter
* @param response Description of Parameter
* @param url Description of Parameter
* @exception IOException Description of Exception
* @since
*/
public static void doRedirect( HttpServletRequest request, HttpServletResponse response, String url ) throws IOException
{
String redirect = response.encodeRedirectURL( request.getContextPath() + url );
response.sendRedirect( redirect );
}
//constructor
/**
* Constructor for the UserSessionManager object
*
* @since
*/
private UserSessionManager() { }
}

View file

@ -1,243 +0,0 @@
package org.thdl.lex;
import java.io.IOException;
import javax.servlet.http.*;
import org.thdl.lex.component.*;
import org.thdl.users.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class Visit
{
//attributes
HttpSession session;
String token;
DisplayHelper helper;
Preferences preferences;
LexQuery query;
ThdlUser user;
String displayMode;
/**
* Sets the token attribute of the Visit object
*
* @param token The new token value
*/
public void setToken( String token )
{
this.token = token;
}
/**
* Gets the token attribute of the Visit object
*
* @return The token value
*/
public String getToken()
{
return token;
}
/**
* Sets the session attribute of the Visit object
*
* @param session The new session value
*/
public void setSession( HttpSession session )
{
this.session = session;
}
/**
* Gets the session attribute of the Visit object
*
* @return The session value
*/
public HttpSession getSession()
{
return session;
}
/**
* Sets the helper attribute of the Visit object
*
* @param helper The new helper value
*/
public void setHelper( DisplayHelper helper )
{
this.helper = helper;
}
/**
* Sets the preferences attribute of the Visit object
*
* @param preferences The new preferences value
*/
public void setPreferences( Preferences preferences )
{
this.preferences = preferences;
}
/**
* Sets the query attribute of the Visit object
*
* @param query The new query value
*/
public void setQuery( LexQuery query )
{
this.query = query;
}
/**
* Sets the user attribute of the Visit object
*
* @param user The new user value
*/
public void setUser( ThdlUser user )
{
if ( user.hasRole( "guest" ) )
{
getSession().setMaxInactiveInterval( 60 * 5 );
}
else
{
getSession().setMaxInactiveInterval( 60 * 60 * 8 );
}
this.user = user;
}
/**
* Sets the displayMode attribute of the Visit object
*
* @param displayMode The new displayMode value
*/
public void setDisplayMode( String displayMode )
{
this.displayMode = displayMode;
}
/**
* Gets the helper attribute of the Visit object
*
* @return The helper value
*/
public DisplayHelper getHelper()
{
if ( null == helper )
{
setHelper( new DisplayHelper() );
}
return helper;
}
/**
* Gets the preferences attribute of the Visit object
*
* @return The preferences value
*/
public Preferences getPreferences()
{
if ( null == preferences )
{
try
{
setPreferences( new Preferences( getUser() ) );
}
catch ( Exception e )
{
setPreferences( new Preferences() );
}
}
return preferences;
}
/**
* Gets the query attribute of the Visit object
*
* @return The query value
*/
public LexQuery getQuery()
{
if ( null == query )
{
setQuery( new LexQuery() );
}
return query;
}
/**
* Gets the user attribute of the Visit object
*
* @return The user value
*/
public ThdlUser getUser()
{
return user;
}
/**
* Gets the displayMode attribute of the Visit object
*
* @return The displayMode value
*/
public String getDisplayMode()
{
return displayMode;
}
//constructor
/**
*Constructor for the Visit object
*/
public Visit() { }
/**
*Constructor for the Visit object
*
* @param session Description of the Parameter
*/
public Visit( HttpSession session )
{
this();
setSession( session );
}
/**
*Constructor for the Visit object
*
* @param session Description of the Parameter
* @param user Description of the Parameter
*/
public Visit( HttpSession session, ThdlUser user )
{
this( session );
setUser( user );
}
}

View file

@ -1 +0,0 @@
old

View file

@ -1,47 +0,0 @@
package org.thdl.lex.commands;
import javax.servlet.http.HttpServletRequest;
import org.thdl.lex.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
* @author travis
* @created October 1, 2003
*/
public class AbortCommand implements Command
{
private String next;
/**
* Description of the Method
*
* @param req Description of Parameter
* @param component Description of Parameter
* @return Description of the Returned Value
* @exception CommandException Description of Exception
* @since
*/
public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException
{
req.setAttribute( "termtool.msg", "Operation Aborted" );
return next;
}
/**
* Constructor for the AbortCommand object
*
* @param next Description of Parameter
* @since
*/
public AbortCommand( String next )
{
this.next = next;
}
}

View file

@ -1,26 +0,0 @@
package org.thdl.lex.commands;
import org.thdl.lex.*;
import org.thdl.lex.component.*;
/**
* Description of the Interface
*
*@author travis
*@created October 3, 2003
*/
public interface Command
{
/**
* Description of the Method
*
*@param req Description of Parameter
*@param component Description of Parameter
*@return Description of the Returned Value
*@exception CommandException Description of Exception
*@since
*/
public String execute( javax.servlet.http.HttpServletRequest req, ILexComponent component ) throws CommandException;
}

View file

@ -1,62 +0,0 @@
package org.thdl.lex.commands;
import org.thdl.lex.*;
import org.thdl.lex.component.*;
/**
* Description of the Class
*
*@author travis
*@created October 1, 2003
*/
public class CommandException extends Exception
{
/**
* Constructor for the CommandException object
*
*@since
*/
public CommandException()
{
super();
}
/**
* Constructor for the CommandException object
*
*@param msg Description of Parameter
*@since
*/
public CommandException( String msg )
{
super( msg );
}
/**
* Constructor for the CommandException object
*
*@param msg Description of Parameter
*@param e Description of Parameter
*@since
*/
public CommandException( String msg, Exception e )
{
super( msg, e );
}
/**
* Constructor for the CommandException object
*
*@param e Description of Parameter
*@since
*/
public CommandException( Exception e )
{
super( e );
}
}

Some files were not shown because too many files have changed in this diff Show more