changes to term interface
This commit is contained in:
parent
90f2041a56
commit
7e0932bbe0
37 changed files with 1997 additions and 734 deletions
42
build.xml
42
build.xml
|
@ -1,16 +1,14 @@
|
|||
|
||||
<project name="Lex" default="compile" basedir=".">
|
||||
|
||||
<!-- Configure the directory into which the web application is built -->
|
||||
<!-- Configure the directory into which the web application is built -->
|
||||
<property name="build" value="${basedir}/build"/>
|
||||
|
||||
<!-- Configure the directory containing the source files -->
|
||||
<property name="source" value="${basedir}/src"/>
|
||||
|
||||
<!-- Configure the directory containing the config files
|
||||
This files from this directory should not go in the CVS hierarchy.
|
||||
-->
|
||||
<property name="config" value="${basedir}/local-config"/>
|
||||
<!-- Configure the directory containing the config files
|
||||
This files from this directory should not go in the CVS hierarchy. -->
|
||||
<property name="config" value="${basedir}/lcl-cfg"/>
|
||||
|
||||
<!-- Configure the context path for this application -->
|
||||
<property name="path" value="/lex"/>
|
||||
|
@ -19,9 +17,10 @@
|
|||
This is used in the classpath to bring in servlet.jar and the jdbc-driver
|
||||
-->
|
||||
<property name="catalina.home" value="/usr/local/tomcat8080"/>
|
||||
<property name="catalina.base" value="/usr/local/tomcat2020"/>
|
||||
|
||||
<!-- Configure properties to access the Manager application
|
||||
user /pass combo should be in $TOMCAT_HOME/conf/tomcat-users.xml with managaer role.-->
|
||||
user /pass combo should be in $TOMCAT_HOME/conf/tomcat-users.xml with manager role.-->
|
||||
<property name="url" value="http://localhost:2020/manager"/>
|
||||
<property name="username" value="user"/>
|
||||
<property name="password" value="pass"/>
|
||||
|
@ -39,27 +38,32 @@
|
|||
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask"/>
|
||||
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
|
||||
|
||||
<!-- Configure up the classpath -->
|
||||
<!-- Configure the classpath -->
|
||||
<path id="classpath">
|
||||
<fileset dir="${basedir}/lib">
|
||||
<include name="**/*.jar"/>
|
||||
<include name="compiletime/lib/javax.servlet.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${catalina.home}/common/lib">
|
||||
<include name="servlet.jar"/>
|
||||
<include name="mysql-connector-java-3.0.8-stable-bin.jar"/>
|
||||
</fileset>
|
||||
<!--point to org/thdl/thdl/users-->
|
||||
<!--point to org/thdl/users-->
|
||||
<pathelement location="${build}/WEB-INF/classes"/>
|
||||
</path>
|
||||
|
||||
|
||||
<!-- Executable Targets -->
|
||||
<target name="copy" description="copy jsp, html, css, js, and other files into the build directory">
|
||||
|
||||
<copy todir="${build}">
|
||||
<fileset dir="${source}/jsp">
|
||||
<include name="**/*.jsp"/>
|
||||
<include name="**/*.jsf"/>
|
||||
<include name="*.jsp"/>
|
||||
<include name="*.jsf"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${build}/jsp">
|
||||
<fileset dir="${source}/jsp/jsp">
|
||||
<include name="*.jsp"/>
|
||||
<include name="*.jsf"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
|
@ -115,13 +119,11 @@
|
|||
</target>
|
||||
|
||||
<target name="test" description="Testing" depends="compile">
|
||||
<java classname="org.thdl.lex.LexMod" classpath="${build}/WEB-INF/classes/" classpathref="classpath"/>
|
||||
<java classname="org.thdl.lex.${class}" classpath="${build}/WEB-INF/classes/" classpathref="classpath"/>
|
||||
</target>
|
||||
|
||||
<target name="javadoc" description="Create Javadocs">
|
||||
<mkdir dir="${build}/docs/api"/>
|
||||
|
||||
<javadoc destdir="${build}/docs/api/" classpathref="classpath" author="true" version="true" use="true" windowtitle="THDL Tibetan Collaborative Dictionary API">
|
||||
<target name="javadoc" description="Create Javadocs">
|
||||
<javadoc destdir="${build}/apidocs/" classpathref="classpath" author="true" version="true" use="true" windowtitle="THDL Tibetan Collaborative Dictionary API">
|
||||
|
||||
<fileset dir="${source}/java" defaultexcludes="yes">
|
||||
<include name="org/thdl/**/*.java"/>
|
||||
|
@ -146,7 +148,9 @@
|
|||
<mkdir dir="logs"/>
|
||||
<tstamp prefix="now"/>
|
||||
<touch file="${basedir}/logs/hibernate.log"/>
|
||||
<move file="${basedir}/logs/hibernate.log" tofile="${basedir}/logs/hibernate_${now.DSTAMP}_${now.TSTAMP}.log" overwrite="true"/>
|
||||
<move file="${basedir}/logs/hibernate.log" tofile="${basedir}/logs/${now.DSTAMP}_${now.TSTAMP}_hibernate.log" overwrite="true"/>
|
||||
<touch file="${basedir}/logs/lex.log"/>
|
||||
<move file="${basedir}/logs/lex.log" tofile="${basedir}/logs/${now.DSTAMP}_${now.TSTAMP}_lex.log" overwrite="true"/>
|
||||
</target>
|
||||
|
||||
<target name="reinstall" description="Remove and Re-install web application" depends="remove">
|
||||
|
|
|
@ -1,40 +1,37 @@
|
|||
<?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">
|
||||
### direct log messages to stdout ###
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
<hibernate-configuration>
|
||||
### direct messages to file hibernate.log ###
|
||||
log4j.appender.file=org.apache.log4j.FileAppender
|
||||
log4j.appender.file.File=/Users/travis/webapps/lex/logs/hibernate.log
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
<session-factory>
|
||||
### direct messages to file lex.log ###
|
||||
log4j.appender.lex-out=org.apache.log4j.FileAppender
|
||||
log4j.appender.lex-out.File=/Users/travis/webapps/lex/logs/lex.log
|
||||
log4j.appender.lex-out.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.lex-out.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
### set log levels - for more verbose logging change 'info' to 'debug' ##
|
||||
|
||||
log4j.rootLogger=warn, stdout
|
||||
|
||||
log4j.logger.net.sf.hibernate=debug, file
|
||||
|
||||
log4j.logger.org.thdl.lex=debug, lex-out, file
|
||||
|
||||
### enable the following line if you want to track down connection ###
|
||||
### leakages when using DriverManagerConnectionProvider ###
|
||||
#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace
|
||||
|
||||
### log JDBC bind parameters ###
|
||||
log4j.logger.net.sf.hibernate.type=info
|
||||
|
||||
### log prepared statement cache activity ###
|
||||
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=info
|
||||
|
||||
<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>
|
||||
|
|
|
@ -1,23 +1,25 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
import org.thdl.lex.commands.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
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;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.apache.log4j.*;
|
||||
import org.thdl.lex.commands.*;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
* @author travis
|
||||
* @created October 1, 2003
|
||||
*/
|
||||
public class LexActionServlet extends HttpServlet
|
||||
{
|
||||
|
@ -31,8 +33,8 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Sets the commands attribute of the LexActionServlet object
|
||||
*
|
||||
*@param commands The new commands value
|
||||
*@since
|
||||
* @param commands The new commands value
|
||||
* @since
|
||||
*/
|
||||
public void setCommands( HashMap commands )
|
||||
{
|
||||
|
@ -43,8 +45,8 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Sets the cmd attribute of the LexActionServlet object
|
||||
*
|
||||
*@param cmd The new cmd value
|
||||
*@since
|
||||
* @param cmd The new cmd value
|
||||
* @since
|
||||
*/
|
||||
public void setCmd( String cmd )
|
||||
{
|
||||
|
@ -55,8 +57,8 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Gets the commands attribute of the LexActionServlet object
|
||||
*
|
||||
*@return The commands value
|
||||
*@since
|
||||
* @return The commands value
|
||||
* @since
|
||||
*/
|
||||
public HashMap getCommands()
|
||||
{
|
||||
|
@ -67,8 +69,8 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Gets the cmd attribute of the LexActionServlet object
|
||||
*
|
||||
*@return The cmd value
|
||||
*@since
|
||||
* @return The cmd value
|
||||
* @since
|
||||
*/
|
||||
public String getCmd()
|
||||
{
|
||||
|
@ -81,9 +83,9 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param config Description of Parameter
|
||||
*@exception ServletException Description of Exception
|
||||
*@since
|
||||
* @param config Description of Parameter
|
||||
* @exception ServletException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public void init( ServletConfig config ) throws ServletException
|
||||
{
|
||||
|
@ -96,17 +98,19 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* 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
|
||||
* @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
|
||||
{
|
||||
logRequestState( req );
|
||||
logSessionState( req.getSession( true ) );
|
||||
setCmd( req.getParameter( LexConstants.COMMAND_REQ_PARAM ) );
|
||||
Command command = lookupCommand( getCmd() );
|
||||
LexComponent component = (LexComponent) req.getAttribute( LexConstants.COMPONENT_REQ_ATTR );
|
||||
|
@ -150,10 +154,10 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param cmdKey Description of Parameter
|
||||
*@return Description of the Returned Value
|
||||
*@exception CommandException Description of Exception
|
||||
*@since
|
||||
* @param cmdKey Description of Parameter
|
||||
* @return Description of the Returned Value
|
||||
* @exception CommandException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
private Command lookupCommand( String cmdKey ) throws CommandException
|
||||
{
|
||||
|
@ -175,7 +179,59 @@ public class LexActionServlet extends HttpServlet
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@since
|
||||
* @param req Description of the Parameter
|
||||
*/
|
||||
public void logRequestState( HttpServletRequest req )
|
||||
{
|
||||
Logger logger = Logger.getLogger( "org.thdl.lex" );
|
||||
Iterator it;
|
||||
Enumeration enum = req.getParameterNames();
|
||||
while ( enum.hasMoreElements() )
|
||||
{
|
||||
String parm = (String) enum.nextElement();
|
||||
logger.debug( "Request Parameter " + parm + " = " + req.getParameter( parm ) );
|
||||
}
|
||||
enum = req.getAttributeNames();
|
||||
while ( enum.hasMoreElements() )
|
||||
{
|
||||
String att = (String) enum.nextElement();
|
||||
logger.debug( "Request Attribute " + att + " = " + req.getAttribute( att ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param ses Description of the Parameter
|
||||
*/
|
||||
public void logSessionState( HttpSession ses )
|
||||
{
|
||||
Logger logger = Logger.getLogger( "org.thdl.lex" );
|
||||
Enumeration enum = ses.getAttributeNames();
|
||||
while ( enum.hasMoreElements() )
|
||||
{
|
||||
String att = (String) enum.nextElement();
|
||||
logger.debug( "Request Attribute " + att + " = " + ses.getAttribute( att ) );
|
||||
}
|
||||
LexQuery query = (LexQuery) ses.getAttribute( "query" );
|
||||
if ( null == query )
|
||||
{
|
||||
return;
|
||||
}
|
||||
logger.debug( "Query Entry: " + query.getEntry() );
|
||||
logger.debug( "Query QueryComponent: " + query.getQueryComponent() );
|
||||
logger.debug( "Query UpdateComponent: " + query.getUpdateComponent() );
|
||||
logger.debug( "Query Results, " + query.getResults() + ", contain: " + query.getResults().values() );
|
||||
logger.debug( "Query Duration: " + query.getEntry() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @since
|
||||
*/
|
||||
private void initCommands()
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ public class LexComponentFilter implements Filter
|
|||
// catch (LexComponentException labe)
|
||||
catch ( Exception labe )
|
||||
{
|
||||
throw new ServletException( "LABE says: " + labe.getMessage() );
|
||||
throw new ServletException( labe );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import java.sql.*;
|
|||
import java.util.*;
|
||||
|
||||
import net.sf.hibernate.*;
|
||||
import org.apache.log4j.*;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
|
@ -26,10 +27,13 @@ public class LexComponentRepository
|
|||
*/
|
||||
private static void setStart( long startTime )
|
||||
{
|
||||
Logger logger = Logger.getLogger( "org.thdl.lex" );
|
||||
logger.debug( "Query start time: " + new java.util.Date( startTime ) );
|
||||
start = startTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the start attribute of the LexComponentRepository object
|
||||
*
|
||||
|
@ -42,6 +46,23 @@ public class LexComponentRepository
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the duration attribute of the LexComponentRepository class
|
||||
*
|
||||
* @return The duration value
|
||||
*/
|
||||
private static long getDuration()
|
||||
{
|
||||
long duration = now() - getStart();
|
||||
|
||||
Logger logger = Logger.getLogger( "org.thdl.lex" );
|
||||
logger.debug( "Query finish: " + new java.util.Date( now() ) );
|
||||
logger.debug( "Query duration in ms: " + duration );
|
||||
logger.info( "Query duration: " + duration / 1000 + " seconds." );
|
||||
return duration;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the session attribute of the LexComponentRepository class
|
||||
*
|
||||
|
@ -155,28 +176,80 @@ public class LexComponentRepository
|
|||
term = (ITerm) it.next();
|
||||
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
|
||||
}
|
||||
lexQuery.setDuration( now() - getStart() );
|
||||
lexQuery.setDuration( getDuration() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param lexQuery Description of Parameter
|
||||
* @param term Description of the Parameter
|
||||
* @exception LexRepositoryException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public static void loadTermByPk( ITerm term ) throws LexRepositoryException
|
||||
{
|
||||
try
|
||||
{
|
||||
getSession().load( term, term.getMetaId() );
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
throw new LexRepositoryException( he );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param lexQuery Description of the Parameter
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
*/
|
||||
public static void loadTermByPk( LexQuery lexQuery ) throws LexRepositoryException
|
||||
{
|
||||
ITerm term = assertTerm( lexQuery.getQueryComponent() );
|
||||
loadTermByPk( term );
|
||||
lexQuery.setEntry( term );
|
||||
if ( !lexQuery.getResults().containsKey( term.getMetaId() ) )
|
||||
{
|
||||
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param component Description of the Parameter
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
*/
|
||||
public static void loadByPk( ILexComponent component ) throws LexRepositoryException
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
getSession().load( term, term.getMetaId() );
|
||||
lexQuery.setEntry( term );
|
||||
if ( !lexQuery.getResults().containsKey( term.getMetaId() ) )
|
||||
{
|
||||
lexQuery.getResults().put( term.getMetaId(), term.getTerm() );
|
||||
}
|
||||
getSession().load( component, component.getMetaId() );
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
throw new LexRepositoryException( he );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param component Description of the Parameter
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
*/
|
||||
public static void update( ILexComponent component ) throws LexRepositoryException
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
getSession().update( component );
|
||||
}
|
||||
catch ( HibernateException he )
|
||||
{
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
|
@ -24,55 +26,55 @@ public class LexConstants
|
|||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String PRONUNCIATIONLABEL_VALUE = "pronunciation";
|
||||
public final static String PRONUNCIATIONLABEL_VALUE = new Pronunciation().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String SPELLINGLABEL_VALUE = "spelling";
|
||||
public final static String SPELLINGLABEL_VALUE = new Spelling().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String ETYMOLOGYLABEL_VALUE = "etymology";
|
||||
public final static String ETYMOLOGYLABEL_VALUE = new Etymology().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String FUNCTIONLABEL_VALUE = "function";
|
||||
public final static String FUNCTIONLABEL_VALUE = new GrammaticalFunction().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String ENCYCLOPEDIA_ARTICLE_LABEL_VALUE = "encyclopediaArticle";
|
||||
public final static String ENCYCLOPEDIA_ARTICLE_LABEL_VALUE = new EncyclopediaArticle().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String DEFINITIONLABEL_VALUE = "definition";
|
||||
public final static String DEFINITIONLABEL_VALUE = new Definition().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String SUBDEFINITIONLABEL_VALUE = "subdefinition";
|
||||
public final static String SUBDEFINITIONLABEL_VALUE = new Subdefinition().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String MODELSENTENCELABEL_VALUE = "modelSentence";
|
||||
public final static String MODELSENTENCELABEL_VALUE = new ModelSentence().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String PASSAGELABEL_VALUE = "passage";
|
||||
public final static String PASSAGELABEL_VALUE = new Passage().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String TRANSLATIONLABEL_VALUE = "translationEquivalent";
|
||||
public final static String TRANSLATIONLABEL_VALUE = new TranslationEquivalent().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String RELATEDTERMLABEL_VALUE = "relatedTerm";
|
||||
public final static String RELATEDTERMLABEL_VALUE = new RelatedTerm().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String REGISTERLABEL_VALUE = "register";
|
||||
public final static String REGISTERLABEL_VALUE = new SpeechRegister().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String KEYWORDLABEL_VALUE = "keyword";
|
||||
public final static String KEYWORDLABEL_VALUE = new Keyword().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
|
@ -80,7 +82,16 @@ public class LexConstants
|
|||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String ANALYTICALNOTELABEL_VALUE = "analyticalNote";
|
||||
public final static String ANALYTICALNOTELABEL_VALUE = new AnalyticalNote().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String TRANSITIONALDATALABEL_VALUE = new TransitionalData().getLabel();
|
||||
/**
|
||||
* Description of the Field
|
||||
*/
|
||||
public final static String GLOSSLABEL_VALUE = new Gloss().getLabel();
|
||||
|
||||
/*
|
||||
REQUEST PARAM NAMES AND VALUES USED BY LexActionServlet.java
|
||||
*/
|
||||
|
@ -224,5 +235,6 @@ public class LexConstants
|
|||
public final static String HIBERNATE_SESSION_KEY = "hib";
|
||||
|
||||
//public final static String URL = "jdbc:mysql://localhost/LexTorque";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,45 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
|
||||
import net.sf.hibernate.*;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import java.util.*;
|
||||
import java.sql.*;
|
||||
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
* @author travis
|
||||
* @created October 1, 2003
|
||||
*/
|
||||
public class LexQuery
|
||||
{
|
||||
private ILexComponent queryComponent;
|
||||
private ILexComponent updateComponent;
|
||||
private ITerm entry;
|
||||
private Map results;
|
||||
private Enumeration mode;
|
||||
private long duration;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the updateComponent attribute of the LexQuery object
|
||||
*
|
||||
* @param updateComponent The new updateComponent value
|
||||
*/
|
||||
public void setUpdateComponent( ILexComponent updateComponent )
|
||||
{
|
||||
this.updateComponent = updateComponent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the duration attribute of the LexQuery object
|
||||
*
|
||||
*@param duration The new duration value
|
||||
*@since
|
||||
* @param duration The new duration value
|
||||
* @since
|
||||
*/
|
||||
public void setDuration( long duration )
|
||||
{
|
||||
|
@ -38,8 +50,8 @@ public class LexQuery
|
|||
/**
|
||||
* Sets the queryComponent attribute of the LexQuery object
|
||||
*
|
||||
*@param queryComponent The new queryComponent value
|
||||
*@since
|
||||
* @param queryComponent The new queryComponent value
|
||||
* @since
|
||||
*/
|
||||
public void setQueryComponent( ILexComponent queryComponent )
|
||||
{
|
||||
|
@ -50,8 +62,8 @@ public class LexQuery
|
|||
/**
|
||||
* Sets the entry attribute of the LexQuery object
|
||||
*
|
||||
*@param entry The new entry value
|
||||
*@since
|
||||
* @param entry The new entry value
|
||||
* @since
|
||||
*/
|
||||
public void setEntry( ITerm entry )
|
||||
{
|
||||
|
@ -62,8 +74,8 @@ public class LexQuery
|
|||
/**
|
||||
* Sets the mode attribute of the LexQuery object
|
||||
*
|
||||
*@param mode The new mode value
|
||||
*@since
|
||||
* @param mode The new mode value
|
||||
* @since
|
||||
*/
|
||||
public void setMode( Enumeration mode )
|
||||
{
|
||||
|
@ -74,8 +86,8 @@ public class LexQuery
|
|||
/**
|
||||
* Sets the results attribute of the LexQuery object
|
||||
*
|
||||
*@param results The new results value
|
||||
*@since
|
||||
* @param results The new results value
|
||||
* @since
|
||||
*/
|
||||
public void setResults( Map results )
|
||||
{
|
||||
|
@ -83,11 +95,22 @@ public class LexQuery
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the updateComponent attribute of the LexQuery object
|
||||
*
|
||||
* @return The updateComponent value
|
||||
*/
|
||||
public ILexComponent getUpdateComponent()
|
||||
{
|
||||
return updateComponent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the duration attribute of the LexQuery object
|
||||
*
|
||||
*@return The duration value
|
||||
*@since
|
||||
* @return The duration value
|
||||
* @since
|
||||
*/
|
||||
public long getDuration()
|
||||
{
|
||||
|
@ -98,8 +121,8 @@ public class LexQuery
|
|||
/**
|
||||
* Gets the queryComponent attribute of the LexQuery object
|
||||
*
|
||||
*@return The queryComponent value
|
||||
*@since
|
||||
* @return The queryComponent value
|
||||
* @since
|
||||
*/
|
||||
public ILexComponent getQueryComponent()
|
||||
{
|
||||
|
@ -110,8 +133,8 @@ public class LexQuery
|
|||
/**
|
||||
* Gets the entry attribute of the LexQuery object
|
||||
*
|
||||
*@return The entry value
|
||||
*@since
|
||||
* @return The entry value
|
||||
* @since
|
||||
*/
|
||||
public ITerm getEntry()
|
||||
{
|
||||
|
@ -122,8 +145,8 @@ public class LexQuery
|
|||
/**
|
||||
* Gets the mode attribute of the LexQuery object
|
||||
*
|
||||
*@return The mode value
|
||||
*@since
|
||||
* @return The mode value
|
||||
* @since
|
||||
*/
|
||||
public Enumeration getMode()
|
||||
{
|
||||
|
@ -134,8 +157,8 @@ public class LexQuery
|
|||
/**
|
||||
* Gets the results attribute of the LexQuery object
|
||||
*
|
||||
*@return The results value
|
||||
*@since
|
||||
* @return The results value
|
||||
* @since
|
||||
*/
|
||||
public Map getResults()
|
||||
{
|
||||
|
@ -151,9 +174,9 @@ public class LexQuery
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param parameters Description of Parameter
|
||||
*@exception LexRepositoryException Description of Exception
|
||||
*@since
|
||||
* @param parameters Description of Parameter
|
||||
* @exception LexRepositoryException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public void populate( Map parameters ) throws LexRepositoryException
|
||||
{
|
||||
|
@ -177,17 +200,17 @@ public class LexQuery
|
|||
/**
|
||||
* Constructor for the LexQuery object
|
||||
*
|
||||
*@since
|
||||
* @since
|
||||
*/
|
||||
public LexQuery() { }
|
||||
|
||||
//inner classes
|
||||
|
||||
/*
|
||||
* class LexQueryMode extends Enumeration
|
||||
* {
|
||||
* }
|
||||
*/
|
||||
class LexQueryMode extends Enumeration
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +1,57 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.HashMap;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 6, 2003
|
||||
*/
|
||||
public class LexUtilities
|
||||
{
|
||||
/* public static String formatTimestamp( Timestamp time )
|
||||
/**
|
||||
* Gets the resultSetSize attribute of the LexUtilities class
|
||||
*
|
||||
* @param rs Description of the Parameter
|
||||
* @return The resultSetSize value
|
||||
* @exception java.sql.SQLException Description of the Exception
|
||||
*/
|
||||
public static int getResultSetSize( java.sql.ResultSet rs ) throws java.sql.SQLException
|
||||
{
|
||||
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd 'at' hh:mm:ss a zzz");
|
||||
// Date coDate = new Date( getCreatedOn().getTime() );
|
||||
// String dateString = formatter.format( coDate );
|
||||
} */
|
||||
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("");
|
||||
map.put( "'", "\\'" );
|
||||
/*
|
||||
map.put("%", "\\%");
|
||||
map.put("_", "\\_");
|
||||
map.put("\"", "\\\"");
|
||||
*/
|
||||
StringBuffer targetString = new StringBuffer( "" );
|
||||
if ( null != fromString )
|
||||
{
|
||||
StringTokenizer tokens = new StringTokenizer( fromString, "'%_\"", true );
|
||||
|
@ -29,79 +60,105 @@ public class LexUtilities
|
|||
String temp = tokens.nextToken();
|
||||
if ( map.containsKey( temp ) )
|
||||
{
|
||||
temp = (String)map.get( temp );
|
||||
temp = (String) map.get( temp );
|
||||
}
|
||||
targetString.append( temp );
|
||||
}
|
||||
}
|
||||
return targetString.toString();
|
||||
}
|
||||
public static int getResultSetSize( java.sql.ResultSet rs ) throws java.sql.SQLException
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param source Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public static Integer[] convertToIntegerArray( String[] source )
|
||||
{
|
||||
rs.last();
|
||||
int i = rs.getRow();
|
||||
rs.beforeFirst();
|
||||
return i;
|
||||
}
|
||||
public static int[] convertToIntArray( String[] source )
|
||||
{
|
||||
if (null == source)
|
||||
if ( null == source )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
int[] target = new int[ source.length ];
|
||||
for ( int i=0; i<target.length; i++ )
|
||||
Integer[] target = new Integer[source.length];
|
||||
for ( int i = 0; i < target.length; i++ )
|
||||
{
|
||||
target[ i ] = Integer.parseInt( source[ i ] );
|
||||
target[i] = new Integer( source[i] );
|
||||
}
|
||||
return target;
|
||||
}
|
||||
public static int[] convertTokensToIntArray( String source )
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param source Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public static Integer[] convertTokensToIntegerArray( String source )
|
||||
{
|
||||
if (null == source || "null".equals( source ) )
|
||||
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++)
|
||||
Integer[] target = new Integer[sourceTokens.countTokens()];
|
||||
for ( int i = 0; sourceTokens.hasMoreTokens(); i++ )
|
||||
{
|
||||
target[ i ] = Integer.parseInt( sourceTokens.nextToken() );
|
||||
target[i] = new Integer( sourceTokens.nextToken() );
|
||||
}
|
||||
return target;
|
||||
}
|
||||
public static String convertIntArrayToTokens( int[] source )
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param source Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public static String convertIntegerArrayToTokens( Integer[] source )
|
||||
{
|
||||
if (null == source)
|
||||
if ( null == source )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
StringBuffer target = new StringBuffer("");
|
||||
for ( int i=0; i<source.length; i++ )
|
||||
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(":");
|
||||
target.append( source[i].toString() );
|
||||
if ( i < ( source.length - 1 ) )
|
||||
{
|
||||
target.append( ":" );
|
||||
}
|
||||
}
|
||||
return target.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
||||
|
||||
/**
|
||||
* The main program for the LexUtilities class
|
||||
*
|
||||
* @param args The command line arguments
|
||||
*/
|
||||
public static void main( String[] args )
|
||||
{
|
||||
String s = "It's stupid to use a % or a _ in a SQL Statement";
|
||||
System.out.println( LexUtilities.escape( s ) );
|
||||
|
||||
int[] ia = {1,2,3,4,5,6,7,8,9};
|
||||
System.out.println( LexUtilities.convertIntArrayToTokens( ia ) );
|
||||
|
||||
|
||||
Integer[] ia = {new Integer( 1 ), new Integer( 3 )};
|
||||
System.out.println( LexUtilities.convertIntegerArrayToTokens( ia ) );
|
||||
|
||||
String str = "9:8:7:6:5";
|
||||
int[] ia2 = LexUtilities.convertTokensToIntArray( str );
|
||||
String newStr="";
|
||||
for (int i=0; i<5; i++)
|
||||
Integer[] ia2 = LexUtilities.convertTokensToIntegerArray( str );
|
||||
String newStr = "";
|
||||
for ( int i = 0; i < 5; i++ )
|
||||
{
|
||||
newStr=newStr + ia2[i] +" ";
|
||||
newStr = newStr + ia2[i] + " ";
|
||||
}
|
||||
System.out.println( newStr );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,22 +1,29 @@
|
|||
package org.thdl.lex;
|
||||
|
||||
import org.thdl.users.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import org.thdl.users.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 6, 2003
|
||||
*/
|
||||
public class Preferences
|
||||
{
|
||||
//attributes
|
||||
private int id;
|
||||
private int userId;
|
||||
private Integer id;
|
||||
private Integer userId;
|
||||
private String preferencesName;
|
||||
private int projectSubject;
|
||||
private int source;
|
||||
private int language;
|
||||
private int script;
|
||||
private int dialect;
|
||||
private Integer projectSubject;
|
||||
private Integer source;
|
||||
private Integer language;
|
||||
private Integer script;
|
||||
private Integer dialect;
|
||||
private String note;
|
||||
private boolean useDefaultProjSub;
|
||||
private boolean useDefaultSource;
|
||||
|
@ -24,149 +31,476 @@ public class Preferences
|
|||
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) {
|
||||
private Integer[] projectSubjectSet;
|
||||
private Integer[] sourceSet;
|
||||
private Integer[] languageSet;
|
||||
private Integer[] scriptSet;
|
||||
private Integer[] dialectSet;
|
||||
//accessors
|
||||
|
||||
/**
|
||||
* Sets the id attribute of the Preferences object
|
||||
*
|
||||
* @param id The new id value
|
||||
*/
|
||||
public void setId( Integer id )
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public void setUserId(int userId) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the userId attribute of the Preferences object
|
||||
*
|
||||
* @param userId The new userId value
|
||||
*/
|
||||
public void setUserId( Integer userId )
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
public void setPreferencesName(String preferencesName) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the preferencesName attribute of the Preferences object
|
||||
*
|
||||
* @param preferencesName The new preferencesName value
|
||||
*/
|
||||
public void setPreferencesName( String preferencesName )
|
||||
{
|
||||
this.preferencesName = preferencesName;
|
||||
}
|
||||
public String getPreferencesName() {
|
||||
return preferencesName;
|
||||
}
|
||||
public void setUseDefaultNote(boolean useDefaultNote) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultNote attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultNote The new useDefaultNote value
|
||||
*/
|
||||
public void setUseDefaultNote( boolean useDefaultNote )
|
||||
{
|
||||
this.useDefaultNote = useDefaultNote;
|
||||
}
|
||||
public boolean getUseDefaultNote() {
|
||||
return useDefaultNote;
|
||||
}
|
||||
public void setUseDefaultProjSub(boolean useDefaultProjSub) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultProjSub attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultProjSub The new useDefaultProjSub value
|
||||
*/
|
||||
public void setUseDefaultProjSub( boolean useDefaultProjSub )
|
||||
{
|
||||
this.useDefaultProjSub = useDefaultProjSub;
|
||||
}
|
||||
public boolean getUseDefaultProjSub() {
|
||||
return useDefaultProjSub;
|
||||
}
|
||||
public void setUseDefaultSource(boolean useDefaultSource) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultSource attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultSource The new useDefaultSource value
|
||||
*/
|
||||
public void setUseDefaultSource( boolean useDefaultSource )
|
||||
{
|
||||
this.useDefaultSource = useDefaultSource;
|
||||
}
|
||||
public void setUseDefaultLanguage(boolean useDefaultLanguage) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultLanguage attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultLanguage The new useDefaultLanguage value
|
||||
*/
|
||||
public void setUseDefaultLanguage( boolean useDefaultLanguage )
|
||||
{
|
||||
this.useDefaultLanguage = useDefaultLanguage;
|
||||
}
|
||||
public void setUseDefaultScript(boolean useDefaultScript) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultScript attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultScript The new useDefaultScript value
|
||||
*/
|
||||
public void setUseDefaultScript( boolean useDefaultScript )
|
||||
{
|
||||
this.useDefaultScript = useDefaultScript;
|
||||
}
|
||||
public void setUseDefaultDialect(boolean useDefaultDialect) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the useDefaultDialect attribute of the Preferences object
|
||||
*
|
||||
* @param useDefaultDialect The new useDefaultDialect value
|
||||
*/
|
||||
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) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the projectSubject attribute of the Preferences object
|
||||
*
|
||||
* @param projectSubject The new projectSubject value
|
||||
*/
|
||||
public void setProjectSubject( Integer projectSubject )
|
||||
{
|
||||
this.projectSubject = projectSubject;
|
||||
}
|
||||
public void setSource(int source) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the source attribute of the Preferences object
|
||||
*
|
||||
* @param source The new source value
|
||||
*/
|
||||
public void setSource( Integer source )
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
public void setLanguage(int language) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the language attribute of the Preferences object
|
||||
*
|
||||
* @param language The new language value
|
||||
*/
|
||||
public void setLanguage( Integer language )
|
||||
{
|
||||
this.language = language;
|
||||
}
|
||||
public void setScript(int script) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the script attribute of the Preferences object
|
||||
*
|
||||
* @param script The new script value
|
||||
*/
|
||||
public void setScript( Integer script )
|
||||
{
|
||||
this.script = script;
|
||||
}
|
||||
public void setDialect(int dialect) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the dialect attribute of the Preferences object
|
||||
*
|
||||
* @param dialect The new dialect value
|
||||
*/
|
||||
public void setDialect( Integer dialect )
|
||||
{
|
||||
this.dialect = dialect;
|
||||
}
|
||||
public void setProjectSubjectSet(int[] projectSubjectSet) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the projectSubjectSet attribute of the Preferences object
|
||||
*
|
||||
* @param projectSubjectSet The new projectSubjectSet value
|
||||
*/
|
||||
public void setProjectSubjectSet( Integer[] projectSubjectSet )
|
||||
{
|
||||
this.projectSubjectSet = projectSubjectSet;
|
||||
}
|
||||
public void setSourceSet(int[] sourceSet) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the sourceSet attribute of the Preferences object
|
||||
*
|
||||
* @param sourceSet The new sourceSet value
|
||||
*/
|
||||
public void setSourceSet( Integer[] sourceSet )
|
||||
{
|
||||
this.sourceSet = sourceSet;
|
||||
}
|
||||
public void setLanguageSet(int[] languageSet) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the languageSet attribute of the Preferences object
|
||||
*
|
||||
* @param languageSet The new languageSet value
|
||||
*/
|
||||
public void setLanguageSet( Integer[] languageSet )
|
||||
{
|
||||
this.languageSet = languageSet;
|
||||
}
|
||||
public void setScriptSet(int[] scriptSet) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the scriptSet attribute of the Preferences object
|
||||
*
|
||||
* @param scriptSet The new scriptSet value
|
||||
*/
|
||||
public void setScriptSet( Integer[] scriptSet )
|
||||
{
|
||||
this.scriptSet = scriptSet;
|
||||
}
|
||||
public void setDialectSet(int[] dialectSet) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the dialectSet attribute of the Preferences object
|
||||
*
|
||||
* @param dialectSet The new dialectSet value
|
||||
*/
|
||||
public void setDialectSet( Integer[] dialectSet )
|
||||
{
|
||||
this.dialectSet = dialectSet;
|
||||
}
|
||||
public void setNote(String note) {
|
||||
|
||||
|
||||
/**
|
||||
* Sets the note attribute of the Preferences object
|
||||
*
|
||||
* @param note The new note value
|
||||
*/
|
||||
public void setNote( String note )
|
||||
{
|
||||
this.note = note;
|
||||
}
|
||||
public int getProjectSubject() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the id attribute of the Preferences object
|
||||
*
|
||||
* @return The id value
|
||||
*/
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the userId attribute of the Preferences object
|
||||
*
|
||||
* @return The userId value
|
||||
*/
|
||||
public Integer getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the preferencesName attribute of the Preferences object
|
||||
*
|
||||
* @return The preferencesName value
|
||||
*/
|
||||
public String getPreferencesName()
|
||||
{
|
||||
return preferencesName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultNote attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultNote value
|
||||
*/
|
||||
public boolean getUseDefaultNote()
|
||||
{
|
||||
return useDefaultNote;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultProjSub attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultProjSub value
|
||||
*/
|
||||
public boolean getUseDefaultProjSub()
|
||||
{
|
||||
return useDefaultProjSub;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultSource attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultSource value
|
||||
*/
|
||||
public boolean getUseDefaultSource()
|
||||
{
|
||||
return useDefaultSource;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultLanguage attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultLanguage value
|
||||
*/
|
||||
public boolean getUseDefaultLanguage()
|
||||
{
|
||||
return useDefaultLanguage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultScript attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultScript value
|
||||
*/
|
||||
public boolean getUseDefaultScript()
|
||||
{
|
||||
return useDefaultScript;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the useDefaultDialect attribute of the Preferences object
|
||||
*
|
||||
* @return The useDefaultDialect value
|
||||
*/
|
||||
public boolean getUseDefaultDialect()
|
||||
{
|
||||
return useDefaultDialect;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the projectSubject attribute of the Preferences object
|
||||
*
|
||||
* @return The projectSubject value
|
||||
*/
|
||||
public Integer getProjectSubject()
|
||||
{
|
||||
return projectSubject;
|
||||
}
|
||||
public int getSource() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the source attribute of the Preferences object
|
||||
*
|
||||
* @return The source value
|
||||
*/
|
||||
public Integer getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
public int getLanguage() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the language attribute of the Preferences object
|
||||
*
|
||||
* @return The language value
|
||||
*/
|
||||
public Integer getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
public int getScript() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the script attribute of the Preferences object
|
||||
*
|
||||
* @return The script value
|
||||
*/
|
||||
public Integer getScript()
|
||||
{
|
||||
return script;
|
||||
}
|
||||
public int getDialect() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the dialect attribute of the Preferences object
|
||||
*
|
||||
* @return The dialect value
|
||||
*/
|
||||
public Integer getDialect()
|
||||
{
|
||||
return dialect;
|
||||
}
|
||||
public int[] getProjectSubjectSet() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the projectSubjectSet attribute of the Preferences object
|
||||
*
|
||||
* @return The projectSubjectSet value
|
||||
*/
|
||||
public Integer[] getProjectSubjectSet()
|
||||
{
|
||||
return projectSubjectSet;
|
||||
}
|
||||
public int[] getSourceSet() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the sourceSet attribute of the Preferences object
|
||||
*
|
||||
* @return The sourceSet value
|
||||
*/
|
||||
public Integer[] getSourceSet()
|
||||
{
|
||||
return sourceSet;
|
||||
}
|
||||
public int[] getLanguageSet() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the languageSet attribute of the Preferences object
|
||||
*
|
||||
* @return The languageSet value
|
||||
*/
|
||||
public Integer[] getLanguageSet()
|
||||
{
|
||||
return languageSet;
|
||||
}
|
||||
public int[] getScriptSet() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the scriptSet attribute of the Preferences object
|
||||
*
|
||||
* @return The scriptSet value
|
||||
*/
|
||||
public Integer[] getScriptSet()
|
||||
{
|
||||
return scriptSet;
|
||||
}
|
||||
public int[] getDialectSet() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the dialectSet attribute of the Preferences object
|
||||
*
|
||||
* @return The dialectSet value
|
||||
*/
|
||||
public Integer[] getDialectSet()
|
||||
{
|
||||
return dialectSet;
|
||||
}
|
||||
public String getNote() {
|
||||
|
||||
|
||||
/**
|
||||
* Gets the note attribute of the Preferences object
|
||||
*
|
||||
* @return The note value
|
||||
*/
|
||||
public String getNote()
|
||||
{
|
||||
return note;
|
||||
}
|
||||
//helpers
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
* @exception LexComponentException Description of the Exception
|
||||
*/
|
||||
public void populate() throws LexRepositoryException, LexComponentException
|
||||
{
|
||||
String sql = "SELECT * FROM Preferences WHERE userId = " + getUserId();
|
||||
ResultSet results = LexRepository.getInstance().doQuery( sql );
|
||||
try {
|
||||
try
|
||||
{
|
||||
if ( LexUtilities.getResultSetSize( results ) > 0 )
|
||||
{
|
||||
results.next();
|
||||
setId( results.getInt( 1 ) );
|
||||
setUserId( results.getInt( 2 ) );
|
||||
setId( new Integer( results.getInt( 1 ) ) );
|
||||
setUserId( new Integer( 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 ) );
|
||||
setProjectSubject( new Integer( results.getInt( 4 ) ) );
|
||||
setSource( new Integer( results.getInt( 5 ) ) );
|
||||
setLanguage( new Integer( results.getInt( 6 ) ) );
|
||||
setScript( new Integer( results.getInt( 7 ) ) );
|
||||
setDialect( new Integer( results.getInt( 8 ) ) );
|
||||
setNote( results.getString( 9 ) );
|
||||
Boolean bool = Boolean.valueOf( results.getString( 10 ) );
|
||||
setUseDefaultProjSub( bool.booleanValue() );
|
||||
|
@ -180,128 +514,183 @@ public class Preferences
|
|||
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 ) ) );
|
||||
setProjectSubjectSet( LexUtilities.convertTokensToIntegerArray( results.getString( 16 ) ) );
|
||||
setSourceSet( LexUtilities.convertTokensToIntegerArray( results.getString( 17 ) ) );
|
||||
setLanguageSet( LexUtilities.convertTokensToIntegerArray( results.getString( 18 ) ) );
|
||||
setScriptSet( LexUtilities.convertTokensToIntegerArray( results.getString( 19 ) ) );
|
||||
setDialectSet( LexUtilities.convertTokensToIntegerArray( results.getString( 20 ) ) );
|
||||
}
|
||||
else {
|
||||
insertNew();
|
||||
else
|
||||
{
|
||||
insertNew();
|
||||
}
|
||||
} catch (SQLException sqle)
|
||||
{ throw new LexComponentException( sqle.getMessage() ); }
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
throw new LexComponentException( sqle.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @exception LexComponentException Description of the Exception
|
||||
*/
|
||||
public void insertNew() throws LexComponentException
|
||||
{
|
||||
try {
|
||||
String sql = "INSERT INTO Preferences ( id, userId ) VALUES ( NULL, " +getUserId() +" )";
|
||||
int i = LexRepository.getInstance().doUpdate( sql );
|
||||
try
|
||||
{
|
||||
String sql = "INSERT INTO Preferences ( id, userId ) VALUES ( NULL, " + getUserId() + " )";
|
||||
Integer i = new Integer( LexRepository.getInstance().doUpdate( sql ) );
|
||||
setId( i );
|
||||
}
|
||||
catch ( LexRepositoryException lre ) { throw new LexComponentException( lre.getMessage() ); }
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
throw new LexComponentException( lre.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @exception LexComponentException Description of the Exception
|
||||
*/
|
||||
public void save() throws LexComponentException
|
||||
{
|
||||
try {
|
||||
String sql = "SELECT id FROM Preferences WHERE userId = " + getUserId();
|
||||
ResultSet results = LexRepository.getInstance().doQuery( sql );
|
||||
if ( LexUtilities.getResultSetSize( results ) < 1 )
|
||||
try
|
||||
{
|
||||
insertNew();
|
||||
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.convertIntegerArrayToTokens( getProjectSubjectSet() ) );
|
||||
sqlBuffer.append( "', sourceSet = '" );
|
||||
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getSourceSet() ) );
|
||||
sqlBuffer.append( "', languageSet = '" );
|
||||
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getLanguageSet() ) );
|
||||
sqlBuffer.append( "', scriptSet = '" );
|
||||
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getScriptSet() ) );
|
||||
sqlBuffer.append( "', dialectSet = '" );
|
||||
sqlBuffer.append( LexUtilities.convertIntegerArrayToTokens( getDialectSet() ) );
|
||||
sqlBuffer.append( "' WHERE id = " );
|
||||
sqlBuffer.append( getId() );
|
||||
|
||||
LexRepository.getInstance().doUpdate( sqlBuffer.toString() );
|
||||
}
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
throw new LexComponentException( lre.getMessage() );
|
||||
}
|
||||
catch ( SQLException sqle )
|
||||
{
|
||||
throw new LexComponentException( sqle.getMessage() );
|
||||
}
|
||||
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() ); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The main program for the Preferences class
|
||||
*
|
||||
* @param args The command line arguments
|
||||
*/
|
||||
public static void main( String[] args )
|
||||
{
|
||||
try
|
||||
{
|
||||
Preferences component = new Preferences();
|
||||
component.setUserId( new Integer( 2 ) );
|
||||
component.save();
|
||||
System.out.println( component.getId() + " " + component.getUserId() );
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//constructors
|
||||
/**
|
||||
*Constructor for the Preferences object
|
||||
*
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
* @exception LexComponentException Description of the Exception
|
||||
*/
|
||||
public Preferences() throws LexRepositoryException, LexComponentException
|
||||
{
|
||||
setId( 0 );
|
||||
setUserId( 1 );
|
||||
setProjectSubject( 1 );
|
||||
setSource( 1 );
|
||||
setLanguage( 1 );
|
||||
setScript( 1 );
|
||||
setDialect( 1 );
|
||||
int[] temp = { getProjectSubject() };
|
||||
setId( new Integer( 0 ) );
|
||||
setUserId( new Integer( 1 ) );
|
||||
setProjectSubject( new Integer( 1 ) );
|
||||
setSource( new Integer( 1 ) );
|
||||
setLanguage( new Integer( 1 ) );
|
||||
setScript( new Integer( 1 ) );
|
||||
setDialect( new Integer( 1 ) );
|
||||
Integer[] temp = {getProjectSubject()};
|
||||
setProjectSubjectSet( temp );
|
||||
int[] temp2 = { getSource() };
|
||||
Integer[] temp2 = {getSource()};
|
||||
setSourceSet( temp2 );
|
||||
int[] temp3 = { getLanguage() };
|
||||
Integer[] temp3 = {getLanguage()};
|
||||
setLanguageSet( temp3 );
|
||||
int[] temp4 = { getDialect() };
|
||||
Integer[] temp4 = {getDialect()};
|
||||
setDialectSet( temp4 );
|
||||
int[] temp5 = { getScript() };
|
||||
Integer[] temp5 = {getScript()};
|
||||
setScriptSet( temp5 );
|
||||
setNote( "Default Note" );
|
||||
}
|
||||
public Preferences(ThdlUser user) throws LexRepositoryException, LexComponentException
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the Preferences object
|
||||
*
|
||||
* @param user Description of the Parameter
|
||||
* @exception LexRepositoryException Description of the Exception
|
||||
* @exception LexComponentException Description of the Exception
|
||||
*/
|
||||
public Preferences( ThdlUser user ) throws LexRepositoryException, LexComponentException
|
||||
{
|
||||
this();
|
||||
setUserId( user.getId() );
|
||||
populate();
|
||||
/* setProjectSubject( user.getDefaultProjSub() );
|
||||
setSource( user.getDefaultSource() );
|
||||
setLanguage( user.getDefaultLanguage() );
|
||||
setScript( user.getDefaultScript() );
|
||||
setDialect( user.getDefaultDialect() ); */
|
||||
}
|
||||
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(); }
|
||||
/*
|
||||
setProjectSubject( user.getDefaultProjSub() );
|
||||
setSource( user.getDefaultSource() );
|
||||
setLanguage( user.getDefaultLanguage() );
|
||||
setScript( user.getDefaultScript() );
|
||||
setDialect( user.getDefaultDialect() );
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,80 +1,133 @@
|
|||
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;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
import org.thdl.users.*;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 6, 2003
|
||||
*/
|
||||
public class GetUpdateFormCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
//helper methods
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param req Description of the Parameter
|
||||
* @param component Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
* @exception CommandException Description of the Exception
|
||||
*/
|
||||
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)
|
||||
LexQuery query = getSessionMgr().getQuery( req.getSession( true ) );
|
||||
Term term = null;
|
||||
try
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
term = (Term) query.getEntry();
|
||||
}
|
||||
*/
|
||||
catch ( ClassCastException cce )
|
||||
{
|
||||
throw new CommandException( term.toString(), cce );
|
||||
}
|
||||
String msg = null;
|
||||
try
|
||||
{
|
||||
component.populate( req.getParameterMap() );
|
||||
ILexComponent child = term.findChild( component );
|
||||
query.setUpdateComponent( child );
|
||||
req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, child );
|
||||
}
|
||||
catch ( LexComponentException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
|
||||
//if the component is a translation of another component get the original as well to assist in editing
|
||||
if ( component.getTranslationOf().intValue() > 0 )
|
||||
{
|
||||
try
|
||||
{
|
||||
LexComponent source = (LexComponent) component.getClass().newInstance();
|
||||
Integer sourcePk = component.getTranslationOf();
|
||||
source.setMetaId( sourcePk );
|
||||
LexComponentRepository.loadByPk( source );
|
||||
req.setAttribute( LexConstants.ORIGINALBEAN_REQ_ATTR, source );
|
||||
}
|
||||
catch ( InstantiationException ie )
|
||||
{
|
||||
throw new CommandException( ie );
|
||||
}
|
||||
catch ( IllegalAccessException iae )
|
||||
{
|
||||
throw new CommandException( iae );
|
||||
}
|
||||
catch ( LexRepositoryException lre )
|
||||
{
|
||||
throw new CommandException( lre );
|
||||
}
|
||||
}
|
||||
|
||||
Integer creator = component.getMeta().getCreatedBy();
|
||||
ThdlUser user = getSessionMgr().getSessionUser( req.getSession( true ) );
|
||||
if ( user.getId().equals( creator ) || user.hasRole( "admin" ) || user.hasRole( "dev" ) )
|
||||
{
|
||||
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 or an administrator.";
|
||||
setNext( "displayEntry.jsp" );
|
||||
}
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
|
||||
return getNext();
|
||||
}
|
||||
public HashMap initForwards()
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
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" );
|
||||
//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
|
||||
/**
|
||||
*Constructor for the GetUpdateFormCommand object
|
||||
*/
|
||||
public GetUpdateFormCommand()
|
||||
{
|
||||
super();
|
||||
//setForwards( initForwards() );
|
||||
//setForwards( initForwards() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the GetUpdateFormCommand object
|
||||
*
|
||||
* @param next Description of the Parameter
|
||||
*/
|
||||
public GetUpdateFormCommand( String next )
|
||||
{
|
||||
super();
|
||||
|
|
|
@ -1,69 +1,126 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.thdl.lex.*;
|
||||
import org.thdl.lex.component.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 6, 2003
|
||||
*/
|
||||
public class PreferencesCommand extends LexCommand implements Command
|
||||
{
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param req Description of the Parameter
|
||||
* @param component Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
* @exception CommandException Description of the Exception
|
||||
*/
|
||||
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") )
|
||||
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" ) ) );
|
||||
isb.setLanguageSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "languages" ) ) );
|
||||
isb.setDialectSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "dialects" ) ) );
|
||||
isb.setSourceSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "sources" ) ) );
|
||||
isb.setProjectSubjectSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "projectSubjects" ) ) );
|
||||
isb.setScriptSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "scripts" ) ) );
|
||||
}
|
||||
else if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals("setMetaDefaults") )
|
||||
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.setLanguage( new Integer( req.getParameter( "language" ) ) );
|
||||
isb.setDialect( new Integer( req.getParameter( "dialect" ) ) );
|
||||
isb.setSource( new Integer( req.getParameter( "source" ) ) );
|
||||
isb.setProjectSubject( new Integer( req.getParameter( "projectSubject" ) ) );
|
||||
isb.setScript( new Integer( 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.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.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.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.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.setUseDefaultScript( false );
|
||||
}
|
||||
if ( null != req.getParameter( "useDefaultNote" ) && req.getParameter( "useDefaultNote" ).equals( "true" ) )
|
||||
{
|
||||
isb.setUseDefaultNote( true );
|
||||
}
|
||||
else
|
||||
isb.setUseDefaultNote( false );
|
||||
{
|
||||
isb.setUseDefaultNote( false );
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
isb.save();
|
||||
}
|
||||
catch( LexComponentException lre )
|
||||
catch ( LexComponentException lre )
|
||||
{
|
||||
throw new CommandException( "LexComponentException says: " + lre.getMessage() );
|
||||
}
|
||||
return getNext();
|
||||
}
|
||||
public java.util.HashMap initForwards() { return null;}
|
||||
public PreferencesCommand(String next)
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public java.util.HashMap initForwards()
|
||||
{
|
||||
super(next);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the PreferencesCommand object
|
||||
*
|
||||
* @param next Description of the Parameter
|
||||
*/
|
||||
public PreferencesCommand( String next )
|
||||
{
|
||||
super( next );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,56 +1,100 @@
|
|||
package org.thdl.lex.commands;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
* @author travis
|
||||
* @created October 6, 2003
|
||||
*/
|
||||
public class UpdateCommand extends LexCommand implements Command
|
||||
{
|
||||
//helper methods
|
||||
public String execute(HttpServletRequest req, ILexComponent component) throws CommandException
|
||||
//helper methods
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param req Description of the Parameter
|
||||
* @param component Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
* @exception CommandException Description of the Exception
|
||||
*/
|
||||
public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException
|
||||
{
|
||||
/* try
|
||||
{
|
||||
String msg = null;
|
||||
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();
|
||||
ThdlUser user = getSessionMgr().getSessionUser( req.getSession( true ) );
|
||||
msg = "Successful Update";
|
||||
|
||||
/*
|
||||
component.setMetaId( new Integer( req.getParameter( "metaId" ) ) );
|
||||
LexComponentRepository.loadByPk( component );
|
||||
component.populate( req.getParameterMap() );
|
||||
Date now = new Date( System.currentTimeMillis() );
|
||||
component.getMeta().setModifiedOn( now );
|
||||
component.getMeta().setModifiedBy( user.getId() );
|
||||
LexComponentRepository.update( component );
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
|
||||
req.setAttribute( "jumpToLocation", component.getLabel() );
|
||||
*/
|
||||
ITerm term = getSessionMgr().getQuery( req.getSession( true ) ).getEntry();
|
||||
LexComponentRepository.update( term );
|
||||
|
||||
/*
|
||||
term = new Term();
|
||||
term.setMetaId( new Integer( 1 ) );
|
||||
try
|
||||
{
|
||||
LexComponentRepository.loadTermByPk( term );
|
||||
}
|
||||
catch ( LexRepositoryException e )
|
||||
{
|
||||
throw new CommandException( "Command had trouble processing " + term, e );
|
||||
}
|
||||
*/
|
||||
getSessionMgr().setDisplayMode( req.getSession( true ), "edit" );
|
||||
}
|
||||
else
|
||||
{
|
||||
String msg="Invalid Reload Attempted";
|
||||
req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg);
|
||||
msg = "Invalid Reload Attempted";
|
||||
}
|
||||
*/ return getNext();
|
||||
/* }
|
||||
catch (LexComponentException e)
|
||||
{
|
||||
throw new CommandException("Lex Action Exception: " + e.getMessage());
|
||||
return getNext();
|
||||
}
|
||||
catch (LexEntryException e)
|
||||
/*
|
||||
catch ( LexComponentException e )
|
||||
{
|
||||
throw new CommandException( e );
|
||||
}
|
||||
*/
|
||||
catch ( LexRepositoryException e )
|
||||
{
|
||||
throw new CommandException("Lex Entry Exception: " + e.getMessage());
|
||||
throw new CommandException( "Command had trouble processing " + component, e );
|
||||
}
|
||||
*/ }
|
||||
public HashMap initForwards()
|
||||
finally
|
||||
{
|
||||
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public HashMap initForwards()
|
||||
{
|
||||
HashMap map = new HashMap();
|
||||
map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" );
|
||||
|
@ -62,11 +106,21 @@ public class UpdateCommand extends LexCommand implements Command
|
|||
}
|
||||
|
||||
//constructors
|
||||
/**
|
||||
*Constructor for the UpdateCommand object
|
||||
*/
|
||||
public UpdateCommand()
|
||||
{
|
||||
super();
|
||||
//setForwards( initForwards() );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the UpdateCommand object
|
||||
*
|
||||
* @param next Description of the Parameter
|
||||
*/
|
||||
public UpdateCommand( String next )
|
||||
{
|
||||
this();
|
||||
|
|
|
@ -7,114 +7,262 @@ 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;
|
||||
/**
|
||||
* @author Hibernate CodeGenerator
|
||||
* @created October 7, 2003
|
||||
*/
|
||||
public abstract class BaseLexComponent implements org.thdl.lex.component.ILexComponent, Serializable
|
||||
{
|
||||
|
||||
/** nullable persistent field */
|
||||
private java.lang.Integer translationOf;
|
||||
/**
|
||||
* identifier field
|
||||
*/
|
||||
private java.lang.Integer metaId;
|
||||
|
||||
/** persistent field */
|
||||
private java.lang.Boolean deleted;
|
||||
/**
|
||||
* nullable persistent field
|
||||
*/
|
||||
private java.lang.Integer translationOf;
|
||||
|
||||
/** persistent field */
|
||||
private List analyticalNotes;
|
||||
/**
|
||||
* persistent field
|
||||
*/
|
||||
private java.lang.Boolean deleted;
|
||||
|
||||
/** persistent field */
|
||||
private Set translations;
|
||||
/**
|
||||
* persistent field
|
||||
*/
|
||||
private List analyticalNotes;
|
||||
|
||||
/** persistent field */
|
||||
private org.thdl.lex.component.Meta meta;
|
||||
/**
|
||||
* persistent field
|
||||
*/
|
||||
private Set translations;
|
||||
|
||||
/** 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;
|
||||
}
|
||||
/**
|
||||
* persistent field
|
||||
*/
|
||||
private org.thdl.lex.component.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;
|
||||
}
|
||||
/**
|
||||
* Sets the metaId attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param metaId The new metaId value
|
||||
*/
|
||||
public void setMetaId( java.lang.Integer metaId )
|
||||
{
|
||||
this.metaId = metaId;
|
||||
}
|
||||
|
||||
public java.lang.Integer getMetaId() {
|
||||
return this.metaId;
|
||||
}
|
||||
|
||||
public void setMetaId(java.lang.Integer metaId) {
|
||||
this.metaId = metaId;
|
||||
}
|
||||
/**
|
||||
* Sets the translationOf attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param translationOf The new translationOf value
|
||||
*/
|
||||
public void setTranslationOf( java.lang.Integer translationOf )
|
||||
{
|
||||
this.translationOf = translationOf;
|
||||
}
|
||||
|
||||
public java.lang.Integer getTranslationOf() {
|
||||
return this.translationOf;
|
||||
}
|
||||
|
||||
public void setTranslationOf(java.lang.Integer translationOf) {
|
||||
this.translationOf = translationOf;
|
||||
}
|
||||
/**
|
||||
* Sets the deleted attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param deleted The new deleted value
|
||||
*/
|
||||
public void setDeleted( java.lang.Boolean deleted )
|
||||
{
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public java.lang.Boolean getDeleted() {
|
||||
return this.deleted;
|
||||
}
|
||||
|
||||
public void setDeleted(java.lang.Boolean deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
/**
|
||||
* Sets the analyticalNotes attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param analyticalNotes The new analyticalNotes value
|
||||
*/
|
||||
public void setAnalyticalNotes( java.util.List analyticalNotes )
|
||||
{
|
||||
this.analyticalNotes = analyticalNotes;
|
||||
}
|
||||
|
||||
public java.util.List getAnalyticalNotes() {
|
||||
return this.analyticalNotes;
|
||||
}
|
||||
|
||||
public void setAnalyticalNotes(java.util.List analyticalNotes) {
|
||||
this.analyticalNotes = analyticalNotes;
|
||||
}
|
||||
/**
|
||||
* Sets the translations attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param translations The new translations value
|
||||
*/
|
||||
public void setTranslations( java.util.Set translations )
|
||||
{
|
||||
this.translations = translations;
|
||||
}
|
||||
|
||||
public java.util.Set getTranslations() {
|
||||
return this.translations;
|
||||
}
|
||||
|
||||
public void setTranslations(java.util.Set translations) {
|
||||
this.translations = translations;
|
||||
}
|
||||
/**
|
||||
* Sets the meta attribute of the BaseLexComponent object
|
||||
*
|
||||
* @param meta The new meta value
|
||||
*/
|
||||
public void setMeta( org.thdl.lex.component.Meta meta )
|
||||
{
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public org.thdl.lex.component.Meta getMeta() {
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
public void setMeta(org.thdl.lex.component.Meta meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
/**
|
||||
* Gets the metaId attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The metaId value
|
||||
*/
|
||||
public java.lang.Integer getMetaId()
|
||||
{
|
||||
return this.metaId;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
/**
|
||||
* Gets the translationOf attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The translationOf value
|
||||
*/
|
||||
public java.lang.Integer getTranslationOf()
|
||||
{
|
||||
return this.translationOf;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(getMetaId())
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deleted attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The deleted value
|
||||
*/
|
||||
public java.lang.Boolean getDeleted()
|
||||
{
|
||||
return this.deleted;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the analyticalNotes attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The analyticalNotes value
|
||||
*/
|
||||
public java.util.List getAnalyticalNotes()
|
||||
{
|
||||
return this.analyticalNotes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the translations attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The translations value
|
||||
*/
|
||||
public java.util.Set getTranslations()
|
||||
{
|
||||
return this.translations;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the meta attribute of the BaseLexComponent object
|
||||
*
|
||||
* @return The meta value
|
||||
*/
|
||||
public org.thdl.lex.component.Meta getMeta()
|
||||
{
|
||||
return this.meta;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder( this )
|
||||
.append( "metaId", getMetaId() )
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @param other Description of the Parameter
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public boolean equals( Object other )
|
||||
{
|
||||
if ( !( other instanceof BaseLexComponent ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
BaseLexComponent castOther = (BaseLexComponent) other;
|
||||
return new EqualsBuilder()
|
||||
.append( this.getMetaId(), castOther.getMetaId() )
|
||||
.isEquals();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public int hashCode()
|
||||
{
|
||||
return new HashCodeBuilder()
|
||||
.append( getMetaId() )
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* full constructor
|
||||
*
|
||||
* @param translationOf Description of the Parameter
|
||||
* @param deleted Description of the Parameter
|
||||
* @param analyticalNotes Description of the Parameter
|
||||
* @param translations Description of the Parameter
|
||||
* @param meta Description of the Parameter
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @param deleted Description of the Parameter
|
||||
* @param analyticalNotes Description of the Parameter
|
||||
* @param translations Description of the Parameter
|
||||
* @param meta Description of the Parameter
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,35 +4,74 @@ package org.thdl.lex.component;
|
|||
/**
|
||||
* Description of the Interface
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
* @author travis
|
||||
* @created October 1, 2003
|
||||
*/
|
||||
public interface ILexComponent
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets the parent attribute of the ILexComponent object
|
||||
*
|
||||
* @param comp The new parent value
|
||||
*/
|
||||
public void setParent( ILexComponent comp );
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parentId attribute of the LexComponent object
|
||||
*
|
||||
* @param parentId The new parentId value
|
||||
*/
|
||||
public void setParentId( java.lang.Integer parentId );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parent attribute of the LexComponent object
|
||||
*
|
||||
* @return The parent value
|
||||
*/
|
||||
public ILexComponent getParent();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parentId attribute of the LexComponent object
|
||||
*
|
||||
* @return The parentId value
|
||||
*/
|
||||
public java.lang.Integer getParentId();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the precedence attribute of the ILexComponent object
|
||||
*
|
||||
* @return The precedence value
|
||||
*/
|
||||
public java.lang.Short getPrecedence();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the precedence attribute of the LexComponent object
|
||||
*
|
||||
* @param precedence The new precedence value
|
||||
*/
|
||||
public void setPrecedence( java.lang.Short precedence );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the label attribute of the ILexComponent object
|
||||
*
|
||||
*@return The label value
|
||||
*@since
|
||||
* @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
|
||||
* @return The metaId value
|
||||
* @since
|
||||
*/
|
||||
public java.lang.Integer getMetaId();
|
||||
|
||||
|
@ -40,8 +79,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the metaId attribute of the ILexComponent object
|
||||
*
|
||||
*@param metaId The new metaId value
|
||||
*@since
|
||||
* @param metaId The new metaId value
|
||||
* @since
|
||||
*/
|
||||
public void setMetaId( java.lang.Integer metaId );
|
||||
|
||||
|
@ -49,8 +88,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Gets the translationOf attribute of the ILexComponent object
|
||||
*
|
||||
*@return The translationOf value
|
||||
*@since
|
||||
* @return The translationOf value
|
||||
* @since
|
||||
*/
|
||||
public java.lang.Integer getTranslationOf();
|
||||
|
||||
|
@ -58,8 +97,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the translationOf attribute of the ILexComponent object
|
||||
*
|
||||
*@param translationOf The new translationOf value
|
||||
*@since
|
||||
* @param translationOf The new translationOf value
|
||||
* @since
|
||||
*/
|
||||
public void setTranslationOf( java.lang.Integer translationOf );
|
||||
|
||||
|
@ -67,8 +106,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Gets the translations attribute of the ILexComponent object
|
||||
*
|
||||
*@return The translations value
|
||||
*@since
|
||||
* @return The translations value
|
||||
* @since
|
||||
*/
|
||||
public java.util.Set getTranslations();
|
||||
|
||||
|
@ -76,8 +115,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the translations attribute of the ILexComponent object
|
||||
*
|
||||
*@param translations The new translations value
|
||||
*@since
|
||||
* @param translations The new translations value
|
||||
* @since
|
||||
*/
|
||||
public void setTranslations( java.util.Set translations );
|
||||
|
||||
|
@ -85,8 +124,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Gets the deleted attribute of the ILexComponent object
|
||||
*
|
||||
*@return The deleted value
|
||||
*@since
|
||||
* @return The deleted value
|
||||
* @since
|
||||
*/
|
||||
public java.lang.Boolean getDeleted();
|
||||
|
||||
|
@ -94,8 +133,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the deleted attribute of the ILexComponent object
|
||||
*
|
||||
*@param deleted The new deleted value
|
||||
*@since
|
||||
* @param deleted The new deleted value
|
||||
* @since
|
||||
*/
|
||||
public void setDeleted( java.lang.Boolean deleted );
|
||||
|
||||
|
@ -103,8 +142,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Gets the analyticalNotes attribute of the ILexComponent object
|
||||
*
|
||||
*@return The analyticalNotes value
|
||||
*@since
|
||||
* @return The analyticalNotes value
|
||||
* @since
|
||||
*/
|
||||
public java.util.List getAnalyticalNotes();
|
||||
|
||||
|
@ -112,8 +151,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the analyticalNotes attribute of the ILexComponent object
|
||||
*
|
||||
*@param analyticalNotes The new analyticalNotes value
|
||||
*@since
|
||||
* @param analyticalNotes The new analyticalNotes value
|
||||
* @since
|
||||
*/
|
||||
public void setAnalyticalNotes( java.util.List analyticalNotes );
|
||||
|
||||
|
@ -121,8 +160,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Gets the meta attribute of the ILexComponent object
|
||||
*
|
||||
*@return The meta value
|
||||
*@since
|
||||
* @return The meta value
|
||||
* @since
|
||||
*/
|
||||
public org.thdl.lex.component.Meta getMeta();
|
||||
|
||||
|
@ -130,8 +169,8 @@ public interface ILexComponent
|
|||
/**
|
||||
* Sets the meta attribute of the ILexComponent object
|
||||
*
|
||||
*@param meta The new meta value
|
||||
*@since
|
||||
* @param meta The new meta value
|
||||
* @since
|
||||
*/
|
||||
public void setMeta( org.thdl.lex.component.Meta meta );
|
||||
|
||||
|
@ -139,9 +178,9 @@ public interface ILexComponent
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param properties Description of Parameter
|
||||
*@exception LexComponentException Description of Exception
|
||||
*@since
|
||||
* @param properties Description of Parameter
|
||||
* @exception LexComponentException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public void populate( java.util.Map properties ) throws LexComponentException;
|
||||
}
|
||||
|
|
|
@ -1,53 +1,85 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 1, 2003
|
||||
* @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;
|
||||
/**
|
||||
* Gets the precedence attribute of the LexComponent object
|
||||
*
|
||||
* @return The precedence value
|
||||
*/
|
||||
public abstract java.lang.Short getPrecedence();
|
||||
|
||||
|
||||
/**
|
||||
* Sets the label attribute of the LexComponent object
|
||||
* Sets the precedence attribute of the LexComponent object
|
||||
*
|
||||
*@param label The new label value
|
||||
*@since
|
||||
* @param precedence The new precedence value
|
||||
*/
|
||||
public void setLabel( String label )
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
public abstract void setPrecedence( java.lang.Short precedence );
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parent attribute of the LexComponent object
|
||||
*
|
||||
* @param comp The new parent value
|
||||
*/
|
||||
public abstract void setParent( ILexComponent comp );
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parentId attribute of the LexComponent object
|
||||
*
|
||||
* @param parentId The new parentId value
|
||||
*/
|
||||
public abstract void setParentId( java.lang.Integer parentId );
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parent attribute of the LexComponent object
|
||||
*
|
||||
* @return The parent value
|
||||
*/
|
||||
public abstract ILexComponent getParent();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parentId attribute of the LexComponent object
|
||||
*
|
||||
* @return The parentId value
|
||||
*/
|
||||
public abstract java.lang.Integer getParentId();
|
||||
|
||||
|
||||
/**
|
||||
* Gets the label attribute of the LexComponent object
|
||||
*
|
||||
*@return The label value
|
||||
*@since
|
||||
* @return The label value
|
||||
* @since
|
||||
*/
|
||||
public String getLabel()
|
||||
{
|
||||
if ( null == label )
|
||||
String label = null;
|
||||
StringTokenizer tokens = new StringTokenizer( this.getClass().getName(), "." );
|
||||
while ( tokens.hasMoreTokens() )
|
||||
{
|
||||
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 );
|
||||
label = tokens.nextToken();
|
||||
}
|
||||
return label;
|
||||
String first = label.substring( 0, 1 ).toLowerCase();
|
||||
String rest = label.substring( 1, label.length() );
|
||||
return first + rest;
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,9 +87,9 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
|
|||
/**
|
||||
* Description of the Method
|
||||
*
|
||||
*@param properties Description of Parameter
|
||||
*@exception LexComponentException Description of Exception
|
||||
*@since
|
||||
* @param properties Description of Parameter
|
||||
* @exception LexComponentException Description of Exception
|
||||
* @since
|
||||
*/
|
||||
public void populate( Map properties ) throws LexComponentException
|
||||
{
|
||||
|
@ -81,12 +113,12 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
|
|||
/**
|
||||
* 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
|
||||
* @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 )
|
||||
{
|
||||
|
@ -97,11 +129,11 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
|
|||
/**
|
||||
* 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
|
||||
* @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 )
|
||||
{
|
||||
|
@ -112,7 +144,7 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
|
|||
/**
|
||||
* Constructor for the LexComponent object
|
||||
*
|
||||
*@since
|
||||
* @since
|
||||
*/
|
||||
public LexComponent()
|
||||
{
|
||||
|
|
|
@ -1,15 +1,273 @@
|
|||
package org.thdl.lex.component;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import org.thdl.lex.LexConstants;
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Class
|
||||
*
|
||||
*@author travis
|
||||
*@created October 3, 2003
|
||||
* @author travis
|
||||
* @created October 3, 2003
|
||||
*/
|
||||
public class Term extends BaseTerm implements Serializable
|
||||
{
|
||||
private HashMap childMap;
|
||||
//helper methods
|
||||
|
||||
/**
|
||||
* Gets the parentId attribute of the Term object
|
||||
*
|
||||
* @return The parentId value
|
||||
*/
|
||||
public java.lang.Integer getParentId()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parentId attribute of the Term object
|
||||
*
|
||||
* @param parentId The new parentId value
|
||||
*/
|
||||
public void setParentId( java.lang.Integer parentId )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the parent attribute of the Term object
|
||||
*
|
||||
* @return The parent value
|
||||
*/
|
||||
public org.thdl.lex.component.ILexComponent getParent()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the parent attribute of the Term object
|
||||
*
|
||||
* @param parent The new parent value
|
||||
*/
|
||||
public void setParent( org.thdl.lex.component.ILexComponent parent )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the childMap attribute of the Term object
|
||||
*
|
||||
* @param childMap The new childMap value
|
||||
*/
|
||||
public void setChildMap( HashMap childMap )
|
||||
{
|
||||
this.childMap = childMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the childMap attribute of the Term object
|
||||
*
|
||||
* @return The childMap value
|
||||
*/
|
||||
public HashMap getChildMap()
|
||||
{
|
||||
return childMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the childList attribute of the Term object
|
||||
*
|
||||
* @param component Description of the Parameter
|
||||
* @return The childList value
|
||||
*/
|
||||
/*
|
||||
public List getChildList( String label )
|
||||
{
|
||||
List list = null;
|
||||
Iterator it = getChildMap().keySet().iterator();
|
||||
while ( it.hasNext() )
|
||||
{
|
||||
String key = (String) it.next();
|
||||
if ( key.equals( label ) )
|
||||
{
|
||||
list = (List) getChildMap().get( key );
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Gets the persistentChild attribute of the Term object
|
||||
*
|
||||
* @param component Description of the Parameter
|
||||
* @return The persistentChild value
|
||||
*/
|
||||
public ILexComponent findChild( ILexComponent component )
|
||||
{
|
||||
ILexComponent persistentChild = null;
|
||||
if ( component.getParent() instanceof Term )
|
||||
{
|
||||
//String label =
|
||||
//List list = getChildList( label );
|
||||
List list = (List) getChildMap().get( component.getLabel() );
|
||||
for ( Iterator it = list.iterator(); it.hasNext(); )
|
||||
{
|
||||
ILexComponent termChild = (ILexComponent) it.next();
|
||||
if ( termChild.getMetaId().equals( component.getMetaId() ) )
|
||||
{
|
||||
persistentChild = termChild;
|
||||
}
|
||||
}
|
||||
}
|
||||
return persistentChild;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a feature to the Child attribute of the Term object
|
||||
*
|
||||
* @param component The feature to be added to the Child attribute
|
||||
* @return Description of the Return Value
|
||||
*/
|
||||
public ILexComponent addChild( ILexComponent component )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The main program for the Term class
|
||||
*
|
||||
* @param args The command line arguments
|
||||
*/
|
||||
public static void main( String[] args )
|
||||
{
|
||||
String[] labels = new String[16];
|
||||
|
||||
labels[0] = new Etymology().getLabel();
|
||||
labels[1] = new GrammaticalFunction().getLabel();
|
||||
labels[2] = new Pronunciation().getLabel();
|
||||
labels[3] = new Definition().getLabel();
|
||||
labels[4] = new EncyclopediaArticle().getLabel();
|
||||
labels[5] = new Spelling().getLabel();
|
||||
labels[6] = new AnalyticalNote().getLabel();
|
||||
labels[7] = new TransitionalData().getLabel();
|
||||
labels[8] = new Subdefinition().getLabel();
|
||||
labels[9] = new Gloss().getLabel();
|
||||
labels[10] = new Keyword().getLabel();
|
||||
labels[11] = new ModelSentence().getLabel();
|
||||
labels[12] = new Passage().getLabel();
|
||||
labels[13] = new SpeechRegister().getLabel();
|
||||
labels[14] = new RelatedTerm().getLabel();
|
||||
labels[15] = new TranslationEquivalent().getLabel();
|
||||
for ( int i = 0; i < labels.length; i++ )
|
||||
{
|
||||
System.out.println( labels[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description of the Method
|
||||
*/
|
||||
private void initChild()
|
||||
{
|
||||
setChildMap( new HashMap() );
|
||||
getChildMap().put( LexConstants.PRONUNCIATIONLABEL_VALUE, getPronunciations() );
|
||||
getChildMap().put( LexConstants.SPELLINGLABEL_VALUE, getSpellings() );
|
||||
getChildMap().put( LexConstants.ETYMOLOGYLABEL_VALUE, getEtymologies() );
|
||||
getChildMap().put( LexConstants.FUNCTIONLABEL_VALUE, getFunctions() );
|
||||
getChildMap().put( LexConstants.ENCYCLOPEDIA_ARTICLE_LABEL_VALUE, getEncyclopediaArticles() );
|
||||
getChildMap().put( LexConstants.DEFINITIONLABEL_VALUE, getDefinitions() );
|
||||
// getChildMap().put( LexConstants.SUBDEFINITIONLABEL_VALUE, getSubdefinitions() );
|
||||
getChildMap().put( LexConstants.MODELSENTENCELABEL_VALUE, getModelSentences() );
|
||||
getChildMap().put( LexConstants.PASSAGELABEL_VALUE, getPassages() );
|
||||
getChildMap().put( LexConstants.TRANSLATIONLABEL_VALUE, getTranslations() );
|
||||
getChildMap().put( LexConstants.RELATEDTERMLABEL_VALUE, getRelatedTerms() );
|
||||
getChildMap().put( LexConstants.REGISTERLABEL_VALUE, getRegisters() );
|
||||
getChildMap().put( LexConstants.KEYWORDLABEL_VALUE, getKeywords() );
|
||||
getChildMap().put( LexConstants.ANALYTICALNOTELABEL_VALUE, getAnalyticalNotes() );
|
||||
getChildMap().put( LexConstants.TRANSLATIONLABEL_VALUE, getTranslations() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the Term object
|
||||
*/
|
||||
public Term()
|
||||
{
|
||||
initChild();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the Term object
|
||||
*
|
||||
* @param translationOf Description of the Parameter
|
||||
* @param deleted Description of the Parameter
|
||||
* @param analyticalNotes Description of the Parameter
|
||||
* @param translations Description of the Parameter
|
||||
* @param meta Description of the Parameter
|
||||
* @param term Description of the Parameter
|
||||
* @param precedence Description of the Parameter
|
||||
* @param pronunciations Description of the Parameter
|
||||
* @param etymologies Description of the Parameter
|
||||
* @param spellings Description of the Parameter
|
||||
* @param functions Description of the Parameter
|
||||
* @param encyclopediaArticles Description of the Parameter
|
||||
* @param transitionalData Description of the Parameter
|
||||
* @param definitions Description of the Parameter
|
||||
* @param glosses Description of the Parameter
|
||||
* @param keywords Description of the Parameter
|
||||
* @param modelSentences Description of the Parameter
|
||||
* @param translationEquivalents Description of the Parameter
|
||||
* @param relatedTerms Description of the Parameter
|
||||
* @param passages Description of the Parameter
|
||||
* @param registers Description of the Parameter
|
||||
*/
|
||||
public Term( 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, term, precedence, pronunciations, etymologies, spellings, functions, encyclopediaArticles, transitionalData, definitions, glosses, keywords, modelSentences, translationEquivalents, relatedTerms, passages, registers );
|
||||
initChild();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Constructor for the Term object
|
||||
*
|
||||
* @param deleted Description of the Parameter
|
||||
* @param analyticalNotes Description of the Parameter
|
||||
* @param translations Description of the Parameter
|
||||
* @param meta Description of the Parameter
|
||||
* @param term Description of the Parameter
|
||||
* @param pronunciations Description of the Parameter
|
||||
* @param etymologies Description of the Parameter
|
||||
* @param spellings Description of the Parameter
|
||||
* @param functions Description of the Parameter
|
||||
* @param encyclopediaArticles Description of the Parameter
|
||||
* @param transitionalData Description of the Parameter
|
||||
* @param definitions Description of the Parameter
|
||||
* @param glosses Description of the Parameter
|
||||
* @param keywords Description of the Parameter
|
||||
* @param modelSentences Description of the Parameter
|
||||
* @param translationEquivalents Description of the Parameter
|
||||
* @param relatedTerms Description of the Parameter
|
||||
* @param passages Description of the Parameter
|
||||
* @param registers Description of the Parameter
|
||||
*/
|
||||
public Term( 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, term, pronunciations, etymologies, spellings, functions, encyclopediaArticles, transitionalData, definitions, glosses, keywords, modelSentences, translationEquivalents, relatedTerms, passages, registers );
|
||||
initChild();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,18 +66,6 @@ if (ie)
|
|||
Scripts for displayTree.jsf
|
||||
=============================
|
||||
*/
|
||||
function submitForm( cmd, component, id, parentId, componentHex, parentHex )
|
||||
{
|
||||
document.forms[2].cmd.value = cmd;
|
||||
document.forms[2].componentLabel.value = component;
|
||||
document.forms[2].id.value = id;
|
||||
document.forms[2].parentId.value = parentId;
|
||||
assert( componentHex != null , "no componentHex");
|
||||
document.forms[2].componentHex.value = componentHex;
|
||||
assert( parentHex != null , "no parentHex") ;
|
||||
document.forms[2].parentHex.value = parentHex;
|
||||
document.forms[2].submit();
|
||||
}
|
||||
|
||||
function smile()
|
||||
{}
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="analyticalNote" value="" />
|
||||
<c:set var="parentMeta" value="${ component.parentMeta }" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="analyticalNote" value="${ component.analyticalNote }" />
|
||||
<c:set var="parentMeta" value="${ component.parentMeta }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="updateMode" value="${ false }" />
|
||||
|
@ -30,7 +30,7 @@
|
|||
<input type="hidden" name="comp" value="analyticalNote" />
|
||||
<c:out value=' <input type="hidden" name="parentMeta" value="${ parentMeta }" /> ' escapeXml="false" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value=' <input type="hidden" name="id" value="${id}" /> ' escapeXml="false" />
|
||||
<c:out value=' <input type="hidden" name="metaId" value="${metaId}" /> ' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value=' <input type="hidden" name="cmd" value="${newCmd}" /> ' escapeXml='false' />
|
||||
<c:out value=' <input type="hidden" name="parentId" value="${ param.parentId }" /> ' escapeXml='false' />
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
<a href = "http://jigsaw.w3.org/css-validator/validator?uri=http://mayor.lib.virginia.edu:8080/lex/lex.css">
|
||||
Validate CSS</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2>USER INFO</h2>
|
||||
User Roles: <c:out value="${ sessionScope.user.roles }"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="definition" value="" />
|
||||
<c:set var="precedence" value="1" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="definition" value="${ component.definition }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="precedence" value="${ component.precedence }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<c:set var="translateMode" value="${ true }" />
|
||||
<c:set var="originalDefinition"
|
||||
value="Original Definition: ${ original.definition } <br /> Translation " />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
</c:if>
|
||||
<form id="newCompForm" action="/lex/action" method="post">
|
||||
<p>
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="definition" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -58,7 +58,7 @@ Back to:
|
|||
<jsp:include page="spellingForm.jsf" />
|
||||
</c:when>
|
||||
|
||||
<c:when test="${ param.comp == 'function'}">
|
||||
<c:when test="${ param.comp == 'grammaticalFunction'}">
|
||||
<jsp:include page="functionForm.jsf" />
|
||||
</c:when>
|
||||
|
||||
|
@ -94,7 +94,7 @@ Back to:
|
|||
<jsp:include page="passageForm.jsf" />
|
||||
</c:when>
|
||||
|
||||
<c:when test="${ param.comp == 'register' }">
|
||||
<c:when test="${ param.comp == 'speechRegister' }">
|
||||
<jsp:include page="registerForm.jsf" />
|
||||
</c:when>
|
||||
|
||||
|
|
|
@ -25,11 +25,27 @@
|
|||
|
||||
<c:if test="${ editMode }">
|
||||
<div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function submitForm( cmd, component, metaId, parentId, componentHex, parentHex )
|
||||
{
|
||||
document.forms[2].cmd.value = cmd;
|
||||
document.forms[2].comp.value = component;
|
||||
document.forms[2].metaId.value = metaId;
|
||||
document.forms[2].parentId.value = parentId;
|
||||
assert( componentHex != null , "no componentHex");
|
||||
document.forms[2].componentHex.value = componentHex;
|
||||
assert( parentHex != null , "no parentHex") ;
|
||||
document.forms[2].parentHex.value = parentHex;
|
||||
document.forms[2].submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<form action="/lex/action" method="get" id="lexActions">
|
||||
<p>
|
||||
<input type="hidden" name="cmd" value="" />
|
||||
<input type="hidden" name="comp" value="" />
|
||||
<input type="hidden" name="id" value="" />
|
||||
<input type="hidden" name="metaId" value="" />
|
||||
<input type="hidden" name="parentId" value="" />
|
||||
<input type="hidden" name="componentHex" value="" />
|
||||
<input type="hidden" name="parentHex" value="" />
|
||||
|
@ -51,7 +67,7 @@
|
|||
<c:out value='<input value="note" type="image" src="/lex/images/etym.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
<c:set var="jsParams" value="'getInsertForm', 'spelling', '${ query.entry.metaId }', '${query.entry.metaId}' , '' , '${query.entry}' " />
|
||||
<c:out value='<input value="note" type="image" src="/lex/images/spell.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
<c:set var="jsParams" value="'getInsertForm', 'function', '${ query.entry.metaId }', '${query.entry.metaId}' , '' , '${query.entry}' " />
|
||||
<c:set var="jsParams" value="'getInsertForm', 'grammaticalFunction', '${ query.entry.metaId }', '${query.entry.metaId}' , '' , '${query.entry}' " />
|
||||
<c:out value='<input value="note" type="image" src="/lex/images/gram.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
<c:set var="jsParams" value="'getInsertForm', 'encyclopediaArticle', '${ query.entry.metaId }', '${query.entry.metaId}' , '' , '${query.entry}' " />
|
||||
<c:out value='<input value="note" type="image" src="/lex/images/ency.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
|
@ -79,13 +95,13 @@
|
|||
|
||||
<div id="termChildren">
|
||||
|
||||
|
||||
<c:out value='${ query.entry.transitionalData }'/>
|
||||
|
||||
<!--TRANSITIONAL DATA-->
|
||||
<c:forEach var="transitionalData" items="${ query.entry.transitionalData }">
|
||||
<p class="data">
|
||||
<c:out value='<a name="${ transitionalData.label }" ></a>' escapeXml="false" />
|
||||
<c:out value='${ transitionalData }' escapeXml="false" /><br/>
|
||||
<c:out value='${ transitionalData.parent }' escapeXml="false" /><br/>
|
||||
<c:out value='${ query.entry }' escapeXml="false" /><br/>
|
||||
<c:if test="${ editMode }">
|
||||
<span class="compEditOptions">
|
||||
<c:set var="jsParams" value="'annotate', 'transitionalData', '${ transitionalData.metaId }', '${ query.entry.metaId }', '${ transitionalData }' , '${ query.entry }'" />
|
||||
|
@ -229,9 +245,9 @@
|
|||
<p class="data">
|
||||
<c:if test="${ editMode }">
|
||||
<span class="compEditOptions">
|
||||
<c:set var="jsParams" value="'annotate', 'function', '${ function.metaId }', '${ query.entry.metaId }', '${ function }' , '${ query.entry }'" />
|
||||
<c:set var="jsParams" value="'annotate', 'grammaticalFunction', '${ function.metaId }', '${ query.entry.metaId }', '${ function }' , '${ query.entry }'" />
|
||||
<c:out value='<input value="note" type="image" src="/lex/images/note.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
<c:set var="jsParams" value="'getUpdateForm', 'function', '${ function.metaId }', '${ query.entry.metaId }', '${ function }' , '${ query.entry }'" />
|
||||
<c:set var="jsParams" value="'getUpdateForm', 'grammaticalFunction', '${ function.metaId }', '${ query.entry.metaId }', '${ function }' , '${ query.entry }'" />
|
||||
<c:out value='<input value="edit" type="image" src="/lex/images/edit.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
</span>
|
||||
</c:if>
|
||||
|
@ -587,9 +603,9 @@
|
|||
<c:out value='<a name="${ register.label }" ></a>' escapeXml="false" />
|
||||
<c:if test="${ editMode }">
|
||||
<span class="compEditOptions">
|
||||
<c:set var="jsParams" value="'annotate', 'register', '${ register.metaId }', '${ subdefinition.metaId }', '${ register }' , '${ subdefinition }'" />
|
||||
<c:set var="jsParams" value="'annotate', 'speechRegister', '${ register.metaId }', '${ subdefinition.metaId }', '${ register }' , '${ subdefinition }'" />
|
||||
<c:out value='<input value="note" type="image" src="/lex/images/note.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
<c:set var="jsParams" value="'getUpdateForm', 'register', '${ register.metaId }', '${ subdefinition.metaId }', '${ register }' , '${ subdefinition }'" />
|
||||
<c:set var="jsParams" value="'getUpdateForm', 'speechRegister', '${ register.metaId }', '${ subdefinition.metaId }', '${ register }' , '${ subdefinition }'" />
|
||||
<c:out value='<input value="edit" type="image" src="/lex/images/edit.gif" onclick="submitForm( ${jsParams} )" />' escapeXml="false" />
|
||||
</span>
|
||||
</c:if>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="article" value="" />
|
||||
<c:set var="articleTitle" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
|
@ -18,7 +18,7 @@
|
|||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="article" value="${ component.article }" />
|
||||
<c:set var="articleTitle" value="${ component.articleTitle }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<c:set var="newCmd" value="" />
|
||||
<c:set var="article" value="ERROR" />
|
||||
<c:set var="articleTitle" value="ERROR" />
|
||||
<c:set var="id" value="ERROR" />
|
||||
<c:set var="metaId" value="ERROR" />
|
||||
<c:set var="note" value="ERROR" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="encyclopediaArticle" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<c:set var="derivation" value="" />
|
||||
<c:set var="etymologyType" value="0" />
|
||||
<c:set var="loanLanguage" value="0" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
|
@ -19,7 +19,7 @@
|
|||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="derivation" value="${ component.derivation }" />
|
||||
<c:set var="etymologyDescription" value="${ component.etymologyDescription }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="etymologyType" value="${ component.etymologyType }" />
|
||||
<c:set var="loanLanguage" value="${ component.loanLanguage }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
|
@ -50,7 +50,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="etymology" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -9,30 +9,30 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="function" value="0" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="function" value="${ component.function }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="" />
|
||||
<c:set var="function" value="ERROR" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="ERROR" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<form id="newCompForm" action="/lex/action" method="post">
|
||||
<p>
|
||||
<input type="hidden" name="comp" value="function" />
|
||||
<input type="hidden" name="comp" value="grammaticalFunction" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="keyword" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="keyword" value="${ component.keyword }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="keyword" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="language" value="${ component.language }" />
|
||||
<c:set var="dialect" value="${ component.dialect }" />
|
||||
<c:set var="source" value="${ component.source }" />
|
||||
<c:set var="projectSubject" value="${ component.modifiedByProjSub }" />
|
||||
<c:set var="script" value="${ component.script }" />
|
||||
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
<c:set var="language" value="${ component.meta.language }" />
|
||||
<c:set var="dialect" value="${ component.meta.dialect }" />
|
||||
<c:set var="source" value="${ component.meta.source }" />
|
||||
<c:set var="projectSubject" value="${ component.meta.modifiedByProjSub }" />
|
||||
<c:set var="script" value="${ component.meta.script }" />
|
||||
<%-- <c:set var="precedence" value="${ component.meta.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.meta.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="updateMode" value="${ false }" />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="modelSentence" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<%-- <c:set var="precedence" value="1" /> --%>
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="modelSentence" value="${ component.modelSentence }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="modelSentence" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<c:set var="spelling" value="" />
|
||||
<c:set var="pagination" value="" />
|
||||
<c:set var="passage" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
|
@ -20,7 +20,7 @@
|
|||
<c:set var="spelling" value="${ component.spelling }" />
|
||||
<c:set var="pagination" value="${ component.pagination }" />
|
||||
<c:set var="passage" value="${ component.passage }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="passage" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="phonetics" value="" />
|
||||
<c:set var="phoneticsType" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
|
@ -18,7 +18,7 @@
|
|||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="phonetics" value="${ component.phonetics }" />
|
||||
<c:set var="phoneticsType" value="${ component.phoneticsType }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<c:set var="newCmd" value="" />
|
||||
<c:set var="phonetics" value="ERROR" />
|
||||
<c:set var="phoneticsType" value="ERROR" />
|
||||
<c:set var="id" value="ERROR" />
|
||||
<c:set var="metaId" value="ERROR" />
|
||||
<c:set var="note" value="ERROR" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="pronunciation" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="register" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<%-- <c:set var="precedence" value="1" /> --%>
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="register" value="${ component.register }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -30,9 +30,9 @@
|
|||
|
||||
<form id="newCompForm" action="/lex/action" method="post">
|
||||
<p>
|
||||
<input type="hidden" name="comp" value="register" />
|
||||
<input type="hidden" name="comp" value="speechRegister" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="relatedTerm" value="" />
|
||||
<c:set var="relatedTermType" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<%-- <c:set var="precedence" value="1" /> --%>
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
|
@ -17,7 +17,7 @@
|
|||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="relatedTerm" value="${ component.relatedTerm }" />
|
||||
<c:set var="relatedTermType" value="${ component.relatedTermType }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="relatedTerm" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="spelling" value="" />
|
||||
<c:set var="spellingType" value="0" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
|
@ -17,7 +17,7 @@
|
|||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="spelling" value="${ component.spelling }" />
|
||||
<c:set var="spellingType" value="${ component.spellingType }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<c:set var="newCmd" value="" />
|
||||
<c:set var="spelling" value="ERROR" />
|
||||
<c:set var="spellingType" value="ERROR" />
|
||||
<c:set var="id" value="ERROR" />
|
||||
<c:set var="metaId" value="ERROR" />
|
||||
<c:set var="note" value="ERROR" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="spelling" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="subdefinition" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
|
||||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="subdefinition" value="${ component.subdefinition }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
|
@ -42,7 +42,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="subdefinition" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="term" value="${ component.term }" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<c:set var="precedence" value="1" />
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="term" value="${ component.term }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<c:set var="precedence" value="${ component.precedence }" />
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="term" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="transitionalDataText" value="${ component.transitionalDataText }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="updateMode" value="${ false }" />
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
<input type="hidden" name="comp" value="transitionalData" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<c:set var="updateMode" value="${ false }" />
|
||||
<c:set var="newCmd" value="insert" />
|
||||
<c:set var="translationEquivalent" value="" />
|
||||
<c:set var="id" value="" />
|
||||
<c:set var="metaId" value="" />
|
||||
<%-- <c:set var="precedence" value="1" /> --%>
|
||||
<c:set var="note" value="" />
|
||||
</c:when>
|
||||
|
@ -15,7 +15,7 @@
|
|||
<c:set var="updateMode" value="${ true }" />
|
||||
<c:set var="newCmd" value="update" />
|
||||
<c:set var="translationEquivalent" value="${ component.translationEquivalent }" />
|
||||
<c:set var="id" value="${ component.id }" />
|
||||
<c:set var="metaId" value="${ component.metaId }" />
|
||||
<%-- <c:set var="precedence" value="${ component.precedence }" /> --%>
|
||||
<c:set var="note" value="${ component.note }" />
|
||||
</c:when>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<p>
|
||||
<input type="hidden" name="comp" value="translationEquivalent" />
|
||||
<c:if test="${ updateMode }">
|
||||
<c:out value='<input type="hidden" name="id" value="${id}" />' escapeXml="false" />
|
||||
<c:out value='<input type="hidden" name="metaId" value="${metaId}" />' escapeXml="false" />
|
||||
</c:if>
|
||||
<c:out value='<input type="hidden" name="cmd" value="${newCmd}" />' escapeXml='false' />
|
||||
<c:out value='<input type="hidden" name="parentId" value="${ param.parentId }" />' escapeXml='false' />
|
||||
|
|
Loading…
Reference in a new issue