diff --git a/build.xml b/build.xml index 04d1a01..69f2b6d 100644 --- a/build.xml +++ b/build.xml @@ -115,8 +115,13 @@ - - + + + + + + + diff --git a/src/css/lex-advanced.css b/src/css/lex-advanced.css index d280f08..925e72f 100644 --- a/src/css/lex-advanced.css +++ b/src/css/lex-advanced.css @@ -1,124 +1,33 @@ - /* ID Selectors */ -#header -{ -position: absolute; -top: 80px; -left: 0px; -width: 98%; -height: 25px; -margin-top: 10px; -margin-left: 5px; -background-color: #ffffff; -font-size:.9em; -border-left:1px solid #000; -border-right:1px solid #000; -border-top:1px solid #000; -padding: 3px 0 0 3px; -} -#label p -{ - color:white; -} #label { -position: absolute; -top: 115px; -left: 0px; -margin-left: 5px; -width: 98%; -height: 25px; -background-color: #666666; -color:white; -font-size:.9em; -border-left:1px solid #000; -border-right:1px solid #000; -border-top:1px solid #000; -padding: 3px 0 0 3px; } #message { -position: absolute; -top: 140px; -left: 0px; -margin-left: 5px; -width: 98%; -height: 25px; -font-size:.9em; -background-color: #999999; -border-left:1px solid #000; -border-right:1px solid #000; -border-top:1px solid #000; -padding: 3px 0 0 3px; - } -#columnSingle + +#results +{ +} + +#toc { -position:absolute; -top:166px; -left: 0; -margin-left: 5px; -padding-bottom:10px; -width: 98%; -background-color: white; -border:1px solid #000; -padding: 0 0 0 3px; + padding: 0; } - -#columnSingle #menu -{ -float:right; -border-left:1px solid #000; -border-bottom:1px solid #000; -width: 230px; -background:#eee; -margin:0px 0px 10px 10px; -padding-top: 5px; -padding-bottom: 5px; -} -/* #columnSingle #menu -{ -float:left; -border-right:1px solid #000; -border-bottom:1px solid #000; -width: 230px; -background:#eee; -margin:0px 10px 10px 0px; -padding-top: 5px; -padding-bottom: 5px; -} */ -#columnSingle form, #columnSingle h1 -{ -margin:5px 5px 5px 5px; -} - -#menu > form +#entry { -border-left: 0; -border-bottom: 0; -margin-left:10px; } #termChildren, #defChildren, #subdefChildren { -margin-left: 35px; -margin-right: 0; } #columnMain textarea { -border: black solid 1px; -} - -#backButton -{ -float:right; -margin-right: 25px; -margin-top: 25px; -} +} #newCompForm, #preferencesForm { @@ -133,6 +42,11 @@ margin: 5px 5px 5px 5px; } /* Class Selectors.*/ + .highlightBox ol +{ +margin: 0 0 0 20px; +} + .label { font-weight: bold; @@ -167,20 +81,16 @@ margin-right: 2px; .metadata, .translation, .analysis { display: none; -/* font-size: .75em; */ margin-left: 1.5em; margin-top: .5em; -/* color: gray; */ } .data input { - /* font-size: .9em; */ padding: 0px; } /* CSS Rollovers */ - p.data a:hover { /* @@ -208,11 +118,9 @@ text-decoration: none !important; position: absolute; margin: 5px 0px 0px 20px; background-color: beige; -/* width: auto; */ max-width: 300px; padding: 2px 10px 2px 10px; border: 1px solid #C0C0C0; -/* color: #000; */ text-align:left; display: block; } @@ -222,46 +130,5 @@ p.data a:hover span.translation span.metadata, p.data a:hover span.analysis span width: 300px; } -/* TEMP WORK TESTING DEBUG AREA */ - -#debug -{ -display:none; -position: absolute; -top: 0; -margin-left: 105%; -font-size:.8em; -width: 60%; -height: auto; -z-index: 4; -background-color: white; -} - -#debug table -{ -position:absolute; -top: 0px; -left: 0px; -width: 100%; -border: black solid 2px; -color: black; -background-color: cyan; -margin: 0 0 15px 0;} - -#debug th, #debug td -{ -border-collapse: collapse; -border-spacing: 0; -background-color: cyan; -font-size: .9em; -text-align: left; -vertical-align: top; -margin: 0; -} - -#debug h3 -{ - background-color: #99ccff; -} /* END OF CSS*/ diff --git a/src/css/lex.css b/src/css/lex.css index 81e4a5d..f12d5c1 100644 --- a/src/css/lex.css +++ b/src/css/lex.css @@ -1,4 +1,6 @@ -@import url( "http://iris.lib.virginia.edu/tibet/style/thdl-styles.css" ); +/* IMPORTS */ + +@import url( "thdl-styles.css" ); @import url( "lex-advanced.css" ); diff --git a/src/css/thdl-advanced.css b/src/css/thdl-advanced.css new file mode 100644 index 0000000..b9d2825 --- /dev/null +++ b/src/css/thdl-advanced.css @@ -0,0 +1,363 @@ +/*-------- +ID Selectors --primarily used for page layout +----------*/ + +#banner +{ +margin: 0px 0px 0px 0px; +padding: 0px 0px 0px 0px; +height : 55px; +background-color: #E5E5E5; +} + +#logo +{ +position: absolute; +top: 2px; +left: 0; +border: 0; +background-color: transparent; +margin-left : 5px; +width: 50px; +margin-right: 5%; +z-index: 11; +} + +#banner h1 { +margin-right: 25%; +position: absolute; +top: 0px; +left: 65px; +color: #003366; +font-size: 14px; +font-weight: bold; +text-transform: uppercase; +} + +#menubar { +position: absolute; +top: 33px; +left: 65px; +height: 21px; +} + +body>#menubar { +height: 22px; +} + +#MenuPos { +height: 22px; +font-size: .9em; +z-index: 2; +} + +#sub_banner +{ +top: 50px; +padding: 0px 0px 0px 0px; +height : 25px; +background-color: #CCCCCC; +z-index: 1; +} + +#breadcrumbs { +position:absolute; +left: 10px; +top: 60px; +font-size: 12px; +} + +#search { +margin-right: 13px; +text-align: right; +} + +#search form { +font-size: 9px; +margin: 0; +display: inline; +text-align: right; +} + +#search form p +{ +margin: 0; +display: inline; +text-align: right; +} + + + +/* #sa, #q - These are Google Search form-parameter names */ +#sa +{ +margin-top: 5px; +padding: 0; +height: 16px; +width: 50px; +background-color: #666666; +color: white; +font-size: 10px; +border-top: solid 1px white; +border-left: solid 1px white; +border-bottom: solid 1px gray; +border-right: solid 1px gray; +} + +p>#sa +{ +height: 14px; +} + +#q +{ +padding: 0; +height: 14px; +width: 90px; +font-size: 10px; +border-top: solid 1px silver; +border-left: solid 1px silver; +border-bottom: solid 1px silver; +border-right: solid 1px silver; +} + +#main { +width: 96%; +margin: 2px 1% 10px 1%; +background-color : #ffffff; +} + +body>#main { +margin-top: 6px; +} + +#columnLeft { +position: absolute; +left:10px; +top:82px; +width:200px; +} + +#columnCenter { +background:#fff; +margin-left: 216px; +margin-right:210px; +} + +#columnRight { +position: absolute; +right:10px; +top:82px; +width:200px; +margin-right: 10px; +margin-top: 0px; +} + +#columnMain { +background: #ffffff; +margin-left: 216px; +margin-right: 10px; +} + +#main p, #columnMain p{ +max-width: 700px; +min-width: 10px; +text-align: justify; +} + +#main p.illustratedBlurb +{ + max-width: none !important; +} + +#main ul, #main dl, #main ol { +max-width: 620px; +min-width: 10px; +text-align: justify; +} + +#columnLeft p, #columnCenter p, #columnRight p, +#columnLeft ul, #columnCenter ul, #columnRight ul, +#columnLeft ol, #columnCenter ol, #columnRight ol, +#columnLeft dl, #columnCenter dl, #columnRight dl +{ +text-align: left; +} + +.low-emph, .low-emph * { +color: gray; +text-decoration: none !important; +} + +.caption { +font-size: .9em; +font-style: italic; +font-weight: normal; +color: #000033; +} + +.smallgray { +font-size: .9em; +font-weight: normal; +color: #333333; +} + +.smalllink { +font-size: .9em; +color: #333399; +} + +.bodytext { +font-size: 1em; +text-align: justify; +} + +.label, .bold { +font-weight: bold; +color: black; +} + +.credits { +font-size: 1.1em; +color: #660033; +text-align: justify; +font-weight: bold; +} + +.highlightBox, .spotlightBox { +width: 100%; +margin: 5px 0 0 0; +padding: 0 0 0 0; +background-color: #e1e1e1; +border: solid 1px gray; +} + +.spotlightBox { +background-color: white; +} + +.highlightBox h2, .spotlightBox h2 { +color: white; +background-color: #336699; +margin: 0; +text-align: center; +} + +.highlightBox li +{ +margin: 2px 0 2px 10px; +} + +.highlightBox ul, .highlightBox ol +{ +margin: 0 0 0 10px; +padding-left: 0px; +} + +.spotlightBox h2 { +color: #000033; +background-color: #E5E5E5; +} + +.highlightBox a:hover, #breadcrumbs a:hover { +background-color: white !important; +} + +ul.member { +list-style-type: none; +} + +.menu0 { +font-size: 1em; +margin-left: 0em; +text-align: left; +color: #FFFFFF; +background-color: #000066; +} + +a.menu { +font-size: 1em; +color: #FFFFFF; +} + +.selected { +margin: 0px; +font-size: 1em; +/*font-style: italic;*/ +font-weight: 900; +color: #009933; +background-color: #ffff99; +padding: .1em; +} + +.selected:hover { +background-color: #ffff99 !important; +} + +p.illustratedBlurb { +clear: none; +} + +div.caption +{ + text-align: left !important; + margin-top: 1px !important; +} + +div.captionedImage { +float: right; +clear: right; +margin: 4px 0 10px 10px; +} + +div.captionedImage img { +float: left; +border: solid 1px gray; +} +div.captionedImage div { +clear: left; +width: 240px; +text-align: center; +margin-top: 20px; +} + +div.captionedImageLeft { +float: left; +clear: left; +margin: 0 10px 10px 5px; +} + +div.captionedImageLeft img { +float: left; +border: solid 1px gray; +} + +div.captionedImageLeft div { +clear: left; +width: 240px; +} + +img +{ +border: 0; +} + +.footer +{ +text-align: center; +font-size: .9em; +margin-right: 240px; +margin-left: 240px; +border-top: 1px dotted gray; +} + +#main img +{ +border: solid 1px silver; +} + +img.text-illustration +{ +margin: 8px 8px 8px 8px; +float: right; +} diff --git a/src/css/thdl-styles.css b/src/css/thdl-styles.css new file mode 100644 index 0000000..85fb20f --- /dev/null +++ b/src/css/thdl-styles.css @@ -0,0 +1,108 @@ +/*------------------ + IMPORT STYLESHEETS + This import hides layout rules from the following older browsers +--------------------*/ + +@import url( "thdl-advanced.css" ); + +/*------------- +Element Selectors +---------------*/ + +body { +margin:0; +padding:0; +color: #000033; +background-color: #FFFFFF; +font-size: small; +font-family: Arial, sans-serif !important; +} + +a { +color: #0033CC; +border: 0; +text-decoration: none; +} + +a:hover { +background-color: #e1e1e1; +} + +p, pre { +color: #000033; +font-size: 1em; +margin: 5px 5px 5px 10px; +} + +p { +text-align: justify; +margin: 5px 5px 7px 5px; +} + +h1, h2, h3, h4, h5, h6 { +font-family: Verdana, sans-serif !important; +font-style: normal; +font-weight: bold; +font-variant: normal; +font-size: 1em; +margin: 5px 5px 5px 3px; +padding:0; +text-transform: none; +line-height: normal; +border-style: none; +} + +h1 { +font-size: 1.2em; +text-transform: uppercase; +} + +h2 { +font-size: 1.1em; +} + +h3 { +font-size: 1em; +} + +form { +margin: 0; +padding: 0; +} + +li { +margin-top: 5px; +font-size: 1em; +font-style: normal; +font-weight: normal; +color: #000033; +} + +blockquote { +font-style: normal; +font-weight: normal; +} + +dt { +font-weight: bold; +} + +.alert, .warning, .dangerous { +font-style: normal; +color: red; +} + +.alert .label, .warning .label, .dangerous .label { +color: red; +} + +.message +{ +color: #006666; +} + +.inline-help +{ +color: #006666; +} + diff --git a/src/java/org/thdl/lex/DisplayHelper.java b/src/java/org/thdl/lex/DisplayHelper.java new file mode 100644 index 0000000..77cadfa --- /dev/null +++ b/src/java/org/thdl/lex/DisplayHelper.java @@ -0,0 +1,245 @@ +package org.thdl.lex; + +import java.util.*; +import org.apache.commons.beanutils.*; +import org.thdl.lex.component.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 14, 2003 + */ +public class DisplayHelper +{ + private Collection collection; + private ILexComponent component; + private ILexComponent note; + + private boolean showNotes; + private boolean showMeta; + private boolean showEditOptions; + private boolean showTranslations; + + + /** + * Sets the note attribute of the DisplayHelper object + * + * @param note The new note value + */ + public void setNote( ILexComponent note ) + { + this.note = note; + } + + + /** + * Gets the note attribute of the DisplayHelper object + * + * @return The note value + */ + public ILexComponent getNote() + { + return note; + } + + + /** + * Sets the component attribute of the DisplayHelper object + * + * @param component The new component value + */ + public void setComponent( ILexComponent component ) + { + this.component = component; + } + + + /** + * Gets the component attribute of the DisplayHelper object + * + * @return The component value + */ + public ILexComponent getComponent() + { + return component; + } + + + /** + * Sets the showEditOptions attribute of the DisplayHelper object + * + * @param showEditOptions The new showEditOptions value + */ + public void setShowEditOptions( boolean showEditOptions ) + { + this.showEditOptions = showEditOptions; + } + + + /** + * Gets the showEditOptions attribute of the DisplayHelper object + * + * @return The showEditOptions value + */ + public boolean getShowEditOptions() + { + return showEditOptions; + } + + + /** + * Sets the showTranslations attribute of the DisplayHelper object + * + * @param showTranslations The new showTranslations value + */ + public void setShowTranslations( boolean showTranslations ) + { + this.showTranslations = showTranslations; + } + + + /** + * Gets the showTranslations attribute of the DisplayHelper object + * + * @return The showTranslations value + */ + public boolean getShowTranslations() + { + return showTranslations; + } + + + /** + * Sets the showNotes attribute of the DisplayHelper object + * + * @param showNotes The new showNotes value + */ + public void setShowNotes( boolean showNotes ) + { + this.showNotes = showNotes; + } + + + /** + * Sets the showMeta attribute of the DisplayHelper object + * + * @param showMeta The new showMeta value + */ + public void setShowMeta( boolean showMeta ) + { + this.showMeta = showMeta; + } + + + /** + * Gets the showNotes attribute of the DisplayHelper object + * + * @return The showNotes value + */ + public boolean getShowNotes() + { + return showNotes; + } + + + /** + * Gets the showMeta attribute of the DisplayHelper object + * + * @return The showMeta value + */ + public boolean getShowMeta() + { + return showMeta; + } + + + + /** + * Sets the collection attribute of the DisplayHelper object + * + * @param collection The new collection value + */ + public void setCollection( Collection collection ) + { + this.collection = collection; + } + + + /** + * Gets the collection attribute of the DisplayHelper object + * + * @return The collection value + */ + public Collection getCollection() + { + return collection; + } + + + /** + * Gets the collectionSize attribute of the DisplayHelper object + * + * @return The collectionSize value + */ + public int getCollectionSize() + { + int size = 0; + if ( null != getCollection() ) + { + size = getCollection().size(); + } + return size; + } + + + /** + * Gets the componentIsTranslation attribute of the DisplayHelper object + * + * @return The componentIsTranslation value + */ + public boolean getComponentIsTranslation() + { + + boolean b = false; + if ( null != getComponent() && getComponent() instanceof Translatable ) + { + Translatable t = (Translatable) getComponent(); + b = t.getTranslationOf() != null ? true : false; + } + return b; + } + +// helpers + /** + * Description of the Method + */ + public void clear() + { + setShowEditOptions( false ); + setShowMeta( false ); + setShowTranslations( false ); + setShowNotes( false ); + } + + + /** + * Description of the Method + * + * @param map Description of the Parameter + * @exception Exception Description of the Exception + */ + public void populate( Map map ) throws Exception + { + clear(); + BeanUtils.populate( this, map ); + } + + + /** + *Constructor for the DisplayHelper object + */ + public DisplayHelper() { } +} + diff --git a/src/java/org/thdl/lex/HibernateTransaction.java b/src/java/org/thdl/lex/HibernateTransaction.java index e3338e2..a3e974a 100644 --- a/src/java/org/thdl/lex/HibernateTransaction.java +++ b/src/java/org/thdl/lex/HibernateTransaction.java @@ -48,13 +48,16 @@ public class HibernateTransaction { Transaction t = (Transaction) transaction.get(); transaction.set( null ); - if ( t != null && commit ) + if ( t != null ) { - t.commit(); - } - else if ( t != null ) - { - t.rollback(); + if ( commit ) + { + t.commit(); + } + else + { + t.rollback(); + } } } diff --git a/src/java/org/thdl/lex/LexActionServlet.java b/src/java/org/thdl/lex/LexActionServlet.java index 0e1647d..c02b0db 100644 --- a/src/java/org/thdl/lex/LexActionServlet.java +++ b/src/java/org/thdl/lex/LexActionServlet.java @@ -106,10 +106,11 @@ public class LexActionServlet extends HttpServlet */ public void service( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException { - LexLogger.debug( "Checking Request state at start of LexActionServlet.service()" ); - LexLogger.logRequestState( req ); - LexLogger.logSessionState( req ); - + /* + LexLogger.debug( "Checking Request state at start of LexActionServlet.service()" ); + LexLogger.logRequestState( req ); + LexLogger.logSessionState( req ); + */ String next; try { @@ -196,23 +197,38 @@ public class LexActionServlet extends HttpServlet commands.put( "logout", new NullCommand( "logout.jsp" ) ); commands.put( "getMetaPrefsForm", new NullCommand( "metaPrefsForm.jsp" ) ); commands.put( "getMetaDefaultsForm", new NullCommand( "metaDefaultsForm.jsp" ) ); - commands.put( "find", new FindCommand() ); - commands.put( "getInsertForm", new GetFormCommand( "displayForm.jsp?formMode=insert", Boolean.TRUE ) ); - commands.put( "getUpdateForm", new GetFormCommand( "displayForm.jsp?formMode=update", Boolean.FALSE ) ); - commands.put( "getInsertTermForm", new GetFormCommand( "displayForm.jsp?formMode=insert", Boolean.TRUE, Boolean.TRUE ) ); - commands.put( "getUpdateTermForm", new GetFormCommand( "displayForm.jsp?formMode=update", Boolean.FALSE, Boolean.TRUE ) ); - commands.put( "getTranslationForm", new GetFormCommand( "displayForm.jsp?formMode=insert", Boolean.TRUE ) ); - commands.put( "annotate", new GetFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) ); - commands.put( "insert", new UpdateCommand( "displayEntry.jsp", Boolean.TRUE ) ); + + commands.put( "find", new FindCommand( "displayEntry.jsp" ) ); + + commands.put( "getInsertForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) ); + commands.put( "getInsertTermForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.TRUE ) ); + commands.put( "getTranslationForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) ); + commands.put( "getAnnotationForm", new GetInsertFormCommand( "displayForm.jsp?formMode=insert", Boolean.FALSE ) ); + + commands.put( "getUpdateForm", new GetUpdateFormCommand( "displayForm.jsp?formMode=update", Boolean.FALSE ) ); + commands.put( "getUpdateTermForm", new GetUpdateFormCommand( "displayForm.jsp?formMode=update", Boolean.TRUE ) ); + + /* + commands.put( "getAnnotationForm", new AnnotateCommand( "displayForm.jsp?formMode=insert" ) ); + commands.put( "addAnnotation", new AddAnnotationCommand( "displayEntry.jsp", Boolean.TRUE ) ); + */ + commands.put( "insert", new InsertCommand( "displayEntry.jsp", Boolean.FALSE ) ); + commands.put( "addAnnotation", new InsertCommand( "displayEntry.jsp", Boolean.FALSE ) ); + commands.put( "insertTerm", new InsertCommand( "displayEntry.jsp", Boolean.TRUE ) ); + commands.put( "update", new UpdateCommand( "displayEntry.jsp", Boolean.FALSE ) ); - commands.put( "display", new DisplayCommand() ); - commands.put( "displayFull", new DisplayCommand() ); - commands.put( "editEntry", new DisplayCommand() ); - commands.put( "remove", new RemoveCommand() ); + commands.put( "updateTerm", new UpdateCommand( "displayEntry.jsp", Boolean.TRUE ) ); + + commands.put( "display", new DisplayCommand( "displayEntry.jsp" ) ); + commands.put( "displayFull", new DisplayCommand( "displayEntry.jsp" ) ); + commands.put( "editEntry", new DisplayCommand( "displayEntry.jsp" ) ); + + commands.put( "remove", new RemoveCommand( "displayEntry.jsp" ) ); + commands.put( "setMetaPrefs", new PreferencesCommand( "menu.jsp" ) ); commands.put( "setMetaDefaults", new PreferencesCommand( "menu.jsp" ) ); + commands.put( "abort", new AbortCommand( "menu.jsp" ) ); - commands.put( "testing", new TestingCommand( "displayEntry.jsp" ) ); setCommands( commands ); } diff --git a/src/java/org/thdl/lex/LexComponentFilter.java b/src/java/org/thdl/lex/LexComponentFilter.java index 1a53525..22802f3 100644 --- a/src/java/org/thdl/lex/LexComponentFilter.java +++ b/src/java/org/thdl/lex/LexComponentFilter.java @@ -143,12 +143,12 @@ public class LexComponentFilter implements Filter String labelValue = req.getParameter( LexConstants.LABEL_REQ_PARAM ); try { -// this if block is for TESTING ONLY if ( getBlanks().get( labelValue ) != null ) { Class glass = getBlanks().get( labelValue ).getClass(); LexComponent component = (LexComponent) glass.newInstance(); -//component.appendDebugMap( "LCFilterMadeNewInstance", component ); + component.populate( req.getParameterMap() ); + component.getMeta().populate( req.getParameterMap() ); req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component ); } else @@ -158,11 +158,15 @@ public class LexComponentFilter implements Filter } catch ( InstantiationException ie ) { - throw new ServletException( ie.getMessage() ); + throw new ServletException( ie ); } catch ( IllegalAccessException iae ) { - throw new ServletException( iae.getMessage() ); + throw new ServletException( iae ); + } + catch ( LexComponentException lce ) + { + throw new ServletException( lce ); } } else @@ -179,9 +183,11 @@ public class LexComponentFilter implements Filter { throw new ServletException( lre ); } - LexLogger.debug( "Checking Request state at end of LexComponentFilter.doFilter()" ); - LexLogger.logRequestState( req ); - LexLogger.logSessionState( req ); + /* + LexLogger.debug( "Checking Request state at end of LexComponentFilter.doFilter()" ); + LexLogger.logRequestState( req ); + LexLogger.logSessionState( req ); + */ long dur = System.currentTimeMillis() - start; LexLogger.debug( "Total Request took: " + dur / 1000 + " seconds.\n\n" ); } diff --git a/src/java/org/thdl/lex/LexComponentRepository.java b/src/java/org/thdl/lex/LexComponentRepository.java index 8c369cb..d8ec104 100644 --- a/src/java/org/thdl/lex/LexComponentRepository.java +++ b/src/java/org/thdl/lex/LexComponentRepository.java @@ -226,6 +226,11 @@ public class LexComponentRepository lexQuery.getResults().clear(); lexQuery.getResults().put( term.getMetaId(), term.getTerm() ); } + else + { + lexQuery.setEntry( null ); + lexQuery.getResults().clear(); + } while ( it.hasNext() ) { term = (ITerm) it.next(); @@ -300,6 +305,30 @@ public class LexComponentRepository } + /** + * Description of the Method + * + * @param component Description of the Parameter + * @param pk Description of the Parameter + * @exception LexRepositoryException Description of the Exception + */ + public static void loadByPk( ILexComponent component, Integer pk ) throws LexRepositoryException + { + + try + { + beginTransaction(); + getSession().load( component, pk ); + endTransaction( false ); + } + catch ( HibernateException he ) + { + throw new LexRepositoryException( he ); + } + } + + + /** * Description of the Method * @@ -322,6 +351,50 @@ public class LexComponentRepository } + /** + * Description of the Method + * + * @param component Description of the Parameter + * @exception LexRepositoryException Description of the Exception + */ + public static void update( ILexComponent component ) throws LexRepositoryException + { + + try + { + beginTransaction(); + getSession().update( component ); + endTransaction( true ); + } + catch ( HibernateException he ) + { + throw new LexRepositoryException( he ); + } + } + + + /** + * Description of the Method + * + * @param component Description of the Parameter + * @exception LexRepositoryException Description of the Exception + */ + public static void refresh( ILexComponent component ) throws LexRepositoryException + { + + try + { + beginTransaction(); + getSession().refresh( component ); + endTransaction( true ); + } + catch ( HibernateException he ) + { + throw new LexRepositoryException( he ); + } + } + + /** * Description of the Method * @@ -332,6 +405,7 @@ public class LexComponentRepository { try { + endTransaction( false ); HibernateSession.closeSession(); } catch ( HibernateException he ) diff --git a/src/java/org/thdl/lex/LexConstants.java b/src/java/org/thdl/lex/LexConstants.java index c1bfa3e..03f5f5d 100644 --- a/src/java/org/thdl/lex/LexConstants.java +++ b/src/java/org/thdl/lex/LexConstants.java @@ -234,6 +234,11 @@ public class LexConstants */ public final static String HIBERNATE_SESSION_KEY = "hib"; + /** + * Description of the Field + */ + public final static String DISPLAY_HELPER_SESSION_ATT = "helper"; + //public final static String URL = "jdbc:mysql://localhost/LexTorque"; } diff --git a/src/java/org/thdl/lex/LexLogger.java b/src/java/org/thdl/lex/LexLogger.java index 327f101..b2ceedf 100644 --- a/src/java/org/thdl/lex/LexLogger.java +++ b/src/java/org/thdl/lex/LexLogger.java @@ -1,8 +1,11 @@ package org.thdl.lex; +import java.io.*; import java.util.*; import javax.servlet.http.*; +import org.apache.commons.beanutils.*; import org.apache.log4j.*; +import org.thdl.lex.component.*; /** @@ -29,7 +32,7 @@ public class LexLogger while ( enum.hasMoreElements() ) { String parm = (String) enum.nextElement(); - LOGGER.debug( "Request Parameter " + parm + " = " + req.getParameter( parm ) ); + LOGGER.debug( "Request Parameter " + parm + " = '" + req.getParameter( parm ) + "'" ); } enum = req.getAttributeNames(); while ( enum.hasMoreElements() ) @@ -67,7 +70,8 @@ public class LexLogger 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() + "\n" ); + + LOGGER.debug( "Query Results, " + query.getResults() + "\n" ); } @@ -103,5 +107,33 @@ public class LexLogger LOGGER.warn( msg ); } + + /** + *Constructor for the debugComponent object + * + * @param component Description of the Parameter + */ + public static void debugComponent( ILexComponent component ) + { + try + { + LOGGER.debug( "Describing: " + component ); + Iterator it = BeanUtils.describe( component ).entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Map.Entry) it.next(); + LOGGER.debug( component.getLabel() + " property: " + entry.getKey() + " = '" + entry.getValue() + "'" ); + } + } + catch ( Exception e ) + { + StringWriter writer = new StringWriter(); + e.printStackTrace( new PrintWriter( writer ) ); + String stackTrace = writer.getBuffer().toString(); + LOGGER.debug( "LexLogger caught an Exception: " + stackTrace ); + } + + } + } diff --git a/src/java/org/thdl/lex/Preferences.java b/src/java/org/thdl/lex/Preferences.java index 1416eda..6aa278f 100644 --- a/src/java/org/thdl/lex/Preferences.java +++ b/src/java/org/thdl/lex/Preferences.java @@ -583,7 +583,7 @@ public class Preferences sqlBuffer.append( ", dialect = " ); sqlBuffer.append( getDialect() ); sqlBuffer.append( ", note = '" ); - sqlBuffer.append( getNote() ); + sqlBuffer.append( LexUtilities.escape( getNote() ) ); sqlBuffer.append( "', useDefaultProjSub = '" ); sqlBuffer.append( getUseDefaultProjSub() ); sqlBuffer.append( "', useDefaultSource = '" ); @@ -645,11 +645,8 @@ public class Preferences //constructors /** *Constructor for the Preferences object - * - * @exception LexRepositoryException Description of the Exception - * @exception LexComponentException Description of the Exception */ - public Preferences() throws LexRepositoryException, LexComponentException + public Preferences() { setId( new Integer( 0 ) ); setUserId( new Integer( 1 ) ); diff --git a/src/java/org/thdl/lex/UserSessionManager.java b/src/java/org/thdl/lex/UserSessionManager.java index d25fceb..eb01bdc 100644 --- a/src/java/org/thdl/lex/UserSessionManager.java +++ b/src/java/org/thdl/lex/UserSessionManager.java @@ -1,17 +1,17 @@ package org.thdl.lex; - -import org.thdl.users.*; -import org.thdl.lex.component.*; +import java.io.IOException; import javax.servlet.http.*; -import java.io.IOException; +import org.thdl.lex.component.*; + +import org.thdl.users.*; /** * Description of the Class * - *@author travis - *@created October 1, 2003 + * @author travis + * @created October 1, 2003 */ public class UserSessionManager { @@ -20,12 +20,40 @@ public class UserSessionManager private static UserSessionManager INSTANCE = new UserSessionManager(); + /** + * Gets the displayHelper attribute of the UserSessionManager object + * + * @param session Description of the Parameter + * @return The displayHelper value + */ + public DisplayHelper getDisplayHelper( HttpSession session ) + { + if ( null == session.getAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT ) ) + { + setDisplayHelper( session, new DisplayHelper() ); + } + return (DisplayHelper) session.getAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT ); + } + + + /** + * Sets the displayHelper attribute of the UserSessionManager object + * + * @param session The new displayHelper value + * @param helper The new displayHelper value + */ + public void setDisplayHelper( HttpSession session, DisplayHelper helper ) + { + session.setAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT, helper ); + } + + /** * Sets the preferences attribute of the UserSessionManager object * - *@param session The new preferences value - *@param preferences The new preferences value - *@since + * @param session The new preferences value + * @param preferences The new preferences value + * @since */ public void setPreferences( HttpSession session, Preferences preferences ) { @@ -36,9 +64,9 @@ public class UserSessionManager /** * Sets the query attribute of the UserSessionManager object * - *@param session The new query value - *@param terms The new query value - *@since + * @param session The new query value + * @param terms The new query value + * @since */ public void setQuery( HttpSession session, LexQuery terms ) { @@ -49,9 +77,9 @@ public class UserSessionManager /** * Sets the sessionUser attribute of the UserSessionManager object * - *@param session The new sessionUser value - *@param user The new sessionUser value - *@since + * @param session The new sessionUser value + * @param user The new sessionUser value + * @since */ public void setSessionUser( HttpSession session, ThdlUser user ) { @@ -72,9 +100,9 @@ public class UserSessionManager /** * Sets the sessionLoginTarget attribute of the UserSessionManager object * - *@param session The new sessionLoginTarget value - *@param loginTarget The new sessionLoginTarget value - *@since + * @param session The new sessionLoginTarget value + * @param loginTarget The new sessionLoginTarget value + * @since */ public void setSessionLoginTarget( HttpSession session, String loginTarget ) { @@ -85,9 +113,9 @@ public class UserSessionManager /** * Sets the displayMode attribute of the UserSessionManager object * - *@param session The new displayMode value - *@param displayMode The new displayMode value - *@since + * @param session The new displayMode value + * @param displayMode The new displayMode value + * @since */ public void setDisplayMode( HttpSession session, String displayMode ) { @@ -98,22 +126,21 @@ public class UserSessionManager /** * Sets the entry attribute of the UserSessionManager object * - *@return The instance value - *@since + * @return The instance value + * @since */ /* - * public void setEntry( HttpSession session, ITerm entry ) - * { - * session.setAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR, entry ); - * } - */ - + public void setEntry( HttpSession session, ITerm entry ) + { + session.setAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR, entry ); + } + */ //helper methods /** * Gets the instance attribute of the UserSessionManager class * - *@return The instance value - *@since + * @return The instance value + * @since */ public static UserSessionManager getInstance() { @@ -124,9 +151,9 @@ public class UserSessionManager /** * Gets the query attribute of the UserSessionManager object * - *@param session Description of Parameter - *@return The query value - *@since + * @param session Description of Parameter + * @return The query value + * @since */ public LexQuery getQuery( HttpSession session ) { @@ -143,12 +170,20 @@ public class UserSessionManager /** * Gets the preferences attribute of the UserSessionManager object * - *@param session Description of Parameter - *@return The preferences value - *@since + * @param session Description of Parameter + * @return The preferences value + * @exception LexRepositoryException Description of the Exception + * @exception LexComponentException Description of the Exception + * @since */ - public Preferences getPreferences( HttpSession session ) + public Preferences getPreferences( HttpSession session ) throws LexRepositoryException, LexComponentException { + Object sesAtt = session.getAttribute( LexConstants.PREFERENCES_SESS_ATTR ); + if ( null == sesAtt ) + { + ThdlUser user = getSessionUser( session ); + setPreferences( session, new Preferences( user ) ); + } return (Preferences) session.getAttribute( LexConstants.PREFERENCES_SESS_ATTR ); } @@ -156,9 +191,9 @@ public class UserSessionManager /** * Gets the sessionUser attribute of the UserSessionManager object * - *@param session Description of Parameter - *@return The sessionUser value - *@since + * @param session Description of Parameter + * @return The sessionUser value + * @since */ public ThdlUser getSessionUser( HttpSession session ) { @@ -169,10 +204,10 @@ public class UserSessionManager /** * Gets the sessionLoginTarget attribute of the UserSessionManager object * - *@param session Description of Parameter - *@param clear Description of Parameter - *@return The sessionLoginTarget value - *@since + * @param session Description of Parameter + * @param clear Description of Parameter + * @return The sessionLoginTarget value + * @since */ public String getSessionLoginTarget( HttpSession session, boolean clear ) { @@ -185,24 +220,12 @@ public class UserSessionManager } - /** - * Gets the entry attribute of the UserSessionManager object - * - *@param session Description of Parameter - *@since - */ - /* - * public ITerm getEntry( HttpSession session ) - * { - * return (ITerm) session.getAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR ); - * } - */ /** * Description of the Method * - *@param session Description of Parameter - *@since + * @param session Description of Parameter + * @since */ public void removeSessionUser( HttpSession session ) { @@ -211,14 +234,15 @@ public class UserSessionManager } + /** * Description of the Method * - *@param request Description of Parameter - *@param response Description of Parameter - *@param url Description of Parameter - *@exception IOException Description of Exception - *@since + * @param request Description of Parameter + * @param response Description of Parameter + * @param url Description of Parameter + * @exception IOException Description of Exception + * @since */ public static void doRedirect( HttpServletRequest request, HttpServletResponse response, String url ) throws IOException { @@ -231,7 +255,7 @@ public class UserSessionManager /** * Constructor for the UserSessionManager object * - *@since + * @since */ private UserSessionManager() { } } diff --git a/src/java/org/thdl/lex/commands/.cvsignore b/src/java/org/thdl/lex/commands/.cvsignore new file mode 100644 index 0000000..3367afd --- /dev/null +++ b/src/java/org/thdl/lex/commands/.cvsignore @@ -0,0 +1 @@ +old diff --git a/src/java/org/thdl/lex/commands/Command.java b/src/java/org/thdl/lex/commands/Command.java index 3436b86..4473776 100644 --- a/src/java/org/thdl/lex/commands/Command.java +++ b/src/java/org/thdl/lex/commands/Command.java @@ -22,6 +22,5 @@ public interface Command *@since */ public String execute( javax.servlet.http.HttpServletRequest req, ILexComponent component ) throws CommandException; - // public java.util.HashMap initForwards(); } diff --git a/src/java/org/thdl/lex/commands/DisplayCommand.java b/src/java/org/thdl/lex/commands/DisplayCommand.java index 42657f5..c1b596e 100644 --- a/src/java/org/thdl/lex/commands/DisplayCommand.java +++ b/src/java/org/thdl/lex/commands/DisplayCommand.java @@ -1,20 +1,21 @@ 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.apache.commons.beanutils.*; + +import org.thdl.lex.*; +import org.thdl.lex.component.*; + /** * Description of the Class * - *@author travis - *@created October 3, 2003 + * @author travis + * @created October 3, 2003 */ public class DisplayCommand extends LexCommand implements Command { @@ -22,8 +23,8 @@ public class DisplayCommand extends LexCommand implements Command /** * Sets the displayMode attribute of the DisplayCommand object * - *@param req The new displayMode value - *@since + * @param req The new displayMode value + * @since */ public void setDisplayMode( HttpServletRequest req ) { @@ -48,29 +49,35 @@ public class DisplayCommand extends LexCommand implements Command /** * Description of the Method * - *@param req Description of Parameter - *@param component Description of Parameter - *@return Description of the Returned Value - *@exception CommandException Description of Exception - *@since + * @param req Description of Parameter + * @param component Description of Parameter + * @return Description of the Returned Value + * @exception CommandException Description of Exception + * @since */ public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { + String msg = null; + String next = getNext(); + DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); try { - component.populate( req.getParameterMap() ); - LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); - query.setQueryComponent( component ); - LexComponentRepository.loadTermByPk( query ); - - String msg = null; - String forward = (String) getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) ); - setNext( forward ); + if ( null != component ) + { + component.populate( req.getParameterMap() ); + query.setQueryComponent( component ); + LexComponentRepository.loadTermByPk( query ); + } + else + { + LexComponentRepository.update( query.getEntry() ); + } + displayHelper.populate( req.getParameterMap() ); req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); - return getNext(); + return next; } catch ( LexComponentException e ) { @@ -80,21 +87,10 @@ public class DisplayCommand extends LexCommand implements Command { throw new CommandException( e ); } - } - - - /** - * Description of the Method - * - *@return Description of the Returned Value - *@since - */ - public HashMap initForwards() - { - HashMap map = new HashMap(); - map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" ); - map.put( LexConstants.ENCYCLOPEDIA_ARTICLE_LABEL_VALUE, "displayEntry.jsp" ); - return map; + catch ( Exception e ) + { + throw new CommandException( e ); + } } @@ -102,12 +98,12 @@ public class DisplayCommand extends LexCommand implements Command /** * Constructor for the DisplayCommand object * - *@since + * @param next Description of the Parameter + * @since */ - public DisplayCommand() + public DisplayCommand( String next ) { - super(); - setForwards( initForwards() ); + super( next ); } } diff --git a/src/java/org/thdl/lex/commands/FindCommand.java b/src/java/org/thdl/lex/commands/FindCommand.java index 96bfe83..a9cbddf 100644 --- a/src/java/org/thdl/lex/commands/FindCommand.java +++ b/src/java/org/thdl/lex/commands/FindCommand.java @@ -1,20 +1,20 @@ 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.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.thdl.lex.*; +import org.thdl.lex.component.*; + /** * Description of the Class * - *@author travis - *@created October 1, 2003 + * @author travis + * @created October 1, 2003 */ public class FindCommand extends LexCommand implements Command { @@ -22,49 +22,42 @@ public class FindCommand extends LexCommand implements Command /** * Description of the Method * - *@param req Description of Parameter - *@param component Description of Parameter - *@return Description of the Returned Value - *@exception CommandException Description of Exception - *@since + * @param req Description of Parameter + * @param component Description of Parameter + * @return Description of the Returned Value + * @exception CommandException Description of Exception + * @since */ public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { try { String msg = null; - String forward = (String) getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) ); - - component.populate( req.getParameterMap() ); - setNext( forward ); + String next = getNext(); + DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); + LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); if ( component instanceof ITerm ) { ITerm term = (ITerm) component; - LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); - query.setQueryComponent( term ); LexComponentRepository.findTermsByTerm( query ); Iterator iterator = query.getResults().keySet().iterator(); if ( iterator.hasNext() ) { - setNext( "displayEntry.jsp" ); getSessionManager().setQuery( req.getSession( true ), query ); msg = "There are " + query.getResults().size() + " terms matching " + term.getTerm(); } else { - setNext( "menu.jsp" ); + next = "menu.jsp"; msg = "There were no terms matching " + term.getTerm(); } } req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); - return getNext(); - } - catch ( LexComponentException e ) - { - throw new CommandException( e ); + query.setQueryComponent( null ); + return next; } catch ( LexRepositoryException e ) { @@ -73,32 +66,17 @@ public class FindCommand extends LexCommand implements Command } - /** - * Description of the Method - * - *@return Description of the Returned Value - *@since - */ - public HashMap initForwards() - { - HashMap map = new HashMap(); - map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" ); - return map; - } - //constructors /** * Constructor for the FindCommand object * - *@since + * @param next Description of the Parameter + * @since */ - public FindCommand() + public FindCommand( String next ) { - super(); - setForwards( initForwards() ); + super( next ); } } diff --git a/src/java/org/thdl/lex/commands/GetFormCommand.java b/src/java/org/thdl/lex/commands/GetFormCommand.java deleted file mode 100644 index 4e637ff..0000000 --- a/src/java/org/thdl/lex/commands/GetFormCommand.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.thdl.lex.commands; -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 GetFormCommand extends LexCommand implements Command -{ - private boolean insertMode; - private boolean termMode; - - - /** - * Sets the termMode attribute of the GetFormCommand object - * - * @param termMode The new termMode value - */ - public void setTermMode( boolean termMode ) - { - this.termMode = termMode; - } - - - /** - * Gets the termMode attribute of the GetFormCommand object - * - * @return The termMode value - */ - public boolean isTermMode() - { - return termMode; - } - - - /** - * Sets the insertMode attribute of the GetFormCommand object - * - * @param insertMode The new insertMode value - */ - public void setInsertMode( boolean insertMode ) - { - this.insertMode = insertMode; - } - - - /** - * Gets the insertMode attribute of the GetFormCommand object - * - * @return The insertMode value - */ - public boolean isInsertMode() - { - return insertMode; - } - -//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 - { - String defaultNext = getNext(); - LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); - ITerm term = query.getEntry(); - String msg = null; - try - { - component.populate( req.getParameterMap() ); - if ( isInsertMode() && !isTermMode() ) - { - term.addChild( component ); - } - else if ( isInsertMode() && isTermMode() ) - { - Term newTerm = new Term(); - newTerm.populate( component ); - LexQuery newTermQuery = new LexQuery( newTerm, LexComponentRepository.EXACT ); - if ( termExists( newTermQuery ) ) - { - msg = newTerm.getTerm() + " is present in the dictionary, please add to this term."; - setNext( "displayEntry.jsp" ); - getSessionManager().setQuery( req.getSession( true ), query ); - } - else - { - query.setEntry( newTerm ); - } - } - else if ( !isTermMode() ) - { - LexComponentRepository.loadByPk( component ); - //find the persistent copy of this component from the term stored in session.query - component = term.findChild( component ); - } - - query.setUpdateComponent( component ); - req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component ); - } - catch ( LexRepositoryException e ) - { - throw new CommandException( e ); - } - catch ( LexComponentException e ) - { - throw new CommandException( e ); - } - finally - { - setNext( defaultNext ); - } - - //if the component is a translation of another component get the original as well to assist in editing - if ( component instanceof Translatable ) - { - Translatable translatable = (Translatable) component; - if ( null != translatable.getTranslationOf() && translatable.getTranslationOf().intValue() > 0 ) - { - try - { - LexComponent source = (LexComponent) translatable.getClass().newInstance(); - Integer sourcePk = translatable.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 ); - } - } - } - - if ( false == isInsertMode() ) - { - Integer creator = component.getMeta().getCreatedBy(); - ThdlUser user = getSessionManager().getSessionUser( req.getSession( true ) ); - if ( user.getId().equals( creator ) || user.hasRole( "admin" ) || user.hasRole( "dev" ) ) - { - msg = "You have reached the Update Form"; - getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); - } - else - { - msg = "A dictionary component can only be edited by the person who created it or an administrator."; - setNext( "displayEntry.jsp" ); - } - } - else - { - msg = "You have reached the Insert Form"; - getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); - } - - req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); - - return getNext(); - } - - - /** - * Description of the Method - * - * @param query Description of the Parameter - * @return The newTerm value - * @exception LexRepositoryException Description of the Exception - */ - public boolean termExists( LexQuery query ) throws LexRepositoryException - { - boolean termExists = false; - query.setFindMode( LexComponentRepository.EXACT ); - LexComponentRepository.findTermsByTerm( query ); - if ( query.getResults().keySet().size() > 0 ) - { - termExists = true; - } - return termExists; - } - - - /** - * 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" ); - return map; - } - -//constructors - - /** - *Constructor for the GetFormCommand object - * - * @param next Description of the Parameter - * @param insertMode Description of the Parameter - * @param termMode Description of the Parameter - */ - public GetFormCommand( String next, Boolean insertMode, Boolean termMode ) - { - super( next ); - setInsertMode( insertMode.booleanValue() ); - setTermMode( termMode.booleanValue() ); - } - - - /** - *Constructor for the GetFormCommand object - * - * @param next Description of the Parameter - * @param insertMode Description of the Parameter - */ - public GetFormCommand( String next, Boolean insertMode ) - { - this( next, insertMode, Boolean.FALSE ); - } - -} - diff --git a/src/java/org/thdl/lex/commands/GetInsertFormCommand.java b/src/java/org/thdl/lex/commands/GetInsertFormCommand.java new file mode 100644 index 0000000..04ce29b --- /dev/null +++ b/src/java/org/thdl/lex/commands/GetInsertFormCommand.java @@ -0,0 +1,189 @@ +package org.thdl.lex.commands; + +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.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 6, 2003 + */ +public class GetInsertFormCommand extends LexCommand implements Command +{ + private boolean termMode; + + + /** + * Sets the termMode attribute of the GetInsertFormCommand object + * + * @param termMode The new termMode value + */ + public void setTermMode( boolean termMode ) + { + this.termMode = termMode; + } + + + /** + * Gets the termMode attribute of the GetInsertFormCommand object + * + * @return The termMode value + */ + public boolean isTermMode() + { + return termMode; + } + + + +//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 + { + String next = getNext(); + HttpSession ses = req.getSession( true ); + LexQuery query = getSessionManager().getQuery( ses ); + ITerm term = query.getEntry(); + String msg = null; + + try + { + LexUser user = (LexUser) getSessionManager().getSessionUser( ses ); + Preferences prefs = getSessionManager().getPreferences( ses ); + + if ( isTermMode() ) + { + Term newTerm = new Term(); + newTerm.populate( component ); + query.setQueryComponent( newTerm ); + if ( termExists( query ) ) + { + msg = newTerm.getTerm() + " is present in the dictionary, please add to this term."; + next = "displayEntry.jsp"; + getSessionManager().setQuery( req.getSession( true ), query ); + } + component = newTerm; + } + + Meta meta = new Meta( user, prefs ); + meta.populate( req.getParameterMap() ); + component.setMeta( meta ); + + if ( req.getParameter( "cmd" ).equals( "getAnnotationForm" ) ) + { + AnalyticalNote note = new AnalyticalNote(); + note.setParentId( component.getMetaId() ); + note.setAnalyticalNote( req.getParameter( "analyticalNote" ) ); + note.setPrecedence( new Integer( 0 ) ); + component.setAnalyticalNotes( new LinkedList() ); + component.getAnalyticalNotes().add( note ); + meta = new Meta( user, prefs ); + meta.populate( req.getParameterMap() ); + note.setMeta( meta ); + req.setAttribute( LexConstants.ORIGINALBEAN_REQ_ATTR, component ); + component = note; + } + + req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component ); + + } + catch ( LexRepositoryException e ) + { + throw new CommandException( e ); + } + 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 instanceof Translatable ) + { + Translatable translatable = (Translatable) component; + if ( null != translatable.getTranslationOf() && translatable.getTranslationOf().intValue() > 0 ) + { + try + { + LexComponent source = (LexComponent) translatable.getClass().newInstance(); + Integer sourcePk = translatable.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 ); + } + } + } + + msg = "You have reached the Insert Form"; + getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); + + req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); + + return next; + } + + + /** + * Description of the Method + * + * @param query Description of the Parameter + * @return The newTerm value + * @exception LexRepositoryException Description of the Exception + */ + public boolean termExists( LexQuery query ) throws LexRepositoryException + { + boolean termExists = false; + query.setFindMode( LexComponentRepository.EXACT ); + LexComponentRepository.findTermsByTerm( query ); + if ( query.getResults().keySet().size() > 0 ) + { + termExists = true; + } + query.setFindMode( LexComponentRepository.STARTS_WITH ); + return termExists; + } + + + +//constructors + + /** + *Constructor for the GetInsertFormCommand object + * + * @param next Description of the Parameter + * @param termMode Description of the Parameter + */ + public GetInsertFormCommand( String next, Boolean termMode ) + { + super( next ); + setTermMode( termMode.booleanValue() ); + } + +} + diff --git a/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java b/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java new file mode 100644 index 0000000..1bf4278 --- /dev/null +++ b/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java @@ -0,0 +1,155 @@ +package org.thdl.lex.commands; +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 +{ + private boolean termMode; + + + /** + * Sets the termMode attribute of the GetFormCommand object + * + * @param termMode The new termMode value + */ + public void setTermMode( boolean termMode ) + { + this.termMode = termMode; + } + + + /** + * Gets the termMode attribute of the GetFormCommand object + * + * @return The termMode value + */ + public boolean isTermMode() + { + return termMode; + } + + + +//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 + { + String next = getNext(); + HttpSession ses = req.getSession( true ); + LexQuery query = getSessionManager().getQuery( ses ); + ITerm term = query.getEntry(); + String msg = null; + ThdlUser user = getSessionManager().getSessionUser( req.getSession( true ) ); + if ( validate( user, component ) ) + { + + try + { + + LexLogger.debug( "Checking component state from getUpdateFormCommand BEFORE component assignment" ); + LexLogger.debugComponent( component ); + if ( isTermMode() ) + { + component = query.getEntry(); + } + else + { + LexComponentRepository.update( term ); + component = term.findChild( component.getMetaId() ); + } + req.setAttribute( LexConstants.COMPONENT_REQ_ATTR, component ); + LexLogger.debug( "Checking component state from getUpdateFormCommand AFTER component assignment" ); + LexLogger.debugComponent( component ); + } + catch ( LexRepositoryException e ) + { + throw new CommandException( e ); + } + 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 instanceof Translatable ) + { + Translatable translatable = (Translatable) component; + if ( null != translatable.getTranslationOf() && translatable.getTranslationOf().intValue() > 0 ) + { + try + { + LexComponent source = (LexComponent) translatable.getClass().newInstance(); + Integer sourcePk = translatable.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 ); + } + } + } + + msg = "You have reached the Update Form"; + getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); + } + else + { + msg = "A dictionary component can only be edited by the person who created it or an administrator."; + next = "displayEntry.jsp"; + } + + req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); + + return next; + } + + + +//constructors + + /** + *Constructor for the GetFormCommand object + * + * @param next Description of the Parameter + * @param termMode Description of the Parameter + */ + public GetUpdateFormCommand( String next, Boolean termMode ) + { + super( next ); + setTermMode( termMode.booleanValue() ); + } + +} + diff --git a/src/java/org/thdl/lex/commands/InsertCommand.java b/src/java/org/thdl/lex/commands/InsertCommand.java new file mode 100644 index 0000000..6736de6 --- /dev/null +++ b/src/java/org/thdl/lex/commands/InsertCommand.java @@ -0,0 +1,164 @@ +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.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 6, 2003 + */ +public class InsertCommand extends LexCommand implements Command +{ + + private boolean termMode; + + + /** + * Sets the termMode attribute of the GetFormCommand object + * + * @param termMode The new termMode value + */ + public void setTermMode( boolean termMode ) + { + this.termMode = termMode; + } + + + /** + * Gets the termMode attribute of the GetFormCommand object + * + * @return The termMode value + */ + public boolean isTermMode() + { + return termMode; + } + + + +//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 + { + String msg = null; + String next = getNext(); + DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); + try + { + HttpSession ses = req.getSession( false ); + if ( null == ses ) + { + throw new CommandException( "Could not update component, user's session has expired" ); + } + + LexQuery query = getSessionManager().getQuery( ses ); + ITerm term = query.getEntry(); + LexUser user = (LexUser) getSessionManager().getSessionUser( ses ); + Preferences prefs = getSessionManager().getPreferences( ses ); + + if ( CommandToken.isValid( req ) && validate( user, component ) ) + { + LexComponentRepository.update( term ); + if ( isTermMode() ) + { + term.populate( req.getParameterMap() ); + component = term; + } + else if ( component instanceof AnalyticalNote ) + { + ILexComponent parent = term.findParent( component.getParentId() ); + parent.getAnalyticalNotes().add( component ); + } + else + { + term.addChild( component ); + } + + Meta meta = new Meta( user, prefs ); + meta.populate( req.getParameterMap() ); + component.setMeta( meta ); + + Date now = new Date( System.currentTimeMillis() ); + component.getMeta().setCreatedOn( now ); + component.getMeta().setModifiedOn( now ); + component.getMeta().setCreatedBy( user.getId() ); + component.getMeta().setModifiedBy( user.getId() ); + + if ( !isTermMode() ) + { + term.getMeta().setModifiedOn( now ); + term.getMeta().setModifiedBy( user.getId() ); + } + + if ( !( component instanceof AnalyticalNote ) && null != req.getParameter( "analyticalNote" ) && req.getParameter( "analyticalNote" ).length() > 0 ) + { + AnalyticalNote note = new AnalyticalNote(); + note.setAnalyticalNote( req.getParameter( "analyticalNote" ) ); + note.setPrecedence( new Integer( 0 ) ); + component.setAnalyticalNotes( new LinkedList() ); + component.getAnalyticalNotes().add( note ); + meta = new Meta( user, prefs ); + meta.populate( req.getParameterMap() ); + note.setMeta( meta ); + LexLogger.debug( "Adding analytical note to " + component.getLabel() ); + } + + LexLogger.debugComponent( component ); + LexLogger.debugComponent( term ); + + LexComponentRepository.saveOrUpdate( term ); + + msg = "Successful Update"; + getSessionManager().setDisplayMode( req.getSession( true ), "edit" ); + } + else + { + msg = CommandToken.isValid( req ) ? "Unauthorized update attempted" : "Invalid reload attempted."; + } + return next; + } + catch ( LexComponentException e ) + { + throw new CommandException( e ); + } + catch ( LexRepositoryException e ) + { + throw new CommandException( "Command had trouble processing " + component, e ); + } + finally + { + req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); + } + } + +//constructors + /** + *Constructor for the GetFormCommand object + * + * @param next Description of the Parameter + * @param termMode Description of the Parameter + */ + public InsertCommand( String next, Boolean termMode ) + { + super( next ); + setTermMode( termMode.booleanValue() ); + } +} + diff --git a/src/java/org/thdl/lex/commands/LexCommand.java b/src/java/org/thdl/lex/commands/LexCommand.java index 9505399..74c9670 100644 --- a/src/java/org/thdl/lex/commands/LexCommand.java +++ b/src/java/org/thdl/lex/commands/LexCommand.java @@ -1,86 +1,47 @@ package org.thdl.lex.commands; - -import org.thdl.lex.*; -import org.thdl.lex.component.*; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.Map; //import org.apache.commons.beanutils.*; import javax.servlet.http.HttpServletRequest; -import java.util.LinkedList; -import java.util.HashMap; -import java.util.Map; + +import org.thdl.lex.*; +import org.thdl.lex.component.*; +import org.thdl.users.ThdlUser; /** * Description of the Class * - *@author travis - *@created October 3, 2003 + * @author travis + * @created October 3, 2003 */ public abstract class LexCommand implements Command { //attributes - private String defaultNext; private String next; - private ILexComponent component; - private LinkedList resultsList; - private HashMap forwards; - private UserSessionManager sessionMgr; + private UserSessionManager sessionManager; //accessors /** - * Sets the sessionMgr attribute of the LexCommand object + * Sets the sessionManager attribute of the LexCommand object * - *@param sessionMgr The new sessionMgr value - *@since + * @param sessionManager The new sessionManager value + * @since */ - public void setSessionManager( UserSessionManager sessionMgr ) + public void setSessionManager( UserSessionManager sessionManager ) { - this.sessionMgr = sessionMgr; - } - - - /** - * Sets the defaultNext attribute of the LexCommand object - * - *@param defaultNext The new defaultNext value - *@since - */ - public void setDefaultNext( String defaultNext ) - { - this.defaultNext = defaultNext; - } - - - /** - * Sets the forwards attribute of the LexCommand object - * - *@param forwards The new forwards value - *@since - */ - public void setForwards( HashMap forwards ) - { - this.forwards = forwards; - } - - - /** - * Sets the resultsList attribute of the LexCommand object - * - *@param resultsList The new resultsList value - *@since - */ - public void setResultsList( LinkedList resultsList ) - { - this.resultsList = resultsList; + this.sessionManager = sessionManager; } /** * Sets the next attribute of the LexCommand object * - *@param next The new next value - *@since + * @param next The new next value + * @since */ public void setNext( String next ) { @@ -88,76 +49,29 @@ public abstract class LexCommand implements Command } - /** - * Sets the component attribute of the LexCommand object - * - *@return The sessionMgr value - *@since - */ - /* - * public void setComponent( ILexComponent component ) - * { - * this.component = component; - * } - */ /** - * Gets the sessionMgr attribute of the LexCommand object + * Gets the sessionManager attribute of the LexCommand object * - *@return The sessionMgr value - *@since + * @return The sessionManager value + * @since */ public UserSessionManager getSessionManager() { - if ( null == sessionMgr ) + if ( null == sessionManager ) { setSessionManager( UserSessionManager.getInstance() ); } - return sessionMgr; + return sessionManager; } - /** - * Gets the defaultNext attribute of the LexCommand object - * - *@return The defaultNext value - *@since - */ - public String getDefaultNext() - { - return defaultNext; - } - - - /** - * Gets the forwards attribute of the LexCommand object - * - *@return The forwards value - *@since - */ - public HashMap getForwards() - { - return forwards; - } - - - /** - * Gets the resultsList attribute of the LexCommand object - * - *@return The resultsList value - *@since - */ - public LinkedList getResultsList() - { - return resultsList; - } - /** * Gets the next attribute of the LexCommand object * - *@return The next value - *@since + * @return The next value + * @since */ public String getNext() { @@ -168,36 +82,48 @@ public abstract class LexCommand implements Command /** * Gets the component attribute of the LexCommand object * - *@param next Description of Parameter - *@since + * @param user Description of the Parameter + * @param component Description of the Parameter + * @return Description of the Return Value + * @since */ /* - * public ILexComponent getComponent() - * { - * return component; - * } - */ + public ILexComponent getComponent() + { + return component; + } + */ //helpers + public boolean validate( ThdlUser user, ILexComponent component ) + { + boolean valid = false; + Integer creator = component.getMeta().getCreatedBy(); + + if ( user.getId().equals( creator ) || user.hasRole( "admin" ) || user.hasRole( "dev" ) ) + { + valid = true; + } + return valid; + } //constructors /** * Constructor for the LexCommand object * - *@param next Description of Parameter - *@since + * @param next Description of Parameter + * @since */ public LexCommand( String next ) { - setDefaultNext( next ); - setNext( getDefaultNext() ); + setNext( next ); } /** * Constructor for the LexCommand object * - *@since + * @since */ public LexCommand() { } } diff --git a/src/java/org/thdl/lex/commands/NewComponentCommand.java b/src/java/org/thdl/lex/commands/NewComponentCommand.java deleted file mode 100644 index f65bb50..0000000 --- a/src/java/org/thdl/lex/commands/NewComponentCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.thdl.lex.commands; - -import org.thdl.lex.*; -import org.thdl.lex.component.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; - -public class NewComponentCommand extends LexCommand implements Command -{ -//helper methods - public String execute(HttpServletRequest req, ILexComponent component) throws CommandException - { -/* try - { - - setComponent( (LexComponent)component ); - getComponent().scrapeRequest( req ); - String msg="You have reached the form for creating a New " +getComponent().getLabel() +" Entry."; - String forward = (String)getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) ); - setNext( forward ); - - if ( getComponent() instanceof Term ) - { - Term term = (Term)getComponent(); - LexComponent[] results = term.find(); - req.setAttribute( "term", term.getTerm() ); - if ( results.length > 0) - { - component=results[0]; - msg="There are already " + results.length + " entries for " + term.getTerm() +"."; - getSessionMgr().setEntry( req.getSession( true), new TermEntry( component ) ); - } - else - { - //REQUEST SHOULD BE FORWARDED TO /lex/action?cmd=getInsertForm HERE - results = new LexComponent[1]; - results[0] = component; - msg="Click the 'New Entry' button to add " + term.getTerm() +" to the dictionary."; - getSessionMgr().setEntry( req.getSession( true), null ); - } - setNext( "displayEntry.jsp?mode=newTerm"); - getSessionMgr().setResults( req.getSession( true ), results ); - } - req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg); - */ return getNext(); - /* } - catch (LexComponentException e) - { - throw new CommandException("Lex Action Exception: " + e.getMessage()); - } - catch (LexEntryException e) - { - throw new CommandException("Lex Entry Exception: " + e.getMessage()); - } - */ } - public HashMap initForwards() - { - HashMap map = new HashMap(); - map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" ); - map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" ); - map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" ); - return map; - } - -//constructors - public NewComponentCommand() - { - super(); - setForwards( initForwards() ); - } -} - diff --git a/src/java/org/thdl/lex/commands/NullCommand.java b/src/java/org/thdl/lex/commands/NullCommand.java index ea5e4f4..d97643b 100644 --- a/src/java/org/thdl/lex/commands/NullCommand.java +++ b/src/java/org/thdl/lex/commands/NullCommand.java @@ -16,7 +16,6 @@ public class NullCommand extends LexCommand implements Command setNext("menu.jsp"); return getNext(); } - public java.util.HashMap initForwards() { return null;} public NullCommand(String next) { super(next); diff --git a/src/java/org/thdl/lex/commands/PreferencesCommand.java b/src/java/org/thdl/lex/commands/PreferencesCommand.java index b003e4e..a56fd5e 100644 --- a/src/java/org/thdl/lex/commands/PreferencesCommand.java +++ b/src/java/org/thdl/lex/commands/PreferencesCommand.java @@ -24,94 +24,89 @@ public class PreferencesCommand extends LexCommand implements Command */ public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { - Preferences isb = UserSessionManager.getInstance().getPreferences( req.getSession( true ) ); - if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals( "setMetaPrefs" ) ) - { - isb.setLanguageSet( LexUtilities.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" ) ) - { - 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.setUseDefaultDialect( true ); - } - else - { - isb.setUseDefaultDialect( false ); - } - if ( null != req.getParameter( "useDefaultSource" ) && req.getParameter( "useDefaultSource" ).equals( "true" ) ) - { - isb.setUseDefaultSource( true ); - } - else - { - isb.setUseDefaultSource( false ); - } - if ( null != req.getParameter( "useDefaultProjSub" ) && req.getParameter( "useDefaultProjSub" ).equals( "true" ) ) - { - isb.setUseDefaultProjSub( true ); - } - else - { - isb.setUseDefaultProjSub( false ); - } - if ( null != req.getParameter( "useDefaultScript" ) && req.getParameter( "useDefaultScript" ).equals( "true" ) ) - { - isb.setUseDefaultScript( true ); - } - else - { - isb.setUseDefaultScript( false ); - } - if ( null != req.getParameter( "useDefaultNote" ) && req.getParameter( "useDefaultNote" ).equals( "true" ) ) - { - isb.setUseDefaultNote( true ); - } - else - { - isb.setUseDefaultNote( false ); - } - } try { + + Preferences isb = UserSessionManager.getInstance().getPreferences( req.getSession( true ) ); + if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals( "setMetaPrefs" ) ) + { + 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" ) ) + { + 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.setUseDefaultDialect( true ); + } + else + { + isb.setUseDefaultDialect( false ); + } + if ( null != req.getParameter( "useDefaultSource" ) && req.getParameter( "useDefaultSource" ).equals( "true" ) ) + { + isb.setUseDefaultSource( true ); + } + else + { + isb.setUseDefaultSource( false ); + } + if ( null != req.getParameter( "useDefaultProjSub" ) && req.getParameter( "useDefaultProjSub" ).equals( "true" ) ) + { + isb.setUseDefaultProjSub( true ); + } + else + { + isb.setUseDefaultProjSub( false ); + } + if ( null != req.getParameter( "useDefaultScript" ) && req.getParameter( "useDefaultScript" ).equals( "true" ) ) + { + isb.setUseDefaultScript( true ); + } + else + { + isb.setUseDefaultScript( false ); + } + if ( null != req.getParameter( "useDefaultNote" ) && req.getParameter( "useDefaultNote" ).equals( "true" ) ) + { + isb.setUseDefaultNote( true ); + } + else + { + isb.setUseDefaultNote( false ); + } + } isb.save(); } catch ( LexComponentException lre ) { throw new CommandException( "LexComponentException says: " + lre.getMessage() ); } + catch ( LexRepositoryException lre ) + { + throw new CommandException( "LexComponentException says: " + lre.getMessage() ); + } return getNext(); } - /** - * Description of the Method - * - * @return Description of the Return Value - */ - public java.util.HashMap initForwards() - { - return null; - } - /** *Constructor for the PreferencesCommand object diff --git a/src/java/org/thdl/lex/commands/RemoveCommand.java b/src/java/org/thdl/lex/commands/RemoveCommand.java index 8ae96f5..a62c020 100644 --- a/src/java/org/thdl/lex/commands/RemoveCommand.java +++ b/src/java/org/thdl/lex/commands/RemoveCommand.java @@ -1,56 +1,72 @@ 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.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 14, 2003 + */ public class RemoveCommand 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 - { - setComponent( (LexComponent)component ); - getComponent().query( Integer.parseInt( req.getParameter("id") ) ); - String msg=null; - String forward = (String)getForwards().get( req.getParameter( LexConstants.LABEL_REQ_PARAM ) ); - setNext( forward ); - int successCode = getComponent().remove(); - msg=null; - String label = req.getParameter( LexConstants.LABEL_REQ_PARAM ); - if (successCode > 0) - { msg = "The " + label +" was successfully removed."; } - else - { msg = "Failure: The " + getComponent().getLabel() +" was not removed."; } + DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); - req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg); - */ return getNext(); - /* } - catch (LexComponentException e) - { - throw new CommandException("Lex Action Exception: " + e.getMessage()); - } - */ } - public HashMap initForwards() - { - HashMap map = new HashMap(); - map.put( LexConstants.TERMLABEL_VALUE, "menu.jsp" ); - // map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" ); - return map; + /* + try + { + setComponent( (LexComponent)component ); + getComponent().query( Integer.parseInt( req.getParameter("id") ) ); + String msg=null; + int successCode = getComponent().remove(); + msg=null; + String label = req.getParameter( LexConstants.LABEL_REQ_PARAM ); + if (successCode > 0) + { msg = "The " + label +" was successfully removed."; } + else + { msg = "Failure: The " + getComponent().getLabel() +" was not removed."; } + req.setAttribute(LexConstants.MESSAGE_REQ_ATTR, msg); + */ + return getNext(); + /* + } + catch (LexComponentException e) + { + throw new CommandException("Lex Action Exception: " + e.getMessage()); + } + */ } + + //constructors - public RemoveCommand() + /** + *Constructor for the RemoveCommand object + * + * @param next Description of the Parameter + */ + public RemoveCommand( String next ) { - super(); - setForwards( initForwards() ); + super( next ); } } diff --git a/src/java/org/thdl/lex/commands/TestingCommand.java b/src/java/org/thdl/lex/commands/TestingCommand.java deleted file mode 100644 index d979a9b..0000000 --- a/src/java/org/thdl/lex/commands/TestingCommand.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.thdl.lex.commands; - -import org.thdl.lex.*; -import org.thdl.lex.component.*; - -import javax.servlet.http.HttpServletRequest; - -public class TestingCommand extends LexCommand implements Command -{ - public String execute(HttpServletRequest req, ILexComponent component) throws CommandException - { - - try { - /* Term term = new Term(); - term.setId( 1 ); - term.setTerm( "this is a word" ); - term.setAnalyticalNotes( new java.util.Vector() ); - term.getAnalyticalNotes().add( "hi" ); - term.getAnalyticalNotes().add( "there" ); - req.setAttribute( "term", term ); */ - return getNext(); - } - catch (Exception e) { throw new CommandException( e.toString() + e.getMessage() ); } - } - public java.util.HashMap initForwards() { return null;} - public TestingCommand(String next) - { - super(next); - } -} diff --git a/src/java/org/thdl/lex/commands/UpdateCommand.java b/src/java/org/thdl/lex/commands/UpdateCommand.java index f3e3466..2f468e2 100644 --- a/src/java/org/thdl/lex/commands/UpdateCommand.java +++ b/src/java/org/thdl/lex/commands/UpdateCommand.java @@ -20,7 +20,6 @@ import org.thdl.users.*; public class UpdateCommand extends LexCommand implements Command { - private boolean insertMode; private boolean termMode; @@ -46,26 +45,6 @@ public class UpdateCommand extends LexCommand implements Command } - /** - * Sets the insertMode attribute of the GetFormCommand object - * - * @param insertMode The new insertMode value - */ - public void setInsertMode( boolean insertMode ) - { - this.insertMode = insertMode; - } - - - /** - * Gets the insertMode attribute of the GetFormCommand object - * - * @return The insertMode value - */ - public boolean isInsertMode() - { - return insertMode; - } //helper methods /** @@ -79,39 +58,61 @@ public class UpdateCommand extends LexCommand implements Command public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { String msg = null; + String next = getNext(); + DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); try { - if ( CommandToken.isValid( req ) ) + HttpSession ses = req.getSession( false ); + if ( null == ses ) { - HttpSession ses = req.getSession( false ); - if ( null == ses ) - { - throw new CommandException( "Could not update component, uses session has expired" ); - } - ThdlUser user = getSessionManager().getSessionUser( ses ); - LexQuery query = getSessionManager().getQuery( ses ); + throw new CommandException( "Could not update component, user's session has expired" ); + } - Map params = req.getParameterMap(); - query.getUpdateComponent().populate( params ); - query.getUpdateComponent().getMeta().populate( params ); - Date now = new Date( System.currentTimeMillis() ); - query.getUpdateComponent().getMeta().setModifiedOn( now ); - query.getUpdateComponent().getMeta().setModifiedBy( user.getId() ); - if ( isInsertMode() ) + ThdlUser user = getSessionManager().getSessionUser( ses ); + LexQuery query = getSessionManager().getQuery( ses ); + ITerm term = query.getEntry(); + + if ( CommandToken.isValid( req ) && validate( user, component ) ) + { + LexComponentRepository.update( term ); + + LexLogger.debug( "Checking component state from updateCommand BEFORE component assignment" ); + LexLogger.debugComponent( component ); + if ( isTermMode() ) { - query.getUpdateComponent().getMeta().setCreatedOn( now ); - query.getUpdateComponent().getMeta().setCreatedBy( user.getId() ); + term.populate( req.getParameterMap() ); + term.getMeta().populate( req.getParameterMap() ); + component = term; } - ITerm term = query.getEntry(); - LexComponentRepository.saveOrUpdate( term ); + else + { + ILexComponent ilc = term.findChild( component.getMetaId() ); + ilc.populate( req.getParameterMap() ); + ilc.getMeta().populate( req.getParameterMap() ); + component = ilc; + } + LexLogger.debug( "Checking component state from updateCommand AFTER component assignment" ); + LexLogger.debugComponent( component ); + + Date now = new Date( System.currentTimeMillis() ); + component.getMeta().setModifiedOn( now ); + component.getMeta().setModifiedBy( user.getId() ); + term.getMeta().setModifiedOn( now ); + term.getMeta().setModifiedBy( user.getId() ); + + LexLogger.debugComponent( component ); + LexLogger.debugComponent( term ); + + LexComponentRepository.update( term ); + msg = "Successful Update"; getSessionManager().setDisplayMode( req.getSession( true ), "edit" ); } else { - msg = "Invalid Reload Attempted."; + msg = CommandToken.isValid( req ) ? "Unauthorized update attempted" : "Invalid reload attempted."; } - return getNext(); + return next; } catch ( LexComponentException e ) { @@ -127,48 +128,18 @@ public class UpdateCommand extends LexCommand implements Command } } - - /** - * Description of the Method - * - * @return Description of the Return Value - */ - public HashMap initForwards() - { - HashMap map = new HashMap(); - // map.put( LexConstants.TERMLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.SUBDEFINITIONLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.TRANSLATIONLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.DEFINITIONLABEL_VALUE, "displayEntry.jsp" ); - // map.put( LexConstants.PASSAGELABEL_VALUE, "displayEntry.jsp" ); - return map; - } - //constructors /** *Constructor for the GetFormCommand object * - * @param next Description of the Parameter - * @param insertMode Description of the Parameter - * @param termMode Description of the Parameter + * @param next Description of the Parameter + * @param termMode Description of the Parameter */ - public UpdateCommand( String next, Boolean insertMode, Boolean termMode ) + public UpdateCommand( String next, Boolean termMode ) { super( next ); - setInsertMode( insertMode.booleanValue() ); setTermMode( termMode.booleanValue() ); } - - /** - *Constructor for the GetFormCommand object - * - * @param next Description of the Parameter - * @param insertMode Description of the Parameter - */ - public UpdateCommand( String next, Boolean insertMode ) - { - this( next, insertMode, Boolean.FALSE ); - } } diff --git a/src/java/org/thdl/lex/component/BaseAnalyticalNote.java b/src/java/org/thdl/lex/component/BaseAnalyticalNote.java index 34f7023..27c2929 100644 --- a/src/java/org/thdl/lex/component/BaseAnalyticalNote.java +++ b/src/java/org/thdl/lex/component/BaseAnalyticalNote.java @@ -11,7 +11,7 @@ abstract public class BaseAnalyticalNote extends LexComponent implements Seriali private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String analyticalNote; @@ -20,7 +20,7 @@ abstract public class BaseAnalyticalNote extends LexComponent implements Seriali private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseAnalyticalNote(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String analyticalNote, org.thdl.lex.component.ILexComponent parent) { + public BaseAnalyticalNote(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String analyticalNote, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -45,11 +45,11 @@ abstract public class BaseAnalyticalNote extends LexComponent implements Seriali this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseDefinition.java b/src/java/org/thdl/lex/component/BaseDefinition.java index 92d50ca..f3b419a 100644 --- a/src/java/org/thdl/lex/component/BaseDefinition.java +++ b/src/java/org/thdl/lex/component/BaseDefinition.java @@ -6,13 +6,13 @@ import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ -abstract public class BaseDefinition extends LexComponent implements org.thdl.lex.component.IDefinition,Serializable,org.thdl.lex.component.Translatable { +abstract public class BaseDefinition extends LexComponent implements org.thdl.lex.component.IDefinition,org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode,Serializable { /** nullable persistent field */ private java.lang.Integer parentId; /** persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String definition; @@ -51,7 +51,7 @@ abstract public class BaseDefinition extends LexComponent implements org.thdl.le private Set translations; /** full constructor */ - public BaseDefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String definition, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { + public BaseDefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String definition, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -74,7 +74,7 @@ abstract public class BaseDefinition extends LexComponent implements org.thdl.le } /** minimal constructor */ - public BaseDefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Short precedence, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { + public BaseDefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer precedence, List subdefinitions, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { super(deleted, analyticalNotes, meta); this.precedence = precedence; this.subdefinitions = subdefinitions; @@ -96,11 +96,11 @@ abstract public class BaseDefinition extends LexComponent implements org.thdl.le this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java b/src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java index d93ea32..f061b4b 100644 --- a/src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java +++ b/src/java/org/thdl/lex/component/BaseEncyclopediaArticle.java @@ -11,7 +11,7 @@ abstract public class BaseEncyclopediaArticle extends LexComponent implements or private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ private java.lang.String article; @@ -23,7 +23,7 @@ abstract public class BaseEncyclopediaArticle extends LexComponent implements or private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseEncyclopediaArticle(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String article, java.lang.String articleTitle, org.thdl.lex.component.ILexComponent parent) { + public BaseEncyclopediaArticle(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String article, java.lang.String articleTitle, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -51,11 +51,11 @@ abstract public class BaseEncyclopediaArticle extends LexComponent implements or this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseEtymology.java b/src/java/org/thdl/lex/component/BaseEtymology.java index 5a66683..5a46e76 100644 --- a/src/java/org/thdl/lex/component/BaseEtymology.java +++ b/src/java/org/thdl/lex/component/BaseEtymology.java @@ -6,19 +6,19 @@ import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ -abstract public class BaseEtymology extends LexComponent implements Serializable,org.thdl.lex.component.IEtymology,org.thdl.lex.component.Translatable { +abstract public class BaseEtymology extends LexComponent implements org.thdl.lex.component.Translatable,Serializable,org.thdl.lex.component.IEtymology { /** nullable persistent field */ private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ - private java.lang.Short loanLanguage; + private java.lang.Integer loanLanguage; /** persistent field */ - private java.lang.Short etymologyType; + private java.lang.Integer etymologyType; /** persistent field */ private java.lang.String derivation; @@ -36,7 +36,7 @@ abstract public class BaseEtymology extends LexComponent implements Serializable private Set translations; /** full constructor */ - public BaseEtymology(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short loanLanguage, java.lang.Short etymologyType, java.lang.String derivation, java.lang.String etymologyDescription, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { + public BaseEtymology(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.Integer loanLanguage, java.lang.Integer etymologyType, java.lang.String derivation, java.lang.String etymologyDescription, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -54,7 +54,7 @@ abstract public class BaseEtymology extends LexComponent implements Serializable } /** minimal constructor */ - public BaseEtymology(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Short etymologyType, java.lang.String derivation, java.lang.String etymologyDescription, Set translations) { + public BaseEtymology(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer etymologyType, java.lang.String derivation, java.lang.String etymologyDescription, Set translations) { super(deleted, analyticalNotes, meta); this.etymologyType = etymologyType; this.derivation = derivation; @@ -70,27 +70,27 @@ abstract public class BaseEtymology extends LexComponent implements Serializable this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } - public java.lang.Short getLoanLanguage() { + public java.lang.Integer getLoanLanguage() { return this.loanLanguage; } - public void setLoanLanguage(java.lang.Short loanLanguage) { + public void setLoanLanguage(java.lang.Integer loanLanguage) { this.loanLanguage = loanLanguage; } - public java.lang.Short getEtymologyType() { + public java.lang.Integer getEtymologyType() { return this.etymologyType; } - public void setEtymologyType(java.lang.Short etymologyType) { + public void setEtymologyType(java.lang.Integer etymologyType) { this.etymologyType = etymologyType; } diff --git a/src/java/org/thdl/lex/component/BaseFunction.java b/src/java/org/thdl/lex/component/BaseFunction.java deleted file mode 100644 index 92f4300..0000000 --- a/src/java/org/thdl/lex/component/BaseFunction.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.thdl.lex.component; - -import java.io.Serializable; -import java.util.List; -import java.util.Set; -import org.apache.commons.lang.builder.ToStringBuilder; - -/** @author Hibernate CodeGenerator */ -abstract public class BaseFunction extends LexComponent implements org.thdl.lex.component.IFunction,Serializable { - - /** nullable persistent field */ - private java.lang.Integer parentId; - - /** nullable persistent field */ - private java.lang.Short precedence; - - /** persistent field */ - private java.lang.Short function; - - /** nullable persistent field */ - private org.thdl.lex.component.ILexComponent parent; - - /** full constructor */ - public BaseFunction(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short function, org.thdl.lex.component.ILexComponent parent) { - super(translationOf, deleted, analyticalNotes, translations, meta); - this.parentId = parentId; - this.precedence = precedence; - this.function = function; - this.parent = parent; - } - - /** default constructor */ - public BaseFunction() { - } - - /** minimal constructor */ - public BaseFunction(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short function) { - super(deleted, analyticalNotes, translations, meta); - this.function = function; - } - - public java.lang.Integer getParentId() { - return this.parentId; - } - - public void setParentId(java.lang.Integer parentId) { - this.parentId = parentId; - } - - public java.lang.Short getPrecedence() { - return this.precedence; - } - - public void setPrecedence(java.lang.Short precedence) { - this.precedence = precedence; - } - - public java.lang.Short getFunction() { - return this.function; - } - - public void setFunction(java.lang.Short function) { - this.function = function; - } - - public org.thdl.lex.component.ILexComponent getParent() { - return this.parent; - } - - public void setParent(org.thdl.lex.component.ILexComponent parent) { - this.parent = parent; - } - - public String toString() { - return new ToStringBuilder(this) - .append("metaId", getMetaId()) - .toString(); - } - -} diff --git a/src/java/org/thdl/lex/component/BaseGloss.java b/src/java/org/thdl/lex/component/BaseGloss.java index 7d87e91..47e9a41 100644 --- a/src/java/org/thdl/lex/component/BaseGloss.java +++ b/src/java/org/thdl/lex/component/BaseGloss.java @@ -11,7 +11,7 @@ abstract public class BaseGloss extends LexComponent implements org.thdl.lex.com private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String gloss; @@ -23,7 +23,7 @@ abstract public class BaseGloss extends LexComponent implements org.thdl.lex.com private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseGloss(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String gloss, java.lang.String translation, org.thdl.lex.component.ILexComponent parent) { + public BaseGloss(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String gloss, java.lang.String translation, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -49,11 +49,11 @@ abstract public class BaseGloss extends LexComponent implements org.thdl.lex.com this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseGrammaticalFunction.java b/src/java/org/thdl/lex/component/BaseGrammaticalFunction.java index c6dcddf..44b07b7 100644 --- a/src/java/org/thdl/lex/component/BaseGrammaticalFunction.java +++ b/src/java/org/thdl/lex/component/BaseGrammaticalFunction.java @@ -11,16 +11,16 @@ abstract public class BaseGrammaticalFunction extends LexComponent implements or private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ - private java.lang.Short function; + private java.lang.Integer function; /** nullable persistent field */ private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseGrammaticalFunction(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short function, org.thdl.lex.component.ILexComponent parent) { + public BaseGrammaticalFunction(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.Integer function, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -33,7 +33,7 @@ abstract public class BaseGrammaticalFunction extends LexComponent implements or } /** minimal constructor */ - public BaseGrammaticalFunction(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Short function) { + public BaseGrammaticalFunction(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer function) { super(deleted, analyticalNotes, meta); this.function = function; } @@ -46,19 +46,19 @@ abstract public class BaseGrammaticalFunction extends LexComponent implements or this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } - public java.lang.Short getFunction() { + public java.lang.Integer getFunction() { return this.function; } - public void setFunction(java.lang.Short function) { + public void setFunction(java.lang.Integer function) { this.function = function; } diff --git a/src/java/org/thdl/lex/component/BaseKeyword.java b/src/java/org/thdl/lex/component/BaseKeyword.java index 1065426..b3c540e 100644 --- a/src/java/org/thdl/lex/component/BaseKeyword.java +++ b/src/java/org/thdl/lex/component/BaseKeyword.java @@ -11,7 +11,7 @@ abstract public class BaseKeyword extends LexComponent implements org.thdl.lex.c private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String keyword; @@ -20,7 +20,7 @@ abstract public class BaseKeyword extends LexComponent implements org.thdl.lex.c private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseKeyword(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String keyword, org.thdl.lex.component.ILexComponent parent) { + public BaseKeyword(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String keyword, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -45,11 +45,11 @@ abstract public class BaseKeyword extends LexComponent implements org.thdl.lex.c this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseMeta.java b/src/java/org/thdl/lex/component/BaseMeta.java index 90e12e9..d98aadc 100644 --- a/src/java/org/thdl/lex/component/BaseMeta.java +++ b/src/java/org/thdl/lex/component/BaseMeta.java @@ -28,19 +28,19 @@ abstract public class BaseMeta implements Serializable { private java.lang.Integer source; /** persistent field */ - private java.lang.Short language; + private java.lang.Integer language; /** persistent field */ - private java.lang.Short script; + private java.lang.Integer script; /** persistent field */ - private java.lang.Short dialect; + private java.lang.Integer dialect; /** nullable persistent field */ private java.lang.String note; /** full constructor */ - public BaseMeta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.util.Date createdOn, java.util.Date modifiedOn, java.lang.Integer source, java.lang.Short language, java.lang.Short script, java.lang.Short dialect, java.lang.String note) { + public BaseMeta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.util.Date createdOn, java.util.Date modifiedOn, java.lang.Integer source, java.lang.Integer language, java.lang.Integer script, java.lang.Integer dialect, java.lang.String note) { this.createdBy = createdBy; this.modifiedBy = modifiedBy; this.createdByProjSub = createdByProjSub; @@ -59,7 +59,7 @@ abstract public class BaseMeta implements Serializable { } /** minimal constructor */ - public BaseMeta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.lang.Integer source, java.lang.Short language, java.lang.Short script, java.lang.Short dialect) { + public BaseMeta(java.lang.Integer createdBy, java.lang.Integer modifiedBy, java.lang.Integer createdByProjSub, java.lang.Integer modifiedByProjSub, java.lang.Integer source, java.lang.Integer language, java.lang.Integer script, java.lang.Integer dialect) { this.createdBy = createdBy; this.modifiedBy = modifiedBy; this.createdByProjSub = createdByProjSub; @@ -126,27 +126,27 @@ abstract public class BaseMeta implements Serializable { this.source = source; } - public java.lang.Short getLanguage() { + public java.lang.Integer getLanguage() { return this.language; } - public void setLanguage(java.lang.Short language) { + public void setLanguage(java.lang.Integer language) { this.language = language; } - public java.lang.Short getScript() { + public java.lang.Integer getScript() { return this.script; } - public void setScript(java.lang.Short script) { + public void setScript(java.lang.Integer script) { this.script = script; } - public java.lang.Short getDialect() { + public java.lang.Integer getDialect() { return this.dialect; } - public void setDialect(java.lang.Short dialect) { + public void setDialect(java.lang.Integer dialect) { this.dialect = dialect; } diff --git a/src/java/org/thdl/lex/component/BaseModelSentence.java b/src/java/org/thdl/lex/component/BaseModelSentence.java index 221f4f1..8625a56 100644 --- a/src/java/org/thdl/lex/component/BaseModelSentence.java +++ b/src/java/org/thdl/lex/component/BaseModelSentence.java @@ -6,16 +6,13 @@ import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ -abstract public class BaseModelSentence extends LexComponent implements org.thdl.lex.component.Translatable,org.thdl.lex.component.IModelSentence,Serializable { +abstract public class BaseModelSentence extends LexComponent implements org.thdl.lex.component.IModelSentence,Serializable,org.thdl.lex.component.Translatable { /** nullable persistent field */ private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; - - /** persistent field */ - private java.lang.Integer subdefinitionId; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String modelSentence; @@ -30,11 +27,10 @@ abstract public class BaseModelSentence extends LexComponent implements org.thdl private Set translations; /** full constructor */ - public BaseModelSentence(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Integer subdefinitionId, java.lang.String modelSentence, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { + public BaseModelSentence(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String modelSentence, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; - this.subdefinitionId = subdefinitionId; this.modelSentence = modelSentence; this.translationOf = translationOf; this.parent = parent; @@ -46,9 +42,8 @@ abstract public class BaseModelSentence extends LexComponent implements org.thdl } /** minimal constructor */ - public BaseModelSentence(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer subdefinitionId, Set translations) { + public BaseModelSentence(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, Set translations) { super(deleted, analyticalNotes, meta); - this.subdefinitionId = subdefinitionId; this.translations = translations; } @@ -60,22 +55,14 @@ abstract public class BaseModelSentence extends LexComponent implements org.thdl this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } - public java.lang.Integer getSubdefinitionId() { - return this.subdefinitionId; - } - - public void setSubdefinitionId(java.lang.Integer subdefinitionId) { - this.subdefinitionId = subdefinitionId; - } - public java.lang.String getModelSentence() { return this.modelSentence; } diff --git a/src/java/org/thdl/lex/component/BasePassage.java b/src/java/org/thdl/lex/component/BasePassage.java index 5c0bd74..2315dd4 100644 --- a/src/java/org/thdl/lex/component/BasePassage.java +++ b/src/java/org/thdl/lex/component/BasePassage.java @@ -12,7 +12,7 @@ abstract public class BasePassage extends LexComponent implements org.thdl.lex.c private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String literarySource; @@ -36,7 +36,7 @@ abstract public class BasePassage extends LexComponent implements org.thdl.lex.c private Set translations; /** full constructor */ - public BasePassage(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String literarySource, java.lang.String spelling, java.lang.String pagination, java.lang.String passage, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { + public BasePassage(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String literarySource, java.lang.String spelling, java.lang.String pagination, java.lang.String passage, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, Set translations) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -67,11 +67,11 @@ abstract public class BasePassage extends LexComponent implements org.thdl.lex.c this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BasePronunciation.java b/src/java/org/thdl/lex/component/BasePronunciation.java index 61a9c48..9c23860 100644 --- a/src/java/org/thdl/lex/component/BasePronunciation.java +++ b/src/java/org/thdl/lex/component/BasePronunciation.java @@ -11,19 +11,19 @@ abstract public class BasePronunciation extends LexComponent implements org.thdl private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ private java.lang.String phonetics; /** persistent field */ - private java.lang.Short phoneticsType; + private java.lang.Integer phoneticsType; /** nullable persistent field */ private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BasePronunciation(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String phonetics, java.lang.Short phoneticsType, org.thdl.lex.component.ILexComponent parent) { + public BasePronunciation(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String phonetics, java.lang.Integer phoneticsType, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -37,7 +37,7 @@ abstract public class BasePronunciation extends LexComponent implements org.thdl } /** minimal constructor */ - public BasePronunciation(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.String phonetics, java.lang.Short phoneticsType) { + public BasePronunciation(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.String phonetics, java.lang.Integer phoneticsType) { super(deleted, analyticalNotes, meta); this.phonetics = phonetics; this.phoneticsType = phoneticsType; @@ -51,11 +51,11 @@ abstract public class BasePronunciation extends LexComponent implements org.thdl this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } @@ -67,11 +67,11 @@ abstract public class BasePronunciation extends LexComponent implements org.thdl this.phonetics = phonetics; } - public java.lang.Short getPhoneticsType() { + public java.lang.Integer getPhoneticsType() { return this.phoneticsType; } - public void setPhoneticsType(java.lang.Short phoneticsType) { + public void setPhoneticsType(java.lang.Integer phoneticsType) { this.phoneticsType = phoneticsType; } diff --git a/src/java/org/thdl/lex/component/BaseRegister.java b/src/java/org/thdl/lex/component/BaseRegister.java deleted file mode 100644 index 975b397..0000000 --- a/src/java/org/thdl/lex/component/BaseRegister.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.thdl.lex.component; - -import java.io.Serializable; -import java.util.List; -import java.util.Set; -import org.apache.commons.lang.builder.ToStringBuilder; - -/** @author Hibernate CodeGenerator */ -abstract public class BaseRegister extends LexComponent implements org.thdl.lex.component.IRegister,Serializable { - - /** nullable persistent field */ - private java.lang.Integer parentId; - - /** nullable persistent field */ - private java.lang.Short precedence; - - /** persistent field */ - private java.lang.Short register; - - /** nullable persistent field */ - private org.thdl.lex.component.ILexComponent parent; - - /** full constructor */ - public BaseRegister(java.lang.Integer translationOf, java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short register, org.thdl.lex.component.ILexComponent parent) { - super(translationOf, deleted, analyticalNotes, translations, meta); - this.parentId = parentId; - this.precedence = precedence; - this.register = register; - this.parent = parent; - } - - /** default constructor */ - public BaseRegister() { - } - - /** minimal constructor */ - public BaseRegister(java.lang.Boolean deleted, List analyticalNotes, Set translations, org.thdl.lex.component.Meta meta, java.lang.Short register) { - super(deleted, analyticalNotes, translations, meta); - this.register = register; - } - - public java.lang.Integer getParentId() { - return this.parentId; - } - - public void setParentId(java.lang.Integer parentId) { - this.parentId = parentId; - } - - public java.lang.Short getPrecedence() { - return this.precedence; - } - - public void setPrecedence(java.lang.Short precedence) { - this.precedence = precedence; - } - - public java.lang.Short getRegister() { - return this.register; - } - - public void setRegister(java.lang.Short register) { - this.register = register; - } - - public org.thdl.lex.component.ILexComponent getParent() { - return this.parent; - } - - public void setParent(org.thdl.lex.component.ILexComponent parent) { - this.parent = parent; - } - - public String toString() { - return new ToStringBuilder(this) - .append("metaId", getMetaId()) - .toString(); - } - -} diff --git a/src/java/org/thdl/lex/component/BaseRelatedTerm.java b/src/java/org/thdl/lex/component/BaseRelatedTerm.java index 06b5973..8c55e59 100644 --- a/src/java/org/thdl/lex/component/BaseRelatedTerm.java +++ b/src/java/org/thdl/lex/component/BaseRelatedTerm.java @@ -11,19 +11,19 @@ abstract public class BaseRelatedTerm extends LexComponent implements Serializab private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String relatedTerm; /** persistent field */ - private java.lang.Short relatedTermType; + private java.lang.Integer relatedTermType; /** nullable persistent field */ private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseRelatedTerm(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String relatedTerm, java.lang.Short relatedTermType, org.thdl.lex.component.ILexComponent parent) { + public BaseRelatedTerm(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String relatedTerm, java.lang.Integer relatedTermType, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -37,7 +37,7 @@ abstract public class BaseRelatedTerm extends LexComponent implements Serializab } /** minimal constructor */ - public BaseRelatedTerm(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Short relatedTermType) { + public BaseRelatedTerm(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer relatedTermType) { super(deleted, analyticalNotes, meta); this.relatedTermType = relatedTermType; } @@ -50,11 +50,11 @@ abstract public class BaseRelatedTerm extends LexComponent implements Serializab this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } @@ -66,11 +66,11 @@ abstract public class BaseRelatedTerm extends LexComponent implements Serializab this.relatedTerm = relatedTerm; } - public java.lang.Short getRelatedTermType() { + public java.lang.Integer getRelatedTermType() { return this.relatedTermType; } - public void setRelatedTermType(java.lang.Short relatedTermType) { + public void setRelatedTermType(java.lang.Integer relatedTermType) { this.relatedTermType = relatedTermType; } diff --git a/src/java/org/thdl/lex/component/BaseSpeechRegister.java b/src/java/org/thdl/lex/component/BaseSpeechRegister.java index 469a4e6..4dc82e8 100644 --- a/src/java/org/thdl/lex/component/BaseSpeechRegister.java +++ b/src/java/org/thdl/lex/component/BaseSpeechRegister.java @@ -11,16 +11,16 @@ abstract public class BaseSpeechRegister extends LexComponent implements org.thd private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ - private java.lang.Short register; + private java.lang.Integer register; /** nullable persistent field */ private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseSpeechRegister(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short register, org.thdl.lex.component.ILexComponent parent) { + public BaseSpeechRegister(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.Integer register, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -33,7 +33,7 @@ abstract public class BaseSpeechRegister extends LexComponent implements org.thd } /** minimal constructor */ - public BaseSpeechRegister(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Short register) { + public BaseSpeechRegister(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer register) { super(deleted, analyticalNotes, meta); this.register = register; } @@ -46,19 +46,19 @@ abstract public class BaseSpeechRegister extends LexComponent implements org.thd this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } - public java.lang.Short getRegister() { + public java.lang.Integer getRegister() { return this.register; } - public void setRegister(java.lang.Short register) { + public void setRegister(java.lang.Integer register) { this.register = register; } diff --git a/src/java/org/thdl/lex/component/BaseSpelling.java b/src/java/org/thdl/lex/component/BaseSpelling.java index acecb20..8ee7f0a 100644 --- a/src/java/org/thdl/lex/component/BaseSpelling.java +++ b/src/java/org/thdl/lex/component/BaseSpelling.java @@ -11,19 +11,19 @@ abstract public class BaseSpelling extends LexComponent implements Serializable, private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ private java.lang.String spelling; /** persistent field */ - private java.lang.Short spellingType; + private java.lang.Integer spellingType; /** nullable persistent field */ private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseSpelling(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String spelling, java.lang.Short spellingType, org.thdl.lex.component.ILexComponent parent) { + public BaseSpelling(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String spelling, java.lang.Integer spellingType, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -37,7 +37,7 @@ abstract public class BaseSpelling extends LexComponent implements Serializable, } /** minimal constructor */ - public BaseSpelling(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.String spelling, java.lang.Short spellingType) { + public BaseSpelling(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.String spelling, java.lang.Integer spellingType) { super(deleted, analyticalNotes, meta); this.spelling = spelling; this.spellingType = spellingType; @@ -51,11 +51,11 @@ abstract public class BaseSpelling extends LexComponent implements Serializable, this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } @@ -67,11 +67,11 @@ abstract public class BaseSpelling extends LexComponent implements Serializable, this.spelling = spelling; } - public java.lang.Short getSpellingType() { + public java.lang.Integer getSpellingType() { return this.spellingType; } - public void setSpellingType(java.lang.Short spellingType) { + public void setSpellingType(java.lang.Integer spellingType) { this.spellingType = spellingType; } diff --git a/src/java/org/thdl/lex/component/BaseSubdefinition.java b/src/java/org/thdl/lex/component/BaseSubdefinition.java index 9d896f9..5c782e0 100644 --- a/src/java/org/thdl/lex/component/BaseSubdefinition.java +++ b/src/java/org/thdl/lex/component/BaseSubdefinition.java @@ -6,13 +6,13 @@ import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ -abstract public class BaseSubdefinition extends LexComponent implements org.thdl.lex.component.ISubdefinition,Serializable,org.thdl.lex.component.Translatable { +abstract public class BaseSubdefinition extends LexComponent implements org.thdl.lex.component.ISubdefinition,org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode,Serializable { /** nullable persistent field */ private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String subdefinition; @@ -48,7 +48,7 @@ abstract public class BaseSubdefinition extends LexComponent implements org.thdl private Set translations; /** full constructor */ - public BaseSubdefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String subdefinition, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { + public BaseSubdefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String subdefinition, java.lang.Integer translationOf, org.thdl.lex.component.ILexComponent parent, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers, Set translations) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -90,11 +90,11 @@ abstract public class BaseSubdefinition extends LexComponent implements org.thdl this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseTerm.java b/src/java/org/thdl/lex/component/BaseTerm.java index a6276a9..026bac8 100644 --- a/src/java/org/thdl/lex/component/BaseTerm.java +++ b/src/java/org/thdl/lex/component/BaseTerm.java @@ -5,13 +5,13 @@ import java.util.List; import org.apache.commons.lang.builder.ToStringBuilder; /** @author Hibernate CodeGenerator */ -abstract public class BaseTerm extends LexComponent implements org.thdl.lex.component.ITerm,Serializable { +abstract public class BaseTerm extends LexComponent implements org.thdl.lex.component.ITerm,Serializable,org.thdl.lex.component.LexComponentNode { /** persistent field */ private java.lang.String term; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** persistent field */ private List pronunciations; @@ -56,7 +56,7 @@ abstract public class BaseTerm extends LexComponent implements org.thdl.lex.comp private List registers; /** full constructor */ - public BaseTerm(java.lang.Boolean deleted, List analyticalNotes, 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) { + public BaseTerm(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.String term, java.lang.Integer 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(deleted, analyticalNotes, meta); this.term = term; this.precedence = precedence; @@ -108,11 +108,11 @@ abstract public class BaseTerm extends LexComponent implements org.thdl.lex.comp this.term = term; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/BaseTransitionalData.java b/src/java/org/thdl/lex/component/BaseTransitionalData.java index 36decb8..f231661 100644 --- a/src/java/org/thdl/lex/component/BaseTransitionalData.java +++ b/src/java/org/thdl/lex/component/BaseTransitionalData.java @@ -11,10 +11,10 @@ abstract public class BaseTransitionalData extends LexComponent implements org.t private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ - private java.lang.Short transitionalDataLabel; + private java.lang.Integer transitionalDataLabel; /** persistent field */ private java.lang.String forPublicConsumption; @@ -26,7 +26,7 @@ abstract public class BaseTransitionalData extends LexComponent implements org.t private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseTransitionalData(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.Short transitionalDataLabel, java.lang.String forPublicConsumption, java.lang.String transitionalDataText, org.thdl.lex.component.ILexComponent parent) { + public BaseTransitionalData(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.Integer transitionalDataLabel, java.lang.String forPublicConsumption, java.lang.String transitionalDataText, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -54,19 +54,19 @@ abstract public class BaseTransitionalData extends LexComponent implements org.t this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } - public java.lang.Short getTransitionalDataLabel() { + public java.lang.Integer getTransitionalDataLabel() { return this.transitionalDataLabel; } - public void setTransitionalDataLabel(java.lang.Short transitionalDataLabel) { + public void setTransitionalDataLabel(java.lang.Integer transitionalDataLabel) { this.transitionalDataLabel = transitionalDataLabel; } diff --git a/src/java/org/thdl/lex/component/BaseTranslationEquivalent.java b/src/java/org/thdl/lex/component/BaseTranslationEquivalent.java index fdb1d33..7e58df0 100644 --- a/src/java/org/thdl/lex/component/BaseTranslationEquivalent.java +++ b/src/java/org/thdl/lex/component/BaseTranslationEquivalent.java @@ -11,7 +11,7 @@ abstract public class BaseTranslationEquivalent extends LexComponent implements private java.lang.Integer parentId; /** nullable persistent field */ - private java.lang.Short precedence; + private java.lang.Integer precedence; /** nullable persistent field */ private java.lang.String translationEquivalent; @@ -20,7 +20,7 @@ abstract public class BaseTranslationEquivalent extends LexComponent implements private org.thdl.lex.component.ILexComponent parent; /** full constructor */ - public BaseTranslationEquivalent(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Short precedence, java.lang.String translationEquivalent, org.thdl.lex.component.ILexComponent parent) { + public BaseTranslationEquivalent(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, java.lang.Integer parentId, java.lang.Integer precedence, java.lang.String translationEquivalent, org.thdl.lex.component.ILexComponent parent) { super(deleted, analyticalNotes, meta); this.parentId = parentId; this.precedence = precedence; @@ -45,11 +45,11 @@ abstract public class BaseTranslationEquivalent extends LexComponent implements this.parentId = parentId; } - public java.lang.Short getPrecedence() { + public java.lang.Integer getPrecedence() { return this.precedence; } - public void setPrecedence(java.lang.Short precedence) { + public void setPrecedence(java.lang.Integer precedence) { this.precedence = precedence; } diff --git a/src/java/org/thdl/lex/component/Definition.java b/src/java/org/thdl/lex/component/Definition.java index 2a8369c..7e10698 100644 --- a/src/java/org/thdl/lex/component/Definition.java +++ b/src/java/org/thdl/lex/component/Definition.java @@ -1,8 +1,9 @@ package org.thdl.lex.component; import java.io.Serializable; -import java.util.HashMap; -import org.thdl.lex.LexConstants; +import java.util.*; +import org.thdl.lex.*; + /** * Description of the Class @@ -40,6 +41,128 @@ public class Definition extends BaseDefinition implements Serializable, Translat return childMap; } +//helpers + /** + * Description of the Method + * + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public List findSiblings( ILexComponent component ) throws LexComponentException + { + List list = null; + if ( null == component.getParent() ) + { + component.setParent( findParent( component.getParentId() ) ); + } + LexComponentNode node = (LexComponentNode) component.getParent(); + list = (List) node.getChildMap().get( component.getLabel() ); + /* + if ( null == list ) + { + Iterator it = getSubefinitions().iterator(); + while ( it.hasNext() ) + { + ISubdefinition subdef = (ISubdefinition) it.next(); + list = subdef.findSiblings( component ); + } + } + */ + return list; + } + + + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException + { + LexLogger.debug( "Finding Parent..." ); + ILexComponent parent = null; + if ( parentPk.equals( this.getMetaId() ) ) + { + parent = this; + } + else + { + parent = findChild( parentPk ); + } + return parent; + } + + + /** + * Gets the persistentChild attribute of the Term object + * + * @param child Description of the Parameter + * @return The persistentChild value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( ILexComponent child ) throws LexComponentException + { + List list = findSiblings( child ); + child = findChild( list, child.getMetaId() ); + return child; + } + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException + { + ILexComponent child = null; + + Iterator childMapValues = getChildMap().values().iterator(); + while ( childMapValues.hasNext() && null == child ) + { + List list = (List) childMapValues.next(); + child = findChild( list, pk ); + } + + Iterator subdefinitions = getSubdefinitions().iterator(); + while ( subdefinitions.hasNext() && null == child ) + { + ISubdefinition def = (ISubdefinition) subdefinitions.next(); + child = def.findChild( pk ); + } + + return child; + } + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + */ + public ILexComponent findChild( List list, Integer pk ) + { + ILexComponent child = null; + for ( Iterator it = list.iterator(); it.hasNext(); ) + { + ILexComponent lc = (LexComponent) it.next(); + if ( lc.getMetaId().equals( pk ) ) + { + child = lc; + break; + } + } + return child; + } + + /** * Description of the Method diff --git a/src/java/org/thdl/lex/component/IAnalyticalNote.java b/src/java/org/thdl/lex/component/IAnalyticalNote.java index 251b5f3..e59ba5d 100644 --- a/src/java/org/thdl/lex/component/IAnalyticalNote.java +++ b/src/java/org/thdl/lex/component/IAnalyticalNote.java @@ -4,34 +4,33 @@ package org.thdl.lex.component; /** * Description of the Interface * - *@author travis - *@created October 3, 2003 + * @author travis + * @created October 3, 2003 */ public interface IAnalyticalNote extends ILexComponent { /** * Gets the parent attribute of the IAnalyticalNote object * - *@return The parent value - *@since + * @param comp The new parent value + * @since */ - public ILexComponent getParent(); /** * Sets the parent attribute of the IAnalyticalNote object * - *@param comp The new parent value - *@since + * @param comp The new parent value + * @since */ - public void setParent( ILexComponent comp ); + /** * Gets the parentId attribute of the IAnalyticalNote object * - *@return The parentId value - *@since + * @return The parentId value + * @since */ public java.lang.Integer getParentId(); @@ -39,8 +38,8 @@ public interface IAnalyticalNote extends ILexComponent /** * Sets the parentId attribute of the IAnalyticalNote object * - *@param parentId The new parentId value - *@since + * @param parentId The new parentId value + * @since */ public void setParentId( java.lang.Integer parentId ); @@ -48,8 +47,8 @@ public interface IAnalyticalNote extends ILexComponent /** * Gets the analyticalNote attribute of the IAnalyticalNote object * - *@return The analyticalNote value - *@since + * @return The analyticalNote value + * @since */ public java.lang.String getAnalyticalNote(); @@ -57,8 +56,8 @@ public interface IAnalyticalNote extends ILexComponent /** * Sets the analyticalNote attribute of the IAnalyticalNote object * - *@param analyticalNote The new analyticalNote value - *@since + * @param analyticalNote The new analyticalNote value + * @since */ public void setAnalyticalNote( java.lang.String analyticalNote ); } diff --git a/src/java/org/thdl/lex/component/IDefinition.java b/src/java/org/thdl/lex/component/IDefinition.java index 978f5ea..ae0f933 100644 --- a/src/java/org/thdl/lex/component/IDefinition.java +++ b/src/java/org/thdl/lex/component/IDefinition.java @@ -7,23 +7,19 @@ package org.thdl.lex.component; * @author travis * @created October 1, 2003 */ -public interface IDefinition extends Translatable +public interface IDefinition extends LexComponentNode { /** * Gets the parent attribute of the IDefinition object * - * @return The parent value + * @return The parentId value */ - public ILexComponent getParent(); - /** * Sets the parent attribute of the IDefinition object * - * @param comp The new parent value + * @return The parentId value */ - public void setParent( ILexComponent comp ); - /** * Gets the parentId attribute of the IDefinition object @@ -65,7 +61,7 @@ public interface IDefinition extends Translatable * @return The precedence value * @since */ - public java.lang.Short getPrecedence(); + public java.lang.Integer getPrecedence(); /** @@ -74,7 +70,7 @@ public interface IDefinition extends Translatable * @param precedence The new precedence value * @since */ - public void setPrecedence( java.lang.Short precedence ); + public void setPrecedence( java.lang.Integer precedence ); /** @@ -220,5 +216,45 @@ public interface IDefinition extends Translatable */ public void setRegisters( java.util.List registers ); + + /** + * Description of the Method + * + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( ILexComponent component ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( java.util.List list, Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException; } diff --git a/src/java/org/thdl/lex/component/IEncyclopediaArticle.java b/src/java/org/thdl/lex/component/IEncyclopediaArticle.java index a3e0b47..1d4f549 100644 --- a/src/java/org/thdl/lex/component/IEncyclopediaArticle.java +++ b/src/java/org/thdl/lex/component/IEncyclopediaArticle.java @@ -1,13 +1,67 @@ package org.thdl.lex.component; -public interface IEncyclopediaArticle extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IEncyclopediaArticle extends ILexComponent +{ + /** + * Sets the parent attribute of the IEncyclopediaArticle object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IEncyclopediaArticle object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IEncyclopediaArticle object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the article attribute of the IEncyclopediaArticle object + * + * @return The article value + */ public java.lang.String getArticle(); - public void setArticle(java.lang.String article); + + + /** + * Sets the article attribute of the IEncyclopediaArticle object + * + * @param article The new article value + */ + public void setArticle( java.lang.String article ); + + + /** + * Gets the articleTitle attribute of the IEncyclopediaArticle object + * + * @return The articleTitle value + */ public java.lang.String getArticleTitle(); - public void setArticleTitle(java.lang.String articleTitle); + + + /** + * Sets the articleTitle attribute of the IEncyclopediaArticle object + * + * @param articleTitle The new articleTitle value + */ + public void setArticleTitle( java.lang.String articleTitle ); } diff --git a/src/java/org/thdl/lex/component/IEtymology.java b/src/java/org/thdl/lex/component/IEtymology.java index 7567e8b..11893ff 100644 --- a/src/java/org/thdl/lex/component/IEtymology.java +++ b/src/java/org/thdl/lex/component/IEtymology.java @@ -1,17 +1,99 @@ package org.thdl.lex.component; -public interface IEtymology extends Translatable -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IEtymology extends Translatable +{ + /** + * Sets the parent attribute of the IEtymology object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IEtymology object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IEtymology object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); - public java.lang.Short getLoanLanguage(); - public void setLoanLanguage(java.lang.Short loanLanguage); - public java.lang.Short getEtymologyType(); - public void setEtymologyType(java.lang.Short etymologyType); + + + /** + * Gets the loanLanguage attribute of the IEtymology object + * + * @return The loanLanguage value + */ + public java.lang.Integer getLoanLanguage(); + + + /** + * Sets the loanLanguage attribute of the IEtymology object + * + * @param loanLanguage The new loanLanguage value + */ + public void setLoanLanguage( java.lang.Integer loanLanguage ); + + + /** + * Gets the etymologyType attribute of the IEtymology object + * + * @return The etymologyType value + */ + public java.lang.Integer getEtymologyType(); + + + /** + * Sets the etymologyType attribute of the IEtymology object + * + * @param etymologyType The new etymologyType value + */ + public void setEtymologyType( java.lang.Integer etymologyType ); + + + /** + * Gets the derivation attribute of the IEtymology object + * + * @return The derivation value + */ public java.lang.String getDerivation(); - public void setDerivation(java.lang.String derivation); + + + /** + * Sets the derivation attribute of the IEtymology object + * + * @param derivation The new derivation value + */ + public void setDerivation( java.lang.String derivation ); + + + /** + * Gets the etymologyDescription attribute of the IEtymology object + * + * @return The etymologyDescription value + */ public java.lang.String getEtymologyDescription(); - public void setEtymologyDescription(java.lang.String etymologyDescription); + + + /** + * Sets the etymologyDescription attribute of the IEtymology object + * + * @param etymologyDescription The new etymologyDescription value + */ + public void setEtymologyDescription( java.lang.String etymologyDescription ); } diff --git a/src/java/org/thdl/lex/component/IFunction.java b/src/java/org/thdl/lex/component/IFunction.java index 5e6b16e..38b8e0e 100644 --- a/src/java/org/thdl/lex/component/IFunction.java +++ b/src/java/org/thdl/lex/component/IFunction.java @@ -1,11 +1,51 @@ package org.thdl.lex.component; -public interface IFunction extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IFunction extends ILexComponent +{ + /** + * Sets the parent attribute of the IFunction object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IFunction object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IFunction object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); - public java.lang.Short getFunction(); - public void setFunction(java.lang.Short function); + + + /** + * Gets the function attribute of the IFunction object + * + * @return The function value + */ + public java.lang.Integer getFunction(); + + + /** + * Sets the function attribute of the IFunction object + * + * @param function The new function value + */ + public void setFunction( java.lang.Integer function ); } diff --git a/src/java/org/thdl/lex/component/IGloss.java b/src/java/org/thdl/lex/component/IGloss.java index 990e5c9..f8dd9c3 100644 --- a/src/java/org/thdl/lex/component/IGloss.java +++ b/src/java/org/thdl/lex/component/IGloss.java @@ -1,13 +1,67 @@ package org.thdl.lex.component; -public interface IGloss extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IGloss extends ILexComponent +{ + /** + * Sets the parent attribute of the IGloss object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IGloss object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IGloss object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the gloss attribute of the IGloss object + * + * @return The gloss value + */ public java.lang.String getGloss(); - public void setGloss(java.lang.String gloss); + + + /** + * Sets the gloss attribute of the IGloss object + * + * @param gloss The new gloss value + */ + public void setGloss( java.lang.String gloss ); + + + /** + * Gets the translation attribute of the IGloss object + * + * @return The translation value + */ public java.lang.String getTranslation(); - public void setTranslation(java.lang.String translation); + + + /** + * Sets the translation attribute of the IGloss object + * + * @param translation The new translation value + */ + public void setTranslation( java.lang.String translation ); } diff --git a/src/java/org/thdl/lex/component/IKeyword.java b/src/java/org/thdl/lex/component/IKeyword.java index ef79f2a..5e07912 100644 --- a/src/java/org/thdl/lex/component/IKeyword.java +++ b/src/java/org/thdl/lex/component/IKeyword.java @@ -1,12 +1,52 @@ package org.thdl.lex.component; -public interface IKeyword extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IKeyword extends ILexComponent +{ + /** + * Sets the parent attribute of the IKeyword object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IKeyword object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IKeyword object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the keyword attribute of the IKeyword object + * + * @return The keyword value + */ public java.lang.String getKeyword(); - public void setKeyword(java.lang.String keyword); + + + /** + * Sets the keyword attribute of the IKeyword object + * + * @param keyword The new keyword value + */ + public void setKeyword( java.lang.String keyword ); } diff --git a/src/java/org/thdl/lex/component/ILexComponent.java b/src/java/org/thdl/lex/component/ILexComponent.java index 18e2b7d..81fe644 100644 --- a/src/java/org/thdl/lex/component/ILexComponent.java +++ b/src/java/org/thdl/lex/component/ILexComponent.java @@ -13,9 +13,17 @@ public interface ILexComponent /** * Sets the parent attribute of the ILexComponent object * - * @param comp The new parent value + * @param parent The new parent value */ - public void setParent( ILexComponent comp ); + public void setParent( ILexComponent parent ); + + + /** + * Gets the parent attribute of the ILexComponent object + * + * @return The parent value + */ + public ILexComponent getParent(); /** @@ -31,8 +39,6 @@ public interface ILexComponent * * @return The parent value */ - public ILexComponent getParent(); - /** * Gets the parentId attribute of the LexComponent object @@ -47,7 +53,7 @@ public interface ILexComponent * * @return The precedence value */ - public java.lang.Short getPrecedence(); + public java.lang.Integer getPrecedence(); /** @@ -55,7 +61,7 @@ public interface ILexComponent * * @param precedence The new precedence value */ - public void setPrecedence( java.lang.Short precedence ); + public void setPrecedence( java.lang.Integer precedence ); /** @@ -85,23 +91,6 @@ public interface ILexComponent public void setMetaId( java.lang.Integer metaId ); - /** - * Gets the translationOf attribute of the ILexComponent object - * - * @return The translationOf value - * @since - */ - public java.lang.Integer getTranslationOf(); - - - /** - * Sets the translationOf attribute of the ILexComponent object - * - * @param translationOf The new translationOf value - * @since - */ - public void setTranslationOf( java.lang.Integer translationOf ); - /** * Gets the translations attribute of the ILexComponent object @@ -115,7 +104,7 @@ public interface ILexComponent /** * Sets the translations attribute of the ILexComponent object * - * @return The deleted value + * @return The deleted value * @since */ //public void setTranslations( java.util.Set translations ); @@ -183,5 +172,14 @@ public interface ILexComponent * @since */ public void populate( java.util.Map properties ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param component Description of the Parameter + * @exception LexComponentException Description of the Exception + */ + public void populate( ILexComponent component ) throws LexComponentException; } diff --git a/src/java/org/thdl/lex/component/IMeta.java b/src/java/org/thdl/lex/component/IMeta.java index 98b9552..b4d3ce9 100644 --- a/src/java/org/thdl/lex/component/IMeta.java +++ b/src/java/org/thdl/lex/component/IMeta.java @@ -1,31 +1,211 @@ package org.thdl.lex.component; + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ public interface IMeta extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); +{ + /** + * Sets the parent attribute of the IMeta object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IMeta object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IMeta object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the createdBy attribute of the IMeta object + * + * @return The createdBy value + */ public java.lang.Integer getCreatedBy(); - public void setCreatedBy(java.lang.Integer createdBy); + + + /** + * Sets the createdBy attribute of the IMeta object + * + * @param createdBy The new createdBy value + */ + public void setCreatedBy( java.lang.Integer createdBy ); + + + /** + * Gets the modifiedBy attribute of the IMeta object + * + * @return The modifiedBy value + */ public java.lang.Integer getModifiedBy(); - public void setModifiedBy(java.lang.Integer modifiedBy); + + + /** + * Sets the modifiedBy attribute of the IMeta object + * + * @param modifiedBy The new modifiedBy value + */ + public void setModifiedBy( java.lang.Integer modifiedBy ); + + + /** + * Gets the createdByProjSub attribute of the IMeta object + * + * @return The createdByProjSub value + */ public java.lang.Integer getCreatedByProjSub(); - public void setCreatedByProjSub(java.lang.Integer createdByProjSub); + + + /** + * Sets the createdByProjSub attribute of the IMeta object + * + * @param createdByProjSub The new createdByProjSub value + */ + public void setCreatedByProjSub( java.lang.Integer createdByProjSub ); + + + /** + * Gets the modifiedByProjSub attribute of the IMeta object + * + * @return The modifiedByProjSub value + */ public java.lang.Integer getModifiedByProjSub(); - public void setModifiedByProjSub(java.lang.Integer modifiedByProjSub); + + + /** + * Sets the modifiedByProjSub attribute of the IMeta object + * + * @param modifiedByProjSub The new modifiedByProjSub value + */ + public void setModifiedByProjSub( java.lang.Integer modifiedByProjSub ); + + + /** + * Gets the createdOn attribute of the IMeta object + * + * @return The createdOn value + */ public java.util.Date getCreatedOn(); - public void setCreatedOn(java.util.Date createdOn); + + + /** + * Sets the createdOn attribute of the IMeta object + * + * @param createdOn The new createdOn value + */ + public void setCreatedOn( java.util.Date createdOn ); + + + /** + * Gets the modifiedOn attribute of the IMeta object + * + * @return The modifiedOn value + */ public java.util.Date getModifiedOn(); - public void setModifiedOn(java.util.Date modifiedOn); + + + /** + * Sets the modifiedOn attribute of the IMeta object + * + * @param modifiedOn The new modifiedOn value + */ + public void setModifiedOn( java.util.Date modifiedOn ); + + + /** + * Gets the source attribute of the IMeta object + * + * @return The source value + */ public java.lang.Integer getSource(); - public void setSource(java.lang.Integer source); - public java.lang.Short getLanguage(); - public void setLanguage(java.lang.Short language); - public java.lang.Short getScript(); - public void setScript(java.lang.Short script); - public java.lang.Short getDialect(); - public void setDialect(java.lang.Short dialect); + + + /** + * Sets the source attribute of the IMeta object + * + * @param source The new source value + */ + public void setSource( java.lang.Integer source ); + + + /** + * Gets the language attribute of the IMeta object + * + * @return The language value + */ + public java.lang.Integer getLanguage(); + + + /** + * Sets the language attribute of the IMeta object + * + * @param language The new language value + */ + public void setLanguage( java.lang.Integer language ); + + + /** + * Gets the script attribute of the IMeta object + * + * @return The script value + */ + public java.lang.Integer getScript(); + + + /** + * Sets the script attribute of the IMeta object + * + * @param script The new script value + */ + public void setScript( java.lang.Integer script ); + + + /** + * Gets the dialect attribute of the IMeta object + * + * @return The dialect value + */ + public java.lang.Integer getDialect(); + + + /** + * Sets the dialect attribute of the IMeta object + * + * @param dialect The new dialect value + */ + public void setDialect( java.lang.Integer dialect ); + + + /** + * Gets the note attribute of the IMeta object + * + * @return The note value + */ public java.lang.String getNote(); - public void setNote(java.lang.String note); + + + /** + * Sets the note attribute of the IMeta object + * + * @param note The new note value + */ + public void setNote( java.lang.String note ); } diff --git a/src/java/org/thdl/lex/component/IModelSentence.java b/src/java/org/thdl/lex/component/IModelSentence.java index ad3c8ca..344c94f 100644 --- a/src/java/org/thdl/lex/component/IModelSentence.java +++ b/src/java/org/thdl/lex/component/IModelSentence.java @@ -1,13 +1,50 @@ package org.thdl.lex.component; -public interface IModelSentence extends Translatable -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IModelSentence extends Translatable +{ + /** + * Sets the parent attribute of the IModelSentence object + * + * @return The parentId value + */ + + + /** + * Gets the parentId attribute of the IModelSentence object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IModelSentence object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); - public java.lang.Integer getSubdefinitionId(); - public void setSubdefinitionId(java.lang.Integer subdefinitionId); + + + /** + * Gets the modelSentence attribute of the IModelSentence object + * + * @return The modelSentence value + */ public java.lang.String getModelSentence(); - public void setModelSentence(java.lang.String modelSentence); + + + /** + * Sets the modelSentence attribute of the IModelSentence object + * + * @param modelSentence The new modelSentence value + */ + public void setModelSentence( java.lang.String modelSentence ); } diff --git a/src/java/org/thdl/lex/component/IPassage.java b/src/java/org/thdl/lex/component/IPassage.java index 48eb7da..991a25f 100644 --- a/src/java/org/thdl/lex/component/IPassage.java +++ b/src/java/org/thdl/lex/component/IPassage.java @@ -12,9 +12,8 @@ public interface IPassage extends Translatable /** * Gets the parent attribute of the IPassage object * - * @return The parent value + * @param comp The new parent value */ - public ILexComponent getParent(); /** @@ -22,7 +21,7 @@ public interface IPassage extends Translatable * * @param comp The new parent value */ - public void setParent( ILexComponent comp ); + /** diff --git a/src/java/org/thdl/lex/component/IPronunciation.java b/src/java/org/thdl/lex/component/IPronunciation.java index be754dd..b4bbbab 100644 --- a/src/java/org/thdl/lex/component/IPronunciation.java +++ b/src/java/org/thdl/lex/component/IPronunciation.java @@ -1,13 +1,67 @@ package org.thdl.lex.component; -public interface IPronunciation extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IPronunciation extends ILexComponent +{ + /** + * Sets the parent attribute of the IPronunciation object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IPronunciation object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IPronunciation object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the phonetics attribute of the IPronunciation object + * + * @return The phonetics value + */ public java.lang.String getPhonetics(); - public void setPhonetics(java.lang.String phonetics); - public java.lang.Short getPhoneticsType(); - public void setPhoneticsType(java.lang.Short phoneticsType); + + + /** + * Sets the phonetics attribute of the IPronunciation object + * + * @param phonetics The new phonetics value + */ + public void setPhonetics( java.lang.String phonetics ); + + + /** + * Gets the phoneticsType attribute of the IPronunciation object + * + * @return The phoneticsType value + */ + public java.lang.Integer getPhoneticsType(); + + + /** + * Sets the phoneticsType attribute of the IPronunciation object + * + * @param phoneticsType The new phoneticsType value + */ + public void setPhoneticsType( java.lang.Integer phoneticsType ); } diff --git a/src/java/org/thdl/lex/component/IRegister.java b/src/java/org/thdl/lex/component/IRegister.java index 3d7fd87..39832cd 100644 --- a/src/java/org/thdl/lex/component/IRegister.java +++ b/src/java/org/thdl/lex/component/IRegister.java @@ -1,11 +1,51 @@ package org.thdl.lex.component; -public interface IRegister extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IRegister extends ILexComponent +{ + /** + * Sets the parent attribute of the IRegister object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IRegister object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IRegister object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); - public java.lang.Short getRegister(); - public void setRegister(java.lang.Short register); + + + /** + * Gets the register attribute of the IRegister object + * + * @return The register value + */ + public java.lang.Integer getRegister(); + + + /** + * Sets the register attribute of the IRegister object + * + * @param register The new register value + */ + public void setRegister( java.lang.Integer register ); } diff --git a/src/java/org/thdl/lex/component/IRelatedTerm.java b/src/java/org/thdl/lex/component/IRelatedTerm.java index 2026717..6df73f4 100644 --- a/src/java/org/thdl/lex/component/IRelatedTerm.java +++ b/src/java/org/thdl/lex/component/IRelatedTerm.java @@ -1,13 +1,67 @@ package org.thdl.lex.component; -public interface IRelatedTerm extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface IRelatedTerm extends ILexComponent +{ + /** + * Sets the parent attribute of the IRelatedTerm object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the IRelatedTerm object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the IRelatedTerm object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the relatedTerm attribute of the IRelatedTerm object + * + * @return The relatedTerm value + */ public java.lang.String getRelatedTerm(); - public void setRelatedTerm(java.lang.String relatedTerm); - public java.lang.Short getRelatedTermType(); - public void setRelatedTermType(java.lang.Short relatedTermType); + + + /** + * Sets the relatedTerm attribute of the IRelatedTerm object + * + * @param relatedTerm The new relatedTerm value + */ + public void setRelatedTerm( java.lang.String relatedTerm ); + + + /** + * Gets the relatedTermType attribute of the IRelatedTerm object + * + * @return The relatedTermType value + */ + public java.lang.Integer getRelatedTermType(); + + + /** + * Sets the relatedTermType attribute of the IRelatedTerm object + * + * @param relatedTermType The new relatedTermType value + */ + public void setRelatedTermType( java.lang.Integer relatedTermType ); } diff --git a/src/java/org/thdl/lex/component/ISpelling.java b/src/java/org/thdl/lex/component/ISpelling.java index cd8cae2..74e26af 100644 --- a/src/java/org/thdl/lex/component/ISpelling.java +++ b/src/java/org/thdl/lex/component/ISpelling.java @@ -1,13 +1,67 @@ package org.thdl.lex.component; -public interface ISpelling extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface ISpelling extends ILexComponent +{ + /** + * Sets the parent attribute of the ISpelling object + * + * @param comp The new parent value + */ + + + + /** + * Gets the parentId attribute of the ISpelling object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the ISpelling object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); + + + /** + * Gets the spelling attribute of the ISpelling object + * + * @return The spelling value + */ public java.lang.String getSpelling(); - public void setSpelling(java.lang.String spelling); - public java.lang.Short getSpellingType(); - public void setSpellingType(java.lang.Short spellingType); + + + /** + * Sets the spelling attribute of the ISpelling object + * + * @param spelling The new spelling value + */ + public void setSpelling( java.lang.String spelling ); + + + /** + * Gets the spellingType attribute of the ISpelling object + * + * @return The spellingType value + */ + public java.lang.Integer getSpellingType(); + + + /** + * Sets the spellingType attribute of the ISpelling object + * + * @param spellingType The new spellingType value + */ + public void setSpellingType( java.lang.Integer spellingType ); } diff --git a/src/java/org/thdl/lex/component/ISubdefinition.java b/src/java/org/thdl/lex/component/ISubdefinition.java index c2f2f78..89458da 100644 --- a/src/java/org/thdl/lex/component/ISubdefinition.java +++ b/src/java/org/thdl/lex/component/ISubdefinition.java @@ -7,23 +7,19 @@ package org.thdl.lex.component; * @author travis * @created October 13, 2003 */ -public interface ISubdefinition extends Translatable +public interface ISubdefinition extends LexComponentNode { /** * Gets the parent attribute of the ISubdefinition object * - * @return The parent value + * @return The parentId value */ - public ILexComponent getParent(); - /** * Sets the parent attribute of the ISubdefinition object * - * @param comp The new parent value + * @return The parentId value */ - public void setParent( ILexComponent comp ); - /** * Gets the parentId attribute of the ISubdefinition object @@ -170,5 +166,45 @@ public interface ISubdefinition extends Translatable public void setRegisters( java.util.List registers ); + /** + * Description of the Method + * + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( ILexComponent component ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( java.util.List list, Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException; + } diff --git a/src/java/org/thdl/lex/component/ITerm.java b/src/java/org/thdl/lex/component/ITerm.java index 660e754..c3780e9 100644 --- a/src/java/org/thdl/lex/component/ITerm.java +++ b/src/java/org/thdl/lex/component/ITerm.java @@ -7,7 +7,7 @@ package org.thdl.lex.component; * @author travis * @created October 1, 2003 */ -public interface ITerm extends ILexComponent +public interface ITerm extends LexComponentNode { /** * Gets the term attribute of the ITerm object @@ -33,7 +33,7 @@ public interface ITerm extends ILexComponent * @return The precedence value * @since */ - public java.lang.Short getPrecedence(); + public java.lang.Integer getPrecedence(); /** @@ -42,7 +42,7 @@ public interface ITerm extends ILexComponent * @param precedence The new precedence value * @since */ - public void setPrecedence( java.lang.Short precedence ); + public void setPrecedence( java.lang.Integer precedence ); /** @@ -296,5 +296,54 @@ public interface ITerm extends ILexComponent */ public void setRegisters( java.util.List registers ); + + /** + * Description of the Method + * + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( ILexComponent component ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( java.util.List list, Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException; + + + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException; + + + /** + * Adds a feature to the Child attribute of the ITerm object + * + * @param component The feature to be added to the Child attribute + * @exception LexComponentException Description of the Exception + */ + public void addChild( ILexComponent component ) throws LexComponentException; } diff --git a/src/java/org/thdl/lex/component/ITransitionalData.java b/src/java/org/thdl/lex/component/ITransitionalData.java index 43c854a..aa4d359 100644 --- a/src/java/org/thdl/lex/component/ITransitionalData.java +++ b/src/java/org/thdl/lex/component/ITransitionalData.java @@ -1,15 +1,79 @@ package org.thdl.lex.component; -public interface ITransitionalData extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); + +/** + * Description of the Interface + * + * @author travis + * @created October 16, 2003 + */ +public interface ITransitionalData extends ILexComponent +{ + + + + + /** + * Gets the parentId attribute of the ITransitionalData object + * + * @return The parentId value + */ public java.lang.Integer getParentId(); + + + /** + * Sets the parentId attribute of the ITransitionalData object + * + * @param parentId The new parentId value + */ public void setParentId( java.lang.Integer parentId ); - public java.lang.Short getTransitionalDataLabel(); - public void setTransitionalDataLabel(java.lang.Short transitionalDataLabel); + + + /** + * Gets the transitionalDataLabel attribute of the ITransitionalData object + * + * @return The transitionalDataLabel value + */ + public java.lang.Integer getTransitionalDataLabel(); + + + /** + * Sets the transitionalDataLabel attribute of the ITransitionalData object + * + * @param transitionalDataLabel The new transitionalDataLabel value + */ + public void setTransitionalDataLabel( java.lang.Integer transitionalDataLabel ); + + + /** + * Gets the forPublicConsumption attribute of the ITransitionalData object + * + * @return The forPublicConsumption value + */ public java.lang.String getForPublicConsumption(); - public void setForPublicConsumption(java.lang.String forPublicConsumption); + + + /** + * Sets the forPublicConsumption attribute of the ITransitionalData object + * + * @param forPublicConsumption The new forPublicConsumption value + */ + public void setForPublicConsumption( java.lang.String forPublicConsumption ); + + + /** + * Gets the transitionalDataText attribute of the ITransitionalData object + * + * @return The transitionalDataText value + */ public java.lang.String getTransitionalDataText(); - public void setTransitionalDataText(java.lang.String transitionalDataText); + + + /** + * Sets the transitionalDataText attribute of the ITransitionalData object + * + * @param transitionalDataText The new transitionalDataText value + */ + public void setTransitionalDataText( java.lang.String transitionalDataText ); } diff --git a/src/java/org/thdl/lex/component/ITranslationEquivalent.java b/src/java/org/thdl/lex/component/ITranslationEquivalent.java index 543f007..5c8f70f 100644 --- a/src/java/org/thdl/lex/component/ITranslationEquivalent.java +++ b/src/java/org/thdl/lex/component/ITranslationEquivalent.java @@ -4,18 +4,19 @@ package org.thdl.lex.component; /** * Description of the Interface * - *@author travis - *@created October 3, 2003 + * @author travis + * @created October 3, 2003 */ public interface ITranslationEquivalent extends ILexComponent -{ public ILexComponent getParent(); - public void setParent( ILexComponent comp ); +{ + + /** * Gets the translationEquivalent attribute of the ITranslationEquivalent * object * - *@return The translationEquivalent value - *@since + * @return The translationEquivalent value + * @since */ public java.lang.String getTranslationEquivalent(); @@ -24,8 +25,8 @@ public interface ITranslationEquivalent extends ILexComponent * Sets the translationEquivalent attribute of the ITranslationEquivalent * object * - *@param translationEquivalent The new translationEquivalent value - *@since + * @param translationEquivalent The new translationEquivalent value + * @since */ public void setTranslationEquivalent( java.lang.String translationEquivalent ); } diff --git a/src/java/org/thdl/lex/component/LexComponent.hbm.xml b/src/java/org/thdl/lex/component/LexComponent.hbm.xml index d6107e0..361e68c 100644 --- a/src/java/org/thdl/lex/component/LexComponent.hbm.xml +++ b/src/java/org/thdl/lex/component/LexComponent.hbm.xml @@ -1,8 +1,9 @@ - + - + + org.thdl.lex.component.BaseLexComponent @@ -11,10 +12,10 @@ - + - + @@ -29,93 +30,101 @@ - - - + + + org.thdl.lex.component.BaseAnalyticalNote - - + + + + + + - + org.thdl.lex.component.BaseTerm - + org.thdl.lex.component.LexComponentNode + + + - - - + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -124,53 +133,57 @@ org.thdl.lex.component.BaseDefinition - org.thdl.lex.component.Translatable - - + org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode + + + + + + - + - + - + - + - + - + - + - + - + - + @@ -179,48 +192,52 @@ org.thdl.lex.component.BaseSubdefinition - org.thdl.lex.component.Translatable - - + org.thdl.lex.component.Translatable, org.thdl.lex.component.LexComponentNode + + + + + + - + - + - + - + - + - + - + - + - + @@ -229,27 +246,35 @@ org.thdl.lex.component.BasePronunciation - - + + + + + + - + - + org.thdl.lex.component.BaseEtymology org.thdl.lex.component.Translatable - - + + + + + + - - - + + + - + @@ -257,63 +282,86 @@ org.thdl.lex.component.BaseSpelling - - + + + + + + - + - + org.thdl.lex.component.BaseGrammaticalFunction - - + + + + + + - - + + org.thdl.lex.component.BaseEncyclopediaArticle - - + + + + + + - + org.thdl.lex.component.BaseGloss - - + + + + + + - + org.thdl.lex.component.BaseKeyword - - + + + + + + - + org.thdl.lex.component.BaseModelSentence org.thdl.lex.component.Translatable - - + + + + + + - - + - + @@ -321,36 +369,48 @@ org.thdl.lex.component.BaseTranslationEquivalent - - + + + + + + - + org.thdl.lex.component.BaseRelatedTerm - - + + + + + + - + - + org.thdl.lex.component.BasePassage org.thdl.lex.component.Translatable - - + + + + + + - + - + @@ -358,20 +418,28 @@ org.thdl.lex.component.BaseSpeechRegister - - + + + + + + - - + + org.thdl.lex.component.BaseTransitionalData - - + + + + + + - - + + diff --git a/src/java/org/thdl/lex/component/LexComponent.java b/src/java/org/thdl/lex/component/LexComponent.java index 24e788a..ad6db40 100644 --- a/src/java/org/thdl/lex/component/LexComponent.java +++ b/src/java/org/thdl/lex/component/LexComponent.java @@ -15,6 +15,8 @@ import org.apache.commons.beanutils.BeanUtils; public abstract class LexComponent extends BaseLexComponent implements Serializable { private Meta meta; + private Integer metaId; + private Integer parentId; /* @@ -50,12 +52,38 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa } + /** + * Sets the metaId attribute of the LexComponent object + * + * @param metaId The new metaId value + */ + public void setMetaId( Integer metaId ) + { + if ( metaId.intValue() == 0 ) + { + this.metaId = null; + } + this.metaId = metaId; + } + + + /** + * Gets the metaId attribute of the LexComponent object + * + * @return The metaId value + */ + public Integer getMetaId() + { + return metaId; + } + + /** * Gets the precedence attribute of the LexComponent object * * @return The precedence value */ - public abstract java.lang.Short getPrecedence(); + public abstract java.lang.Integer getPrecedence(); /** @@ -63,7 +91,7 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa * * @param precedence The new precedence value */ - public abstract void setPrecedence( java.lang.Short precedence ); + public abstract void setPrecedence( java.lang.Integer precedence ); /** @@ -79,7 +107,14 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa * * @param parentId The new parentId value */ - public abstract void setParentId( java.lang.Integer parentId ); + public void setParentId( java.lang.Integer parentId ) + { + if ( parentId.intValue() == 0 ) + { + this.parentId = null; + } + this.parentId = parentId; + } /** @@ -95,7 +130,10 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa * * @return The parentId value */ - public abstract java.lang.Integer getParentId(); + public java.lang.Integer getParentId() + { + return this.parentId; + } /** @@ -188,6 +226,7 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa public LexComponent() { super(); + setDeleted( Boolean.FALSE ); } } diff --git a/src/java/org/thdl/lex/component/Meta.java b/src/java/org/thdl/lex/component/Meta.java index 4adcd34..cf1e787 100644 --- a/src/java/org/thdl/lex/component/Meta.java +++ b/src/java/org/thdl/lex/component/Meta.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.Map; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang.builder.ToStringBuilder; +import org.thdl.lex.*; /** @@ -55,5 +56,25 @@ public class Meta extends BaseMeta implements Serializable */ public Meta() { } + + /** + *Constructor for the Meta object + * + * @param user Description of the Parameter + * @param preferences Description of the Parameter + */ + public Meta( LexUser user, Preferences preferences ) + { + setCreatedBy( user.getId() ); + setModifiedBy( user.getId() ); + setCreatedByProjSub( preferences.getProjectSubject() ); + setModifiedByProjSub( preferences.getProjectSubject() ); + setSource( preferences.getSource() );//default source is Self from Lex.Sources + setLanguage( preferences.getLanguage() ); + setScript( preferences.getScript() ); + setDialect( preferences.getDialect() ); + setNote( preferences.getNote() ); + } + } diff --git a/src/java/org/thdl/lex/component/Subdefinition.java b/src/java/org/thdl/lex/component/Subdefinition.java index e6ed26c..d817f7d 100644 --- a/src/java/org/thdl/lex/component/Subdefinition.java +++ b/src/java/org/thdl/lex/component/Subdefinition.java @@ -1,8 +1,9 @@ package org.thdl.lex.component; import java.io.Serializable; -import java.util.HashMap; -import org.thdl.lex.LexConstants; +import java.util.*; +import org.thdl.lex.*; + /** @@ -42,6 +43,109 @@ public class Subdefinition extends BaseSubdefinition implements Serializable, Tr } + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException + { + LexLogger.debug( "Finding Parent..." ); + ILexComponent parent = null; + if ( parentPk.equals( this.getMetaId() ) ) + { + parent = this; + } + else + { + parent = findChild( parentPk ); + } + return parent; + } + + + /** + * Description of the Method + * + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public List findSiblings( ILexComponent component ) throws LexComponentException + { + List list = null; + if ( null == component.getParent() ) + { + component.setParent( findParent( component.getParentId() ) ); + } + LexComponentNode node = (LexComponentNode) component.getParent(); + list = (List) node.getChildMap().get( component.getLabel() ); + + return list; + } + + + /** + * Gets the persistentChild attribute of the Term object + * + * @param child Description of the Parameter + * @return The persistentChild value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( ILexComponent child ) throws LexComponentException + { + List list = findSiblings( child ); + child = findChild( list, child.getMetaId() ); + return child; + } + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException + { + ILexComponent child = null; + + Iterator childMapValues = getChildMap().values().iterator(); + while ( childMapValues.hasNext() && null == child ) + { + List list = (List) childMapValues.next(); + child = findChild( list, pk ); + } + return child; + } + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + */ + public ILexComponent findChild( List list, Integer pk ) + { + ILexComponent child = null; + for ( Iterator it = list.iterator(); it.hasNext(); ) + { + ILexComponent lc = (LexComponent) it.next(); + if ( lc.getMetaId().equals( pk ) ) + { + child = lc; + break; + } + } + return child; + } + + /** * Description of the Method */ diff --git a/src/java/org/thdl/lex/component/Term.java b/src/java/org/thdl/lex/component/Term.java index 9d0b054..e59455a 100644 --- a/src/java/org/thdl/lex/component/Term.java +++ b/src/java/org/thdl/lex/component/Term.java @@ -2,8 +2,7 @@ package org.thdl.lex.component; import java.io.Serializable; import java.util.*; -import org.thdl.lex.LexConstants; -import org.thdl.lex.LexLogger; +import org.thdl.lex.*; /** @@ -97,17 +96,52 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode public List findSiblings( ILexComponent component ) throws LexComponentException { List list = null; - if ( null != component.getParent() ) + if ( null == component.getParent() ) { - LexComponentNode node = (LexComponentNode) component.getParent(); - list = (List) node.getChildMap().get( component.getLabel() ); - LexLogger.debug( "List derived from " + node + ": " + list ); + component.setParent( findParent( component.getParentId() ) ); + } + LexComponentNode node = (LexComponentNode) component.getParent(); + list = (List) node.getChildMap().get( component.getLabel() ); + LexLogger.debug( "List derived from " + node + ": " + list ); + + if ( null == list ) + { + LexLogger.debug( "findSiblings returned a null list" ); + LexLogger.debugComponent( component ); + /* + Iterator it = getDefinitions().iterator(); + while ( it.hasNext() ) + { + IDefinition def = (IDefinition) it.next(); + list = def.findSiblings( component ); + } + */ + } + + return list; + } + + + /** + * Description of the Method + * + * @param parentPk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findParent( Integer parentPk ) throws LexComponentException + { + LexLogger.debug( "Finding Parent..." ); + ILexComponent parent = null; + if ( parentPk.equals( this.getMetaId() ) ) + { + parent = this; } else { - throw new LexComponentException( "Failed to locate a set of siblings in the Term object graph for: " + component ); + parent = findChild( parentPk ); } - return list; + return parent; } @@ -120,17 +154,61 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode */ public ILexComponent findChild( ILexComponent child ) throws LexComponentException { - ILexComponent persistentChild = null; List list = findSiblings( child ); + child = findChild( list, child.getMetaId() ); + return child; + } + + + /** + * Description of the Method + * + * @param pk Description of the Parameter + * @return Description of the Return Value + * @exception LexComponentException Description of the Exception + */ + public ILexComponent findChild( Integer pk ) throws LexComponentException + { + ILexComponent child = null; + + Iterator childMapValues = getChildMap().values().iterator(); + while ( childMapValues.hasNext() && null == child ) + { + List list = (List) childMapValues.next(); + child = findChild( list, pk ); + } + + Iterator definitions = getDefinitions().iterator(); + while ( definitions.hasNext() && null == child ) + { + IDefinition def = (IDefinition) definitions.next(); + child = def.findChild( pk ); + } + + return child; + } + + + /** + * Description of the Method + * + * @param list Description of the Parameter + * @param pk Description of the Parameter + * @return Description of the Return Value + */ + public ILexComponent findChild( List list, Integer pk ) + { + ILexComponent child = null; for ( Iterator it = list.iterator(); it.hasNext(); ) { - ILexComponent lc = (ILexComponent) it.next(); - if ( lc.getMetaId().equals( child.getMetaId() ) ) + ILexComponent lc = (LexComponent) it.next(); + if ( lc.getMetaId().equals( pk ) ) { - persistentChild = lc; + child = lc; + break; } } - return persistentChild; + return child; } @@ -147,38 +225,6 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode } - /** - * 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 */ diff --git a/src/jsp/jsp/.cvsignore b/src/jsp/jsp/.cvsignore new file mode 100644 index 0000000..3367afd --- /dev/null +++ b/src/jsp/jsp/.cvsignore @@ -0,0 +1 @@ +old diff --git a/src/jsp/jsp/analyticalNoteForm.jsf b/src/jsp/jsp/analyticalNoteForm.jsf index 8d651a9..5e392b1 100644 --- a/src/jsp/jsp/analyticalNoteForm.jsf +++ b/src/jsp/jsp/analyticalNoteForm.jsf @@ -5,35 +5,30 @@ - + - - -

- - Analysis:
diff --git a/src/jsp/jsp/definitionForm.jsf b/src/jsp/jsp/definitionForm.jsf index a1fdc37..064813f 100644 --- a/src/jsp/jsp/definitionForm.jsf +++ b/src/jsp/jsp/definitionForm.jsf @@ -7,24 +7,21 @@ - - + - - + - - + @@ -45,7 +42,6 @@ - @@ -54,8 +50,6 @@ Definition:

-Precedence:
- diff --git a/src/jsp/jsp/displayDefinition.jsf b/src/jsp/jsp/displayDefinition.jsf new file mode 100644 index 0000000..89d4d19 --- /dev/null +++ b/src/jsp/jsp/displayDefinition.jsf @@ -0,0 +1,52 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + +

+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + view/edit translation + + +
+
+ + + +
+
+ + + + + +

+ diff --git a/src/jsp/jsp/displayEncyclopediaArticle.jsf b/src/jsp/jsp/displayEncyclopediaArticle.jsf new file mode 100644 index 0000000..c7d0f9a --- /dev/null +++ b/src/jsp/jsp/displayEncyclopediaArticle.jsf @@ -0,0 +1,35 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + + +

+ + + + + + + + + +
+ + + + + + + + + + + +

+
+ + diff --git a/src/jsp/jsp/displayEntry.jsp b/src/jsp/jsp/displayEntry.jsp index 66990a6..d577498 100644 --- a/src/jsp/jsp/displayEntry.jsp +++ b/src/jsp/jsp/displayEntry.jsp @@ -1,54 +1,103 @@ -<%-- <%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" %>--%> <%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - - - + + + -

Search Results Page

-
-

+ + + + + + + + + + + + + + + +

+
+

Search Results

+
    + + + + + +
  1. +
    +
  2. +
    +
+
+ +
+ +
+ +
+ +
+ + +

.
- <%-- --%>

-
-
- - - + +
@@ -57,7 +106,8 @@ -
+
+
diff --git a/src/jsp/jsp/displayEtymology.jsf b/src/jsp/jsp/displayEtymology.jsf new file mode 100644 index 0000000..9816117 --- /dev/null +++ b/src/jsp/jsp/displayEtymology.jsf @@ -0,0 +1,65 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + +

+ + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + view/edit translation + + +
+ +
+ +
+ +
+ +
+ + +
+
+ + + + +

+
+ + diff --git a/src/jsp/jsp/displayForm.jsp b/src/jsp/jsp/displayForm.jsp index 36c9a43..023aabf 100644 --- a/src/jsp/jsp/displayForm.jsp +++ b/src/jsp/jsp/displayForm.jsp @@ -26,19 +26,19 @@ Back to: + && param.cmd != 'getAnnotationForm'}"> - + - + diff --git a/src/jsp/jsp/displayFunction.jsf b/src/jsp/jsp/displayFunction.jsf new file mode 100644 index 0000000..29c5fb8 --- /dev/null +++ b/src/jsp/jsp/displayFunction.jsf @@ -0,0 +1,32 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + +

+ + + + + + + + +
+ + + + + + + + + + +

+
+ + diff --git a/src/jsp/jsp/displayKeyword.jsf b/src/jsp/jsp/displayKeyword.jsf new file mode 100644 index 0000000..5399fae --- /dev/null +++ b/src/jsp/jsp/displayKeyword.jsf @@ -0,0 +1,31 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + + +
+ + + + + + + + + + +

+ + diff --git a/src/jsp/jsp/displayMeta.jsf b/src/jsp/jsp/displayMeta.jsf index 25b409b..dc6126a 100644 --- a/src/jsp/jsp/displayMeta.jsf +++ b/src/jsp/jsp/displayMeta.jsf @@ -1,9 +1,22 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + + + view metadata + + + + + + + + +
diff --git a/src/jsp/jsp/displayModelSentence.jsf b/src/jsp/jsp/displayModelSentence.jsf new file mode 100644 index 0000000..e68e6b5 --- /dev/null +++ b/src/jsp/jsp/displayModelSentence.jsf @@ -0,0 +1,50 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + view/edit translation + + +
+
+ + + +
+
+ + + + + +

+ diff --git a/src/jsp/jsp/displayNotes.jsf b/src/jsp/jsp/displayNotes.jsf new file mode 100644 index 0000000..c3a69c5 --- /dev/null +++ b/src/jsp/jsp/displayNotes.jsf @@ -0,0 +1,22 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +analysis + +
+ + + + + + + + + +
+
+
+
diff --git a/src/jsp/jsp/displayPassage.jsf b/src/jsp/jsp/displayPassage.jsf new file mode 100644 index 0000000..a032c47 --- /dev/null +++ b/src/jsp/jsp/displayPassage.jsf @@ -0,0 +1,61 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + view/edit translation + + +
+ +
+ +
+ +
+
+ + + +
+
+ + + + + +

+ diff --git a/src/jsp/jsp/displayPronunciation.jsf b/src/jsp/jsp/displayPronunciation.jsf new file mode 100644 index 0000000..2648b27 --- /dev/null +++ b/src/jsp/jsp/displayPronunciation.jsf @@ -0,0 +1,33 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + +

+ + + + + + + + + +
+ +
+ + + + + + + + + +

+
+ diff --git a/src/jsp/jsp/displayRegister.jsf b/src/jsp/jsp/displayRegister.jsf new file mode 100644 index 0000000..5052be8 --- /dev/null +++ b/src/jsp/jsp/displayRegister.jsf @@ -0,0 +1,31 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + +
+ + + + + + + + + + + +

+ + diff --git a/src/jsp/jsp/displayRelatedTerm.jsf b/src/jsp/jsp/displayRelatedTerm.jsf new file mode 100644 index 0000000..3c8b484 --- /dev/null +++ b/src/jsp/jsp/displayRelatedTerm.jsf @@ -0,0 +1,33 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + +
+ + +
+ + + + + + + + + + + +

+ diff --git a/src/jsp/jsp/displaySpelling.jsf b/src/jsp/jsp/displaySpelling.jsf new file mode 100644 index 0000000..6497ded --- /dev/null +++ b/src/jsp/jsp/displaySpelling.jsf @@ -0,0 +1,34 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + +

+ + + + + + + + +
+
+ + + + + + + + + + +

+
+ + + diff --git a/src/jsp/jsp/displaySubdefinition.jsf b/src/jsp/jsp/displaySubdefinition.jsf new file mode 100644 index 0000000..93ec1b7 --- /dev/null +++ b/src/jsp/jsp/displaySubdefinition.jsf @@ -0,0 +1,58 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + +

+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + view/edit translation + + +
+
+ + + + +
+
+ + + + + +

+ diff --git a/src/jsp/jsp/displayTerm.jsf b/src/jsp/jsp/displayTerm.jsf new file mode 100644 index 0000000..a5e8343 --- /dev/null +++ b/src/jsp/jsp/displayTerm.jsf @@ -0,0 +1,36 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + + +

+

+ + + + + + + + + + + + + + + + + + + + + +

+ + + diff --git a/src/jsp/jsp/displayTransitionalData.jsf b/src/jsp/jsp/displayTransitionalData.jsf new file mode 100644 index 0000000..2a65da5 --- /dev/null +++ b/src/jsp/jsp/displayTransitionalData.jsf @@ -0,0 +1,34 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + + + +

+ + + + + + + + + +
+
+ + + + + + + + + + +

+
+ + diff --git a/src/jsp/jsp/displayTranslationEquivalent.jsf b/src/jsp/jsp/displayTranslationEquivalent.jsf new file mode 100644 index 0000000..1f095e1 --- /dev/null +++ b/src/jsp/jsp/displayTranslationEquivalent.jsf @@ -0,0 +1,32 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + + +

+ + + + + + + + + + +
+ + + + + + + + + + + +

+ + diff --git a/src/jsp/jsp/displayTree.jsf b/src/jsp/jsp/displayTree.jsf index 2c4ef30..4fb31f7 100644 --- a/src/jsp/jsp/displayTree.jsf +++ b/src/jsp/jsp/displayTree.jsf @@ -1,642 +1,152 @@ -<%-- - --%> -<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - -<%-- This whole edit/update/display should be REWRITTEN! --%> - - - +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + - - - - - - - -

-
- -
- - - -
-

- - - - - <%-- - --%> -

- - - -

- - - - - - - - - - - - - - - - - - - - - - - Term:
- <%-- metadata --%> - - - analysis - Analysis:
- - -
-
-

- - - -
+ + + +

Special Guests

-

- - - - - - - - - - - -
-
-  view metadata - - - analysis - Analysis:
- - -
-
-

+
+
+ + +

Pronunciations

-

- - - - - - - - - - - Phonetic Rendering:
- Type of Phonetics:
-  view metadata - - - analysis - Analysis:
- - -
-
-

-
+ + +
+ + +

Etymologies

-

- - - - - - - - - - - - - Etymology:
- Etymology Type:
- Loan Language:
- Derivation:
-  view metadata - - - - - - - view/edit translation - - Etymology:
- Etymology Type:
- Loan Language:
- Derivation:
- - -
-
- - - analysis - Analysis:
- - -
-
-

+
- +
+ + +

Spellings

-

- - - - - - - - - - - Spelling:
- Spelling Type:
-  view metadata - - - analysis - Analysis:
- - -
-
-

+
- +
+ + +

Functions

-

- - - - - - - - - - Grammatical Function:
-  view metadata - - - analysis - Analysis:
- - -
-
-

-
+ + +
+ + +

Encyclopedia Articles

-

- - - - - - - - - - - - <%-- Encyclopedia Article:
--%> - Encyclopedia Article:
-  view metadata - - - analysis - Analysis:
- - -
-
-

-
- -
+ + + + + +

Definitions

-

- - - - - - - - - - - - - + + - Definition -
-  view metadata - - - - - - - view/edit translation - Definition -
- - -
-
- - - analysis - Analysis:
- - -
-
-

- -
- -

- - - - - - - - - + + +

Subdefinitions

+ + + - - - - - - - - - - - - - - - - - Subdefinition: -
-  view metadata - - - - - - - view/edit translation - Subdefinition: -
- - -
-
- - - analysis - Analysis:
- - -
-
- -

- -
- -

- - - - - - - - - - - Keyword: -
 view metadata - - - analysis - Analysis:
- - -
-
-

-
- + + +

Keywords

+ + + + +
- -

- - - - - - - - - - - - - Model Sentence: -
-  view metadata - - - - - - - view/edit translation - Model Sentence:
- - -
-
- - - analysis - Analysis:
- - -
-
-

-
+ + +

Model Sentences

+ + + + +
- - - - -

- - - - - - - - - - - Translation Equivalent: -
-  view metadata - - - analysis - Analysis:
- - -
-
-

-
+ + +

Translation Equivalents

+ + + + +
- -

- - - - - - - - - - - Related Term:
- Related Term Type: -
-  view metadata - - - analysis - Analysis:
- - -
-
-

-
+ + +

RelatedTerm

+ + + + +
- -

- - - - - - - - - - - - - Literary Source:
- Spelling:
- Pagination:
- Passage:
-  view metadata - - - - - - - view/edit translation - Literary Source:
- Spelling:
- Pagination:
- Passage:
- - -
-
- - - analysis - Analysis:
- - -
-
-

-
+ + +

Passages

+ + + + +
- -

- - - - - - - - - - Speech Register: -
-  view metadata + + +

Registers

+ + + + - - analysis - Analysis:
- - -
-
-

-
-
-
-
-
+ +
-

 

-

 

-

 

-

 

- - - -
+
- diff --git a/src/jsp/jsp/displayTreeToc.jsf b/src/jsp/jsp/displayTreeToc.jsf new file mode 100644 index 0000000..3d05e80 --- /dev/null +++ b/src/jsp/jsp/displayTreeToc.jsf @@ -0,0 +1,116 @@ +<%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> + + + +

Term Map

+

+ +

+ +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/src/jsp/jsp/encyclopediaArticleForm.jsf b/src/jsp/jsp/encyclopediaArticleForm.jsf index 23326c8..ffa5511 100644 --- a/src/jsp/jsp/encyclopediaArticleForm.jsf +++ b/src/jsp/jsp/encyclopediaArticleForm.jsf @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -38,7 +38,6 @@
- Article Title:
diff --git a/src/jsp/jsp/etymologyForm.jsf b/src/jsp/jsp/etymologyForm.jsf index 3018ee7..a7d1b13 100644 --- a/src/jsp/jsp/etymologyForm.jsf +++ b/src/jsp/jsp/etymologyForm.jsf @@ -11,9 +11,9 @@ - - + + @@ -22,8 +22,8 @@ - + @@ -31,7 +31,6 @@ - @@ -53,7 +52,6 @@ - diff --git a/src/jsp/jsp/functionForm.jsf b/src/jsp/jsp/functionForm.jsf index 453842b..a50a2dc 100644 --- a/src/jsp/jsp/functionForm.jsf +++ b/src/jsp/jsp/functionForm.jsf @@ -10,21 +10,21 @@ - + - + - + @@ -35,7 +35,6 @@ - Grammatical Function: diff --git a/src/jsp/jsp/metaForm.jsf b/src/jsp/jsp/metaForm.jsf index f2cbf3b..a17621d 100644 --- a/src/jsp/jsp/metaForm.jsf +++ b/src/jsp/jsp/metaForm.jsf @@ -36,17 +36,15 @@ -<%-- - - - + + + + +<%-- + --%> - - - - - +

Analysis:
diff --git a/src/jsp/jsp/modelSentenceForm.jsf b/src/jsp/jsp/modelSentenceForm.jsf index 9eda6c7..2328499 100644 --- a/src/jsp/jsp/modelSentenceForm.jsf +++ b/src/jsp/jsp/modelSentenceForm.jsf @@ -9,7 +9,7 @@ <%-- --%> - + @@ -17,14 +17,14 @@ <%-- --%> - + <%-- --%> - + @@ -46,7 +46,6 @@ - Model Sentence:
diff --git a/src/jsp/jsp/passageForm.jsf b/src/jsp/jsp/passageForm.jsf index 5b9a316..40aa459 100644 --- a/src/jsp/jsp/passageForm.jsf +++ b/src/jsp/jsp/passageForm.jsf @@ -11,7 +11,7 @@ - + @@ -21,7 +21,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -54,7 +54,6 @@ - LiterarySource:
diff --git a/src/jsp/jsp/pronunciationForm.jsf b/src/jsp/jsp/pronunciationForm.jsf index a6c87e3..1794e30 100644 --- a/src/jsp/jsp/pronunciationForm.jsf +++ b/src/jsp/jsp/pronunciationForm.jsf @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -38,7 +38,6 @@ - Phonetic Rendering:
diff --git a/src/jsp/jsp/registerForm.jsf b/src/jsp/jsp/registerForm.jsf index fd81877..086a2c7 100644 --- a/src/jsp/jsp/registerForm.jsf +++ b/src/jsp/jsp/registerForm.jsf @@ -9,7 +9,7 @@ <%-- --%> - + @@ -17,14 +17,14 @@ <%-- --%> - + <%-- --%> - + @@ -35,7 +35,6 @@ - Register: diff --git a/src/jsp/jsp/spellingForm.jsf b/src/jsp/jsp/spellingForm.jsf index cfd3d88..c2a1c6a 100644 --- a/src/jsp/jsp/spellingForm.jsf +++ b/src/jsp/jsp/spellingForm.jsf @@ -10,7 +10,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -37,7 +37,6 @@ - Spelling:
diff --git a/src/jsp/jsp/subdefinitionForm.jsf b/src/jsp/jsp/subdefinitionForm.jsf index 4539379..4d02a62 100644 --- a/src/jsp/jsp/subdefinitionForm.jsf +++ b/src/jsp/jsp/subdefinitionForm.jsf @@ -8,21 +8,21 @@ - + - + - + @@ -45,7 +45,6 @@ - Subdefinition:
diff --git a/src/jsp/jsp/termForm.jsf b/src/jsp/jsp/termForm.jsf index 7e57a82..3188c97 100644 --- a/src/jsp/jsp/termForm.jsf +++ b/src/jsp/jsp/termForm.jsf @@ -5,26 +5,23 @@ - + - - + - - @@ -39,7 +36,8 @@ Term:
-Precedence:
+ + diff --git a/src/jsp/jsp/transitionalDataForm.jsf b/src/jsp/jsp/transitionalDataForm.jsf index b555242..ecc0298 100644 --- a/src/jsp/jsp/transitionalDataForm.jsf +++ b/src/jsp/jsp/transitionalDataForm.jsf @@ -39,7 +39,6 @@ - diff --git a/src/jsp/jsp/translationEquivalentForm.jsf b/src/jsp/jsp/translationEquivalentForm.jsf index c91d6eb..6ad82ae 100644 --- a/src/jsp/jsp/translationEquivalentForm.jsf +++ b/src/jsp/jsp/translationEquivalentForm.jsf @@ -9,7 +9,7 @@ <%-- --%> - + @@ -17,14 +17,14 @@ <%-- --%> - + <%-- --%> - + @@ -35,7 +35,6 @@ - Translation Equivalent: