Big Update to fix rampant bugs with basic add/edit/remove of everything

This commit is contained in:
travismccauley 2003-12-21 16:51:08 +00:00
parent 136340ab79
commit afa2f340a1
30 changed files with 771 additions and 308 deletions

View file

@ -39,6 +39,10 @@
<name>maxActive</name> <name>maxActive</name>
<value>15</value> <value>15</value>
</parameter> </parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams> </ResourceParams>
<Resource name="jdbc/thdl-users-datasource" scope="Shareable" type="javax.sql.DataSource"/> <Resource name="jdbc/thdl-users-datasource" scope="Shareable" type="javax.sql.DataSource"/>
@ -87,6 +91,10 @@
<name>maxActive</name> <name>maxActive</name>
<value>15</value> <value>15</value>
</parameter> </parameter>
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams> </ResourceParams>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="lex_access_log." suffix=".txt" pattern="combined" resolveHosts="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="lex_access_log." suffix=".txt" pattern="combined" resolveHosts="true"/>

View file

@ -137,9 +137,10 @@ public class LexActionServlet extends HttpServlet
rd.forward( req, res ); rd.forward( req, res );
LexLogger.debug( "Checking Request state at end of LexActionServlet.service()" ); LexLogger.debug( "Checking Request state at end of LexActionServlet.service()" );
LexLogger.logRequestState( req ); LexLogger.logRequestState( req );
LexLogger.debug( "Checking Session state at end of LexActionServlet.service()" );
LexLogger.logSessionState( req ); LexLogger.logSessionState( req );
LexLogger.debug( "Checking Context state at end of LexActionServlet.service()" );
LexLogger.logContextState( getServletContext() ); LexLogger.logContextState( getServletContext() );
} }
@ -199,7 +200,6 @@ public class LexActionServlet extends HttpServlet
commands.put( "addAnnotation", new AddAnnotationCommand( "displayEntry.jsp", Boolean.TRUE ) ); commands.put( "addAnnotation", new AddAnnotationCommand( "displayEntry.jsp", Boolean.TRUE ) );
*/ */
commands.put( "insert", new InsertCommand( "displayEntry.jsp", Boolean.FALSE ) ); 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( "insertTerm", new InsertCommand( "displayEntry.jsp", Boolean.TRUE ) );
commands.put( "update", new UpdateCommand( "displayEntry.jsp", Boolean.FALSE ) ); commands.put( "update", new UpdateCommand( "displayEntry.jsp", Boolean.FALSE ) );

View file

@ -267,6 +267,33 @@ public class LexComponentRepository
} }
/**
* Description of the Method
*
* @param pk Description of the Parameter
* @return Description of the Return Value
* @exception LexRepositoryException Description of the Exception
*/
public static ITerm findTermByPk( Integer pk ) throws LexRepositoryException
{
ITerm term = null;
beginTransaction();
String queryString = " FROM org.thdl.lex.component.ITerm as term WHERE term.metaId = " + pk.toString();
try
{
Query query = getSession().createQuery( queryString );
term = (ITerm) query.uniqueResult();
}
catch ( HibernateException he )
{
throw new LexRepositoryException( he );
}
endTransaction( false );
return term;
}
/** /**
* Description of the Method * Description of the Method
* *
@ -274,7 +301,7 @@ public class LexComponentRepository
* @exception LexRepositoryException Description of Exception * @exception LexRepositoryException Description of Exception
* @since * @since
*/ */
public static void loadTermByPk( ITerm term ) throws LexRepositoryException public static void loadTerm( ITerm term ) throws LexRepositoryException
{ {
try try
{ {
@ -299,7 +326,7 @@ public class LexComponentRepository
{ {
beginTransaction(); beginTransaction();
ITerm term = assertTerm( lexQuery.getQueryComponent() ); ITerm term = assertTerm( lexQuery.getQueryComponent() );
loadTermByPk( term ); loadTerm( term );
lexQuery.setEntry( term ); lexQuery.setEntry( term );
if ( !lexQuery.getResults().containsKey( term.getMetaId() ) ) if ( !lexQuery.getResults().containsKey( term.getMetaId() ) )
{ {

View file

@ -182,15 +182,20 @@ public class LexLogger
*/ */
public static void debugComponent( Object component ) public static void debugComponent( Object component )
{ {
if ( null == component )
{
debug( "debugComponent was just handed a null component" );
return;
}
try try
{ {
LOGGER.debug( "Describing:: " + component ); LOGGER.debug( "Describing: " + component );
String label = component instanceof ILexComponent ? ( (ILexComponent) component ).getLabel() : component.toString(); String label = component instanceof ILexComponent ? ( (ILexComponent) component ).getLabel() : component.toString();
Iterator it = BeanUtils.describe( component ).entrySet().iterator(); Iterator it = BeanUtils.describe( component ).entrySet().iterator();
while ( it.hasNext() ) while ( it.hasNext() )
{ {
Map.Entry entry = (Map.Entry) it.next(); Map.Entry entry = (Map.Entry) it.next();
LOGGER.debug( label + " property:: " + entry.getKey() + " = '" + entry.getValue() + "'" ); LOGGER.debug( label + " property: " + entry.getKey() + " = '" + entry.getValue() + "'" );
} }
} }
catch ( Exception e ) catch ( Exception e )
@ -198,8 +203,20 @@ public class LexLogger
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
e.printStackTrace( new PrintWriter( writer ) ); e.printStackTrace( new PrintWriter( writer ) );
String stackTrace = writer.getBuffer().toString(); String stackTrace = writer.getBuffer().toString();
LOGGER.debug( "LexLogger caught an Exception:: " + stackTrace ); LOGGER.debug( "LexLogger caught an Exception: " + stackTrace );
} }
} }
/**
* Description of the Method
*
* @param term Description of the Parameter
*/
public static void debugTerm( ITerm term )
{
debugComponent( term );
}
} }

View file

@ -74,7 +74,7 @@ public class DisplayCommand extends LexCommand implements Command
} }
else else
{ {
LexComponentRepository.loadTermByPk( term ); LexComponentRepository.loadTerm( term );
query.setEntry( term ); query.setEntry( term );
if ( query.getResults().keySet().size() < 1 ) if ( query.getResults().keySet().size() < 1 )
{ {

View file

@ -88,7 +88,7 @@ public class GetInsertFormCommand extends LexCommand implements Command
{ {
AnalyticalNote note = new AnalyticalNote(); AnalyticalNote note = new AnalyticalNote();
note.setParentId( component.getMetaId() ); note.setParentId( component.getMetaId() );
note.setAnalyticalNote( req.getParameter( "analyticalNote" ) ); //note.setAnalyticalNote( req.getParameter( "analyticalNote" ) );
note.setPrecedence( new Integer( 0 ) ); note.setPrecedence( new Integer( 0 ) );
component.setAnalyticalNotes( new LinkedList() ); component.setAnalyticalNotes( new LinkedList() );
component.getAnalyticalNotes().add( note ); component.getAnalyticalNotes().add( note );

View file

@ -74,6 +74,13 @@ public class GetRemoveFormCommand extends LexCommand implements Command
{ {
component = query.getEntry(); component = query.getEntry();
} }
else if ( component instanceof IAnalyticalNote )
{
ILexComponent parent = term.findParent( component.getParentId() );
List notes = parent.getAnalyticalNotes();
int index = notes.indexOf( component );
component = (ILexComponent) notes.get( index );
}
else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() ) else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() )
{ {
LexComponentRepository.update( term ); LexComponentRepository.update( term );

View file

@ -68,12 +68,19 @@ public class GetUpdateFormCommand extends LexCommand implements Command
try try
{ {
LexLogger.debug( "Checking component state from getUpdateFormCommand BEFORE component assignment" );
LexLogger.debugComponent( component );
if ( isTermMode() ) if ( isTermMode() )
{ {
component = query.getEntry(); component = query.getEntry();
} }
else if ( component instanceof IAnalyticalNote )
{
ILexComponent parent = term.findParent( component.getParentId() );
List notes = parent.getAnalyticalNotes();
int index = notes.indexOf( component );
component = (ILexComponent) notes.get( index );
LexLogger.debug( "Checking component state from getUpdateFormCommand AFTER assignment to analytical Note" );
LexLogger.debugComponent( component );
}
else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() ) else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() )
{ {
LexComponentRepository.update( term ); LexComponentRepository.update( term );

View file

@ -83,13 +83,22 @@ public class InsertCommand extends LexCommand implements Command
if ( isTermMode() ) if ( isTermMode() )
{ {
term = (ITerm) component; query.setEntry( (ITerm) component );
//term.populate( req.getParameterMap() ); term = query.getEntry();
} }
else if ( component instanceof AnalyticalNote ) else if ( component instanceof AnalyticalNote )
{ {
LexLogger.debug( "Debugging Component before inserting analytical note" );
LexLogger.debugComponent( component );
ILexComponent parent = term.findParent( component.getParentId() ); ILexComponent parent = term.findParent( component.getParentId() );
parent.getAnalyticalNotes().add( component ); List list = parent.getAnalyticalNotes();
if ( null == list )
{
list = new LinkedList();
}
list.add( component );
parent.setAnalyticalNotes( list );
//term.addSiblingList( parent, component, list );
} }
else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() ) else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() )
{ {
@ -106,8 +115,13 @@ public class InsertCommand extends LexCommand implements Command
source.setMetaId( translation.getTranslationOf() ); source.setMetaId( translation.getTranslationOf() );
source.setParentId( translation.getParentId() ); source.setParentId( translation.getParentId() );
source = (Translatable) term.findChild( source ); source = (Translatable) term.findChild( source );
List l = source.getTranslations(); List list = source.getTranslations();
l.add( translation ); if ( null == list )
{
list = new LinkedList();
}
list.add( translation );
source.setTranslations( list );
} }
else else
{ {
@ -124,6 +138,8 @@ public class InsertCommand extends LexCommand implements Command
component.getMeta().setCreatedBy( user.getId() ); component.getMeta().setCreatedBy( user.getId() );
component.getMeta().setModifiedBy( user.getId() ); component.getMeta().setModifiedBy( user.getId() );
LexComponentRepository.save( term );
if ( !isTermMode() ) if ( !isTermMode() )
{ {
term.getMeta().setModifiedOn( now ); term.getMeta().setModifiedOn( now );
@ -134,6 +150,7 @@ public class InsertCommand extends LexCommand implements Command
{ {
AnalyticalNote note = new AnalyticalNote(); AnalyticalNote note = new AnalyticalNote();
note.setAnalyticalNote( req.getParameter( "analyticalNote" ) ); note.setAnalyticalNote( req.getParameter( "analyticalNote" ) );
note.setParentId( component.getMetaId() );
note.setPrecedence( new Integer( 0 ) ); note.setPrecedence( new Integer( 0 ) );
component.setAnalyticalNotes( new LinkedList() ); component.setAnalyticalNotes( new LinkedList() );
component.getAnalyticalNotes().add( note ); component.getAnalyticalNotes().add( note );
@ -146,9 +163,10 @@ public class InsertCommand extends LexCommand implements Command
LexLogger.debugComponent( component ); LexLogger.debugComponent( component );
LexLogger.debugComponent( term ); LexLogger.debugComponent( term );
LexComponentRepository.save( term ); LexComponentRepository.update( term );
msg = "Successful Update"; msg = "Successful Update";
visit.setDisplayMode( "edit" ); visit.setDisplayMode( "edit" );
} }
else else
{ {
@ -167,6 +185,8 @@ public class InsertCommand extends LexCommand implements Command
finally finally
{ {
req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg );
LexLogger.debug( "Showing Term Map at end of InsertCommand.execute()" );
LexLogger.debugTerm( ( (Visit) req.getSession( false ).getAttribute( "visit" ) ).getQuery().getEntry() );
} }
} }

View file

@ -82,6 +82,14 @@ public class RemoveCommand extends LexCommand implements Command
LexComponentRepository.update( term ); LexComponentRepository.update( term );
query.setEntry( null ); query.setEntry( null );
} }
else if ( component instanceof AnalyticalNote )
{
LexLogger.debug( "Debugging Component before inserting analytical note" );
LexLogger.debugComponent( component );
ILexComponent parent = term.findParent( component.getParentId() );
List notes = parent.getAnalyticalNotes();
notes.remove( component );
}
else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() ) else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() )
{ {
Translatable translation = (Translatable) component; Translatable translation = (Translatable) component;

View file

@ -86,6 +86,15 @@ public class UpdateCommand extends LexCommand implements Command
term.getMeta().populate( req.getParameterMap() ); term.getMeta().populate( req.getParameterMap() );
component = term; component = term;
} }
else if ( component instanceof AnalyticalNote )
{
LexLogger.debug( "Debugging Component before updating analytical note" );
LexLogger.debugComponent( component );
ILexComponent parent = term.findParent( component.getParentId() );
List notes = parent.getAnalyticalNotes();
ILexComponent ilc = (ILexComponent) notes.get( notes.indexOf( component ) );
ilc.populate( component );
}
else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() ) else if ( component instanceof Translatable && null != ( (Translatable) component ).getTranslationOf() )
{ {
Translatable translation = (Translatable) component; Translatable translation = (Translatable) component;
@ -125,7 +134,7 @@ public class UpdateCommand extends LexCommand implements Command
LexLogger.debugComponent( component ); LexLogger.debugComponent( component );
LexLogger.debugComponent( term ); LexLogger.debugComponent( term );
LexComponentRepository.save( term ); LexComponentRepository.update( term );
msg = "Successful Update"; msg = "Successful Update";
visit.setDisplayMode( "edit" ); visit.setDisplayMode( "edit" );
} }

View file

@ -4,191 +4,460 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringBuilder;
/** @author Hibernate CodeGenerator */
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; * @author Hibernate CodeGenerator
* @created December 20, 2003
*/
public abstract 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 precedence; * nullable persistent field
*/
private java.lang.Integer parentId;
/** nullable persistent field */ /**
private java.lang.String subdefinition; * nullable persistent field
*/
private java.lang.Integer precedence;
/** nullable persistent field */ /**
private java.lang.Integer translationOf; * nullable persistent field
*/
private java.lang.String subdefinition;
/** nullable persistent field */ /**
private org.thdl.lex.component.ILexComponent parent; * nullable persistent field
*/
private java.lang.Integer translationOf;
/** persistent field */ /**
private List translations; * nullable persistent field
*/
private org.thdl.lex.component.ILexComponent parent;
/** persistent field */ /**
private List glosses; * persistent field
*/
private List translations;
/** persistent field */ /**
private List keywords; * persistent field
*/
private List glosses;
/** persistent field */ /**
private List modelSentences; * persistent field
*/
private List keywords;
/** persistent field */ /**
private List translationEquivalents; * persistent field
*/
private List modelSentences;
/** persistent field */ /**
private List relatedTerms; * persistent field
*/
private List translationEquivalents;
/** persistent field */ /**
private List passages; * persistent field
*/
private List relatedTerms;
/** persistent field */ /**
private List registers; * persistent field
*/
private List passages;
/** full constructor */ /**
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 translations, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) { * persistent field
super(deleted, analyticalNotes, meta); */
this.parentId = parentId; private List registers;
this.precedence = precedence;
this.subdefinition = subdefinition;
this.translationOf = translationOf;
this.parent = parent;
this.translations = translations;
this.glosses = glosses;
this.keywords = keywords;
this.modelSentences = modelSentences;
this.translationEquivalents = translationEquivalents;
this.relatedTerms = relatedTerms;
this.passages = passages;
this.registers = registers;
}
/** default constructor */
public BaseSubdefinition() {
}
/** minimal constructor */ /**
public BaseSubdefinition(java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, List translations, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers) { * full constructor
super(deleted, analyticalNotes, meta); *
this.translations = translations; * @param deleted Description of the Parameter
this.glosses = glosses; * @param analyticalNotes Description of the Parameter
this.keywords = keywords; * @param meta Description of the Parameter
this.modelSentences = modelSentences; * @param parentId Description of the Parameter
this.translationEquivalents = translationEquivalents; * @param precedence Description of the Parameter
this.relatedTerms = relatedTerms; * @param subdefinition Description of the Parameter
this.passages = passages; * @param translationOf Description of the Parameter
this.registers = registers; * @param parent Description of the Parameter
} * @param translations Description of the Parameter
* @param glosses Description of the Parameter
* @param keywords Description of the Parameter
* @param modelSentences Description of the Parameter
* @param translationEquivalents Description of the Parameter
* @param relatedTerms Description of the Parameter
* @param passages Description of the Parameter
* @param registers Description of the Parameter
*/
public 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 translations, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers )
{
super( deleted, analyticalNotes, meta );
this.parentId = parentId;
this.precedence = precedence;
this.subdefinition = subdefinition;
this.translationOf = translationOf;
this.parent = parent;
this.translations = translations;
this.glosses = glosses;
this.keywords = keywords;
this.modelSentences = modelSentences;
this.translationEquivalents = translationEquivalents;
this.relatedTerms = relatedTerms;
this.passages = passages;
this.registers = registers;
}
public java.lang.Integer getParentId() {
return this.parentId;
}
public void setParentId(java.lang.Integer parentId) { /**
this.parentId = parentId; * default constructor
} */
public BaseSubdefinition() { }
public java.lang.Integer getPrecedence() {
return this.precedence;
}
public void setPrecedence(java.lang.Integer precedence) { /**
this.precedence = precedence; * minimal constructor
} *
* @param deleted Description of the Parameter
* @param analyticalNotes Description of the Parameter
* @param meta Description of the Parameter
* @param translations Description of the Parameter
* @param glosses Description of the Parameter
* @param keywords Description of the Parameter
* @param modelSentences Description of the Parameter
* @param translationEquivalents Description of the Parameter
* @param relatedTerms Description of the Parameter
* @param passages Description of the Parameter
* @param registers Description of the Parameter
*/
public BaseSubdefinition( java.lang.Boolean deleted, List analyticalNotes, org.thdl.lex.component.Meta meta, List translations, List glosses, List keywords, List modelSentences, List translationEquivalents, List relatedTerms, List passages, List registers )
{
super( deleted, analyticalNotes, meta );
this.translations = translations;
this.glosses = glosses;
this.keywords = keywords;
this.modelSentences = modelSentences;
this.translationEquivalents = translationEquivalents;
this.relatedTerms = relatedTerms;
this.passages = passages;
this.registers = registers;
}
public java.lang.String getSubdefinition() {
return this.subdefinition;
}
public void setSubdefinition(java.lang.String subdefinition) { /**
this.subdefinition = subdefinition; * Gets the parentId attribute of the BaseSubdefinition object
} *
* @return The parentId value
*/
public java.lang.Integer getParentId()
{
return this.parentId;
}
public java.lang.Integer getTranslationOf() {
return this.translationOf;
}
public void setTranslationOf(java.lang.Integer translationOf) { /**
this.translationOf = translationOf; * Sets the parentId attribute of the BaseSubdefinition object
} *
* @param parentId The new parentId value
*/
public void setParentId( java.lang.Integer parentId )
{
this.parentId = parentId;
}
public org.thdl.lex.component.ILexComponent getParent() {
return this.parent;
}
public void setParent(org.thdl.lex.component.ILexComponent parent) { /**
this.parent = parent; * Gets the precedence attribute of the BaseSubdefinition object
} *
* @return The precedence value
*/
public java.lang.Integer getPrecedence()
{
return this.precedence;
}
public java.util.List getTranslations() {
return this.translations;
}
public void setTranslations(java.util.List translations) { /**
this.translations = translations; * Sets the precedence attribute of the BaseSubdefinition object
} *
* @param precedence The new precedence value
*/
public void setPrecedence( java.lang.Integer precedence )
{
if ( null == precedence )
{
int i = getGlosses().size();
}
if ( ( new Integer( -1 ) ).equals( precedence ) )
{
Object o = new String();
Integer i = (Integer) o;
}
this.precedence = precedence;
}
public java.util.List getGlosses() {
return this.glosses;
}
public void setGlosses(java.util.List glosses) { /**
this.glosses = glosses; * Gets the subdefinition attribute of the BaseSubdefinition object
} *
* @return The subdefinition value
*/
public java.lang.String getSubdefinition()
{
return this.subdefinition;
}
public java.util.List getKeywords() {
return this.keywords;
}
public void setKeywords(java.util.List keywords) { /**
this.keywords = keywords; * Sets the subdefinition attribute of the BaseSubdefinition object
} *
* @param subdefinition The new subdefinition value
*/
public void setSubdefinition( java.lang.String subdefinition )
{
this.subdefinition = subdefinition;
}
public java.util.List getModelSentences() {
return this.modelSentences;
}
public void setModelSentences(java.util.List modelSentences) { /**
this.modelSentences = modelSentences; * Gets the translationOf attribute of the BaseSubdefinition object
} *
* @return The translationOf value
*/
public java.lang.Integer getTranslationOf()
{
return this.translationOf;
}
public java.util.List getTranslationEquivalents() {
return this.translationEquivalents;
}
public void setTranslationEquivalents(java.util.List translationEquivalents) { /**
this.translationEquivalents = translationEquivalents; * Sets the translationOf attribute of the BaseSubdefinition object
} *
* @param translationOf The new translationOf value
*/
public void setTranslationOf( java.lang.Integer translationOf )
{
this.translationOf = translationOf;
}
public java.util.List getRelatedTerms() {
return this.relatedTerms;
}
public void setRelatedTerms(java.util.List relatedTerms) { /**
this.relatedTerms = relatedTerms; * Gets the parent attribute of the BaseSubdefinition object
} *
* @return The parent value
*/
public org.thdl.lex.component.ILexComponent getParent()
{
return this.parent;
}
public java.util.List getPassages() {
return this.passages;
}
public void setPassages(java.util.List passages) { /**
this.passages = passages; * Sets the parent attribute of the BaseSubdefinition object
} *
* @param parent The new parent value
*/
public void setParent( org.thdl.lex.component.ILexComponent parent )
{
this.parent = parent;
}
public java.util.List getRegisters() {
return this.registers;
}
public void setRegisters(java.util.List registers) { /**
this.registers = registers; * Gets the translations attribute of the BaseSubdefinition object
} *
* @return The translations value
*/
public java.util.List getTranslations()
{
return this.translations;
}
public String toString() {
return new ToStringBuilder(this) /**
.append("metaId", getMetaId()) * Sets the translations attribute of the BaseSubdefinition object
.toString(); *
} * @param translations The new translations value
*/
public void setTranslations( java.util.List translations )
{
this.translations = translations;
}
/**
* Gets the glosses attribute of the BaseSubdefinition object
*
* @return The glosses value
*/
public java.util.List getGlosses()
{
return this.glosses;
}
/**
* Sets the glosses attribute of the BaseSubdefinition object
*
* @param glosses The new glosses value
*/
public void setGlosses( java.util.List glosses )
{
this.glosses = glosses;
}
/**
* Gets the keywords attribute of the BaseSubdefinition object
*
* @return The keywords value
*/
public java.util.List getKeywords()
{
return this.keywords;
}
/**
* Sets the keywords attribute of the BaseSubdefinition object
*
* @param keywords The new keywords value
*/
public void setKeywords( java.util.List keywords )
{
this.keywords = keywords;
}
/**
* Gets the modelSentences attribute of the BaseSubdefinition object
*
* @return The modelSentences value
*/
public java.util.List getModelSentences()
{
return this.modelSentences;
}
/**
* Sets the modelSentences attribute of the BaseSubdefinition object
*
* @param modelSentences The new modelSentences value
*/
public void setModelSentences( java.util.List modelSentences )
{
this.modelSentences = modelSentences;
}
/**
* Gets the translationEquivalents attribute of the BaseSubdefinition object
*
* @return The translationEquivalents value
*/
public java.util.List getTranslationEquivalents()
{
return this.translationEquivalents;
}
/**
* Sets the translationEquivalents attribute of the BaseSubdefinition object
*
* @param translationEquivalents The new translationEquivalents value
*/
public void setTranslationEquivalents( java.util.List translationEquivalents )
{
this.translationEquivalents = translationEquivalents;
}
/**
* Gets the relatedTerms attribute of the BaseSubdefinition object
*
* @return The relatedTerms value
*/
public java.util.List getRelatedTerms()
{
return this.relatedTerms;
}
/**
* Sets the relatedTerms attribute of the BaseSubdefinition object
*
* @param relatedTerms The new relatedTerms value
*/
public void setRelatedTerms( java.util.List relatedTerms )
{
this.relatedTerms = relatedTerms;
}
/**
* Gets the passages attribute of the BaseSubdefinition object
*
* @return The passages value
*/
public java.util.List getPassages()
{
return this.passages;
}
/**
* Sets the passages attribute of the BaseSubdefinition object
*
* @param passages The new passages value
*/
public void setPassages( java.util.List passages )
{
this.passages = passages;
}
/**
* Gets the registers attribute of the BaseSubdefinition object
*
* @return The registers value
*/
public java.util.List getRegisters()
{
return this.registers;
}
/**
* Sets the registers attribute of the BaseSubdefinition object
*
* @param registers The new registers value
*/
public void setRegisters( java.util.List registers )
{
this.registers = registers;
}
/**
* Description of the Method
*
* @return Description of the Return Value
*/
public String toString()
{
return new ToStringBuilder( this )
.append( "metaId", getMetaId() )
.toString();
}
} }

View file

@ -3,6 +3,7 @@ package org.thdl.lex.component;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;
import org.thdl.lex.*; import org.thdl.lex.*;
import org.apache.commons.beanutils.MethodUtils;
/** /**
@ -58,14 +59,18 @@ public class Definition extends BaseDefinition implements Serializable, Translat
} }
LexComponentNode node = (LexComponentNode) component.getParent(); LexComponentNode node = (LexComponentNode) component.getParent();
list = (List) node.getChildMap().get( component.getLabel() ); list = (List) node.getChildMap().get( component.getLabel() );
LexLogger.debug( "[Definition] List derived from " + node + ": " + list );
if ( null == list ) if ( null == list )
{ {
Iterator it = getSubdefinitions().iterator(); if ( null != getSubdefinitions() )
while ( it.hasNext() )
{ {
ISubdefinition subdef = (ISubdefinition) it.next(); Iterator it = getSubdefinitions().iterator();
list = subdef.findSiblings( component ); while ( it.hasNext() )
{
ISubdefinition subdef = (ISubdefinition) it.next();
list = subdef.findSiblings( component );
}
} }
} }
@ -129,13 +134,15 @@ public class Definition extends BaseDefinition implements Serializable, Translat
child = findChild( list, pk ); child = findChild( list, pk );
} }
Iterator subdefinitions = getSubdefinitions().iterator(); if ( null != getSubdefinitions() )
while ( subdefinitions.hasNext() && null == child )
{ {
ISubdefinition def = (ISubdefinition) subdefinitions.next(); Iterator subdefinitions = getSubdefinitions().iterator();
child = def.findChild( pk ); while ( subdefinitions.hasNext() && null == child )
{
ISubdefinition def = (ISubdefinition) subdefinitions.next();
child = def.findChild( pk );
}
} }
return child; return child;
} }
@ -150,13 +157,16 @@ public class Definition extends BaseDefinition implements Serializable, Translat
public ILexComponent findChild( List list, Integer pk ) public ILexComponent findChild( List list, Integer pk )
{ {
ILexComponent child = null; ILexComponent child = null;
for ( Iterator it = list.iterator(); it.hasNext(); ) if ( null != list )
{ {
ILexComponent lc = (LexComponent) it.next(); for ( Iterator it = list.iterator(); it.hasNext(); )
if ( lc.getMetaId().equals( pk ) )
{ {
child = lc; ILexComponent lc = (LexComponent) it.next();
break; if ( lc.getMetaId().equals( pk ) )
{
child = lc;
break;
}
} }
} }
return child; return child;

View file

@ -1,5 +1,7 @@
package org.thdl.lex.component; package org.thdl.lex.component;
import java.util.List;
/** /**
* Description of the Interface * Description of the Interface
@ -181,5 +183,16 @@ public interface ILexComponent
* @exception LexComponentException Description of the Exception * @exception LexComponentException Description of the Exception
*/ */
public void populate( ILexComponent component ) throws LexComponentException; public void populate( ILexComponent component ) throws LexComponentException;
/**
* Adds a feature to the SiblingList attribute of the LexComponentNode object
*
* @param component The feature to be added to the SiblingList attribute
* @param list The feature to be added to the SiblingList attribute
* @param parent The feature to be added to the SiblingList attribute
* @exception LexComponentException Description of the Exception
*/
public void addSiblingList( ILexComponent parent, ILexComponent component, List list ) throws LexComponentException;
} }

View file

@ -3,6 +3,7 @@ import java.io.Serializable;
import java.util.*; import java.util.*;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.MethodUtils;
/** /**
@ -206,6 +207,44 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
} }
/**
* Uses component.label to find the correct sibling list in 'parent' and set it to 'list'
*
* @param component The feature to be added to the SiblingList attribute
* @param list The feature to be added to the SiblingList attribute
* @param parent The feature to be added to the SiblingList attribute
* @exception LexComponentException Description of the Exception
*/
public void addSiblingList( ILexComponent parent, ILexComponent component, List list ) throws LexComponentException
{
String label = component.getLabel();
if ( label.equals( "etymology" ) )
{
label = "etymologies";
}
else if ( label.equals( "transitionalData" ) )
{
label = "transitionalData";
}
else
{
label = label + "s";
}
char[] chars = label.toCharArray();
chars[0] = Character.toUpperCase( chars[0] );
label = "set" + new String( chars );
try
{
Object iAmVoid = MethodUtils.invokeMethod( parent, label, list );
}
catch ( Exception e )
{
throw new LexComponentException( e );
}
}
/** /**
* Description of the Method * Description of the Method
* *
@ -214,12 +253,17 @@ public abstract class LexComponent extends BaseLexComponent implements Serializa
*/ */
public boolean equals( Object o ) public boolean equals( Object o )
{ {
boolean b = false; boolean rVal = false;
if ( o instanceof ILexComponent ) if ( o instanceof ILexComponent )
{ {
b = this.metaId.equals( ( (ILexComponent) o ).getMetaId() ); Integer a = ( (ILexComponent) o ).getMetaId();
Integer b = this.getMetaId();
if ( null != a && null != b )
{
rVal = a.equals( b );
}
} }
return b; return rVal;
} }
//constructors //constructors

View file

@ -1,5 +1,7 @@
package org.thdl.lex.component; package org.thdl.lex.component;
import java.util.List;
/** /**
* Description of the Interface * Description of the Interface
@ -29,5 +31,6 @@ public interface LexComponentNode extends ILexComponent
* @exception LexComponentException Description of the Exception * @exception LexComponentException Description of the Exception
*/ */
public java.util.List findSiblings( ILexComponent component ) throws LexComponentException; public java.util.List findSiblings( ILexComponent component ) throws LexComponentException;
} }

View file

@ -3,6 +3,7 @@ package org.thdl.lex.component;
import java.io.Serializable; import java.io.Serializable;
import java.util.*; import java.util.*;
import org.thdl.lex.*; import org.thdl.lex.*;
import org.apache.commons.beanutils.MethodUtils;
@ -87,6 +88,8 @@ public class Subdefinition extends BaseSubdefinition implements Serializable, Tr
} }
/** /**
* Gets the persistentChild attribute of the Term object * Gets the persistentChild attribute of the Term object
* *
@ -133,13 +136,16 @@ public class Subdefinition extends BaseSubdefinition implements Serializable, Tr
public ILexComponent findChild( List list, Integer pk ) public ILexComponent findChild( List list, Integer pk )
{ {
ILexComponent child = null; ILexComponent child = null;
for ( Iterator it = list.iterator(); it.hasNext(); ) if ( list != null )
{ {
ILexComponent lc = (LexComponent) it.next(); for ( Iterator it = list.iterator(); it.hasNext(); )
if ( lc.getMetaId().equals( pk ) )
{ {
child = lc; ILexComponent lc = (LexComponent) it.next();
break; if ( lc.getMetaId().equals( pk ) )
{
child = lc;
break;
}
} }
} }
return child; return child;

View file

@ -5,6 +5,7 @@ import java.util.*;
import org.thdl.lex.*; import org.thdl.lex.*;
/** /**
* Description of the Class * Description of the Class
* *
@ -102,18 +103,21 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode
} }
LexComponentNode node = (LexComponentNode) component.getParent(); LexComponentNode node = (LexComponentNode) component.getParent();
list = (List) node.getChildMap().get( component.getLabel() ); list = (List) node.getChildMap().get( component.getLabel() );
LexLogger.debug( "List derived from " + node + ": " + list ); LexLogger.debug( "[Term] List derived from " + node + ": " + list );
if ( null == list ) if ( null == list )
{ {
LexLogger.debug( "findSiblings returned a null list" ); LexLogger.debug( "findSiblings returned a null list" );
LexLogger.debugComponent( component ); LexLogger.debugComponent( component );
Iterator it = getDefinitions().iterator(); if ( null != getDefinitions() )
while ( it.hasNext() )
{ {
IDefinition def = (IDefinition) it.next(); Iterator it = getDefinitions().iterator();
list = def.findSiblings( component ); while ( it.hasNext() )
{
IDefinition def = (IDefinition) it.next();
list = def.findSiblings( component );
}
} }
} }
@ -160,20 +164,6 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode
} }
/**
* Description of the Method
*
* @param child Description of the Parameter
* @exception LexComponentException Description of the Exception
*/
public void removeChild( ILexComponent child ) throws LexComponentException
{
List list = findSiblings( child );
child = findChild( list, child.getMetaId() );
list.remove( child );
}
/** /**
* Description of the Method * Description of the Method
* *
@ -184,21 +174,21 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode
public ILexComponent findChild( Integer pk ) throws LexComponentException public ILexComponent findChild( Integer pk ) throws LexComponentException
{ {
ILexComponent child = null; ILexComponent child = null;
Iterator childMapValues = getChildMap().values().iterator(); Iterator childMapValues = getChildMap().values().iterator();
while ( childMapValues.hasNext() && null == child ) while ( childMapValues.hasNext() && null == child )
{ {
List list = (List) childMapValues.next(); List list = (List) childMapValues.next();
child = findChild( list, pk ); child = findChild( list, pk );
} }
if ( null != getDefinitions() )
Iterator definitions = getDefinitions().iterator();
while ( definitions.hasNext() && null == child )
{ {
IDefinition def = (IDefinition) definitions.next(); Iterator definitions = getDefinitions().iterator();
child = def.findChild( pk ); while ( definitions.hasNext() && null == child )
{
IDefinition def = (IDefinition) definitions.next();
child = def.findChild( pk );
}
} }
return child; return child;
} }
@ -210,16 +200,20 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode
* @param pk Description of the Parameter * @param pk Description of the Parameter
* @return Description of the Return Value * @return Description of the Return Value
*/ */
public ILexComponent findChild( List list, Integer pk ) public ILexComponent findChild( List list, Integer pk )
{ {
ILexComponent child = null; ILexComponent child = null;
for ( Iterator it = list.iterator(); it.hasNext(); ) if ( list != null )
{ {
ILexComponent lc = (LexComponent) it.next(); for ( Iterator it = list.iterator(); it.hasNext(); )
if ( lc.getMetaId().equals( pk ) )
{ {
child = lc; ILexComponent lc = (LexComponent) it.next();
break; if ( lc.getMetaId().equals( pk ) )
{
child = lc;
break;
}
} }
} }
return child; return child;
@ -235,9 +229,29 @@ public class Term extends BaseTerm implements Serializable, LexComponentNode
public void addChild( ILexComponent component ) throws LexComponentException public void addChild( ILexComponent component ) throws LexComponentException
{ {
List list = findSiblings( component ); List list = findSiblings( component );
if ( list == null )
{
list = new LinkedList();
LexComponentNode parent = (LexComponentNode) component.getParent();
parent.addSiblingList( parent, component, list );
parent.getChildMap().put( component.getLabel(), list );
}
list.add( component ); list.add( component );
int precedence = list.indexOf( component ); }
component.setPrecedence( new Integer( precedence ) );
/**
* Description of the Method
*
* @param child Description of the Parameter
* @exception LexComponentException Description of the Exception
*/
public void removeChild( ILexComponent child ) throws LexComponentException
{
List list = findSiblings( child );
int index = list.indexOf( child );
list.remove( index );
} }

View file

@ -5,9 +5,10 @@
<c:choose> <c:choose>
<c:when test="${ ! empty param.formMode && param.formMode == 'insert'}"> <c:when test="${ ! empty param.formMode && param.formMode == 'insert'}">
<c:set var="updateMode" value="${ false }" /> <c:set var="updateMode" value="${ false }" />
<c:set var="newCmd" value="addAnnotation" /> <c:set var="newCmd" value="insert" />
<c:set var="analyticalNote" value="" /> <c:set var="analyticalNote" value="" />
<c:set var="metaId" value="" /> <c:set var="metaId" value="" />
</c:when> </c:when>
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}"> <c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
<c:set var="updateMode" value="${ true }" /> <c:set var="updateMode" value="${ true }" />

View file

@ -26,29 +26,38 @@
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</p>
<c:if test="${sessionScope.visit.helper.showTranslations }"> <c:if test="${sessionScope.visit.helper.showTranslations }">
<!--translation--> <c:set value="${definition.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3>
<ul>
<c:forEach var="translation" items="${ definition.translations }" > <c:forEach var="translation" items="${ definition.translations }" >
<c:set var='href' value='#'/> <li>
<p class="data">
<c:if test="${ editMode }"> <c:if test="${ editMode }">
<c:set var='href' value='/lex/action?cmd=getUpdateForm&amp;comp=definition&amp;metaId=${ translation.metaId }' /> <span class="compEditOptions">
<c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=definition&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Edit this definition"><img alt="Edit this definition" src="/lex/images/edit.gif"/></a>' escapeXml="false" />
<c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=definition&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this definition"><img alt="Remove this definition" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
</span>
</c:if> </c:if>
<c:out value='<a class="meta" href="${href} ">'escapeXml="false" /><img src="/lex/images/trans.gif" alt="view/edit translation" />
<span class="translation">
<!--<span class="label">Definition ${translation.precedence}:</span>-->
<c:out value="${ translation.definition }" escapeXml="false" /> <c:out value="${ translation.definition }" escapeXml="false" />
</span></a>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</p>
</li>
</c:forEach> </c:forEach>
</ul>
</c:if>
</c:if> </c:if>
<jsp:include page="displayNotes.jsf" /> <jsp:include page="displayNotes.jsf" />
</p>

View file

@ -37,6 +37,7 @@
</form> </form>
</div> </div>
<c:if test="${ ! empty sessionScope.visit.query.results}">
<div id="results" class="highlightBox"> <div id="results" class="highlightBox">
<h2> Search Results </h2> <h2> Search Results </h2>
<ol> <ol>
@ -52,6 +53,7 @@
</c:forEach> </c:forEach>
</ol> </ol>
</div><!--END MENU--> </div><!--END MENU-->
</c:if>
</div> </div>

View file

@ -34,6 +34,7 @@
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</p>
<c:if test="${sessionScope.visit.helper.showTranslations }"> <c:if test="${sessionScope.visit.helper.showTranslations }">
<!--translation--> <!--translation-->
@ -44,20 +45,19 @@
<c:forEach var="translation" items="${ etymology.translations }" > <c:forEach var="translation" items="${ etymology.translations }" >
<li> <li>
<p class="data">
<%-- <c:set var='href' value='#'/>
<c:if test="${ editMode }"> <c:if test="${ editMode }">
<c:set var='href' value='/lex/action?cmd=getUpdateForm&amp;comp=etymology&amp;metaId=${ translation.metaId }' /> <span class="compEditOptions">
</c:if> <c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=etymology&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Edit this etymology"><img alt="Edit this etymology" src="/lex/images/edit.gif"/></a>' escapeXml="false" />
<c:out value='<a class="meta" href="${href} ">'escapeXml="false" /><img src="/lex/images/trans.gif" alt="view/edit translation" />--%> <c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=etymology&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this etymology"><img alt="Remove this etymology" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
</span>
</c:if>
<span class="translation"> <span class="translation">
<!--<span class="label">Etymology:</span>-->
<c:out value="${ translation.etymologyDescription }" escapeXml="false" /> <br /> <c:out value="${ translation.etymologyDescription }" escapeXml="false" /> <br />
<!--<span class="label">Etymology Type:</span>-->
<c:out value="${ applicationScope.flatData.etymologyTypes[ translation.etymologyType ] }" escapeXml="false" /> <br /> <c:out value="${ applicationScope.flatData.etymologyTypes[ translation.etymologyType ] }" escapeXml="false" /> <br />
<!--<span class="label">Loan Language:</span>-->
<c:out value="${ applicationScope.flatData.languages[ translation.loanLanguage ] }" escapeXml="false" /> <br /> <c:out value="${ applicationScope.flatData.languages[ translation.loanLanguage ] }" escapeXml="false" /> <br />
<!--<span class="label">Derivation:</span>-->
<c:out value="${ translation.derivation }" escapeXml="false" /> <c:out value="${ translation.derivation }" escapeXml="false" />
</span> </span>
@ -65,6 +65,7 @@
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" />
</p>
</li> </li>
</c:forEach> </c:forEach>
</ul> </ul>
@ -74,5 +75,4 @@
<jsp:include page="displayNotes.jsf" /> <jsp:include page="displayNotes.jsf" />
</p>

View file

@ -61,11 +61,12 @@ Back to:
<c:choose> <c:choose>
<c:when test="${ param.cmd == 'getRemoveForm' && param.comp == 'analyticalNote' }"> <c:when test="${ param.cmd == 'getRemoveForm' && param.comp == 'analyticalNote' }">
<p><jsp:include page="displayAnalyticalNote.jsf" /></p> <h2>Note</h2>
<p><c:out value="${ component.analyticalNote }" escapeXml="false" /></p>
</c:when> </c:when>
<c:when test="${ param.cmd == 'getRemoveTermForm' && param.comp == 'term' }"> <c:when test="${ param.cmd == 'getRemoveTermForm' && param.comp == 'term' }">
<p><p><jsp:include page="displayTerm.jsf" /></p></p> <p><jsp:include page="displayTerm.jsf" /></p>
</c:when> </c:when>
<c:when test="${ param.cmd == 'getRemoveForm' && param.comp == 'pronunciation'}"> <c:when test="${ param.cmd == 'getRemoveForm' && param.comp == 'pronunciation'}">
@ -126,7 +127,7 @@ Back to:
<%--Insert Form--%> <%--Insert Form--%>
<c:when test="${ param.cmd == 'getAnnotationForm' }"> <c:when test="${ param.cmd == 'getAnnotationForm' || param.comp == 'analyticalNote' }">
<jsp:include page="analyticalNoteForm.jsf" /> <jsp:include page="analyticalNoteForm.jsf" />
</c:when> </c:when>

View file

@ -40,14 +40,6 @@
<span class="label">Dialect: </span><c:out value="${ applicationScope.flatData.majorDialectFamilies[ component.meta.dialect ] }" default="unknown" escapeXml="false"/> <span class="label">Dialect: </span><c:out value="${ applicationScope.flatData.majorDialectFamilies[ component.meta.dialect ] }" default="unknown" escapeXml="false"/>
<br /> <br />
<span class="label">Translation: </span> <span class="label">Translation: </span>
<%-- <c:choose>
<c:when test="${ component.translationOf > 0 }">
Yes (of <c:out value="${ component.translationOf }" default="unknown" escapeXml="false"/>)
</c:when>
<c:otherwise>
No
</c:otherwise>
</c:choose> --%>
<br /> <br />
<span class="label">Note: </span><c:out value="${ component.meta.note }" default="unknown" escapeXml="false"/> <br /> <span class="label">Note: </span><c:out value="${ component.meta.note }" default="unknown" escapeXml="false"/> <br />
</c:if> </c:if>

View file

@ -18,49 +18,46 @@
<!--<span class="label">Model Sentence:</span>--> <!--<span class="label">Model Sentence:</span>-->
<c:out value="${ modelSentence.modelSentence }" escapeXml="false" /> <c:out value="${ modelSentence.modelSentence }" escapeXml="false" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</p>
<c:if test="${sessionScope.visit.helper.showTranslations }"> <c:if test="${sessionScope.visit.helper.showTranslations }">
<!--translation-->
<c:set value="${modelSentence.translations}" target="${sessionScope.visit.helper}" property="collection"/> <c:set value="${modelSentence.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }"> <c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3> <h3>Translations</h3>
<ul> <ul>
<c:forEach var="translation" items="${ modelSentence.translations }" > <c:forEach var="translation" items="${ modelSentence.translations }" >
<li> <li>
<%-- <p class="data">
<c:set var='href' value='#'/>
<c:if test="${ editMode }"> <c:if test="${ editMode }">
<c:set var='href' value='/lex/action?cmd=getUpdateForm&amp;comp=modelSentence&amp;metaId=${ translation.metaId }' /> <span class="compEditOptions">
</c:if> <c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=modelSentence&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Edit this modelSentence"><img alt="Edit this modelSentence" src="/lex/images/edit.gif"/></a>' escapeXml="false" />
<c:out value='<a class="meta" href="${href} ">'escapeXml="false" /><img src="/lex/images/trans.gif" alt="view/edit translation" /> --%> <c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=modelSentence&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this modelSentence"><img alt="Remove this modelSentence" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
<span class="translation"> </span>
<!--<span class="label">Model Sentence:</span>--> </c:if>
<c:out value="${ translation.modelSentence }" escapeXml="false" />
</span> <c:out value="${ translation.modelSentence }" escapeXml="false" />
<c:set var="originalComponent" value="${ modelSentence }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" /> </p>
</li> </li>
</c:forEach> </c:forEach>
</ul> </ul>
</c:if> </c:if>
</c:if> </c:if>
<jsp:include page="displayNotes.jsf" /> <jsp:include page="displayNotes.jsf" />
</p>

View file

@ -11,10 +11,11 @@
<ol class="notes"> <ol class="notes">
<c:forEach var="note" items="${ sessionScope.visit.helper.component.analyticalNotes }"> <c:forEach var="note" items="${ sessionScope.visit.helper.component.analyticalNotes }">
<li> <li>
<p class = "data">
<c:if test="${ editMode }"> <c:if test="${ editMode }">
<span class="compEditOptions"> <span class="compEditOptions">
<c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=analyticalNote&amp;metaId=${ note.metaId }" title="Edit this analyticalNote"><img alt="Edit this analyticalNote" src="/lex/images/edit.gif"/></a>' escapeXml="false" /> <c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=analyticalNote&amp;metaId=${ note.metaId }&amp;parentId=${ note.parentId }" title="Edit this analyticalNote"><img alt="Edit this analyticalNote" src="/lex/images/edit.gif"/></a>' escapeXml="false" />
<c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=analyticalNote&amp;metaId=${ note.metaId }" title="Remove this analyticalNote"><img alt="Remove this analyticalNote" src="/lex/images/remove.gif"/></a>' escapeXml="false" /> <c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=analyticalNote&amp;metaId=${ note.metaId }&amp;parentId=${ note.parentId }" title="Remove this analyticalNote"><img alt="Remove this analyticalNote" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
</span> </span>
</c:if> </c:if>
@ -31,6 +32,7 @@
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ parent }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ parent }" />
</span> </span>
</p>
</li> </li>
</c:forEach> </c:forEach>
</ol> </ol>

View file

@ -56,9 +56,9 @@
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</p>
<c:if test="${sessionScope.visit.helper.showTranslations }"> <c:if test="${sessionScope.visit.helper.showTranslations }">
<!--translation-->
<c:set value="${passage.translations}" target="${sessionScope.visit.helper}" property="collection"/> <c:set value="${passage.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }"> <c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3> <h3>Translations</h3>
@ -72,15 +72,9 @@
<c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=passage&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this passage"><img alt="Remove this passage" src="/lex/images/remove.gif"/></a>' escapeXml="false" /> <c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=passage&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this passage"><img alt="Remove this passage" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
</span> </span>
</c:if> </c:if>
<%-- <c:set var='href' value='#'/>
<c:if test="${ editMode }">
<c:set var='href' value='/lex/action?cmd=getUpdateForm&amp;comp=passage&amp;metaId=${ translation.metaId }' />
</c:if> --%>
<%-- <span class="translation"> --%>
<c:set var="source" value="${ LexFlatDataRepository.literarySources[ translation.literarySource ] }"/> <c:set var="source" value="${ LexFlatDataRepository.literarySources[ translation.literarySource ] }"/>
<c:if test="${ ! empty source }"> <c:if test="${ ! empty source }">
<!--<span class="label">Literary Source:</span>-->
<c:out value="${ source }" /> <br /> <c:out value="${ source }" /> <br />
</c:if> </c:if>
@ -95,7 +89,6 @@
</c:if> </c:if>
<c:out value="${ translation.passage }" /> <c:out value="${ translation.passage }" />
<%-- </span> --%>
<c:set var="originalComponent" value="${ passage }" /> <c:set var="originalComponent" value="${ passage }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
@ -113,5 +106,4 @@
<jsp:include page="displayNotes.jsf" /> <jsp:include page="displayNotes.jsf" />
</p>

View file

@ -25,33 +25,38 @@
</span> </span>
</c:if> </c:if>
<!--<span class="label">Subdefinition:</span>-->
<c:out value="${ subdefinition.subdefinition }" escapeXml="false" /> <c:out value="${ subdefinition.subdefinition }" escapeXml="false" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
<c:if test="${sessionScope.visit.helper.showTranslations }"> </p>
<!--translation-->
<c:forEach var="translation" items="${ subdefinition.translations }"> <c:if test="${sessionScope.visit.helper.showTranslations }">
<c:set var='href' value='#'/> <c:set value="${subdefinition.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3>
<ul>
<c:forEach var="translation" items="${ subdefinition.translations }" >
<li>
<p class="data">
<c:if test="${ editMode }"> <c:if test="${ editMode }">
<c:set var='href' value='/lex/action?cmd=getUpdateForm&amp;comp=subdefinition&amp;metaId=${ translation.metaId }' /> <span class="compEditOptions">
<c:out value='<a href="/lex/action?cmd=getUpdateForm&amp;comp=subdefinition&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Edit this subdefinition"><img alt="Edit this subdefinition" src="/lex/images/edit.gif"/></a>' escapeXml="false" />
<c:out value='<a href="/lex/action?cmd=getRemoveForm&amp;comp=subdefinition&amp;metaId=${ translation.metaId }&amp;translationOf=${ translation.translationOf }&amp;parentId=${ translation.parentId }" title="Remove this subdefinition"><img alt="Remove this subdefinition" src="/lex/images/remove.gif"/></a>' escapeXml="false" />
</span>
</c:if> </c:if>
<c:out value='<a class="meta" href="${href} ">'escapeXml="false" /><img src="/lex/images/trans.gif" alt="view/edit translation" />
<span class="translation"> <c:out value="${ translation.subdefinition }" escapeXml="false" />
<!--<span class="label">Subdefinition:</span>-->
<c:out value="${ translation.subdefinition }" escapeXml="false" />
</span>
</a>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" /> <c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" /> <jsp:include page="displayMeta.jsf" />
</c:forEach> </p>
</li>
</c:forEach>
</ul>
</c:if>
</c:if> </c:if>
<jsp:include page="displayNotes.jsf" /> <jsp:include page="displayNotes.jsf" />

View file

@ -12,7 +12,7 @@
<c:set var="source" value="${ sessionScope.visit.preferences.source }" /> <c:set var="source" value="${ sessionScope.visit.preferences.source }" />
<c:set var="projectSubject" value="${ sessionScope.visit.preferences.projectSubject }" /> <c:set var="projectSubject" value="${ sessionScope.visit.preferences.projectSubject }" />
<c:set var="script" value="${ sessionScope.visit.preferences.script }" /> <c:set var="script" value="${ sessionScope.visit.preferences.script }" />
<%-- <c:set var="precedence" value="1" /> --%> <c:set var="precedence" value="0" />
<c:set var="note" value="${ sessionScope.visit.preferences.note }" /> <c:set var="note" value="${ sessionScope.visit.preferences.note }" />
</c:when> </c:when>
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}"> <c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
@ -22,7 +22,7 @@
<c:set var="source" value="${ component.meta.source }" /> <c:set var="source" value="${ component.meta.source }" />
<c:set var="projectSubject" value="${ component.meta.modifiedByProjSub }" /> <c:set var="projectSubject" value="${ component.meta.modifiedByProjSub }" />
<c:set var="script" value="${ component.meta.script }" /> <c:set var="script" value="${ component.meta.script }" />
<%-- <c:set var="precedence" value="${ component.meta.precedence }" /> --%> <c:set var="precedence" value="${ component.precedence }" />
<c:set var="note" value="${ component.meta.note }" /> <c:set var="note" value="${ component.meta.note }" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
@ -32,17 +32,18 @@
<c:set var="source" value="ERROR" /> <c:set var="source" value="ERROR" />
<c:set var="projectSubject" value="ERROR" /> <c:set var="projectSubject" value="ERROR" />
<c:set var="script" value="ERROR" /> <c:set var="script" value="ERROR" />
<%-- <c:set var="precedence" value="ERROR" /> --%>
<c:set var="note" value="ERROR" /> <c:set var="note" value="ERROR" />
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<c:out value='<input type="hidden" name="precedence" value="${ component.precedence }" />'escapeXml="false" /> <c:set var="parentId" value="${ component.parentId }" />
<c:out value='<input type="hidden" name="parentId" value="${ component.parentId }" />' escapeXml='false' /> <%-- <c:if test="${ parentId == null || component.parentId < 1 }">
<c:set var="parentId" value="${ param.parentId }" />
<%-- <c:if test="${ translateMode && ! empty component.translationOf}">
<c:out value='<input type="hidden" name="translationOf" value="${ component.translationOf }" />'escapeXml="false" />
</c:if> --%> </c:if> --%>
<c:out value=' <input type="hidden" name="parentId" value="${parentId}" /> ' escapeXml='false' />
<c:out value='<input type="hidden" name="precedence" value="${ precedence }" />'escapeXml="false" />
<c:if test="${ ! updateMode && param.cmd != 'getAnnotationForm' && param.cmd != 'getTranslationForm' }"> <c:if test="${ ! updateMode && param.cmd != 'getAnnotationForm' && param.cmd != 'getTranslationForm' }">
<p> <p>
@ -71,7 +72,6 @@ Language:
</c:if> </c:if>
<c:out value='<option value="${ prefLangs }" ${ sel }>${ applicationScope.flatData.languages[ prefLangs ] }</option>' escapeXml="false" /> <c:out value='<option value="${ prefLangs }" ${ sel }>${ applicationScope.flatData.languages[ prefLangs ] }</option>' escapeXml="false" />
</c:forEach> </c:forEach>
<%-- <option disabled="disabled" value="">----------------</option> --%>
<c:forEach var="langs" items="${ applicationScope.flatData.languages }"> <c:forEach var="langs" items="${ applicationScope.flatData.languages }">
<c:set var="printOption" value="${ true }" /> <c:set var="printOption" value="${ true }" />
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }"> <c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">

View file

@ -48,7 +48,7 @@
<c:out value="${ originalSubdefinition }" escapeXml='false'/> <c:out value="${ originalSubdefinition }" escapeXml='false'/>
Subdefinition: <br /> Subdefinition: <br />
<textarea name="subdefinition" rows="8" cols="90"><c:out value='${ subdefinition }' escapeXml='false' /> </textarea> <textarea name="subdefinition" rows="8" cols="90"><c:out value='${ component.subdefinition }' escapeXml='false' /> </textarea>
<br /> <br />
<%-- Precedence: <c:out value='<input type="text" value="${ precedence }" name="precedence" size="3"/>' escapeXml='false' /> <br /> <%-- Precedence: <c:out value='<input type="text" value="${ precedence }" name="precedence" size="3"/>' escapeXml='false' /> <br />