testing
This commit is contained in:
parent
1de7ae90e5
commit
0ecf2b6ee9
186 changed files with 14574 additions and 0 deletions
40
src/java/hibernate.cfg.xml
Normal file
40
src/java/hibernate.cfg.xml
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?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">true</property>
|
||||
<property name="use_outer_join">false</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>
|
40
src/java/log4j.properties
Normal file
40
src/java/log4j.properties
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?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">true</property>
|
||||
<property name="use_outer_join">false</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>
|
92
src/java/org/thdl/lex/AuthenticationFilter.java
Normal file
92
src/java/org/thdl/lex/AuthenticationFilter.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.ServletException;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
public class AuthenticationFilter implements Filter
|
||||
{
|
||||
//attributes
|
||||
private String loginPage;
|
||||
private UserSessionManager sessionMgr;
|
||||
|
||||
//accessors
|
||||
public void setLoginPage(String loginPage) {
|
||||
this.loginPage = loginPage;
|
||||
}
|
||||
public String getLoginPage() {
|
||||
return loginPage;
|
||||
}
|
||||
public void setSessionMgr() {
|
||||
this.sessionMgr = UserSessionManager.getInstance();
|
||||
}
|
||||
public UserSessionManager getSessionMgr() {
|
||||
return sessionMgr;
|
||||
}
|
||||
|
||||
//contract methods
|
||||
public void init(FilterConfig config) throws ServletException
|
||||
{
|
||||
setSessionMgr();
|
||||
setLoginPage( config.getInitParameter("loginPage") );
|
||||
if ( null == getLoginPage() )
|
||||
throw new ServletException("The loginPage parameter must be specified");
|
||||
}
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
|
||||
{
|
||||
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse)
|
||||
{
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpSession session = req.getSession(true);
|
||||
ThdlUser user = sessionMgr.getSessionUser(session);
|
||||
if (null == user )
|
||||
{
|
||||
requireLogin(req, (HttpServletResponse)response, session);
|
||||
}
|
||||
else
|
||||
{
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ServletException("Filter only applicable to HTTP and HTTPS requests");
|
||||
}
|
||||
}
|
||||
public void destroy() {}
|
||||
//helper methods
|
||||
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;
|
||||
|
||||
sessionMgr.setSessionLoginTarget( session, buffer.toString() );
|
||||
UserSessionManager.doRedirect(request, response, loginPage);
|
||||
}
|
||||
}
|
72
src/java/org/thdl/lex/GuestFilter.java
Normal file
72
src/java/org/thdl/lex/GuestFilter.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.ServletException;
|
||||
import java.io.IOException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
public class GuestFilter implements Filter
|
||||
{
|
||||
//attributes
|
||||
private String loginPage;
|
||||
private UserSessionManager sessionMgr;
|
||||
|
||||
//accessors
|
||||
public void setLoginPage(String loginPage) {
|
||||
this.loginPage = loginPage;
|
||||
}
|
||||
public String getLoginPage() {
|
||||
return loginPage;
|
||||
}
|
||||
public void setSessionMgr() {
|
||||
this.sessionMgr = UserSessionManager.getInstance();
|
||||
}
|
||||
public UserSessionManager getSessionMgr() {
|
||||
return sessionMgr;
|
||||
}
|
||||
|
||||
//contract methods
|
||||
public void init(FilterConfig config) throws ServletException
|
||||
{
|
||||
setSessionMgr();
|
||||
}
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
|
||||
{
|
||||
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse)
|
||||
{
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpSession session = req.getSession(true);
|
||||
ThdlUser user = getSessionMgr().getSessionUser(session);
|
||||
if (null == user )
|
||||
{
|
||||
try
|
||||
{
|
||||
user = new LexUser();
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
throw new ServletException( e );
|
||||
}
|
||||
user.setRoles( "guest" );
|
||||
getSessionMgr().setSessionUser( session, user );
|
||||
getSessionMgr().setDisplayMode( session, "full" );
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ServletException("Filter only applicable to HTTP and HTTPS requests");
|
||||
}
|
||||
}
|
||||
public void destroy() {}
|
||||
//helper methods
|
||||
}
|
70
src/java/org/thdl/lex/HibernateSession.java
Normal file
70
src/java/org/thdl/lex/HibernateSession.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
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;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
262
src/java/org/thdl/lex/HibernateTestServlet.java
Normal file
262
src/java/org/thdl/lex/HibernateTestServlet.java
Normal file
|
@ -0,0 +1,262 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
// import org.thdl.lex.component.peers.*;
|
||||
|
||||
import net.sf.hibernate.*;
|
||||
import net.sf.hibernate.cfg.*;
|
||||
// import net.sf.hibernate.tool.hbm2ddl.*;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.ServletException;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
|
||||
/**
|
||||
* 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" );
|
||||
PrintWriter out = response.getWriter();
|
||||
out.println( "<html><body>" );
|
||||
|
||||
beginTransaction();
|
||||
processMods( out );
|
||||
//testQuery( out );
|
||||
endTransaction( false );
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param out Description of Parameter
|
||||
*@exception SQLException Description of Exception
|
||||
*@exception HibernateException Description of Exception
|
||||
*@since
|
||||
*/
|
||||
public void processMods( PrintWriter out ) throws SQLException, HibernateException
|
||||
{
|
||||
String queryString = "FROM org.thdl.lex.component.LexComponent";
|
||||
Query query = getSession().createQuery( queryString );
|
||||
|
||||
out.println( "Starting..." );
|
||||
for ( Iterator it = query.iterate(); it.hasNext(); )
|
||||
{
|
||||
ILexComponent lc = (ILexComponent) it.next();
|
||||
out.println( lc.getMetaId() + " </br/> " );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.Term as term WHERE term.term = :term";
|
||||
Query query = getSession().createQuery( queryString );
|
||||
ITerm term = new Term();
|
||||
term.setTerm( "thos pa" );
|
||||
query.setProperties( term );
|
||||
for ( Iterator it = query.iterate(); it.hasNext(); )
|
||||
{
|
||||
out.println( it.next() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
207
src/java/org/thdl/lex/LexActionServlet.java
Normal file
207
src/java/org/thdl/lex/LexActionServlet.java
Normal file
|
@ -0,0 +1,207 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
import org.thdl.lex.commands.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public class LexActionServlet extends HttpServlet
|
||||
{
|
||||
//attributes
|
||||
private HashMap commands;
|
||||
private String cmd;
|
||||
|
||||
|
||||
//accessors
|
||||
|
||||
/**
|
||||
* Sets the commands attribute of the LexActionServlet object
|
||||
*
|
||||
*@param commands The new commands value
|
||||
*@since
|
||||
*/
|
||||
public void setCommands( HashMap commands )
|
||||
{
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the cmd attribute of the LexActionServlet object
|
||||
*
|
||||
*@param cmd The new cmd value
|
||||
*@since
|
||||
*/
|
||||
public void setCmd( String cmd )
|
||||
{
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the commands attribute of the LexActionServlet object
|
||||
*
|
||||
*@return The commands value
|
||||
*@since
|
||||
*/
|
||||
public HashMap getCommands()
|
||||
{
|
||||
return commands;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the cmd attribute of the LexActionServlet object
|
||||
*
|
||||
*@return The cmd value
|
||||
*@since
|
||||
*/
|
||||
public String getCmd()
|
||||
{
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
//helper methods
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param config Description of Parameter
|
||||
*@exception ServletException Description of Exception
|
||||
*@since
|
||||
*/
|
||||
public void init( ServletConfig config ) throws ServletException
|
||||
{
|
||||
super.init( config );
|
||||
initCommands();
|
||||
config.getServletContext().setAttribute( "flatData", new LexFlatDataRepository() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
String next;
|
||||
try
|
||||
{
|
||||
setCmd( req.getParameter( LexConstants.COMMAND_REQ_PARAM ) );
|
||||
Command command = lookupCommand( getCmd() );
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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: '" + getCmd() + "'" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
private void initCommands()
|
||||
{
|
||||
HashMap commands = new HashMap();
|
||||
commands.put( "menu", new NullCommand( "menu.jsp" ) );
|
||||
commands.put( "abort", new AbortCommand( "menu.jsp" ) );
|
||||
commands.put( "testing", new TestingCommand( "displayEntry.jsp" ) );
|
||||
// commands.put( "login", new NullCommand( "login.jsp" ) );
|
||||
commands.put( "logout", new NullCommand( "logout.jsp" ) );
|
||||
commands.put( "new", new NewComponentCommand() );
|
||||
commands.put( "find", new FindCommand() );
|
||||
commands.put( "getInsertForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert" ) );
|
||||
commands.put( "getUpdateForm", new GetUpdateFormCommand( "displayForm.jsp?formMode=update" ) );
|
||||
commands.put( "getTranslationForm", new GetTranslationFormCommand( "displayForm.jsp?formMode=insert" ) );
|
||||
commands.put( "annotate", new GetInsertFormCommand( "displayForm.jsp?formMode=insert" ) );
|
||||
commands.put( "insert", new InsertCommand( "displayEntry.jsp" ) );
|
||||
commands.put( "update", new UpdateCommand( "displayEntry.jsp" ) );
|
||||
commands.put( "display", new DisplayCommand() );
|
||||
commands.put( "displayFull", new DisplayCommand() );
|
||||
commands.put( "editEntry", new DisplayCommand() );
|
||||
commands.put( "remove", new RemoveCommand() );
|
||||
commands.put( "getMetaPrefsForm", new NullCommand( "metaPrefsForm.jsp" ) );
|
||||
commands.put( "getMetaDefaultsForm", new NullCommand( "metaDefaultsForm.jsp" ) );
|
||||
commands.put( "setMetaPrefs", new PreferencesCommand( "menu.jsp" ) );
|
||||
commands.put( "setMetaDefaults", new PreferencesCommand( "menu.jsp" ) );
|
||||
setCommands( commands );
|
||||
}
|
||||
}
|
||||
|
206
src/java/org/thdl/lex/LexComponentFilter.java
Normal file
206
src/java/org/thdl/lex/LexComponentFilter.java
Normal file
|
@ -0,0 +1,206 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.ServletException;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* 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 setSessionMgr( 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 getSessionMgr()
|
||||
{
|
||||
if ( null == sessionMgr )
|
||||
{
|
||||
setSessionMgr( 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() );
|
||||
getBlanks().put( LexConstants.TERMLABEL_VALUE, new Term() );
|
||||
getBlanks().put( LexConstants.PRONUNCIATIONLABEL_VALUE, new Pronunciation() );
|
||||
getBlanks().put( LexConstants.ETYMOLOGYLABEL_VALUE, new Etymology() );
|
||||
getBlanks().put( LexConstants.FUNCTIONLABEL_VALUE, new Function() );
|
||||
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 Register() );
|
||||
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 says: " + labe.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse )
|
||||
{
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
if ( null != req.getParameter( LexConstants.LABEL_REQ_PARAM ) )
|
||||
{
|
||||
String labelValue = req.getParameter( LexConstants.LABEL_REQ_PARAM );
|
||||
try
|
||||
{
|
||||
// this if block is for TESTING ONLY
|
||||
if ( getBlanks().get( labelValue ) != null )
|
||||
{
|
||||
Class glass = getBlanks().get( labelValue ).getClass();
|
||||
LexComponent component = (LexComponent) glass.newInstance();
|
||||
//component.appendDebugMap( "LCFilterMadeNewInstance", component );
|
||||
req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component );
|
||||
}
|
||||
else
|
||||
{
|
||||
req.setAttribute( "LCFilter says: ", "componentLabel was not in blank components" );
|
||||
}
|
||||
}
|
||||
catch ( InstantiationException ie )
|
||||
{
|
||||
throw new ServletException( ie.getMessage() );
|
||||
}
|
||||
catch ( IllegalAccessException iae )
|
||||
{
|
||||
throw new ServletException( iae.getMessage() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
req.setAttribute( "LexComponentFilter says: '", LexConstants.LABEL_REQ_PARAM + "' was not specified." );
|
||||
}
|
||||
chain.doFilter( request, response );
|
||||
|
||||
try
|
||||
{
|
||||
LexComponentRepository.cleanup();
|
||||
}
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
throw new ServletException( lre );
|
||||
}
|
||||
}
|
||||
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() { }
|
||||
}
|
||||
|
206
src/java/org/thdl/lex/LexComponentRepository.java
Normal file
206
src/java/org/thdl/lex/LexComponentRepository.java
Normal file
|
@ -0,0 +1,206 @@
|
|||
package org.thdl.lex;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.sf.hibernate.*;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 1, 2003
|
||||
*/
|
||||
public class LexComponentRepository
|
||||
{
|
||||
private static long start;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the start attribute of the LexComponentRepository object
|
||||
*
|
||||
* @param startTime The new start value
|
||||
* @since
|
||||
*/
|
||||
private static void setStart( long startTime )
|
||||
{
|
||||
start = startTime;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the start attribute of the LexComponentRepository object
|
||||
*
|
||||
* @return The start value
|
||||
* @since
|
||||
*/
|
||||
private static long getStart()
|
||||
{
|
||||
return start;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the session attribute of the LexComponentRepository class
|
||||
*
|
||||
* @return The session value
|
||||
* @exception HibernateException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
private static Session getSession() throws HibernateException
|
||||
{
|
||||
Session session = HibernateSession.currentSession();
|
||||
if ( !session.isConnected() )
|
||||
{
|
||||
//session.reconnect();
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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() );
|
||||
ITerm term = assertTerm( lexQuery.getQueryComponent() );
|
||||
if ( null == term.getTerm() )
|
||||
{
|
||||
throw new LexRepositoryException( "Query Component term was null." );
|
||||
}
|
||||
|
||||
Query query = null;
|
||||
Iterator it = null;
|
||||
String queryString = " FROM org.thdl.lex.component.Term as term WHERE term.term like '" + term.getTerm() + "%' AND term.deleted=0 ORDER BY term.term";
|
||||
try
|
||||
{
|
||||
query = getSession().createQuery( queryString );
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
throw new LexRepositoryException( he );
|
||||
}
|
||||
|
||||
/*
|
||||
try
|
||||
{
|
||||
query.setProperties( lexQuery.getQueryComponent() );
|
||||
}
|
||||
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() );
|
||||
}
|
||||
while ( it.hasNext() )
|
||||
{
|
||||
term = (ITerm) it.next();
|
||||
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
|
||||
}
|
||||
lexQuery.setDuration( now() - getStart() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param lexQuery Description of Parameter
|
||||
* @exception LexRepositoryException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public static void loadTermByPk( LexQuery lexQuery ) throws LexRepositoryException
|
||||
{
|
||||
ITerm term = assertTerm( lexQuery.getQueryComponent() );
|
||||
try
|
||||
{
|
||||
getSession().load( term, term.getMetaId() );
|
||||
lexQuery.setEntry( term );
|
||||
if ( !lexQuery.getResults().containsKey( term.getMetaId() ) )
|
||||
{
|
||||
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
|
||||
}
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
throw new LexRepositoryException( he );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @exception LexRepositoryException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public static void cleanup() throws LexRepositoryException
|
||||
{
|
||||
try
|
||||
{
|
||||
HibernateSession.closeSession();
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
throw new LexRepositoryException( he );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
89
src/java/org/thdl/lex/LexConstants.java
Normal file
89
src/java/org/thdl/lex/LexConstants.java
Normal file
|
@ -0,0 +1,89 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
public final static String LABEL_REQ_PARAM = "comp";
|
||||
public final static String TERMLABEL_VALUE = "term";
|
||||
public final static String PRONUNCIATIONLABEL_VALUE = "pronunciation";
|
||||
public final static String SPELLINGLABEL_VALUE = "spelling";
|
||||
public final static String ETYMOLOGYLABEL_VALUE = "etymology";
|
||||
public final static String FUNCTIONLABEL_VALUE = "function";
|
||||
public final static String ENCYCLOPEDIA_ARTICLE_LABEL_VALUE = "encyclopediaArticle";
|
||||
public final static String DEFINITIONLABEL_VALUE = "definition";
|
||||
public final static String SUBDEFINITIONLABEL_VALUE = "subdefinition";
|
||||
public final static String MODELSENTENCELABEL_VALUE = "modelSentence";
|
||||
public final static String PASSAGELABEL_VALUE = "passage";
|
||||
public final static String TRANSLATIONLABEL_VALUE = "translationEquivalent";
|
||||
public final static String RELATEDTERMLABEL_VALUE = "relatedTerm";
|
||||
public final static String REGISTERLABEL_VALUE = "register";
|
||||
public final static String KEYWORDLABEL_VALUE = "keyword";
|
||||
public final static String PREFERENCESLABEL_VALUE = "preferences";
|
||||
public final static String ANALYTICALNOTELABEL_VALUE = "analyticalNote";
|
||||
/*
|
||||
* REQUEST PARAM NAMES AND VALUES USED BY LexActionServlet.java
|
||||
*/
|
||||
public final static String COMMAND_REQ_PARAM = "cmd";
|
||||
/*
|
||||
* REQUEST PARAM NAMES AND VALUES USED BY LoginServlet.java
|
||||
*/
|
||||
public final static String USERNAME_REQ_PARAM = "username";
|
||||
public final static String PASSWORD_REQ_PARAM = "password";
|
||||
|
||||
/*
|
||||
* --------------------------
|
||||
* REQUEST PARAM NAMES USED BY LexComponent.scrapeRequest(req) METHODS
|
||||
* --------------------------
|
||||
*/
|
||||
//Meta Data Request Params
|
||||
public final static String NOTE_REQ_PARAM = "note";
|
||||
public final static String LANGUAGE_REQ_PARAM = "language";
|
||||
public final static String TRANSLATIONOF_REQ_PARAM = "translationOf";
|
||||
public final static String DIALECT_REQ_PARAM = "dialect";
|
||||
public final static String SOURCE_REQ_PARAM = "source";
|
||||
public final static String PROJSUB_REQ_PARAM = "projectSubject";
|
||||
public final static String SCRIPT_REQ_PARAM = "script";
|
||||
//Term Data Request Params
|
||||
public final static String TERM_REQ_PARAM = "term";
|
||||
public final static String TERMID_REQ_PARAM = "termId";
|
||||
// public static final String SPELLINGNOTE_REQ_PARAM = "spellingNote";
|
||||
public final static String PRECEDENCE_REQ_PARAM = "precedence";
|
||||
//Definition Data Request Params
|
||||
public final static String SUBDEFINITION_REQ_PARAM = "subdefinition";
|
||||
|
||||
//outgoing request attributes to jsp
|
||||
public final static String COMPONENT_REQ_ATTR = "component";
|
||||
public final static String ORIGINALBEAN_REQ_ATTR = "original";
|
||||
public final static String MESSAGE_REQ_ATTR = "message";
|
||||
|
||||
//session attributes used by filters, servlet, commands and jsp
|
||||
public final static String USER_SESS_ATTR = "user";
|
||||
public final static String PREFERENCES_SESS_ATTR = "preferences";
|
||||
public final static String LOGINTARGET_SESS_PARAM = "loginTarget";
|
||||
|
||||
public final static String DISPLAYMODE_SESS_ATTR = "displayMode";
|
||||
public final static String QUERY_SESS_ATTR = "query";
|
||||
public final static String TERMENTRYBEAN_SESS_ATTR = "termEntry";
|
||||
|
||||
//used by Servlet
|
||||
public final static String JSP_DIR = "/jsp/";
|
||||
public final static String WELCOME_PAGE = "action?cmd=menu";
|
||||
public final static String ERROR_PAGE = "error.jsp";
|
||||
//used by Repository
|
||||
public final static String DRIVER = "com.mysql.jdbc.Driver";
|
||||
|
||||
public final static String HIBERNATE_SESSION_KEY = "hib";
|
||||
|
||||
//public final static String URL = "jdbc:mysql://localhost/LexTorque";
|
||||
}
|
||||
|
18
src/java/org/thdl/lex/LexConstantsSecure.java
Normal file
18
src/java/org/thdl/lex/LexConstantsSecure.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
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";
|
||||
}
|
||||
|
300
src/java/org/thdl/lex/LexFlatDataRepository.java
Normal file
300
src/java/org/thdl/lex/LexFlatDataRepository.java
Normal file
|
@ -0,0 +1,300 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
|
||||
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
|
||||
public static LexFlatDataRepository getInstance()
|
||||
{
|
||||
if (null == instance)
|
||||
instance = new LexFlatDataRepository();
|
||||
return instance;
|
||||
}
|
||||
public void setTransitionalDataLabels()
|
||||
{
|
||||
String sql = "SELECT id, transitionalDataLabel FROM TransitionalDataLabels";
|
||||
setTransitionalDataLabels( createMap( sql ) );
|
||||
}
|
||||
public void setTransitionalDataLabels(HashMap transitionalDataLabels) {
|
||||
this.transitionalDataLabels = transitionalDataLabels;
|
||||
}
|
||||
public HashMap getTransitionalDataLabels() {
|
||||
return transitionalDataLabels;
|
||||
}
|
||||
public void setLiterarySources(HashMap literarySources) {
|
||||
this.literarySources = literarySources;
|
||||
}
|
||||
public void setLiterarySources()
|
||||
{
|
||||
String sql="SELECT id, sourceNormalizedTitle FROM LiterarySources";
|
||||
setLiterarySources( createMap( sql ) );
|
||||
}
|
||||
public HashMap getLiterarySources() {
|
||||
return literarySources;
|
||||
}
|
||||
public void setUsers(HashMap users) {
|
||||
this.users = users;
|
||||
}
|
||||
public void setUsers() {
|
||||
String sql="SELECT id, firstName, lastName FROM Users";
|
||||
setUsers( createMap(sql) );
|
||||
}
|
||||
public void setProjectSubjects(HashMap projectSubjects) {
|
||||
this.projectSubjects = projectSubjects;
|
||||
}
|
||||
public void setProjectSubjects() {
|
||||
String sql="SELECT id, projectSubject FROM projectSubjects";
|
||||
setProjectSubjects( createMap(sql) );
|
||||
}
|
||||
public void setSources(HashMap sources) {
|
||||
this.sources = sources;
|
||||
}
|
||||
public void setSources() {
|
||||
String sql ="SELECT id, sourceTitle FROM Sources";
|
||||
setSources( createMap(sql) );
|
||||
}
|
||||
public void setLanguages(HashMap languages) {
|
||||
this.languages = languages;
|
||||
}
|
||||
public void setLanguages() {
|
||||
String sql="SELECT id,Language FROM Languages";
|
||||
setLanguages( createMap(sql) );
|
||||
}
|
||||
public void setScripts(HashMap scripts) {
|
||||
this.scripts = scripts;
|
||||
}
|
||||
public void setScripts() {
|
||||
String sql="SELECT id,script FROM scripts";
|
||||
setScripts( createMap(sql) );
|
||||
}
|
||||
public HashMap getUsers() {
|
||||
return users;
|
||||
}
|
||||
public HashMap getProjectSubjects() {
|
||||
return projectSubjects;
|
||||
}
|
||||
public HashMap getSources() {
|
||||
return sources;
|
||||
}
|
||||
public HashMap getLanguages() {
|
||||
return languages;
|
||||
}
|
||||
public HashMap getScripts() {
|
||||
return scripts;
|
||||
}
|
||||
public void setEtymologyTypes(HashMap etymologyTypes) {
|
||||
this.etymologyTypes = etymologyTypes;
|
||||
}
|
||||
public void setEtymologyTypes() {
|
||||
String sql="SELECT id, etymologyType FROM EtymologyTypes";
|
||||
setEtymologyTypes( createMap( sql ) );
|
||||
}
|
||||
public HashMap getEtymologyTypes() {
|
||||
return etymologyTypes;
|
||||
}
|
||||
public void setSpellingTypes() {
|
||||
String sql="SELECT id, spellingType FROM SpellingTypes";
|
||||
setSpellingTypes( createMap( sql ) );
|
||||
}
|
||||
public void setSpellingTypes(HashMap spellingTypes) {
|
||||
this.spellingTypes = spellingTypes;
|
||||
}
|
||||
public HashMap getSpellingTypes() {
|
||||
return spellingTypes;
|
||||
}
|
||||
public void setPhoneticsTypes() {
|
||||
String sql="SELECT id, phoneticsType FROM PhoneticsTypes";
|
||||
setPhoneticsTypes( createMap( sql ) );
|
||||
}
|
||||
public void setPhoneticsTypes(HashMap phoneticsTypes) {
|
||||
this.phoneticsTypes = phoneticsTypes;
|
||||
}
|
||||
public HashMap getPhoneticsTypes() {
|
||||
return phoneticsTypes;
|
||||
}
|
||||
public void setRelatedTermTypes() {
|
||||
String sql="SELECT id, relatedTermType FROM RelatedTermTypes";
|
||||
setRelatedTermTypes( createMap( sql ) );
|
||||
}
|
||||
public void setRelatedTermTypes(HashMap relatedTermTypes) {
|
||||
this.relatedTermTypes = relatedTermTypes;
|
||||
}
|
||||
public HashMap getRelatedTermTypes() {
|
||||
return relatedTermTypes;
|
||||
}
|
||||
public void setRegisters() {
|
||||
String sql="SELECT id, register FROM Registers";
|
||||
setRegisters( createMap( sql ) );
|
||||
}
|
||||
public void setRegisters(HashMap registers) {
|
||||
this.registers = registers;
|
||||
}
|
||||
public HashMap getRegisters() {
|
||||
return registers;
|
||||
}
|
||||
public void setFunctionsGeneral() {
|
||||
String sql="SELECT id, functionGeneral FROM FunctionsGeneral";
|
||||
setFunctionsGeneral( createMap( sql ) );
|
||||
}
|
||||
public void setFunctionsGeneral(HashMap functionsGeneral) {
|
||||
this.functionsGeneral = functionsGeneral;
|
||||
}
|
||||
public HashMap getFunctionsGeneral() {
|
||||
return functionsGeneral;
|
||||
}
|
||||
public void setMajorDialectFamilies()
|
||||
{
|
||||
String sql = "SELECT id, majorDialectFamily FROM MajorDialectFamilies";
|
||||
setMajorDialectFamilies( createMap( sql ) );
|
||||
}
|
||||
public void setMajorDialectFamilies(HashMap majorDialectFamilies) {
|
||||
this.majorDialectFamilies = majorDialectFamilies;
|
||||
}
|
||||
public HashMap getMajorDialectFamilies() {
|
||||
return majorDialectFamilies;
|
||||
}
|
||||
// accessor methods for HashMap items
|
||||
public String getUser(int userId)
|
||||
{
|
||||
return (String) getUsers().get( new Integer( userId ) );
|
||||
}
|
||||
public String getProjectSubject(int projSubId)
|
||||
{
|
||||
return (String) getProjectSubjects().get( new Integer( projSubId ) );
|
||||
}
|
||||
public String getSource(int sourceId)
|
||||
{
|
||||
return (String) getSources().get( new Integer( sourceId ) );
|
||||
}
|
||||
public String getLanguage(int langId)
|
||||
{
|
||||
return (String) getLanguages().get( new Integer( langId ) );
|
||||
}
|
||||
public String getScript(int scriptId)
|
||||
{
|
||||
return (String) getScripts().get( new Integer( scriptId ) );
|
||||
}
|
||||
public String getLiterarySource(int litSourceId)
|
||||
{
|
||||
return (String) getLiterarySources().get( new Integer( litSourceId ) );
|
||||
}
|
||||
public String getEtymologyType(int etymType)
|
||||
{
|
||||
return (String) getEtymologyTypes().get( new Integer( etymType ) );
|
||||
}
|
||||
public String getSpellingType(int varType)
|
||||
{
|
||||
return (String) getSpellingTypes().get( new Integer( varType ) );
|
||||
}
|
||||
public String getRegister( int reg )
|
||||
{
|
||||
return (String) getRegisters().get( new Integer( reg ) );
|
||||
}
|
||||
public String getFunctionGeneral( int funcGen )
|
||||
{
|
||||
return (String) getFunctionsGeneral().get( new Integer( funcGen ) );
|
||||
}
|
||||
public String getMajorDialectFamily( int dial )
|
||||
{
|
||||
return (String)getMajorDialectFamilies().get( new Integer( dial ) );
|
||||
}
|
||||
public String getTransitionalDataLabel( int label )
|
||||
{
|
||||
return (String)getTransitionalDataLabels().get( new Integer( label ) );
|
||||
}
|
||||
//helpers
|
||||
public HashMap createMap(String sql)
|
||||
{
|
||||
ResultSet rs = null;
|
||||
HashMap map = new HashMap();
|
||||
try
|
||||
{
|
||||
LexRepository lr = LexRepository.getInstance();
|
||||
rs = lr.getQueryStatement().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 );
|
||||
}
|
||||
}
|
||||
} catch (LexRepositoryException lre)
|
||||
{
|
||||
lre.printStackTrace();
|
||||
} catch (SQLException sqle)
|
||||
{
|
||||
sqle.printStackTrace();
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public LexFlatDataRepository()
|
||||
{
|
||||
setUsers();
|
||||
setProjectSubjects();
|
||||
setSources();
|
||||
setLanguages();
|
||||
setScripts();
|
||||
setLiterarySources();
|
||||
setEtymologyTypes();
|
||||
setSpellingTypes();
|
||||
setPhoneticsTypes();
|
||||
setRelatedTermTypes();
|
||||
setRegisters();
|
||||
setFunctionsGeneral();
|
||||
setMajorDialectFamilies();
|
||||
setTransitionalDataLabels();
|
||||
}
|
||||
//main
|
||||
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) );
|
||||
}
|
||||
}
|
16
src/java/org/thdl/lex/LexQuery.hbm.xml
Normal file
16
src/java/org/thdl/lex/LexQuery.hbm.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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>
|
||||
|
193
src/java/org/thdl/lex/LexQuery.java
Normal file
193
src/java/org/thdl/lex/LexQuery.java
Normal file
|
@ -0,0 +1,193 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import net.sf.hibernate.*;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public class LexQuery
|
||||
{
|
||||
private ILexComponent queryComponent;
|
||||
private ITerm entry;
|
||||
private Map results;
|
||||
private Enumeration mode;
|
||||
private long duration;
|
||||
|
||||
|
||||
/**
|
||||
* 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 mode attribute of the LexQuery object
|
||||
*
|
||||
*@param mode The new mode value
|
||||
*@since
|
||||
*/
|
||||
public void setMode( Enumeration mode )
|
||||
{
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 duration attribute of the LexQuery object
|
||||
*
|
||||
*@return The duration value
|
||||
*@since
|
||||
*/
|
||||
public long getDuration()
|
||||
{
|
||||
return duration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 mode attribute of the LexQuery object
|
||||
*
|
||||
*@return The mode value
|
||||
*@since
|
||||
*/
|
||||
public Enumeration getMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public LexQuery() { }
|
||||
|
||||
//inner classes
|
||||
|
||||
/*
|
||||
* class LexQueryMode extends Enumeration
|
||||
* {
|
||||
* }
|
||||
*/
|
||||
}
|
||||
|
||||
|
323
src/java/org/thdl/lex/LexRepository.java
Normal file
323
src/java/org/thdl/lex/LexRepository.java
Normal file
|
@ -0,0 +1,323 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created September 26, 2002
|
||||
*/
|
||||
public class LexRepository
|
||||
{
|
||||
//attributes
|
||||
private static LexRepository instance;
|
||||
|
||||
private Connection connection;
|
||||
|
||||
private Statement queryStatement;
|
||||
private Statement updateStatement;
|
||||
|
||||
|
||||
//accessors
|
||||
/**
|
||||
* Sets the connection attribute of the LexRepository object
|
||||
*
|
||||
*@param connection The new connection value
|
||||
*@since
|
||||
*/
|
||||
private void setConnection( Connection connection )
|
||||
{
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the queryStatement attribute of the LexRepository object
|
||||
*
|
||||
*@param queryStatement The new queryStatement value
|
||||
*@since
|
||||
*/
|
||||
public void setQueryStatement( Statement queryStatement )
|
||||
{
|
||||
this.queryStatement = queryStatement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the updateStatement attribute of the LexRepository object
|
||||
*
|
||||
*@param updateStatement The new updateStatement value
|
||||
*@since
|
||||
*/
|
||||
public void setUpdateStatement( Statement updateStatement )
|
||||
{
|
||||
this.updateStatement = updateStatement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the connection attribute of the LexRepository object
|
||||
*
|
||||
*@return The connection value
|
||||
*@since
|
||||
*/
|
||||
private Connection getConnection()
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the queryStatement attribute of the LexRepository object
|
||||
*
|
||||
*@return The queryStatement value
|
||||
*@since
|
||||
*/
|
||||
public Statement getQueryStatement()
|
||||
{
|
||||
return queryStatement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the updateStatement attribute of the LexRepository object
|
||||
*
|
||||
*@return The updateStatement value
|
||||
*@since
|
||||
*/
|
||||
public Statement getUpdateStatement()
|
||||
{
|
||||
return updateStatement;
|
||||
}
|
||||
|
||||
|
||||
//helper methods
|
||||
/**
|
||||
* doQuery() performs a SELECT query on the database.
|
||||
*
|
||||
*@param sql This is a SQL String passed in from
|
||||
* outside.
|
||||
*@return ResultSet representing query results
|
||||
*@exception LexRepositoryException Description of the Exception
|
||||
*@since
|
||||
*/
|
||||
public ResultSet doQuery( String sql ) throws LexRepositoryException
|
||||
{
|
||||
try
|
||||
{
|
||||
return getQueryStatement().executeQuery( sql );
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
throw new LexRepositoryException( sqle.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
return getQueryStatement().executeUpdate( sql );
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
throw new LexRepositoryException( sqle.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
{
|
||||
rs = doQuery( "SELECT LAST_INSERT_ID()" );
|
||||
while ( rs.next() )
|
||||
{
|
||||
returnVal = rs.getInt( 1 );
|
||||
}
|
||||
return returnVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnVal = i;
|
||||
}
|
||||
throw new LexRepositoryException( "Insert affected 0 rows. Sql String was '" + sql + "'" );
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
throw new LexRepositoryException( sqle.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//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 )
|
||||
{
|
||||
String table = "Testing";
|
||||
String msg = "Successful";
|
||||
if ( args.length == 1 )
|
||||
{
|
||||
msg = args[0];
|
||||
}
|
||||
//TEST doInsert() method. Insert a message multiple times using the Testing table
|
||||
System.out.println( "TEST ONE\n--------\n" );
|
||||
try
|
||||
{
|
||||
LexRepository lr = LexRepository.getInstance();
|
||||
String sqlString = "INSERT INTO Testing Values (NULL, '" + msg + "')";
|
||||
int newPK = lr.doInsert( sqlString );
|
||||
if ( newPK > 0 )
|
||||
{
|
||||
System.out.println( "The newly inserted row's primary key equals " + newPK );
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println( "The row was not inserted" );
|
||||
}
|
||||
}
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
System.out.println( lre.getMessage() );
|
||||
lre.printStackTrace();
|
||||
}
|
||||
|
||||
//TEST doQuery() method. Accept a table parameter from the command line and output
|
||||
//a tab-delimited representation of the table.
|
||||
System.out.println( "\nTEST TWO\n--------\n" );
|
||||
try
|
||||
{
|
||||
LexRepository lr = LexRepository.getInstance();
|
||||
ResultSet rs = lr.doQuery( "SELECT * FROM " + table );
|
||||
ResultSetMetaData rsmd = rs.getMetaData();
|
||||
|
||||
int cc = rsmd.getColumnCount();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for ( int i = 1; i <= cc; i++ )
|
||||
{
|
||||
if ( 1 != i )
|
||||
{
|
||||
sb.append( "\t" );
|
||||
}
|
||||
sb.append( rsmd.getColumnLabel( i ) );
|
||||
}
|
||||
System.out.println( sb.toString() );
|
||||
sb.setLength( 0 );
|
||||
while ( rs.next() )
|
||||
{
|
||||
for ( int i = 1; i <= cc; i++ )
|
||||
{
|
||||
if ( 1 != i )
|
||||
{
|
||||
sb.append( "\t" );
|
||||
}
|
||||
sb.append( rs.getString( i ) );
|
||||
}
|
||||
|
||||
System.out.println( sb.toString() );
|
||||
sb.setLength( 0 );
|
||||
}
|
||||
}
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
System.out.println( lre.getMessage() );
|
||||
lre.printStackTrace();
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
System.out.println( sqle.getMessage() );
|
||||
sqle.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//constructors
|
||||
/**
|
||||
* Default Constructor for the LexRepository object
|
||||
*
|
||||
*@exception LexRepositoryException Description of the Exception
|
||||
*@since
|
||||
*/
|
||||
private LexRepository() throws LexRepositoryException
|
||||
{
|
||||
try
|
||||
{
|
||||
Class.forName( LexConstants.DRIVER );
|
||||
Properties props = new Properties();
|
||||
props.setProperty( "user", LexConstantsSecure.USER );
|
||||
props.setProperty( "password", LexConstantsSecure.PASSWORD );
|
||||
props.setProperty( "useUnicode", "true" );
|
||||
props.setProperty( "characterEncoding", "UTF-8" );
|
||||
setConnection( DriverManager.getConnection( LexConstantsSecure.URL, props ) );
|
||||
setQueryStatement( getConnection().createStatement() );
|
||||
setUpdateStatement( getConnection().createStatement() );
|
||||
}
|
||||
catch ( ClassNotFoundException cnfe )
|
||||
{
|
||||
throw new LexRepositoryException( "No Driver Available for: " + LexConstants.DRIVER );
|
||||
}
|
||||
catch ( SQLException se )
|
||||
{
|
||||
throw new LexRepositoryException( se.getMessage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
59
src/java/org/thdl/lex/LexRepositoryException.java
Normal file
59
src/java/org/thdl/lex/LexRepositoryException.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
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 );
|
||||
}
|
||||
}
|
||||
|
23
src/java/org/thdl/lex/LexUser.java
Normal file
23
src/java/org/thdl/lex/LexUser.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
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;
|
||||
}
|
||||
}
|
107
src/java/org/thdl/lex/LexUtilities.java
Normal file
107
src/java/org/thdl/lex/LexUtilities.java
Normal file
|
@ -0,0 +1,107 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class LexUtilities
|
||||
{
|
||||
/* 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 );
|
||||
} */
|
||||
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();
|
||||
}
|
||||
public static int getResultSetSize( java.sql.ResultSet rs ) throws java.sql.SQLException
|
||||
{
|
||||
rs.last();
|
||||
int i = rs.getRow();
|
||||
rs.beforeFirst();
|
||||
return i;
|
||||
}
|
||||
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;
|
||||
}
|
||||
public static int[] convertTokensToIntArray( String source )
|
||||
{
|
||||
if (null == source || "null".equals( 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;
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
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 ) );
|
||||
|
||||
int[] ia = {1,2,3,4,5,6,7,8,9};
|
||||
System.out.println( LexUtilities.convertIntArrayToTokens( ia ) );
|
||||
|
||||
String str = "9:8:7:6:5";
|
||||
int[] ia2 = LexUtilities.convertTokensToIntArray( str );
|
||||
String newStr="";
|
||||
for (int i=0; i<5; i++)
|
||||
{
|
||||
newStr=newStr + ia2[i] +" ";
|
||||
}
|
||||
System.out.println( newStr );
|
||||
|
||||
}
|
||||
}
|
228
src/java/org/thdl/lex/LoginServlet.java
Normal file
228
src/java/org/thdl/lex/LoginServlet.java
Normal file
|
@ -0,0 +1,228 @@
|
|||
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 request Description of Parameter
|
||||
* @param response Description of Parameter
|
||||
* @param user Description of Parameter
|
||||
* @exception IOException Description of Exception
|
||||
* @exception LexRepositoryException Description of Exception
|
||||
* @exception LexComponentException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
private void doLoginSuccess( HttpServletRequest request, HttpServletResponse response, ThdlUser user ) throws IOException, LexRepositoryException, LexComponentException
|
||||
{
|
||||
HttpSession session = request.getSession( true );
|
||||
getSessionManager().setSessionUser( session, user );
|
||||
|
||||
Preferences preferences = new Preferences( user );
|
||||
getSessionManager().setPreferences( session, preferences );
|
||||
|
||||
getSessionManager().setDisplayMode( session, "brief" );
|
||||
String targetPage = getSessionManager().getSessionLoginTarget( session, true );
|
||||
|
||||
if ( targetPage == null )
|
||||
{
|
||||
UserSessionManager.doRedirect( request, 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
34
src/java/org/thdl/lex/LogoutServlet.java
Normal file
34
src/java/org/thdl/lex/LogoutServlet.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package org.thdl.lex;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
|
||||
public class LogoutServlet extends HttpServlet
|
||||
{
|
||||
private String goodbyePage;
|
||||
private UserSessionManager sessionMgr = UserSessionManager.getInstance();
|
||||
|
||||
public void setGoodbyePage(String goodbyePage) {
|
||||
this.goodbyePage = goodbyePage;
|
||||
}
|
||||
public String getGoodbyePage() {
|
||||
return goodbyePage;
|
||||
}
|
||||
|
||||
public void init(ServletConfig config) throws ServletException
|
||||
{
|
||||
setGoodbyePage( config.getInitParameter("goodbyePage") );
|
||||
if (goodbyePage == null)
|
||||
throw new ServletException( "The goodbyePage init parameter must be specified.");
|
||||
}
|
||||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException
|
||||
{
|
||||
HttpSession session = request.getSession(true);
|
||||
sessionMgr.removeSessionUser(session);
|
||||
try
|
||||
{
|
||||
UserSessionManager.doRedirect( request, response, goodbyePage);
|
||||
}
|
||||
catch (IOException e) {throw new ServletException("could not redirect to goodbye page");}
|
||||
}
|
||||
}
|
307
src/java/org/thdl/lex/Preferences.java
Normal file
307
src/java/org/thdl/lex/Preferences.java
Normal file
|
@ -0,0 +1,307 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.users.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Preferences
|
||||
{
|
||||
//attributes
|
||||
private int id;
|
||||
private int userId;
|
||||
private String preferencesName;
|
||||
private int projectSubject;
|
||||
private int source;
|
||||
private int language;
|
||||
private int script;
|
||||
private int dialect;
|
||||
private String note;
|
||||
private boolean useDefaultProjSub;
|
||||
private boolean useDefaultSource;
|
||||
private boolean useDefaultLanguage;
|
||||
private boolean useDefaultScript;
|
||||
private boolean useDefaultDialect;
|
||||
private boolean useDefaultNote;
|
||||
private int[] projectSubjectSet;
|
||||
private int[] sourceSet;
|
||||
private int[] languageSet;
|
||||
private int[] scriptSet;
|
||||
private int[] dialectSet;
|
||||
//accessors
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setPreferencesName(String preferencesName) {
|
||||
this.preferencesName = preferencesName;
|
||||
}
|
||||
public String getPreferencesName() {
|
||||
return preferencesName;
|
||||
}
|
||||
public void setUseDefaultNote(boolean useDefaultNote) {
|
||||
this.useDefaultNote = useDefaultNote;
|
||||
}
|
||||
public boolean getUseDefaultNote() {
|
||||
return useDefaultNote;
|
||||
}
|
||||
public void setUseDefaultProjSub(boolean useDefaultProjSub) {
|
||||
this.useDefaultProjSub = useDefaultProjSub;
|
||||
}
|
||||
public boolean getUseDefaultProjSub() {
|
||||
return useDefaultProjSub;
|
||||
}
|
||||
public void setUseDefaultSource(boolean useDefaultSource) {
|
||||
this.useDefaultSource = useDefaultSource;
|
||||
}
|
||||
public void setUseDefaultLanguage(boolean useDefaultLanguage) {
|
||||
this.useDefaultLanguage = useDefaultLanguage;
|
||||
}
|
||||
public void setUseDefaultScript(boolean useDefaultScript) {
|
||||
this.useDefaultScript = useDefaultScript;
|
||||
}
|
||||
public void setUseDefaultDialect(boolean useDefaultDialect) {
|
||||
this.useDefaultDialect = useDefaultDialect;
|
||||
}
|
||||
public boolean getUseDefaultSource() {
|
||||
return useDefaultSource;
|
||||
}
|
||||
public boolean getUseDefaultLanguage() {
|
||||
return useDefaultLanguage;
|
||||
}
|
||||
public boolean getUseDefaultScript() {
|
||||
return useDefaultScript;
|
||||
}
|
||||
public boolean getUseDefaultDialect() {
|
||||
return useDefaultDialect;
|
||||
}
|
||||
public void setProjectSubject(int projectSubject) {
|
||||
this.projectSubject = projectSubject;
|
||||
}
|
||||
public void setSource(int source) {
|
||||
this.source = source;
|
||||
}
|
||||
public void setLanguage(int language) {
|
||||
this.language = language;
|
||||
}
|
||||
public void setScript(int script) {
|
||||
this.script = script;
|
||||
}
|
||||
public void setDialect(int dialect) {
|
||||
this.dialect = dialect;
|
||||
}
|
||||
public void setProjectSubjectSet(int[] projectSubjectSet) {
|
||||
this.projectSubjectSet = projectSubjectSet;
|
||||
}
|
||||
public void setSourceSet(int[] sourceSet) {
|
||||
this.sourceSet = sourceSet;
|
||||
}
|
||||
public void setLanguageSet(int[] languageSet) {
|
||||
this.languageSet = languageSet;
|
||||
}
|
||||
public void setScriptSet(int[] scriptSet) {
|
||||
this.scriptSet = scriptSet;
|
||||
}
|
||||
public void setDialectSet(int[] dialectSet) {
|
||||
this.dialectSet = dialectSet;
|
||||
}
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
public int getProjectSubject() {
|
||||
return projectSubject;
|
||||
}
|
||||
public int getSource() {
|
||||
return source;
|
||||
}
|
||||
public int getLanguage() {
|
||||
return language;
|
||||
}
|
||||
public int getScript() {
|
||||
return script;
|
||||
}
|
||||
public int getDialect() {
|
||||
return dialect;
|
||||
}
|
||||
public int[] getProjectSubjectSet() {
|
||||
return projectSubjectSet;
|
||||
}
|
||||
public int[] getSourceSet() {
|
||||
return sourceSet;
|
||||
}
|
||||
public int[] getLanguageSet() {
|
||||
return languageSet;
|
||||
}
|
||||
public int[] getScriptSet() {
|
||||
return scriptSet;
|
||||
}
|
||||
public int[] getDialectSet() {
|
||||
return dialectSet;
|
||||
}
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
//helpers
|
||||
public void populate() throws LexRepositoryException, LexComponentException
|
||||
{
|
||||
String sql = "SELECT * FROM Preferences WHERE userId = " + getUserId();
|
||||
ResultSet results = LexRepository.getInstance().doQuery( sql );
|
||||
try {
|
||||
if ( LexUtilities.getResultSetSize( results ) > 0 )
|
||||
{
|
||||
results.next();
|
||||
setId( results.getInt( 1 ) );
|
||||
setUserId( results.getInt( 2 ) );
|
||||
setPreferencesName( results.getString( 3 ) );
|
||||
setProjectSubject( results.getInt( 4 ) );
|
||||
setSource( results.getInt( 5 ) );
|
||||
setLanguage( results.getInt( 6 ) );
|
||||
setScript( results.getInt( 7 ) );
|
||||
setDialect( 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.convertTokensToIntArray( results.getString( 16 ) ) );
|
||||
setSourceSet( LexUtilities.convertTokensToIntArray( results.getString( 17 ) ) );
|
||||
setLanguageSet( LexUtilities.convertTokensToIntArray( results.getString( 18 ) ) );
|
||||
setScriptSet( LexUtilities.convertTokensToIntArray( results.getString( 19 ) ) );
|
||||
setDialectSet( LexUtilities.convertTokensToIntArray(results.getString( 20 ) ) );
|
||||
}
|
||||
else {
|
||||
insertNew();
|
||||
}
|
||||
} catch (SQLException sqle)
|
||||
{ throw new LexComponentException( sqle.getMessage() ); }
|
||||
}
|
||||
|
||||
public void insertNew() throws LexComponentException
|
||||
{
|
||||
try {
|
||||
String sql = "INSERT INTO Preferences ( id, userId ) VALUES ( NULL, " +getUserId() +" )";
|
||||
int i = LexRepository.getInstance().doUpdate( sql );
|
||||
setId( i );
|
||||
}
|
||||
catch ( LexRepositoryException lre ) { throw new LexComponentException( lre.getMessage() ); }
|
||||
}
|
||||
|
||||
public void save() throws LexComponentException
|
||||
{
|
||||
try {
|
||||
String sql = "SELECT id FROM Preferences WHERE userId = " + getUserId();
|
||||
ResultSet results = LexRepository.getInstance().doQuery( sql );
|
||||
if ( LexUtilities.getResultSetSize( results ) < 1 )
|
||||
{
|
||||
insertNew();
|
||||
}
|
||||
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( 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.convertIntArrayToTokens( getProjectSubjectSet() ) );
|
||||
sqlBuffer.append( "', sourceSet = '");
|
||||
sqlBuffer.append( LexUtilities.convertIntArrayToTokens( getSourceSet() ) );
|
||||
sqlBuffer.append( "', languageSet = '");
|
||||
sqlBuffer.append( LexUtilities.convertIntArrayToTokens( getLanguageSet() ) );
|
||||
sqlBuffer.append( "', scriptSet = '");
|
||||
sqlBuffer.append( LexUtilities.convertIntArrayToTokens( getScriptSet() ) );
|
||||
sqlBuffer.append( "', dialectSet = '");
|
||||
sqlBuffer.append( LexUtilities.convertIntArrayToTokens( getDialectSet() ) );
|
||||
sqlBuffer.append( "' WHERE id = ");
|
||||
sqlBuffer.append( getId() );
|
||||
|
||||
int i = LexRepository.getInstance().doUpdate( sqlBuffer.toString() );
|
||||
}
|
||||
catch ( LexRepositoryException lre ) { throw new LexComponentException( lre.getMessage() ); }
|
||||
catch ( SQLException sqle ) { throw new LexComponentException( sqle.getMessage() ); }
|
||||
}
|
||||
|
||||
//constructors
|
||||
public Preferences() throws LexRepositoryException, LexComponentException
|
||||
{
|
||||
setId( 0 );
|
||||
setUserId( 1 );
|
||||
setProjectSubject( 1 );
|
||||
setSource( 1 );
|
||||
setLanguage( 1 );
|
||||
setScript( 1 );
|
||||
setDialect( 1 );
|
||||
int[] temp = { getProjectSubject() };
|
||||
setProjectSubjectSet( temp );
|
||||
int[] temp2 = { getSource() };
|
||||
setSourceSet( temp2 );
|
||||
int[] temp3 = { getLanguage() };
|
||||
setLanguageSet( temp3 );
|
||||
int[] temp4 = { getDialect() };
|
||||
setDialectSet( temp4 );
|
||||
int[] temp5 = { getScript() };
|
||||
setScriptSet( temp5 );
|
||||
setNote( "Default Note" );
|
||||
}
|
||||
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() ); */
|
||||
}
|
||||
public static void main(String[] args)
|
||||
{
|
||||
try {
|
||||
Preferences component = new Preferences();
|
||||
component.setUserId( 2 );
|
||||
component.save();
|
||||
System.out.println( component.getId() + " " + component.getUserId() );
|
||||
}
|
||||
catch(Exception e){ e.printStackTrace(); }
|
||||
}
|
||||
}
|
||||
|
164
src/java/org/thdl/lex/ThdlUtilities.java
Normal file
164
src/java/org/thdl/lex/ThdlUtilities.java
Normal file
|
@ -0,0 +1,164 @@
|
|||
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 );
|
||||
|
||||
}
|
||||
}
|
||||
|
238
src/java/org/thdl/lex/UserSessionManager.java
Normal file
238
src/java/org/thdl/lex/UserSessionManager.java
Normal file
|
@ -0,0 +1,238 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.users.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public class UserSessionManager
|
||||
{
|
||||
//attributes
|
||||
|
||||
private static UserSessionManager INSTANCE = new UserSessionManager();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the preferences attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session The new preferences value
|
||||
*@param preferences The new preferences value
|
||||
*@since
|
||||
*/
|
||||
public void setPreferences( HttpSession session, Preferences preferences )
|
||||
{
|
||||
session.setAttribute( LexConstants.PREFERENCES_SESS_ATTR, preferences );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the query attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session The new query value
|
||||
*@param terms The new query value
|
||||
*@since
|
||||
*/
|
||||
public void setQuery( HttpSession session, LexQuery terms )
|
||||
{
|
||||
session.setAttribute( LexConstants.QUERY_SESS_ATTR, terms );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the sessionUser attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session The new sessionUser value
|
||||
*@param user The new sessionUser value
|
||||
*@since
|
||||
*/
|
||||
public void setSessionUser( HttpSession session, ThdlUser user )
|
||||
{
|
||||
session.setAttribute( LexConstants.USER_SESS_ATTR, user );
|
||||
String roleParam = "administrator";
|
||||
if ( user.hasRole( roleParam ) )
|
||||
{
|
||||
//roles from Lex.Users.userRoleList (references Lex.UserRoles)
|
||||
session.setMaxInactiveInterval( 60 * 60 * 8 );
|
||||
}
|
||||
else
|
||||
{
|
||||
session.setMaxInactiveInterval( 60 * 45 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the displayMode attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session The new displayMode value
|
||||
*@param displayMode The new displayMode value
|
||||
*@since
|
||||
*/
|
||||
public void setDisplayMode( HttpSession session, String displayMode )
|
||||
{
|
||||
session.setAttribute( LexConstants.DISPLAYMODE_SESS_ATTR, displayMode );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the entry attribute of the UserSessionManager object
|
||||
*
|
||||
*@return The instance value
|
||||
*@since
|
||||
*/
|
||||
/*
|
||||
* public void setEntry( HttpSession session, ITerm entry )
|
||||
* {
|
||||
* session.setAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR, entry );
|
||||
* }
|
||||
*/
|
||||
|
||||
//helper methods
|
||||
/**
|
||||
* Gets the instance attribute of the UserSessionManager class
|
||||
*
|
||||
*@return The instance value
|
||||
*@since
|
||||
*/
|
||||
public static UserSessionManager getInstance()
|
||||
{
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the query attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session Description of Parameter
|
||||
*@return The query value
|
||||
*@since
|
||||
*/
|
||||
public LexQuery getQuery( HttpSession session )
|
||||
{
|
||||
Object query = session.getAttribute( LexConstants.QUERY_SESS_ATTR );
|
||||
if ( null == query || !( query instanceof LexQuery ) )
|
||||
{
|
||||
query = new LexQuery();
|
||||
session.setAttribute( LexConstants.QUERY_SESS_ATTR, query );
|
||||
}
|
||||
return (LexQuery) query;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the preferences attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session Description of Parameter
|
||||
*@return The preferences value
|
||||
*@since
|
||||
*/
|
||||
public Preferences getPreferences( HttpSession session )
|
||||
{
|
||||
return (Preferences) session.getAttribute( LexConstants.PREFERENCES_SESS_ATTR );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the sessionUser attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session Description of Parameter
|
||||
*@return The sessionUser value
|
||||
*@since
|
||||
*/
|
||||
public ThdlUser getSessionUser( HttpSession session )
|
||||
{
|
||||
return (ThdlUser) session.getAttribute( LexConstants.USER_SESS_ATTR );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the entry attribute of the UserSessionManager object
|
||||
*
|
||||
*@param session Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
/*
|
||||
* public ITerm getEntry( HttpSession session )
|
||||
* {
|
||||
* return (ITerm) session.getAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR );
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param session Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public void removeSessionUser( HttpSession session )
|
||||
{
|
||||
session.removeAttribute( LexConstants.USER_SESS_ATTR );
|
||||
session.removeAttribute( LexConstants.PREFERENCES_SESS_ATTR );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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() { }
|
||||
}
|
||||
|
47
src/java/org/thdl/lex/commands/AbortCommand.java
Normal file
47
src/java/org/thdl/lex/commands/AbortCommand.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
27
src/java/org/thdl/lex/commands/Command.java
Normal file
27
src/java/org/thdl/lex/commands/Command.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
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;
|
||||
// public java.util.HashMap initForwards();
|
||||
}
|
||||
|
62
src/java/org/thdl/lex/commands/CommandException.java
Normal file
62
src/java/org/thdl/lex/commands/CommandException.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
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 );
|
||||
}
|
||||
}
|
||||
|
49
src/java/org/thdl/lex/commands/CommandToken.java
Normal file
49
src/java/org/thdl/lex/commands/CommandToken.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
public class CommandToken
|
||||
{
|
||||
public static void set(HttpServletRequest req)
|
||||
{
|
||||
HttpSession session = req.getSession(true);
|
||||
long systime = System.currentTimeMillis();
|
||||
byte[] time = new Long(systime).toString().getBytes();
|
||||
byte[] id = session.getId().getBytes();
|
||||
try
|
||||
{
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(id);
|
||||
md5.update(time);
|
||||
String token = toHex( md5.digest() );
|
||||
req.setAttribute("token", token);
|
||||
session.setAttribute("token", token);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("Unable to calculate MD5 Digests.\nCould not create unique token");
|
||||
}
|
||||
}
|
||||
public static boolean isValid(HttpServletRequest req)
|
||||
{
|
||||
HttpSession session = req.getSession(true);
|
||||
String requestToken = req.getParameter("token");
|
||||
String sessionToken = (String) session.getAttribute("token");
|
||||
if (requestToken == null && sessionToken == null)
|
||||
return false;
|
||||
else
|
||||
return requestToken.equals(sessionToken);//this is a boolean
|
||||
}
|
||||
public static String toHex(byte[] digest)
|
||||
{
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (int i = 0; i < digest.length; i++)
|
||||
buf.append( Integer.toHexString( (int)digest[i] & 0x00ff ) );//param=BITWISE operation
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
113
src/java/org/thdl/lex/commands/DisplayCommand.java
Normal file
113
src/java/org/thdl/lex/commands/DisplayCommand.java
Normal file
|
@ -0,0 +1,113 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
*/
|
||||
public class DisplayCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
/**
|
||||
* Sets the displayMode attribute of the DisplayCommand object
|
||||
*
|
||||
*@param req The new displayMode value
|
||||
*@since
|
||||
*/
|
||||
public void setDisplayMode( HttpServletRequest req )
|
||||
{
|
||||
String cmd = req.getParameter( LexConstants.COMMAND_REQ_PARAM );
|
||||
if ( cmd.equals( "display" ) )
|
||||
{
|
||||
req.getSession( true ).setAttribute( LexConstants.DISPLAYMODE_SESS_ATTR, "brief" );
|
||||
}
|
||||
else if ( cmd.equals( "displayFull" ) )
|
||||
{
|
||||
req.getSession( true ).setAttribute( LexConstants.DISPLAYMODE_SESS_ATTR, "full" );
|
||||
}
|
||||
else if ( cmd.equals( "editEntry" ) )
|
||||
{
|
||||
req.getSession( true ).setAttribute( LexConstants.DISPLAYMODE_SESS_ATTR, "edit" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//contract methods
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
try
|
||||
{
|
||||
component.populate( req.getParameterMap() );
|
||||
|
||||
LexQuery query = getSessionMgr().getQuery( req.getSession( true ) );
|
||||
query.setQueryComponent( component );
|
||||
LexComponentRepository.loadTermByPk( query );
|
||||
|
||||
String msg = null;
|
||||
String forward = (String) getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) );
|
||||
setNext( forward );
|
||||
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
|
||||
|
||||
return getNext();
|
||||
}
|
||||
catch ( LexComponentException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
catch ( LexRepositoryException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@return Description of the Returned Value
|
||||
*@since
|
||||
*/
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
map.put( LexConstants.ENCYCLOPEDIA_ARTICLE_LABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
//constructors
|
||||
/**
|
||||
* Constructor for the DisplayCommand object
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public DisplayCommand()
|
||||
{
|
||||
super();
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
}
|
||||
|
104
src/java/org/thdl/lex/commands/FindCommand.java
Normal file
104
src/java/org/thdl/lex/commands/FindCommand.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public class FindCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
try
|
||||
{
|
||||
String msg = null;
|
||||
String forward = (String) getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) );
|
||||
|
||||
component.populate( req.getParameterMap() );
|
||||
setNext( forward );
|
||||
|
||||
if ( component instanceof ITerm )
|
||||
{
|
||||
ITerm term = (ITerm) component;
|
||||
|
||||
LexQuery query = getSessionMgr().getQuery( req.getSession( true ) );
|
||||
|
||||
query.setQueryComponent( term );
|
||||
LexComponentRepository.findTermsByTerm( query );
|
||||
Iterator iterator = query.getResults().keySet().iterator();
|
||||
if ( iterator.hasNext() )
|
||||
{
|
||||
setNext( "displayEntry.jsp" );
|
||||
getSessionMgr().setQuery( req.getSession( true ), query );
|
||||
msg = "There are " + query.getResults().size() + " terms matching " + term.getTerm();
|
||||
}
|
||||
else
|
||||
{
|
||||
setNext( "menu.jsp" );
|
||||
msg = "There were no terms matching " + term.getTerm();
|
||||
}
|
||||
}
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
|
||||
return getNext();
|
||||
}
|
||||
catch ( LexComponentException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
catch ( LexRepositoryException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@return Description of the Returned Value
|
||||
*@since
|
||||
*/
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
//constructors
|
||||
/**
|
||||
* Constructor for the FindCommand object
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public FindCommand()
|
||||
{
|
||||
super();
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
}
|
||||
|
65
src/java/org/thdl/lex/commands/GetInsertFormCommand.java
Normal file
65
src/java/org/thdl/lex/commands/GetInsertFormCommand.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GetInsertFormCommand extends LexCommand implements Command
|
||||
{
|
||||
//contract methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
setComponent( (LexComponent)component );
|
||||
getComponent().scrapeRequest( req );
|
||||
String msg="You have reached the New Entry form.";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals( "annotate" ) )
|
||||
{
|
||||
setComponent( (LexComponent)component );
|
||||
getComponent().scrapeRequest( req );
|
||||
getComponent().query();
|
||||
|
||||
AnalyticalNote note = new AnalyticalNote();
|
||||
note.setParentMeta( getComponent().getMetaId() );
|
||||
req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component );
|
||||
}
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ), "addNewComponent" );
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
//helper methods
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp?formMode=insert" );
|
||||
map.put( LexConstants.SUBDEFINITIONLABEL_VALUE, "displayEntry.jsp?formMode=insert" );
|
||||
map.put( LexConstants.TRANSLATIONLABEL_VALUE, "displayEntry.jsp?formMode=insert" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public GetInsertFormCommand()
|
||||
{
|
||||
super();
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
public GetInsertFormCommand( String next )
|
||||
{
|
||||
super();
|
||||
setNext( next );
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GetTranslationFormCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
ThdlUser user = getSessionMgr().getSessionUser( req.getSession( true ) );
|
||||
Preferences preferences = getSessionMgr().getPreferences( req.getSession( true ) );
|
||||
Meta meta = new Meta( user, preferences );
|
||||
meta.scrapeRequest( req );
|
||||
component.setTranslationOf( Integer.parseInt( req.getParameter("id") ) );
|
||||
meta.insert();
|
||||
setComponent( component );
|
||||
getComponent().query( Integer.parseInt( req.getParameter("id") ) );
|
||||
req.setAttribute( LexConstants.ORIGINALBEAN_REQ_ATTR , getComponent() );
|
||||
getComponent().setMeta( meta );
|
||||
//getComponent().insert();
|
||||
String msg="You have reached the Translation Form";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ) , "addEditForm" );
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
//constructors
|
||||
public GetTranslationFormCommand()
|
||||
{
|
||||
super();
|
||||
}
|
||||
public GetTranslationFormCommand( String next )
|
||||
{
|
||||
super();
|
||||
setNext( next );
|
||||
}
|
||||
}
|
||||
|
84
src/java/org/thdl/lex/commands/GetUpdateFormCommand.java
Normal file
84
src/java/org/thdl/lex/commands/GetUpdateFormCommand.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GetUpdateFormCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
String msg = null;
|
||||
setComponent( (LexComponent)component );
|
||||
getComponent().scrapeRequest( req );
|
||||
getComponent().query();
|
||||
if ( getComponent().getTranslationOf() > 0 )
|
||||
{
|
||||
try
|
||||
{
|
||||
LexComponent lab = (LexComponent) getComponent().getClass().newInstance();
|
||||
lab.query( getComponent().getTranslationOf() );
|
||||
req.setAttribute( LexConstants.ORIGINALBEAN_REQ_ATTR , lab );
|
||||
}
|
||||
catch (InstantiationException ie)
|
||||
{
|
||||
throw new LexComponentException("InstantiationException Says: " +ie.getMessage());
|
||||
}
|
||||
catch (IllegalAccessException iae)
|
||||
{
|
||||
throw new LexComponentException("IllegalAccessException Says: " +iae.getMessage());
|
||||
}
|
||||
}
|
||||
Meta meta = getComponent().getMeta();
|
||||
if ( getSessionMgr().getSessionUser( req.getSession( true ) ).getId() == meta.getCreatedBy() )
|
||||
{
|
||||
msg="You have reached the Update Form";
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ) , "addEditForm" );
|
||||
setNext( "displayForm.jsp?formMode=update" );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg="A dictionary component can only be edited by the person who created it";
|
||||
setNext( "displayEntry.jsp" );
|
||||
}
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
*/
|
||||
}
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
//map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp?formMode=update" );
|
||||
//map.put( LexConstants.SUBDEFINITIONLABEL_VALUE, "displayEntry.jsp?formMode=update" );
|
||||
//map.put( LexConstants.TRANSLATIONLABEL_VALUE, "displayEntry.jsp?formMode=update" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public GetUpdateFormCommand()
|
||||
{
|
||||
super();
|
||||
//setForwards( initForwards() );
|
||||
}
|
||||
public GetUpdateFormCommand( String next )
|
||||
{
|
||||
super();
|
||||
setNext( next );
|
||||
}
|
||||
}
|
||||
|
97
src/java/org/thdl/lex/commands/InsertCommand.java
Normal file
97
src/java/org/thdl/lex/commands/InsertCommand.java
Normal file
|
@ -0,0 +1,97 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class InsertCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
if ( CommandToken.isValid( req ) )
|
||||
{
|
||||
ThdlUser user = getSessionMgr().getSessionUser( req.getSession( true ) );
|
||||
Preferences preferences = getSessionMgr().getPreferences( req.getSession( true ) );
|
||||
if ( null == user )
|
||||
throw new CommandException("No ThdlUser available in this Session");
|
||||
if ( null == preferences )
|
||||
throw new CommandException("No Preferences available in this Session");
|
||||
Meta meta = new Meta( user, preferences );
|
||||
meta.scrapeRequest( req );
|
||||
meta.insert();
|
||||
|
||||
setComponent( component );
|
||||
getComponent().setMeta( meta );
|
||||
getComponent().scrapeRequest( req );
|
||||
getComponent().insert();
|
||||
getComponent().query();
|
||||
req.setAttribute( "jumpToLocation", getComponent().getLabel() );
|
||||
if ( null != req.getParameter( "analyticalNote" ) )
|
||||
{
|
||||
if ( ! LexConstants.LABEL_REQ_PARAM.equals( LexConstants.ANALYTICALNOTELABEL_VALUE )
|
||||
&& ! "".equals( req.getParameter( "analyticalNote" ) ) )
|
||||
{
|
||||
AnalyticalNote note = new AnalyticalNote();
|
||||
Meta mb = new Meta( meta );
|
||||
mb.insert();
|
||||
note.setMeta( mb );
|
||||
note.scrapeRequest( req );
|
||||
note.setParentMeta( getComponent().getMetaId() );
|
||||
note.insert();
|
||||
}
|
||||
}
|
||||
|
||||
String msg="Successful new " +getComponent().getLabel() +" Entry.";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
if ( getComponent() instanceof Term )
|
||||
getSessionMgr().setEntry( req.getSession( true ) , new TermEntry( getComponent() ) );
|
||||
else
|
||||
getSessionMgr().getEntry( req.getSession( true ) ).rebuild();
|
||||
if (null == getSessionMgr().getResults( req.getSession( true ) ) )
|
||||
{
|
||||
LexComponent[] results = {component};
|
||||
getSessionMgr().setResults( req.getSession( true ), results );
|
||||
}
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ), "edit" );
|
||||
}
|
||||
else
|
||||
{
|
||||
String msg="Invalid Reload Attempted";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
}
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
catch (LexEntryException e)
|
||||
{
|
||||
throw new CommandException("Lex Entry Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
// map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
public InsertCommand( String next)
|
||||
{
|
||||
super( next );
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
}
|
||||
|
204
src/java/org/thdl/lex/commands/LexCommand.java
Normal file
204
src/java/org/thdl/lex/commands/LexCommand.java
Normal file
|
@ -0,0 +1,204 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
//import org.apache.commons.beanutils.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.LinkedList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
*/
|
||||
public abstract class LexCommand implements Command
|
||||
{
|
||||
//attributes
|
||||
private String defaultNext;
|
||||
private String next;
|
||||
private ILexComponent component;
|
||||
private LinkedList resultsList;
|
||||
private HashMap forwards;
|
||||
private UserSessionManager sessionMgr;
|
||||
|
||||
|
||||
//accessors
|
||||
/**
|
||||
* Sets the sessionMgr attribute of the LexCommand object
|
||||
*
|
||||
*@param sessionMgr The new sessionMgr value
|
||||
*@since
|
||||
*/
|
||||
public void setSessionMgr( UserSessionManager sessionMgr )
|
||||
{
|
||||
this.sessionMgr = sessionMgr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the defaultNext attribute of the LexCommand object
|
||||
*
|
||||
*@param defaultNext The new defaultNext value
|
||||
*@since
|
||||
*/
|
||||
public void setDefaultNext( String defaultNext )
|
||||
{
|
||||
this.defaultNext = defaultNext;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the forwards attribute of the LexCommand object
|
||||
*
|
||||
*@param forwards The new forwards value
|
||||
*@since
|
||||
*/
|
||||
public void setForwards( HashMap forwards )
|
||||
{
|
||||
this.forwards = forwards;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the resultsList attribute of the LexCommand object
|
||||
*
|
||||
*@param resultsList The new resultsList value
|
||||
*@since
|
||||
*/
|
||||
public void setResultsList( LinkedList resultsList )
|
||||
{
|
||||
this.resultsList = resultsList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the next attribute of the LexCommand object
|
||||
*
|
||||
*@param next The new next value
|
||||
*@since
|
||||
*/
|
||||
public void setNext( String next )
|
||||
{
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the component attribute of the LexCommand object
|
||||
*
|
||||
*@return The sessionMgr value
|
||||
*@since
|
||||
*/
|
||||
/*
|
||||
* public void setComponent( ILexComponent component )
|
||||
* {
|
||||
* this.component = component;
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the sessionMgr attribute of the LexCommand object
|
||||
*
|
||||
*@return The sessionMgr value
|
||||
*@since
|
||||
*/
|
||||
public UserSessionManager getSessionMgr()
|
||||
{
|
||||
if ( null == sessionMgr )
|
||||
{
|
||||
setSessionMgr( UserSessionManager.getInstance() );
|
||||
}
|
||||
return sessionMgr;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the defaultNext attribute of the LexCommand object
|
||||
*
|
||||
*@return The defaultNext value
|
||||
*@since
|
||||
*/
|
||||
public String getDefaultNext()
|
||||
{
|
||||
return defaultNext;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the forwards attribute of the LexCommand object
|
||||
*
|
||||
*@return The forwards value
|
||||
*@since
|
||||
*/
|
||||
public HashMap getForwards()
|
||||
{
|
||||
return forwards;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the resultsList attribute of the LexCommand object
|
||||
*
|
||||
*@return The resultsList value
|
||||
*@since
|
||||
*/
|
||||
public LinkedList getResultsList()
|
||||
{
|
||||
return resultsList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the next attribute of the LexCommand object
|
||||
*
|
||||
*@return The next value
|
||||
*@since
|
||||
*/
|
||||
public String getNext()
|
||||
{
|
||||
return next;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the component attribute of the LexCommand object
|
||||
*
|
||||
*@param next Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
/*
|
||||
* public ILexComponent getComponent()
|
||||
* {
|
||||
* return component;
|
||||
* }
|
||||
*/
|
||||
//helpers
|
||||
|
||||
//constructors
|
||||
|
||||
/**
|
||||
* Constructor for the LexCommand object
|
||||
*
|
||||
*@param next Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexCommand( String next )
|
||||
{
|
||||
setDefaultNext( next );
|
||||
setNext( getDefaultNext() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexCommand object
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public LexCommand() { }
|
||||
}
|
||||
|
76
src/java/org/thdl/lex/commands/NewComponentCommand.java
Normal file
76
src/java/org/thdl/lex/commands/NewComponentCommand.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class NewComponentCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
|
||||
setComponent( (LexComponent)component );
|
||||
getComponent().scrapeRequest( req );
|
||||
String msg="You have reached the form for creating a New " +getComponent().getLabel() +" Entry.";
|
||||
String forward = (String)getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) );
|
||||
setNext( forward );
|
||||
|
||||
if ( getComponent() instanceof Term )
|
||||
{
|
||||
Term term = (Term)getComponent();
|
||||
LexComponent[] results = term.find();
|
||||
req.setAttribute( "term", term.getTerm() );
|
||||
if ( results.length > 0)
|
||||
{
|
||||
component=results[0];
|
||||
msg="There are already " + results.length + " entries for " + term.getTerm() +".";
|
||||
getSessionMgr().setEntry( req.getSession( true), new TermEntry( component ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
//REQUEST SHOULD BE FORWARDED TO /lex/action?cmd=getInsertForm HERE
|
||||
results = new LexComponent[1];
|
||||
results[0] = component;
|
||||
msg="Click the 'New Entry' button to add " + term.getTerm() +" to the dictionary.";
|
||||
getSessionMgr().setEntry( req.getSession( true), null );
|
||||
}
|
||||
setNext( "displayEntry.jsp?mode=newTerm");
|
||||
getSessionMgr().setResults( req.getSession( true ), results );
|
||||
}
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
catch (LexEntryException e)
|
||||
{
|
||||
throw new CommandException("Lex Entry Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public NewComponentCommand()
|
||||
{
|
||||
super();
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
}
|
||||
|
24
src/java/org/thdl/lex/commands/NullCommand.java
Normal file
24
src/java/org/thdl/lex/commands/NullCommand.java
Normal file
|
@ -0,0 +1,24 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class NullCommand extends LexCommand implements Command
|
||||
{
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
if( null == req.getParameter( LexConstants.COMMAND_REQ_PARAM ) )
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, "Start from here." );
|
||||
if( "login" == req.getParameter( LexConstants.COMMAND_REQ_PARAM )
|
||||
&& null != getSessionMgr().getSessionUser( req.getSession(true) ) )
|
||||
setNext("menu.jsp");
|
||||
return getNext();
|
||||
}
|
||||
public java.util.HashMap initForwards() { return null;}
|
||||
public NullCommand(String next)
|
||||
{
|
||||
super(next);
|
||||
}
|
||||
}
|
69
src/java/org/thdl/lex/commands/PreferencesCommand.java
Normal file
69
src/java/org/thdl/lex/commands/PreferencesCommand.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class PreferencesCommand extends LexCommand implements Command
|
||||
{
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
Preferences isb = UserSessionManager.getInstance().getPreferences( req.getSession( true ) );
|
||||
if (req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals("setMetaPrefs") )
|
||||
{
|
||||
isb.setLanguageSet( LexUtilities.convertToIntArray( req.getParameterValues( "languages" ) ) );
|
||||
isb.setDialectSet( LexUtilities.convertToIntArray( req.getParameterValues( "dialects" ) ) );
|
||||
isb.setSourceSet( LexUtilities.convertToIntArray( req.getParameterValues( "sources" ) ) );
|
||||
isb.setProjectSubjectSet( LexUtilities.convertToIntArray( req.getParameterValues( "projectSubjects" ) ) );
|
||||
isb.setScriptSet( LexUtilities.convertToIntArray( req.getParameterValues( "scripts" ) ) );
|
||||
}
|
||||
else if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals("setMetaDefaults") )
|
||||
{
|
||||
isb.setLanguage( Integer.parseInt( req.getParameter( "language" ) ) );
|
||||
isb.setDialect( Integer.parseInt( req.getParameter( "dialect" ) ) );
|
||||
isb.setSource( Integer.parseInt( req.getParameter( "source" ) ) );
|
||||
isb.setProjectSubject( Integer.parseInt( req.getParameter( "projectSubject" ) ) );
|
||||
isb.setScript( Integer.parseInt( req.getParameter( "script" ) ) );
|
||||
isb.setNote( req.getParameter( "note" ) );
|
||||
if ( null != req.getParameter( "useDefaultLanguage" ) && req.getParameter( "useDefaultLanguage" ).equals( "true" ) )
|
||||
isb.setUseDefaultLanguage( true );
|
||||
else
|
||||
isb.setUseDefaultLanguage( false );
|
||||
if ( null != req.getParameter( "useDefaultDialect" ) && req.getParameter( "useDefaultDialect" ).equals( "true" ) )
|
||||
isb.setUseDefaultDialect( true );
|
||||
else
|
||||
isb.setUseDefaultDialect( false );
|
||||
if ( null != req.getParameter( "useDefaultSource" ) && req.getParameter( "useDefaultSource" ).equals( "true" ) )
|
||||
isb.setUseDefaultSource( true );
|
||||
else
|
||||
isb.setUseDefaultSource( false );
|
||||
if ( null != req.getParameter( "useDefaultProjSub" ) && req.getParameter( "useDefaultProjSub" ).equals( "true" ) )
|
||||
isb.setUseDefaultProjSub( true );
|
||||
else
|
||||
isb.setUseDefaultProjSub( false );
|
||||
if ( null != req.getParameter( "useDefaultScript" ) && req.getParameter( "useDefaultScript" ).equals( "true" ) )
|
||||
isb.setUseDefaultScript( true );
|
||||
else
|
||||
isb.setUseDefaultScript( false );
|
||||
if ( null != req.getParameter( "useDefaultNote" ) && req.getParameter( "useDefaultNote" ).equals( "true" ) )
|
||||
isb.setUseDefaultNote( true );
|
||||
else
|
||||
isb.setUseDefaultNote( false );
|
||||
}
|
||||
try
|
||||
{
|
||||
isb.save();
|
||||
}
|
||||
catch( LexComponentException lre )
|
||||
{
|
||||
throw new CommandException( "LexComponentException says: " + lre.getMessage() );
|
||||
}
|
||||
return getNext();
|
||||
}
|
||||
public java.util.HashMap initForwards() { return null;}
|
||||
public PreferencesCommand(String next)
|
||||
{
|
||||
super(next);
|
||||
}
|
||||
}
|
56
src/java/org/thdl/lex/commands/RemoveCommand.java
Normal file
56
src/java/org/thdl/lex/commands/RemoveCommand.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class RemoveCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
setComponent( (LexComponent)component );
|
||||
getComponent().query( Integer.parseInt( req.getParameter("id") ) );
|
||||
String msg=null;
|
||||
String forward = (String)getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) );
|
||||
setNext( forward );
|
||||
int successCode = getComponent().remove();
|
||||
msg=null;
|
||||
String label = req.getParameter( LexConstants.LABEL_REQ_PARAM );
|
||||
if (successCode > 0)
|
||||
{ msg = "The " + label +" was successfully removed."; }
|
||||
else
|
||||
{ msg = "Failure: The " + getComponent().getLabel() +" was not removed."; }
|
||||
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "menu.jsp" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public RemoveCommand()
|
||||
{
|
||||
super();
|
||||
setForwards( initForwards() );
|
||||
}
|
||||
}
|
||||
|
30
src/java/org/thdl/lex/commands/TestingCommand.java
Normal file
30
src/java/org/thdl/lex/commands/TestingCommand.java
Normal file
|
@ -0,0 +1,30 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class TestingCommand extends LexCommand implements Command
|
||||
{
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
|
||||
try {
|
||||
/* Term term = new Term();
|
||||
term.setId( 1 );
|
||||
term.setTerm( "this is a word" );
|
||||
term.setAnalyticalNotes( new java.util.Vector() );
|
||||
term.getAnalyticalNotes().add( "hi" );
|
||||
term.getAnalyticalNotes().add( "there" );
|
||||
req.setAttribute( "term", term ); */
|
||||
return getNext();
|
||||
}
|
||||
catch (Exception e) { throw new CommandException( e.toString() + e.getMessage() ); }
|
||||
}
|
||||
public java.util.HashMap initForwards() { return null;}
|
||||
public TestingCommand(String next)
|
||||
{
|
||||
super(next);
|
||||
}
|
||||
}
|
76
src/java/org/thdl/lex/commands/UpdateCommand.java
Normal file
76
src/java/org/thdl/lex/commands/UpdateCommand.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class UpdateCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
if ( CommandToken.isValid( req ) )
|
||||
{
|
||||
Preferences preferences=getSessionMgr().getPreferences( req.getSession(true) );
|
||||
ThdlUser user = getSessionMgr().getSessionUser( req.getSession(true) );
|
||||
String msg="Successful Update";
|
||||
|
||||
setComponent( component );
|
||||
getComponent().query( Integer.parseInt( req.getParameter("id") ) );
|
||||
getComponent().scrapeRequest( req );
|
||||
getComponent().update( user, preferences );
|
||||
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
req.setAttribute( "jumpToLocation", getComponent().getLabel() );
|
||||
getSessionMgr().getEntry( req.getSession( true ) ).rebuild();
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ), "edit" );
|
||||
}
|
||||
else
|
||||
{
|
||||
String msg="Invalid Reload Attempted";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
}
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
}
|
||||
catch (LexEntryException e)
|
||||
{
|
||||
throw new CommandException("Lex Entry Exception: " + e.getMessage());
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
map.put( LexConstants.SUBDEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
map.put( LexConstants.TRANSLATIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" );
|
||||
// map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" );
|
||||
return map;
|
||||
}
|
||||
|
||||
//constructors
|
||||
public UpdateCommand()
|
||||
{
|
||||
super();
|
||||
//setForwards( initForwards() );
|
||||
}
|
||||
public UpdateCommand( String next )
|
||||
{
|
||||
this();
|
||||
setNext( next );
|
||||
}
|
||||
}
|
||||
|
9
src/java/org/thdl/lex/component/AnalyticalNote.java
Normal file
9
src/java/org/thdl/lex/component/AnalyticalNote.java
Normal file
|
@ -0,0 +1,9 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
public class AnalyticalNote extends BaseAnalyticalNote implements Serializable
|
||||
{
|
||||
|
||||
}
|
79
src/java/org/thdl/lex/component/BaseAnalyticalNote.java
Normal file
79
src/java/org/thdl/lex/component/BaseAnalyticalNote.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseAnalyticalNote extends LexComponent implements Serializable,org.thdl.lex.component.IAnalyticalNote {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String analyticalNote;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseAnalyticalNote(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String analyticalNote, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.analyticalNote = analyticalNote;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseAnalyticalNote() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseAnalyticalNote(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getAnalyticalNote() {
|
||||
return this.analyticalNote;
|
||||
}
|
||||
|
||||
public void setAnalyticalNote(java.lang.String analyticalNote) {
|
||||
this.analyticalNote = analyticalNote;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
184
src/java/org/thdl/lex/component/BaseDefinition.java
Normal file
184
src/java/org/thdl/lex/component/BaseDefinition.java
Normal file
|
@ -0,0 +1,184 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseDefinition extends LexComponent implements org.thdl.lex.component.IDefinition,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String definition;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** persistent field */
|
||||
private List subdefinitions;
|
||||
|
||||
/** persistent field */
|
||||
private List glosses;
|
||||
|
||||
/** persistent field */
|
||||
private List keywords;
|
||||
|
||||
/** persistent field */
|
||||
private List modelSentences;
|
||||
|
||||
/** persistent field */
|
||||
private List translationEquivalents;
|
||||
|
||||
/** persistent field */
|
||||
private List relatedTerms;
|
||||
|
||||
/** persistent field */
|
||||
private List passages;
|
||||
|
||||
/** persistent field */
|
||||
private List registers;
|
||||
|
||||
/** full constructor */
|
||||
public BaseDefinition(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String definition, org.thdl.lex.component.ILexComponent parent, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.definition = definition;
|
||||
this.parent = parent;
|
||||
this.subdefinitions = subdefinitions;
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseDefinition() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseDefinition(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short precedence, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.precedence = precedence;
|
||||
this.subdefinitions = subdefinitions;
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getDefinition() {
|
||||
return this.definition;
|
||||
}
|
||||
|
||||
public void setDefinition(java.lang.String definition) {
|
||||
this.definition = definition;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public java.util.List getSubdefinitions() {
|
||||
return this.subdefinitions;
|
||||
}
|
||||
|
||||
public void setSubdefinitions(java.util.List subdefinitions) {
|
||||
this.subdefinitions = subdefinitions;
|
||||
}
|
||||
|
||||
public java.util.List getGlosses() {
|
||||
return this.glosses;
|
||||
}
|
||||
|
||||
public void setGlosses(java.util.List glosses) {
|
||||
this.glosses = glosses;
|
||||
}
|
||||
|
||||
public java.util.List getKeywords() {
|
||||
return this.keywords;
|
||||
}
|
||||
|
||||
public void setKeywords(java.util.List keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public java.util.List getModelSentences() {
|
||||
return this.modelSentences;
|
||||
}
|
||||
|
||||
public void setModelSentences(java.util.List modelSentences) {
|
||||
this.modelSentences = modelSentences;
|
||||
}
|
||||
|
||||
public java.util.List getTranslationEquivalents() {
|
||||
return this.translationEquivalents;
|
||||
}
|
||||
|
||||
public void setTranslationEquivalents(java.util.List translationEquivalents) {
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
}
|
||||
|
||||
public java.util.List getRelatedTerms() {
|
||||
return this.relatedTerms;
|
||||
}
|
||||
|
||||
public void setRelatedTerms(java.util.List relatedTerms) {
|
||||
this.relatedTerms = relatedTerms;
|
||||
}
|
||||
|
||||
public java.util.List getPassages() {
|
||||
return this.passages;
|
||||
}
|
||||
|
||||
public void setPassages(java.util.List passages) {
|
||||
this.passages = passages;
|
||||
}
|
||||
|
||||
public java.util.List getRegisters() {
|
||||
return this.registers;
|
||||
}
|
||||
|
||||
public void setRegisters(java.util.List registers) {
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
93
src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java
Normal file
93
src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseEncyclopediaArticle extends LexComponent implements org.thdl.lex.component.IEncyclopediaArticle,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String article;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String articleTitle;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseEncyclopediaArticle(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String article, java.lang.String articleTitle, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.article = article;
|
||||
this.articleTitle = articleTitle;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseEncyclopediaArticle() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseEncyclopediaArticle(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String article, java.lang.String articleTitle) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.article = article;
|
||||
this.articleTitle = articleTitle;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getArticle() {
|
||||
return this.article;
|
||||
}
|
||||
|
||||
public void setArticle(java.lang.String article) {
|
||||
this.article = article;
|
||||
}
|
||||
|
||||
public java.lang.String getArticleTitle() {
|
||||
return this.articleTitle;
|
||||
}
|
||||
|
||||
public void setArticleTitle(java.lang.String articleTitle) {
|
||||
this.articleTitle = articleTitle;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
118
src/java/org/thdl/lex/component/BaseEtymology.java
Normal file
118
src/java/org/thdl/lex/component/BaseEtymology.java
Normal file
|
@ -0,0 +1,118 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseEtymology extends LexComponent implements Serializable,org.thdl.lex.component.IEtymology {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short loanLanguage;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short etymologyType;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String derivation;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String etymologyDescription;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseEtymology(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short loanLanguage, java.lang.Short etymologyType, java.lang.String derivation, java.lang.String etymologyDescription, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.loanLanguage = loanLanguage;
|
||||
this.etymologyType = etymologyType;
|
||||
this.derivation = derivation;
|
||||
this.etymologyDescription = etymologyDescription;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseEtymology() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseEtymology(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short etymologyType, java.lang.String derivation, java.lang.String etymologyDescription) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.etymologyType = etymologyType;
|
||||
this.derivation = derivation;
|
||||
this.etymologyDescription = etymologyDescription;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getLoanLanguage() {
|
||||
return this.loanLanguage;
|
||||
}
|
||||
|
||||
public void setLoanLanguage(java.lang.Short loanLanguage) {
|
||||
this.loanLanguage = loanLanguage;
|
||||
}
|
||||
|
||||
public java.lang.Short getEtymologyType() {
|
||||
return this.etymologyType;
|
||||
}
|
||||
|
||||
public void setEtymologyType(java.lang.Short etymologyType) {
|
||||
this.etymologyType = etymologyType;
|
||||
}
|
||||
|
||||
public java.lang.String getDerivation() {
|
||||
return this.derivation;
|
||||
}
|
||||
|
||||
public void setDerivation(java.lang.String derivation) {
|
||||
this.derivation = derivation;
|
||||
}
|
||||
|
||||
public java.lang.String getEtymologyDescription() {
|
||||
return this.etymologyDescription;
|
||||
}
|
||||
|
||||
public void setEtymologyDescription(java.lang.String etymologyDescription) {
|
||||
this.etymologyDescription = etymologyDescription;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
80
src/java/org/thdl/lex/component/BaseFunction.java
Normal file
80
src/java/org/thdl/lex/component/BaseFunction.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseFunction extends LexComponent implements org.thdl.lex.component.IFunction,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short function;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseFunction(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short function, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.function = function;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseFunction() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseFunction(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short function) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getFunction() {
|
||||
return this.function;
|
||||
}
|
||||
|
||||
public void setFunction(java.lang.Short function) {
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
91
src/java/org/thdl/lex/component/BaseGloss.java
Normal file
91
src/java/org/thdl/lex/component/BaseGloss.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseGloss extends LexComponent implements org.thdl.lex.component.IGloss,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String gloss;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String translation;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseGloss(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String gloss, java.lang.String translation, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.gloss = gloss;
|
||||
this.translation = translation;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseGloss() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseGloss(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getGloss() {
|
||||
return this.gloss;
|
||||
}
|
||||
|
||||
public void setGloss(java.lang.String gloss) {
|
||||
this.gloss = gloss;
|
||||
}
|
||||
|
||||
public java.lang.String getTranslation() {
|
||||
return this.translation;
|
||||
}
|
||||
|
||||
public void setTranslation(java.lang.String translation) {
|
||||
this.translation = translation;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
80
src/java/org/thdl/lex/component/BaseGrammaticalFunction.java
Normal file
80
src/java/org/thdl/lex/component/BaseGrammaticalFunction.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseGrammaticalFunction extends LexComponent implements org.thdl.lex.component.IFunction,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short function;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseGrammaticalFunction(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short function, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.function = function;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseGrammaticalFunction() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseGrammaticalFunction(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short function) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getFunction() {
|
||||
return this.function;
|
||||
}
|
||||
|
||||
public void setFunction(java.lang.Short function) {
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
79
src/java/org/thdl/lex/component/BaseKeyword.java
Normal file
79
src/java/org/thdl/lex/component/BaseKeyword.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseKeyword extends LexComponent implements org.thdl.lex.component.IKeyword,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String keyword;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseKeyword(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String keyword, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.keyword = keyword;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseKeyword() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseKeyword(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getKeyword() {
|
||||
return this.keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(java.lang.String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
120
src/java/org/thdl/lex/component/BaseLexComponent.java
Normal file
120
src/java/org/thdl/lex/component/BaseLexComponent.java
Normal file
|
@ -0,0 +1,120 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseLexComponent implements org.thdl.lex.component.ILexComponent,Serializable {
|
||||
|
||||
/** identifier field */
|
||||
private java.lang.Integer metaId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer translationOf;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Boolean deleted;
|
||||
|
||||
/** persistent field */
|
||||
private List analyticalNotes;
|
||||
|
||||
/** persistent field */
|
||||
private Set translations;
|
||||
|
||||
/** persistent field */
|
||||
private org.thdl.lex.component.Meta meta;
|
||||
|
||||
/** full constructor */
|
||||
public BaseLexComponent(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
this.translationOf = translationOf;
|
||||
this.deleted = deleted;
|
||||
this.analyticalNotes = analyticalNotes;
|
||||
this.translations = translations;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseLexComponent() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseLexComponent(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
this.deleted = deleted;
|
||||
this.analyticalNotes = analyticalNotes;
|
||||
this.translations = translations;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public java.lang.Integer getMetaId() {
|
||||
return this.metaId;
|
||||
}
|
||||
|
||||
public void setMetaId(java.lang.Integer metaId) {
|
||||
this.metaId = metaId;
|
||||
}
|
||||
|
||||
public java.lang.Integer getTranslationOf() {
|
||||
return this.translationOf;
|
||||
}
|
||||
|
||||
public void setTranslationOf(java.lang.Integer translationOf) {
|
||||
this.translationOf = translationOf;
|
||||
}
|
||||
|
||||
public java.lang.Boolean getDeleted() {
|
||||
return this.deleted;
|
||||
}
|
||||
|
||||
public void setDeleted(java.lang.Boolean deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public java.util.List getAnalyticalNotes() {
|
||||
return this.analyticalNotes;
|
||||
}
|
||||
|
||||
public void setAnalyticalNotes(java.util.List analyticalNotes) {
|
||||
this.analyticalNotes = analyticalNotes;
|
||||
}
|
||||
|
||||
public java.util.Set getTranslations() {
|
||||
return this.translations;
|
||||
}
|
||||
|
||||
public void setTranslations(java.util.Set translations) {
|
||||
this.translations = translations;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.Meta getMeta() {
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
public void setMeta(org.thdl.lex.component.Meta meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if ( !(other instanceof BaseLexComponent) ) return false;
|
||||
BaseLexComponent castOther = (BaseLexComponent) other;
|
||||
return new EqualsBuilder()
|
||||
.append(this.getMetaId(), castOther.getMetaId())
|
||||
.isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(getMetaId())
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
}
|
92
src/java/org/thdl/lex/component/BaseModelSentence.java
Normal file
92
src/java/org/thdl/lex/component/BaseModelSentence.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseModelSentence extends LexComponent implements org.thdl.lex.component.IModelSentence,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer subdefinitionId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String modelSentence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseModelSentence(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Integer subdefinitionId, java.lang.String modelSentence, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.subdefinitionId = subdefinitionId;
|
||||
this.modelSentence = modelSentence;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseModelSentence() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseModelSentence(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer subdefinitionId) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.subdefinitionId = subdefinitionId;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Integer getSubdefinitionId() {
|
||||
return this.subdefinitionId;
|
||||
}
|
||||
|
||||
public void setSubdefinitionId(java.lang.Integer subdefinitionId) {
|
||||
this.subdefinitionId = subdefinitionId;
|
||||
}
|
||||
|
||||
public java.lang.String getModelSentence() {
|
||||
return this.modelSentence;
|
||||
}
|
||||
|
||||
public void setModelSentence(java.lang.String modelSentence) {
|
||||
this.modelSentence = modelSentence;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
115
src/java/org/thdl/lex/component/BasePassage.java
Normal file
115
src/java/org/thdl/lex/component/BasePassage.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BasePassage extends LexComponent implements org.thdl.lex.component.IPassage,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String literarySource;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String spelling;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String pagination;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String passage;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BasePassage(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String literarySource, java.lang.String spelling, java.lang.String pagination, java.lang.String passage, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.literarySource = literarySource;
|
||||
this.spelling = spelling;
|
||||
this.pagination = pagination;
|
||||
this.passage = passage;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BasePassage() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BasePassage(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getLiterarySource() {
|
||||
return this.literarySource;
|
||||
}
|
||||
|
||||
public void setLiterarySource(java.lang.String literarySource) {
|
||||
this.literarySource = literarySource;
|
||||
}
|
||||
|
||||
public java.lang.String getSpelling() {
|
||||
return this.spelling;
|
||||
}
|
||||
|
||||
public void setSpelling(java.lang.String spelling) {
|
||||
this.spelling = spelling;
|
||||
}
|
||||
|
||||
public java.lang.String getPagination() {
|
||||
return this.pagination;
|
||||
}
|
||||
|
||||
public void setPagination(java.lang.String pagination) {
|
||||
this.pagination = pagination;
|
||||
}
|
||||
|
||||
public java.lang.String getPassage() {
|
||||
return this.passage;
|
||||
}
|
||||
|
||||
public void setPassage(java.lang.String passage) {
|
||||
this.passage = passage;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
93
src/java/org/thdl/lex/component/BasePronunciation.java
Normal file
93
src/java/org/thdl/lex/component/BasePronunciation.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BasePronunciation extends LexComponent implements org.thdl.lex.component.IPronunciation,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String phonetics;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short phoneticsType;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BasePronunciation(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String phonetics, java.lang.Short phoneticsType, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.phonetics = phonetics;
|
||||
this.phoneticsType = phoneticsType;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BasePronunciation() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BasePronunciation(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String phonetics, java.lang.Short phoneticsType) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.phonetics = phonetics;
|
||||
this.phoneticsType = phoneticsType;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getPhonetics() {
|
||||
return this.phonetics;
|
||||
}
|
||||
|
||||
public void setPhonetics(java.lang.String phonetics) {
|
||||
this.phonetics = phonetics;
|
||||
}
|
||||
|
||||
public java.lang.Short getPhoneticsType() {
|
||||
return this.phoneticsType;
|
||||
}
|
||||
|
||||
public void setPhoneticsType(java.lang.Short phoneticsType) {
|
||||
this.phoneticsType = phoneticsType;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
80
src/java/org/thdl/lex/component/BaseRegister.java
Normal file
80
src/java/org/thdl/lex/component/BaseRegister.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseRegister extends LexComponent implements org.thdl.lex.component.IRegister,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short register;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseRegister(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short register, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.register = register;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseRegister() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseRegister(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short register) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getRegister() {
|
||||
return this.register;
|
||||
}
|
||||
|
||||
public void setRegister(java.lang.Short register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
92
src/java/org/thdl/lex/component/BaseRelatedTerm.java
Normal file
92
src/java/org/thdl/lex/component/BaseRelatedTerm.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseRelatedTerm extends LexComponent implements Serializable,org.thdl.lex.component.IRelatedTerm {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String relatedTerm;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short relatedTermType;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseRelatedTerm(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String relatedTerm, java.lang.Short relatedTermType, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.relatedTerm = relatedTerm;
|
||||
this.relatedTermType = relatedTermType;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseRelatedTerm() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseRelatedTerm(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short relatedTermType) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.relatedTermType = relatedTermType;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getRelatedTerm() {
|
||||
return this.relatedTerm;
|
||||
}
|
||||
|
||||
public void setRelatedTerm(java.lang.String relatedTerm) {
|
||||
this.relatedTerm = relatedTerm;
|
||||
}
|
||||
|
||||
public java.lang.Short getRelatedTermType() {
|
||||
return this.relatedTermType;
|
||||
}
|
||||
|
||||
public void setRelatedTermType(java.lang.Short relatedTermType) {
|
||||
this.relatedTermType = relatedTermType;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
80
src/java/org/thdl/lex/component/BaseSpeechRegister.java
Normal file
80
src/java/org/thdl/lex/component/BaseSpeechRegister.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseSpeechRegister extends LexComponent implements org.thdl.lex.component.IRegister,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short register;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseSpeechRegister(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short register, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.register = register;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseSpeechRegister() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseSpeechRegister(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short register) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getRegister() {
|
||||
return this.register;
|
||||
}
|
||||
|
||||
public void setRegister(java.lang.Short register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
93
src/java/org/thdl/lex/component/BaseSpelling.java
Normal file
93
src/java/org/thdl/lex/component/BaseSpelling.java
Normal file
|
@ -0,0 +1,93 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseSpelling extends LexComponent implements Serializable,org.thdl.lex.component.ISpelling {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String spelling;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short spellingType;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseSpelling(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String spelling, java.lang.Short spellingType, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.spelling = spelling;
|
||||
this.spellingType = spellingType;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseSpelling() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseSpelling(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String spelling, java.lang.Short spellingType) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.spelling = spelling;
|
||||
this.spellingType = spellingType;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getSpelling() {
|
||||
return this.spelling;
|
||||
}
|
||||
|
||||
public void setSpelling(java.lang.String spelling) {
|
||||
this.spelling = spelling;
|
||||
}
|
||||
|
||||
public java.lang.Short getSpellingType() {
|
||||
return this.spellingType;
|
||||
}
|
||||
|
||||
public void setSpellingType(java.lang.Short spellingType) {
|
||||
this.spellingType = spellingType;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
170
src/java/org/thdl/lex/component/BaseSubdefinition.java
Normal file
170
src/java/org/thdl/lex/component/BaseSubdefinition.java
Normal file
|
@ -0,0 +1,170 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseSubdefinition extends LexComponent implements org.thdl.lex.component.ISubdefinition,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String subdefinition;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** persistent field */
|
||||
private List glosses;
|
||||
|
||||
/** persistent field */
|
||||
private List keywords;
|
||||
|
||||
/** persistent field */
|
||||
private List modelSentences;
|
||||
|
||||
/** persistent field */
|
||||
private List translationEquivalents;
|
||||
|
||||
/** persistent field */
|
||||
private List relatedTerms;
|
||||
|
||||
/** persistent field */
|
||||
private List passages;
|
||||
|
||||
/** persistent field */
|
||||
private List registers;
|
||||
|
||||
/** full constructor */
|
||||
public BaseSubdefinition(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String subdefinition, org.thdl.lex.component.ILexComponent parent, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.subdefinition = subdefinition;
|
||||
this.parent = parent;
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseSubdefinition() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseSubdefinition(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getSubdefinition() {
|
||||
return this.subdefinition;
|
||||
}
|
||||
|
||||
public void setSubdefinition(java.lang.String subdefinition) {
|
||||
this.subdefinition = subdefinition;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public java.util.List getGlosses() {
|
||||
return this.glosses;
|
||||
}
|
||||
|
||||
public void setGlosses(java.util.List glosses) {
|
||||
this.glosses = glosses;
|
||||
}
|
||||
|
||||
public java.util.List getKeywords() {
|
||||
return this.keywords;
|
||||
}
|
||||
|
||||
public void setKeywords(java.util.List keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public java.util.List getModelSentences() {
|
||||
return this.modelSentences;
|
||||
}
|
||||
|
||||
public void setModelSentences(java.util.List modelSentences) {
|
||||
this.modelSentences = modelSentences;
|
||||
}
|
||||
|
||||
public java.util.List getTranslationEquivalents() {
|
||||
return this.translationEquivalents;
|
||||
}
|
||||
|
||||
public void setTranslationEquivalents(java.util.List translationEquivalents) {
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
}
|
||||
|
||||
public java.util.List getRelatedTerms() {
|
||||
return this.relatedTerms;
|
||||
}
|
||||
|
||||
public void setRelatedTerms(java.util.List relatedTerms) {
|
||||
this.relatedTerms = relatedTerms;
|
||||
}
|
||||
|
||||
public java.util.List getPassages() {
|
||||
return this.passages;
|
||||
}
|
||||
|
||||
public void setPassages(java.util.List passages) {
|
||||
this.passages = passages;
|
||||
}
|
||||
|
||||
public java.util.List getRegisters() {
|
||||
return this.registers;
|
||||
}
|
||||
|
||||
public void setRegisters(java.util.List registers) {
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
238
src/java/org/thdl/lex/component/BaseTerm.java
Normal file
238
src/java/org/thdl/lex/component/BaseTerm.java
Normal file
|
@ -0,0 +1,238 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseTerm extends LexComponent implements org.thdl.lex.component.ITerm,Serializable {
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String term;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** persistent field */
|
||||
private List pronunciations;
|
||||
|
||||
/** persistent field */
|
||||
private List etymologies;
|
||||
|
||||
/** persistent field */
|
||||
private List spellings;
|
||||
|
||||
/** persistent field */
|
||||
private List functions;
|
||||
|
||||
/** persistent field */
|
||||
private List encyclopediaArticles;
|
||||
|
||||
/** persistent field */
|
||||
private List transitionalData;
|
||||
|
||||
/** persistent field */
|
||||
private List definitions;
|
||||
|
||||
/** persistent field */
|
||||
private List glosses;
|
||||
|
||||
/** persistent field */
|
||||
private List keywords;
|
||||
|
||||
/** persistent field */
|
||||
private List modelSentences;
|
||||
|
||||
/** persistent field */
|
||||
private List translationEquivalents;
|
||||
|
||||
/** persistent field */
|
||||
private List relatedTerms;
|
||||
|
||||
/** persistent field */
|
||||
private List passages;
|
||||
|
||||
/** persistent field */
|
||||
private List registers;
|
||||
|
||||
/** full constructor */
|
||||
public BaseTerm(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String term, java.lang.Short precedence, List pronunciations, List etymologies, List spellings, List functions, List encyclopediaArticles, List transitionalData, List definitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.term = term;
|
||||
this.precedence = precedence;
|
||||
this.pronunciations = pronunciations;
|
||||
this.etymologies = etymologies;
|
||||
this.spellings = spellings;
|
||||
this.functions = functions;
|
||||
this.encyclopediaArticles = encyclopediaArticles;
|
||||
this.transitionalData = transitionalData;
|
||||
this.definitions = definitions;
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseTerm() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseTerm(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String term, List pronunciations, List etymologies, List spellings, List functions, List encyclopediaArticles, List transitionalData, List definitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.term = term;
|
||||
this.pronunciations = pronunciations;
|
||||
this.etymologies = etymologies;
|
||||
this.spellings = spellings;
|
||||
this.functions = functions;
|
||||
this.encyclopediaArticles = encyclopediaArticles;
|
||||
this.transitionalData = transitionalData;
|
||||
this.definitions = definitions;
|
||||
this.glosses = glosses;
|
||||
this.keywords = keywords;
|
||||
this.modelSentences = modelSentences;
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
this.relatedTerms = relatedTerms;
|
||||
this.passages = passages;
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public java.lang.String getTerm() {
|
||||
return this.term;
|
||||
}
|
||||
|
||||
public void setTerm(java.lang.String term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.util.List getPronunciations() {
|
||||
return this.pronunciations;
|
||||
}
|
||||
|
||||
public void setPronunciations(java.util.List pronunciations) {
|
||||
this.pronunciations = pronunciations;
|
||||
}
|
||||
|
||||
public java.util.List getEtymologies() {
|
||||
return this.etymologies;
|
||||
}
|
||||
|
||||
public void setEtymologies(java.util.List etymologies) {
|
||||
this.etymologies = etymologies;
|
||||
}
|
||||
|
||||
public java.util.List getSpellings() {
|
||||
return this.spellings;
|
||||
}
|
||||
|
||||
public void setSpellings(java.util.List spellings) {
|
||||
this.spellings = spellings;
|
||||
}
|
||||
|
||||
public java.util.List getFunctions() {
|
||||
return this.functions;
|
||||
}
|
||||
|
||||
public void setFunctions(java.util.List functions) {
|
||||
this.functions = functions;
|
||||
}
|
||||
|
||||
public java.util.List getEncyclopediaArticles() {
|
||||
return this.encyclopediaArticles;
|
||||
}
|
||||
|
||||
public void setEncyclopediaArticles(java.util.List encyclopediaArticles) {
|
||||
this.encyclopediaArticles = encyclopediaArticles;
|
||||
}
|
||||
|
||||
public java.util.List getTransitionalData() {
|
||||
return this.transitionalData;
|
||||
}
|
||||
|
||||
public void setTransitionalData(java.util.List transitionalData) {
|
||||
this.transitionalData = transitionalData;
|
||||
}
|
||||
|
||||
public java.util.List getDefinitions() {
|
||||
return this.definitions;
|
||||
}
|
||||
|
||||
public void setDefinitions(java.util.List definitions) {
|
||||
this.definitions = definitions;
|
||||
}
|
||||
|
||||
public java.util.List getGlosses() {
|
||||
return this.glosses;
|
||||
}
|
||||
|
||||
public void setGlosses(java.util.List glosses) {
|
||||
this.glosses = glosses;
|
||||
}
|
||||
|
||||
public java.util.List getKeywords() {
|
||||
return this.keywords;
|
||||
}
|
||||
|
||||
public void setKeywords(java.util.List keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public java.util.List getModelSentences() {
|
||||
return this.modelSentences;
|
||||
}
|
||||
|
||||
public void setModelSentences(java.util.List modelSentences) {
|
||||
this.modelSentences = modelSentences;
|
||||
}
|
||||
|
||||
public java.util.List getTranslationEquivalents() {
|
||||
return this.translationEquivalents;
|
||||
}
|
||||
|
||||
public void setTranslationEquivalents(java.util.List translationEquivalents) {
|
||||
this.translationEquivalents = translationEquivalents;
|
||||
}
|
||||
|
||||
public java.util.List getRelatedTerms() {
|
||||
return this.relatedTerms;
|
||||
}
|
||||
|
||||
public void setRelatedTerms(java.util.List relatedTerms) {
|
||||
this.relatedTerms = relatedTerms;
|
||||
}
|
||||
|
||||
public java.util.List getPassages() {
|
||||
return this.passages;
|
||||
}
|
||||
|
||||
public void setPassages(java.util.List passages) {
|
||||
this.passages = passages;
|
||||
}
|
||||
|
||||
public java.util.List getRegisters() {
|
||||
return this.registers;
|
||||
}
|
||||
|
||||
public void setRegisters(java.util.List registers) {
|
||||
this.registers = registers;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
104
src/java/org/thdl/lex/component/BaseTransitionalData.java
Normal file
104
src/java/org/thdl/lex/component/BaseTransitionalData.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseTransitionalData extends LexComponent implements org.thdl.lex.component.ITransitionalData,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short transitionalDataLabel;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.String forPublicConsumption;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String transitionalDataText;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseTransitionalData(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short transitionalDataLabel, java.lang.String forPublicConsumption, java.lang.String transitionalDataText, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.transitionalDataLabel = transitionalDataLabel;
|
||||
this.forPublicConsumption = forPublicConsumption;
|
||||
this.transitionalDataText = transitionalDataText;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseTransitionalData() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseTransitionalData(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.String forPublicConsumption) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
this.forPublicConsumption = forPublicConsumption;
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.Short getTransitionalDataLabel() {
|
||||
return this.transitionalDataLabel;
|
||||
}
|
||||
|
||||
public void setTransitionalDataLabel(java.lang.Short transitionalDataLabel) {
|
||||
this.transitionalDataLabel = transitionalDataLabel;
|
||||
}
|
||||
|
||||
public java.lang.String getForPublicConsumption() {
|
||||
return this.forPublicConsumption;
|
||||
}
|
||||
|
||||
public void setForPublicConsumption(java.lang.String forPublicConsumption) {
|
||||
this.forPublicConsumption = forPublicConsumption;
|
||||
}
|
||||
|
||||
public java.lang.String getTransitionalDataText() {
|
||||
return this.transitionalDataText;
|
||||
}
|
||||
|
||||
public void setTransitionalDataText(java.lang.String transitionalDataText) {
|
||||
this.transitionalDataText = transitionalDataText;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
abstract public class BaseTranslationEquivalent extends LexComponent implements org.thdl.lex.component.ITranslationEquivalent,Serializable {
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer parentId;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Short precedence;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String translationEquivalent;
|
||||
|
||||
/** nullable persistent field */
|
||||
private org.thdl.lex.component.ILexComponent parent;
|
||||
|
||||
/** full constructor */
|
||||
public BaseTranslationEquivalent(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String translationEquivalent, org.thdl.lex.component.ILexComponent parent) {
|
||||
super(translationOf, deleted, analyticalNotes, translations, meta);
|
||||
this.parentId = parentId;
|
||||
this.precedence = precedence;
|
||||
this.translationEquivalent = translationEquivalent;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public BaseTranslationEquivalent() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public BaseTranslationEquivalent(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta) {
|
||||
super(deleted, analyticalNotes, translations, meta);
|
||||
}
|
||||
|
||||
public java.lang.Integer getParentId() {
|
||||
return this.parentId;
|
||||
}
|
||||
|
||||
public void setParentId(java.lang.Integer parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public java.lang.Short getPrecedence() {
|
||||
return this.precedence;
|
||||
}
|
||||
|
||||
public void setPrecedence(java.lang.Short precedence) {
|
||||
this.precedence = precedence;
|
||||
}
|
||||
|
||||
public java.lang.String getTranslationEquivalent() {
|
||||
return this.translationEquivalent;
|
||||
}
|
||||
|
||||
public void setTranslationEquivalent(java.lang.String translationEquivalent) {
|
||||
this.translationEquivalent = translationEquivalent;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.ILexComponent getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(org.thdl.lex.component.ILexComponent parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.append("metaId", getMetaId())
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Definition.java
Normal file
8
src/java/org/thdl/lex/component/Definition.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Definition extends BaseDefinition implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/EncyclopediaArticle.java
Normal file
8
src/java/org/thdl/lex/component/EncyclopediaArticle.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class EncyclopediaArticle extends BaseEncyclopediaArticle implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Etymology.java
Normal file
8
src/java/org/thdl/lex/component/Etymology.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Etymology extends BaseEtymology implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Gloss.java
Normal file
8
src/java/org/thdl/lex/component/Gloss.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Gloss extends BaseGloss implements Serializable
|
||||
{
|
||||
|
||||
}
|
16
src/java/org/thdl/lex/component/GrammaticalFunction.java
Normal file
16
src/java/org/thdl/lex/component/GrammaticalFunction.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 5, 2003
|
||||
*/
|
||||
public class GrammaticalFunction extends BaseGrammaticalFunction implements Serializable
|
||||
{
|
||||
|
||||
}
|
||||
|
65
src/java/org/thdl/lex/component/IAnalyticalNote.java
Normal file
65
src/java/org/thdl/lex/component/IAnalyticalNote.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
*/
|
||||
public interface IAnalyticalNote extends ILexComponent
|
||||
{
|
||||
/**
|
||||
* Gets the parent attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@return The parent value
|
||||
*@since
|
||||
*/
|
||||
public ILexComponent getParent();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parent attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@param comp The new parent value
|
||||
*@since
|
||||
*/
|
||||
public void setParent( ILexComponent comp );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parentId attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@return The parentId value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Integer getParentId();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parentId attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@param parentId The new parentId value
|
||||
*@since
|
||||
*/
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the analyticalNote attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@return The analyticalNote value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.String getAnalyticalNote();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the analyticalNote attribute of the IAnalyticalNote object
|
||||
*
|
||||
*@param analyticalNote The new analyticalNote value
|
||||
*@since
|
||||
*/
|
||||
public void setAnalyticalNote( java.lang.String analyticalNote );
|
||||
}
|
||||
|
194
src/java/org/thdl/lex/component/IDefinition.java
Normal file
194
src/java/org/thdl/lex/component/IDefinition.java
Normal file
|
@ -0,0 +1,194 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public interface IDefinition extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
/**
|
||||
* Gets the definition attribute of the IDefinition object
|
||||
*
|
||||
*@return The definition value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.String getDefinition();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the definition attribute of the IDefinition object
|
||||
*
|
||||
*@param definition The new definition value
|
||||
*@since
|
||||
*/
|
||||
public void setDefinition( java.lang.String definition );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the precedence attribute of the IDefinition object
|
||||
*
|
||||
*@return The precedence value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Short getPrecedence();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the precedence attribute of the IDefinition object
|
||||
*
|
||||
*@param precedence The new precedence value
|
||||
*@since
|
||||
*/
|
||||
public void setPrecedence( java.lang.Short precedence );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the subdefinitions attribute of the IDefinition object
|
||||
*
|
||||
*@return The subdefinitions value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getSubdefinitions();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the subdefinitions attribute of the IDefinition object
|
||||
*
|
||||
*@param subdefinitions The new subdefinitions value
|
||||
*@since
|
||||
*/
|
||||
public void setSubdefinitions( java.util.List subdefinitions );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the glosses attribute of the IDefinition object
|
||||
*
|
||||
*@return The glosses value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getGlosses();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the glosses attribute of the IDefinition object
|
||||
*
|
||||
*@param glosses The new glosses value
|
||||
*@since
|
||||
*/
|
||||
public void setGlosses( java.util.List glosses );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the keywords attribute of the IDefinition object
|
||||
*
|
||||
*@return The keywords value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getKeywords();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the keywords attribute of the IDefinition object
|
||||
*
|
||||
*@param keywords The new keywords value
|
||||
*@since
|
||||
*/
|
||||
public void setKeywords( java.util.List keywords );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the modelSentences attribute of the IDefinition object
|
||||
*
|
||||
*@return The modelSentences value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getModelSentences();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the modelSentences attribute of the IDefinition object
|
||||
*
|
||||
*@param modelSentences The new modelSentences value
|
||||
*@since
|
||||
*/
|
||||
public void setModelSentences( java.util.List modelSentences );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the translationEquivalents attribute of the IDefinition object
|
||||
*
|
||||
*@return The translationEquivalents value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getTranslationEquivalents();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the translationEquivalents attribute of the IDefinition object
|
||||
*
|
||||
*@param translationEquivalents The new translationEquivalents value
|
||||
*@since
|
||||
*/
|
||||
public void setTranslationEquivalents( java.util.List translationEquivalents );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the relatedTerms attribute of the IDefinition object
|
||||
*
|
||||
*@return The relatedTerms value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getRelatedTerms();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the relatedTerms attribute of the IDefinition object
|
||||
*
|
||||
*@param relatedTerms The new relatedTerms value
|
||||
*@since
|
||||
*/
|
||||
public void setRelatedTerms( java.util.List relatedTerms );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the passages attribute of the IDefinition object
|
||||
*
|
||||
*@return The passages value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getPassages();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the passages attribute of the IDefinition object
|
||||
*
|
||||
*@param passages The new passages value
|
||||
*@since
|
||||
*/
|
||||
public void setPassages( java.util.List passages );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the registers attribute of the IDefinition object
|
||||
*
|
||||
*@return The registers value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getRegisters();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the registers attribute of the IDefinition object
|
||||
*
|
||||
*@param registers The new registers value
|
||||
*@since
|
||||
*/
|
||||
public void setRegisters( java.util.List registers );
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/IEncyclopediaArticle.java
Normal file
13
src/java/org/thdl/lex/component/IEncyclopediaArticle.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IEncyclopediaArticle extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getArticle();
|
||||
public void setArticle(java.lang.String article);
|
||||
public java.lang.String getArticleTitle();
|
||||
public void setArticleTitle(java.lang.String articleTitle);
|
||||
}
|
||||
|
17
src/java/org/thdl/lex/component/IEtymology.java
Normal file
17
src/java/org/thdl/lex/component/IEtymology.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IEtymology extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Short getLoanLanguage();
|
||||
public void setLoanLanguage(java.lang.Short loanLanguage);
|
||||
public java.lang.Short getEtymologyType();
|
||||
public void setEtymologyType(java.lang.Short etymologyType);
|
||||
public java.lang.String getDerivation();
|
||||
public void setDerivation(java.lang.String derivation);
|
||||
public java.lang.String getEtymologyDescription();
|
||||
public void setEtymologyDescription(java.lang.String etymologyDescription);
|
||||
}
|
||||
|
11
src/java/org/thdl/lex/component/IFunction.java
Normal file
11
src/java/org/thdl/lex/component/IFunction.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IFunction extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Short getFunction();
|
||||
public void setFunction(java.lang.Short function);
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/IGloss.java
Normal file
13
src/java/org/thdl/lex/component/IGloss.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IGloss extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getGloss();
|
||||
public void setGloss(java.lang.String gloss);
|
||||
public java.lang.String getTranslation();
|
||||
public void setTranslation(java.lang.String translation);
|
||||
}
|
||||
|
12
src/java/org/thdl/lex/component/IKeyword.java
Normal file
12
src/java/org/thdl/lex/component/IKeyword.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IKeyword extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getKeyword();
|
||||
public void setKeyword(java.lang.String keyword);
|
||||
}
|
||||
|
||||
|
148
src/java/org/thdl/lex/component/ILexComponent.java
Normal file
148
src/java/org/thdl/lex/component/ILexComponent.java
Normal file
|
@ -0,0 +1,148 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public interface ILexComponent
|
||||
{
|
||||
|
||||
/**
|
||||
* Gets the label attribute of the ILexComponent object
|
||||
*
|
||||
*@return The label value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.String getLabel();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the label attribute of the ILexComponent object
|
||||
*
|
||||
*@param label The new label value
|
||||
*@since
|
||||
*/
|
||||
public void setLabel( java.lang.String label );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the metaId attribute of the ILexComponent object
|
||||
*
|
||||
*@return The metaId value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Integer getMetaId();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the metaId attribute of the ILexComponent object
|
||||
*
|
||||
*@param metaId The new metaId value
|
||||
*@since
|
||||
*/
|
||||
public void setMetaId( java.lang.Integer metaId );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the translationOf attribute of the ILexComponent object
|
||||
*
|
||||
*@return The translationOf value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Integer getTranslationOf();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the translationOf attribute of the ILexComponent object
|
||||
*
|
||||
*@param translationOf The new translationOf value
|
||||
*@since
|
||||
*/
|
||||
public void setTranslationOf( java.lang.Integer translationOf );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the translations attribute of the ILexComponent object
|
||||
*
|
||||
*@return The translations value
|
||||
*@since
|
||||
*/
|
||||
public java.util.Set getTranslations();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the translations attribute of the ILexComponent object
|
||||
*
|
||||
*@param translations The new translations value
|
||||
*@since
|
||||
*/
|
||||
public void setTranslations( java.util.Set translations );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the deleted attribute of the ILexComponent object
|
||||
*
|
||||
*@return The deleted value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Boolean getDeleted();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the deleted attribute of the ILexComponent object
|
||||
*
|
||||
*@param deleted The new deleted value
|
||||
*@since
|
||||
*/
|
||||
public void setDeleted( java.lang.Boolean deleted );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the analyticalNotes attribute of the ILexComponent object
|
||||
*
|
||||
*@return The analyticalNotes value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getAnalyticalNotes();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the analyticalNotes attribute of the ILexComponent object
|
||||
*
|
||||
*@param analyticalNotes The new analyticalNotes value
|
||||
*@since
|
||||
*/
|
||||
public void setAnalyticalNotes( java.util.List analyticalNotes );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the meta attribute of the ILexComponent object
|
||||
*
|
||||
*@return The meta value
|
||||
*@since
|
||||
*/
|
||||
public org.thdl.lex.component.Meta getMeta();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the meta attribute of the ILexComponent object
|
||||
*
|
||||
*@param meta The new meta value
|
||||
*@since
|
||||
*/
|
||||
public void setMeta( org.thdl.lex.component.Meta meta );
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param properties Description of Parameter
|
||||
*@exception LexComponentException Description of Exception
|
||||
*@since
|
||||
*/
|
||||
public void populate( java.util.Map properties ) throws LexComponentException;
|
||||
}
|
||||
|
31
src/java/org/thdl/lex/component/IMeta.java
Normal file
31
src/java/org/thdl/lex/component/IMeta.java
Normal file
|
@ -0,0 +1,31 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IMeta extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Integer getCreatedBy();
|
||||
public void setCreatedBy(java.lang.Integer createdBy);
|
||||
public java.lang.Integer getModifiedBy();
|
||||
public void setModifiedBy(java.lang.Integer modifiedBy);
|
||||
public java.lang.Integer getCreatedByProjSub();
|
||||
public void setCreatedByProjSub(java.lang.Integer createdByProjSub);
|
||||
public java.lang.Integer getModifiedByProjSub();
|
||||
public void setModifiedByProjSub(java.lang.Integer modifiedByProjSub);
|
||||
public java.util.Date getCreatedOn();
|
||||
public void setCreatedOn(java.util.Date createdOn);
|
||||
public java.util.Date getModifiedOn();
|
||||
public void setModifiedOn(java.util.Date modifiedOn);
|
||||
public java.lang.Integer getSource();
|
||||
public void setSource(java.lang.Integer source);
|
||||
public java.lang.Short getLanguage();
|
||||
public void setLanguage(java.lang.Short language);
|
||||
public java.lang.Short getScript();
|
||||
public void setScript(java.lang.Short script);
|
||||
public java.lang.Short getDialect();
|
||||
public void setDialect(java.lang.Short dialect);
|
||||
public java.lang.String getNote();
|
||||
public void setNote(java.lang.String note);
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/IModelSentence.java
Normal file
13
src/java/org/thdl/lex/component/IModelSentence.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IModelSentence extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Integer getSubdefinitionId();
|
||||
public void setSubdefinitionId(java.lang.Integer subdefinitionId);
|
||||
public java.lang.String getModelSentence();
|
||||
public void setModelSentence(java.lang.String modelSentence);
|
||||
}
|
||||
|
17
src/java/org/thdl/lex/component/IPassage.java
Normal file
17
src/java/org/thdl/lex/component/IPassage.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IPassage extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getLiterarySource();
|
||||
public void setLiterarySource(java.lang.String literarySource);
|
||||
public java.lang.String getSpelling();
|
||||
public void setSpelling(java.lang.String spelling);
|
||||
public java.lang.String getPagination();
|
||||
public void setPagination(java.lang.String pagination);
|
||||
public java.lang.String getPassage();
|
||||
public void setPassage(java.lang.String passage);
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/IPronunciation.java
Normal file
13
src/java/org/thdl/lex/component/IPronunciation.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IPronunciation extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getPhonetics();
|
||||
public void setPhonetics(java.lang.String phonetics);
|
||||
public java.lang.Short getPhoneticsType();
|
||||
public void setPhoneticsType(java.lang.Short phoneticsType);
|
||||
}
|
||||
|
11
src/java/org/thdl/lex/component/IRegister.java
Normal file
11
src/java/org/thdl/lex/component/IRegister.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IRegister extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Short getRegister();
|
||||
public void setRegister(java.lang.Short register);
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/IRelatedTerm.java
Normal file
13
src/java/org/thdl/lex/component/IRelatedTerm.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface IRelatedTerm extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getRelatedTerm();
|
||||
public void setRelatedTerm(java.lang.String relatedTerm);
|
||||
public java.lang.Short getRelatedTermType();
|
||||
public void setRelatedTermType(java.lang.Short relatedTermType);
|
||||
}
|
||||
|
13
src/java/org/thdl/lex/component/ISpelling.java
Normal file
13
src/java/org/thdl/lex/component/ISpelling.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface ISpelling extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getSpelling();
|
||||
public void setSpelling(java.lang.String spelling);
|
||||
public java.lang.Short getSpellingType();
|
||||
public void setSpellingType(java.lang.Short spellingType);
|
||||
}
|
||||
|
25
src/java/org/thdl/lex/component/ISubdefinition.java
Normal file
25
src/java/org/thdl/lex/component/ISubdefinition.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface ISubdefinition extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.String getSubdefinition();
|
||||
public void setSubdefinition(java.lang.String subdefinition);
|
||||
public java.util.List getGlosses();
|
||||
public void setGlosses(java.util.List glosses);
|
||||
public java.util.List getKeywords();
|
||||
public void setKeywords(java.util.List keywords);
|
||||
public java.util.List getModelSentences();
|
||||
public void setModelSentences(java.util.List modelSentences);
|
||||
public java.util.List getTranslationEquivalents();
|
||||
public void setTranslationEquivalents(java.util.List translationEquivalents);
|
||||
public java.util.List getRelatedTerms();
|
||||
public void setRelatedTerms(java.util.List relatedTerms);
|
||||
public java.util.List getPassages();
|
||||
public void setPassages(java.util.List passages);
|
||||
public java.util.List getRegisters();
|
||||
public void setRegisters(java.util.List registers);
|
||||
}
|
||||
|
299
src/java/org/thdl/lex/component/ITerm.java
Normal file
299
src/java/org/thdl/lex/component/ITerm.java
Normal file
|
@ -0,0 +1,299 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public interface ITerm extends ILexComponent
|
||||
{
|
||||
/**
|
||||
* Gets the term attribute of the ITerm object
|
||||
*
|
||||
*@return The term value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.String getTerm();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the term attribute of the ITerm object
|
||||
*
|
||||
*@param term The new term value
|
||||
*@since
|
||||
*/
|
||||
public void setTerm( java.lang.String term );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the precedence attribute of the ITerm object
|
||||
*
|
||||
*@return The precedence value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.Short getPrecedence();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the precedence attribute of the ITerm object
|
||||
*
|
||||
*@param precedence The new precedence value
|
||||
*@since
|
||||
*/
|
||||
public void setPrecedence( java.lang.Short precedence );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the pronunciations attribute of the ITerm object
|
||||
*
|
||||
*@return The pronunciations value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getPronunciations();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the pronunciations attribute of the ITerm object
|
||||
*
|
||||
*@param pronunciations The new pronunciations value
|
||||
*@since
|
||||
*/
|
||||
public void setPronunciations( java.util.List pronunciations );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the etymologies attribute of the ITerm object
|
||||
*
|
||||
*@return The etymologies value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getEtymologies();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the etymologies attribute of the ITerm object
|
||||
*
|
||||
*@param etymologies The new etymologies value
|
||||
*@since
|
||||
*/
|
||||
public void setEtymologies( java.util.List etymologies );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the spellings attribute of the ITerm object
|
||||
*
|
||||
*@return The spellings value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getSpellings();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the spellings attribute of the ITerm object
|
||||
*
|
||||
*@param spellings The new spellings value
|
||||
*@since
|
||||
*/
|
||||
public void setSpellings( java.util.List spellings );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the functions attribute of the ITerm object
|
||||
*
|
||||
*@return The functions value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getFunctions();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the functions attribute of the ITerm object
|
||||
*
|
||||
*@param functions The new functions value
|
||||
*@since
|
||||
*/
|
||||
public void setFunctions( java.util.List functions );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the encyclopediaArticles attribute of the ITerm object
|
||||
*
|
||||
*@return The encyclopediaArticles value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getEncyclopediaArticles();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the encyclopediaArticles attribute of the ITerm object
|
||||
*
|
||||
*@param encyclopediaArticles The new encyclopediaArticles value
|
||||
*@since
|
||||
*/
|
||||
public void setEncyclopediaArticles( java.util.List encyclopediaArticles );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the transitionalData attribute of the ITerm object
|
||||
*
|
||||
*@return The transitionalData value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getTransitionalData();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the transitionalData attribute of the ITerm object
|
||||
*
|
||||
*@param transitionalData The new transitionalData value
|
||||
*@since
|
||||
*/
|
||||
public void setTransitionalData( java.util.List transitionalData );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the definitions attribute of the ITerm object
|
||||
*
|
||||
*@return The definitions value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getDefinitions();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the definitions attribute of the ITerm object
|
||||
*
|
||||
*@param definitions The new definitions value
|
||||
*@since
|
||||
*/
|
||||
public void setDefinitions( java.util.List definitions );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the glosses attribute of the ITerm object
|
||||
*
|
||||
*@return The glosses value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getGlosses();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the glosses attribute of the ITerm object
|
||||
*
|
||||
*@param glosses The new glosses value
|
||||
*@since
|
||||
*/
|
||||
public void setGlosses( java.util.List glosses );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the keywords attribute of the ITerm object
|
||||
*
|
||||
*@return The keywords value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getKeywords();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the keywords attribute of the ITerm object
|
||||
*
|
||||
*@param keywords The new keywords value
|
||||
*@since
|
||||
*/
|
||||
public void setKeywords( java.util.List keywords );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the modelSentences attribute of the ITerm object
|
||||
*
|
||||
*@return The modelSentences value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getModelSentences();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the modelSentences attribute of the ITerm object
|
||||
*
|
||||
*@param modelSentences The new modelSentences value
|
||||
*@since
|
||||
*/
|
||||
public void setModelSentences( java.util.List modelSentences );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the translationEquivalents attribute of the ITerm object
|
||||
*
|
||||
*@return The translationEquivalents value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getTranslationEquivalents();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the translationEquivalents attribute of the ITerm object
|
||||
*
|
||||
*@param translationEquivalents The new translationEquivalents value
|
||||
*@since
|
||||
*/
|
||||
public void setTranslationEquivalents( java.util.List translationEquivalents );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the relatedTerms attribute of the ITerm object
|
||||
*
|
||||
*@return The relatedTerms value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getRelatedTerms();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the relatedTerms attribute of the ITerm object
|
||||
*
|
||||
*@param relatedTerms The new relatedTerms value
|
||||
*@since
|
||||
*/
|
||||
public void setRelatedTerms( java.util.List relatedTerms );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the passages attribute of the ITerm object
|
||||
*
|
||||
*@return The passages value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getPassages();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the passages attribute of the ITerm object
|
||||
*
|
||||
*@param passages The new passages value
|
||||
*@since
|
||||
*/
|
||||
public void setPassages( java.util.List passages );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the registers attribute of the ITerm object
|
||||
*
|
||||
*@return The registers value
|
||||
*@since
|
||||
*/
|
||||
public java.util.List getRegisters();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the registers attribute of the ITerm object
|
||||
*
|
||||
*@param registers The new registers value
|
||||
*@since
|
||||
*/
|
||||
public void setRegisters( java.util.List registers );
|
||||
}
|
||||
|
15
src/java/org/thdl/lex/component/ITransitionalData.java
Normal file
15
src/java/org/thdl/lex/component/ITransitionalData.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public interface ITransitionalData extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
public java.lang.Integer getParentId();
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
public java.lang.Short getTransitionalDataLabel();
|
||||
public void setTransitionalDataLabel(java.lang.Short transitionalDataLabel);
|
||||
public java.lang.String getForPublicConsumption();
|
||||
public void setForPublicConsumption(java.lang.String forPublicConsumption);
|
||||
public java.lang.String getTransitionalDataText();
|
||||
public void setTransitionalDataText(java.lang.String transitionalDataText);
|
||||
}
|
||||
|
32
src/java/org/thdl/lex/component/ITranslationEquivalent.java
Normal file
32
src/java/org/thdl/lex/component/ITranslationEquivalent.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
*/
|
||||
public interface ITranslationEquivalent extends ILexComponent
|
||||
{ public ILexComponent getParent();
|
||||
public void setParent( ILexComponent comp );
|
||||
/**
|
||||
* Gets the translationEquivalent attribute of the ITranslationEquivalent
|
||||
* object
|
||||
*
|
||||
*@return The translationEquivalent value
|
||||
*@since
|
||||
*/
|
||||
public java.lang.String getTranslationEquivalent();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the translationEquivalent attribute of the ITranslationEquivalent
|
||||
* object
|
||||
*
|
||||
*@param translationEquivalent The new translationEquivalent value
|
||||
*@since
|
||||
*/
|
||||
public void setTranslationEquivalent( java.lang.String translationEquivalent );
|
||||
}
|
||||
|
8
src/java/org/thdl/lex/component/Keyword.java
Normal file
8
src/java/org/thdl/lex/component/Keyword.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Keyword extends BaseKeyword implements Serializable
|
||||
{
|
||||
|
||||
}
|
354
src/java/org/thdl/lex/component/LexComponent.hbm.xml
Normal file
354
src/java/org/thdl/lex/component/LexComponent.hbm.xml
Normal file
|
@ -0,0 +1,354 @@
|
|||
<?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 default-cascade="save-update">
|
||||
|
||||
<class name="org.thdl.lex.component.LexComponent" proxy="org.thdl.lex.component.ILexComponent" table="Meta" where="translationOf = 0 AND deleted=0">
|
||||
|
||||
<meta attribute="generated-class" inherit="false">org.thdl.lex.component.BaseLexComponent</meta>
|
||||
|
||||
<id name="metaId" type="java.lang.Integer" column="metaId">
|
||||
<!-- <meta attribute="finder-method">findById</meta> -->
|
||||
<generator class="native"/>
|
||||
</id>
|
||||
|
||||
<property name="translationOf" type="java.lang.Integer" column="translationOf" length="11"/>
|
||||
<set name="translations" table="Meta" lazy="true" where="translationOf = 1">
|
||||
<key column="translationOf"/>
|
||||
<one-to-many class="org.thdl.lex.component.LexComponent"/>
|
||||
</set>
|
||||
<property name="deleted" type="java.lang.Boolean" column="deleted" not-null="true" length="5"/>
|
||||
<list name="analyticalNotes" table="AnalyticalNotes" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.AnalyticalNote"/>
|
||||
</list>
|
||||
|
||||
<component name="meta" class="org.thdl.lex.component.Meta">
|
||||
<property name="createdBy" type="java.lang.Integer" column="createdBy" not-null="true" length="11"/>
|
||||
<property name="modifiedBy" type="java.lang.Integer" column="modifiedBy" not-null="true" length="11"/>
|
||||
<property name="createdByProjSub" type="java.lang.Integer" column="createdByProjSub" not-null="true" length="11"/>
|
||||
<property name="modifiedByProjSub" type="java.lang.Integer" column="modifiedByProjSub" not-null="true" length="11"/>
|
||||
<property name="createdOn" type="java.sql.Timestamp" column="createdOn" length="14"/>
|
||||
<property name="modifiedOn" type="java.sql.Timestamp" column="modifiedOn" length="14"/>
|
||||
<property name="source" type="java.lang.Integer" column="source" not-null="true" length="11"/>
|
||||
<property name="language" type="java.lang.Short" column="language" not-null="true" length="6"/>
|
||||
<property name="script" type="java.lang.Short" column="script" not-null="true" length="6"/>
|
||||
<property name="dialect" type="java.lang.Short" column="dialect" not-null="true" length="6"/>
|
||||
<property name="note" type="java.lang.String" column="note" length="65535"/>
|
||||
</component>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.AnalyticalNote" proxy="org.thdl.lex.component.IAnalyticalNote" table="AnalyticalNotes">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseAnalyticalNote</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="analyticalNote" type="java.lang.String" column="analyticalNote" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Term" proxy="org.thdl.lex.component.ITerm" table="Terms">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseTerm</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="term" type="java.lang.String" column="term" not-null="true" length="255">
|
||||
<!-- <meta attribute="finder-method">findByTerm</meta> --></property>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<list name="pronunciations" table="Pronunciations" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Pronunciation"/>
|
||||
</list>
|
||||
<list name="etymologies" table="Etymologies" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Etymology"/>
|
||||
</list>
|
||||
<list name="spellings" table="Spellings" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Spelling"/>
|
||||
</list>
|
||||
<list name="functions" table="GrammaticalFunctions" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.GrammaticalFunction"/>
|
||||
</list>
|
||||
<list name="encyclopediaArticles" table="EncyclopediaArticles" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.EncyclopediaArticle"/>
|
||||
</list>
|
||||
<list name="transitionalData" table="TransitionalData" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.TransitionalData"/>
|
||||
</list>
|
||||
<list name="definitions" table="Definitions" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Definition"/>
|
||||
</list>
|
||||
<list name="glosses" table="Glosses" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Gloss"/>
|
||||
</list>
|
||||
<list name="keywords" table="Keywords" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Keyword"/>
|
||||
</list>
|
||||
<list name="modelSentences" table="ModelSentences" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
|
||||
</list>
|
||||
<list name="translationEquivalents" table="TranslationEquivalents" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.TranslationEquivalent"/>
|
||||
</list>
|
||||
<list name="relatedTerms" table="RelatedTerms" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
|
||||
</list>
|
||||
<list name="passages" table="Passages" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Passage"/>
|
||||
</list>
|
||||
<list name="registers" table="SpeechRegisters" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
|
||||
</list>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Definition" proxy="org.thdl.lex.component.IDefinition" table="Definitions">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseDefinition</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" not-null="true" length="6"/>
|
||||
<property name="definition" type="java.lang.String" column="definition" length="65535"/>
|
||||
<list name="subdefinitions" table="Subdefinitions" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Subdefinition"/>
|
||||
</list>
|
||||
<list name="glosses" table="Glosses" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Gloss"/>
|
||||
</list>
|
||||
<list name="keywords" table="Keywords" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Keyword"/>
|
||||
</list>
|
||||
<list name="modelSentences" table="ModelSentences" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
|
||||
</list>
|
||||
<list name="translationEquivalents" table="TranslationEquivalents" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.TranslationEquivalent"/>
|
||||
</list>
|
||||
<list name="relatedTerms" table="RelatedTerms" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
|
||||
</list>
|
||||
<list name="passages" table="Passages" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Passage"/>
|
||||
</list>
|
||||
<list name="registers" table="SpeechRegisters" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
|
||||
</list>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Subdefinition" proxy="org.thdl.lex.component.ISubdefinition" table="Subdefinitions">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseSubdefinition</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="subdefinition" type="java.lang.String" column="subdefinition" length="65535"/>
|
||||
<list name="glosses" table="Glosses" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Gloss"/>
|
||||
</list>
|
||||
<list name="keywords" table="Keywords" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Keyword"/>
|
||||
</list>
|
||||
<list name="modelSentences" table="ModelSentences" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.ModelSentence"/>
|
||||
</list>
|
||||
<list name="translationEquivalents" table="TranslationEquivalents" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.TranslationEquivalent"/>
|
||||
</list>
|
||||
<list name="relatedTerms" table="RelatedTerms" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.RelatedTerm"/>
|
||||
</list>
|
||||
<list name="passages" table="Passages" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.Passage"/>
|
||||
</list>
|
||||
<list name="registers" table="SpeechRegisters" lazy="true">
|
||||
<key column="parentId"/>
|
||||
<index column="precedence"/>
|
||||
<one-to-many class="org.thdl.lex.component.SpeechRegister"/>
|
||||
</list>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Pronunciation" proxy="org.thdl.lex.component.IPronunciation" table="Pronunciations">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BasePronunciation</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="phonetics" type="java.lang.String" column="phonetics" not-null="true" length="65535"/>
|
||||
<property name="phoneticsType" type="java.lang.Short" column="phoneticsType" not-null="true" length="6"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Etymology" proxy="org.thdl.lex.component.IEtymology" table="Etymologies">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseEtymology</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="loanLanguage" type="java.lang.Short" column="loanLanguage" length="6"/>
|
||||
<property name="etymologyType" type="java.lang.Short" column="etymologyType" not-null="true" length="6"/>
|
||||
<property name="derivation" type="java.lang.String" column="derivation" not-null="true" length="255"/>
|
||||
<property name="etymologyDescription" type="java.lang.String" column="etymologyDescription" not-null="true" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Spelling" proxy="org.thdl.lex.component.ISpelling" table="Spellings">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseSpelling</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="spelling" type="java.lang.String" column="spelling" not-null="true" length="255"/>
|
||||
<property name="spellingType" type="java.lang.Short" column="spellingType" not-null="true" length="6"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.GrammaticalFunction" proxy="org.thdl.lex.component.IFunction" table="GrammaticalFunctions">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseGrammaticalFunction</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="function" type="java.lang.Short" column="function" not-null="true" length="6"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.EncyclopediaArticle" proxy="org.thdl.lex.component.IEncyclopediaArticle" table="EncyclopediaArticles">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseEncyclopediaArticle</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="article" type="java.lang.String" column="article" not-null="true" length="65535"/>
|
||||
<property name="articleTitle" type="java.lang.String" column="articleTitle" not-null="true" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Gloss" proxy="org.thdl.lex.component.IGloss" table="Glosses">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseGloss</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="gloss" type="java.lang.String" column="gloss" length="65535"/>
|
||||
<property name="translation" type="java.lang.String" column="translation" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Keyword" proxy="org.thdl.lex.component.IKeyword" table="Keywords">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseKeyword</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="keyword" type="java.lang.String" column="keyword" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.ModelSentence" proxy="org.thdl.lex.component.IModelSentence" table="ModelSentences">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseModelSentence</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="subdefinitionId" type="java.lang.Integer" column="subdefinitionId" not-null="true" length="11"/>
|
||||
<property name="modelSentence" type="java.lang.String" column="modelSentence" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.TranslationEquivalent" proxy="org.thdl.lex.component.ITranslationEquivalent" table="TranslationEquivalents">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseTranslationEquivalent</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="translationEquivalent" type="java.lang.String" column="translationEquivalent" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.RelatedTerm" proxy="org.thdl.lex.component.IRelatedTerm" table="RelatedTerms">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseRelatedTerm</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="relatedTerm" type="java.lang.String" column="relatedTerm" length="65535"/>
|
||||
<property name="relatedTermType" type="java.lang.Short" column="relatedTermType" not-null="true" length="6"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.Passage" proxy="org.thdl.lex.component.IPassage" table="LiteraryQuotations">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BasePassage</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="literarySource" type="java.lang.String" column="literarySource" length="65535"/>
|
||||
<property name="spelling" type="java.lang.String" column="spelling" length="65535"/>
|
||||
<property name="pagination" type="java.lang.String" column="pagination" length="65535"/>
|
||||
<property name="passage" type="java.lang.String" column="passage" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.SpeechRegister" proxy="org.thdl.lex.component.IRegister" table="SpeechRegisters">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseSpeechRegister</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="register" type="java.lang.Short" column="register" not-null="true" length="6"/>
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.thdl.lex.component.TransitionalData" proxy="org.thdl.lex.component.ITransitionalData" table="TransitionalData">
|
||||
<meta attribute="generated-class">org.thdl.lex.component.BaseTransitionalData</meta>
|
||||
<key column="metaId"/>
|
||||
<property name="parentId" type="java.lang.Integer" column="parentId" length="11"/>
|
||||
<many-to-one name="parent" class="org.thdl.lex.component.LexComponent" column="parentId" insert="false" update="false"/>
|
||||
<property name="precedence" type="java.lang.Short" column="precedence" length="6"/>
|
||||
<property name="transitionalDataLabel" type="java.lang.Short" column="transitionalDataLabel" length="6"/>
|
||||
<property name="forPublicConsumption" type="java.lang.String" column="forPublicConsumption" not-null="true" length="5"/>
|
||||
<property name="transitionalDataText" type="java.lang.String" column="transitionalDataText" length="65535"/>
|
||||
</joined-subclass>
|
||||
|
||||
</class>
|
||||
|
||||
</hibernate-mapping>
|
||||
|
122
src/java/org/thdl/lex/component/LexComponent.java
Normal file
122
src/java/org/thdl/lex/component/LexComponent.java
Normal file
|
@ -0,0 +1,122 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
// public abstract class LexComponent extends BaseLexComponent implements Serializable
|
||||
public abstract class LexComponent extends BaseLexComponent implements Serializable
|
||||
{
|
||||
|
||||
private String label;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the label attribute of the LexComponent object
|
||||
*
|
||||
*@param label The new label value
|
||||
*@since
|
||||
*/
|
||||
public void setLabel( String label )
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the label attribute of the LexComponent object
|
||||
*
|
||||
*@return The label value
|
||||
*@since
|
||||
*/
|
||||
public String getLabel()
|
||||
{
|
||||
if ( null == label )
|
||||
{
|
||||
String labelHex = this.toString();
|
||||
int cutoff = labelHex.indexOf( "@" );
|
||||
labelHex = labelHex.substring( 0, cutoff );
|
||||
labelHex = labelHex + "." + getMetaId();
|
||||
labelHex = labelHex.replace( ".".toCharArray()[0], ":".toCharArray()[0] );
|
||||
setLabel( labelHex );
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
//helper methods
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param properties Description of Parameter
|
||||
*@exception LexComponentException Description of Exception
|
||||
*@since
|
||||
*/
|
||||
public void populate( Map properties ) throws LexComponentException
|
||||
{
|
||||
try
|
||||
{
|
||||
BeanUtils.populate( this, properties );
|
||||
}
|
||||
catch ( IllegalAccessException iae )
|
||||
{
|
||||
throw new LexComponentException( iae );
|
||||
}
|
||||
catch ( java.lang.reflect.InvocationTargetException ite )
|
||||
{
|
||||
throw new LexComponentException( ite );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//constructors
|
||||
/**
|
||||
* Constructor for the LexComponent object
|
||||
*
|
||||
*@param translationOf Description of Parameter
|
||||
*@param deleted Description of Parameter
|
||||
*@param analyticalNotes Description of Parameter
|
||||
*@param meta Description of Parameter
|
||||
*@param translations Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexComponent( Integer translationOf, Boolean deleted, List analyticalNotes, Set translations, Meta meta )
|
||||
{
|
||||
super( translationOf, deleted, analyticalNotes, translations, meta );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexComponent object
|
||||
*
|
||||
*@param deleted Description of Parameter
|
||||
*@param analyticalNotes Description of Parameter
|
||||
*@param meta Description of Parameter
|
||||
*@param translations Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexComponent( Boolean deleted, List analyticalNotes, Set translations, Meta meta )
|
||||
{
|
||||
super( deleted, analyticalNotes, translations, meta );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexComponent object
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public LexComponent()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
59
src/java/org/thdl/lex/component/LexComponentException.java
Normal file
59
src/java/org/thdl/lex/component/LexComponentException.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
*/
|
||||
public class LexComponentException extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor for the LexComponentException object
|
||||
*
|
||||
*@since
|
||||
*/
|
||||
public LexComponentException()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexComponentException object
|
||||
*
|
||||
*@param msg Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexComponentException( String msg )
|
||||
{
|
||||
super( msg );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexComponentException object
|
||||
*
|
||||
*@param e Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexComponentException( Exception e )
|
||||
{
|
||||
super( e );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for the LexComponentException object
|
||||
*
|
||||
*@param msg Description of Parameter
|
||||
*@param e Description of Parameter
|
||||
*@since
|
||||
*/
|
||||
public LexComponentException( String msg, Exception e )
|
||||
{
|
||||
super( msg, e );
|
||||
}
|
||||
}
|
||||
|
14
src/java/org/thdl/lex/component/LexEntryException.java
Normal file
14
src/java/org/thdl/lex/component/LexEntryException.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
public class LexEntryException extends Exception
|
||||
{
|
||||
public LexEntryException()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public LexEntryException(String msg)
|
||||
{
|
||||
super(msg);
|
||||
}
|
||||
}
|
166
src/java/org/thdl/lex/component/Meta.java
Normal file
166
src/java/org/thdl/lex/component/Meta.java
Normal file
|
@ -0,0 +1,166 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/** @author Hibernate CodeGenerator */
|
||||
public class Meta implements Serializable {
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer createdBy;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer modifiedBy;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer createdByProjSub;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer modifiedByProjSub;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.util.Date createdOn;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.util.Date modifiedOn;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Integer source;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short language;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short script;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Short dialect;
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.String note;
|
||||
|
||||
/** full constructor */
|
||||
public Meta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.util.Date createdOn, java.util.Date modifiedOn, java.lang.Integer source, java.lang.Short language, java.lang.Short script, java.lang.Short dialect, java.lang.String note) {
|
||||
this.createdBy = createdBy;
|
||||
this.modifiedBy = modifiedBy;
|
||||
this.createdByProjSub = createdByProjSub;
|
||||
this.modifiedByProjSub = modifiedByProjSub;
|
||||
this.createdOn = createdOn;
|
||||
this.modifiedOn = modifiedOn;
|
||||
this.source = source;
|
||||
this.language = language;
|
||||
this.script = script;
|
||||
this.dialect = dialect;
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
/** default constructor */
|
||||
public Meta() {
|
||||
}
|
||||
|
||||
/** minimal constructor */
|
||||
public Meta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.lang.Integer source, java.lang.Short language, java.lang.Short script, java.lang.Short dialect) {
|
||||
this.createdBy = createdBy;
|
||||
this.modifiedBy = modifiedBy;
|
||||
this.createdByProjSub = createdByProjSub;
|
||||
this.modifiedByProjSub = modifiedByProjSub;
|
||||
this.source = source;
|
||||
this.language = language;
|
||||
this.script = script;
|
||||
this.dialect = dialect;
|
||||
}
|
||||
|
||||
public java.lang.Integer getCreatedBy() {
|
||||
return this.createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(java.lang.Integer createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public java.lang.Integer getModifiedBy() {
|
||||
return this.modifiedBy;
|
||||
}
|
||||
|
||||
public void setModifiedBy(java.lang.Integer modifiedBy) {
|
||||
this.modifiedBy = modifiedBy;
|
||||
}
|
||||
|
||||
public java.lang.Integer getCreatedByProjSub() {
|
||||
return this.createdByProjSub;
|
||||
}
|
||||
|
||||
public void setCreatedByProjSub(java.lang.Integer createdByProjSub) {
|
||||
this.createdByProjSub = createdByProjSub;
|
||||
}
|
||||
|
||||
public java.lang.Integer getModifiedByProjSub() {
|
||||
return this.modifiedByProjSub;
|
||||
}
|
||||
|
||||
public void setModifiedByProjSub(java.lang.Integer modifiedByProjSub) {
|
||||
this.modifiedByProjSub = modifiedByProjSub;
|
||||
}
|
||||
|
||||
public java.util.Date getCreatedOn() {
|
||||
return this.createdOn;
|
||||
}
|
||||
|
||||
public void setCreatedOn(java.util.Date createdOn) {
|
||||
this.createdOn = createdOn;
|
||||
}
|
||||
|
||||
public java.util.Date getModifiedOn() {
|
||||
return this.modifiedOn;
|
||||
}
|
||||
|
||||
public void setModifiedOn(java.util.Date modifiedOn) {
|
||||
this.modifiedOn = modifiedOn;
|
||||
}
|
||||
|
||||
public java.lang.Integer getSource() {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
public void setSource(java.lang.Integer source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public java.lang.Short getLanguage() {
|
||||
return this.language;
|
||||
}
|
||||
|
||||
public void setLanguage(java.lang.Short language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public java.lang.Short getScript() {
|
||||
return this.script;
|
||||
}
|
||||
|
||||
public void setScript(java.lang.Short script) {
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public java.lang.Short getDialect() {
|
||||
return this.dialect;
|
||||
}
|
||||
|
||||
public void setDialect(java.lang.Short dialect) {
|
||||
this.dialect = dialect;
|
||||
}
|
||||
|
||||
public java.lang.String getNote() {
|
||||
return this.note;
|
||||
}
|
||||
|
||||
public void setNote(java.lang.String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this)
|
||||
.toString();
|
||||
}
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/ModelSentence.java
Normal file
8
src/java/org/thdl/lex/component/ModelSentence.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ModelSentence extends BaseModelSentence implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Passage.java
Normal file
8
src/java/org/thdl/lex/component/Passage.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Passage extends BasePassage implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Pronunciation.java
Normal file
8
src/java/org/thdl/lex/component/Pronunciation.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Pronunciation extends BasePronunciation implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/RelatedTerm.java
Normal file
8
src/java/org/thdl/lex/component/RelatedTerm.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class RelatedTerm extends BaseRelatedTerm implements Serializable
|
||||
{
|
||||
|
||||
}
|
16
src/java/org/thdl/lex/component/SpeechRegister.java
Normal file
16
src/java/org/thdl/lex/component/SpeechRegister.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 5, 2003
|
||||
*/
|
||||
public class SpeechRegister extends BaseSpeechRegister implements Serializable
|
||||
{
|
||||
|
||||
}
|
||||
|
8
src/java/org/thdl/lex/component/Spelling.java
Normal file
8
src/java/org/thdl/lex/component/Spelling.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Spelling extends BaseSpelling implements Serializable
|
||||
{
|
||||
|
||||
}
|
8
src/java/org/thdl/lex/component/Subdefinition.java
Normal file
8
src/java/org/thdl/lex/component/Subdefinition.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Subdefinition extends BaseSubdefinition implements Serializable
|
||||
{
|
||||
|
||||
}
|
15
src/java/org/thdl/lex/component/Term.java
Normal file
15
src/java/org/thdl/lex/component/Term.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
*/
|
||||
public class Term extends BaseTerm implements Serializable
|
||||
{
|
||||
}
|
||||
|
8
src/java/org/thdl/lex/component/TransitionalData.java
Normal file
8
src/java/org/thdl/lex/component/TransitionalData.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TransitionalData extends BaseTransitionalData implements Serializable
|
||||
{
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue