From 6d27cd40aa3db4f97a47ad9a296e26d09d42e747 Mon Sep 17 00:00:00 2001 From: dubtraxis Date: Tue, 21 Oct 2003 18:00:23 +0000 Subject: [PATCH] Moved most objects stored in session into Visit for better lazy initialization control. Also added some date formatting to DisplayHelper --- src/css/lex-advanced.css | 20 +- .../org/thdl/lex/AuthenticationFilter.java | 125 +++++++--- src/java/org/thdl/lex/DisplayHelper.java | 39 +++- src/java/org/thdl/lex/Global.java | 106 +++++---- src/java/org/thdl/lex/GuestFilter.java | 28 +-- src/java/org/thdl/lex/LexActionServlet.java | 3 +- .../org/thdl/lex/LexComponentRepository.java | 31 ++- src/java/org/thdl/lex/LexConstants.java | 8 +- src/java/org/thdl/lex/LexLogger.java | 32 ++- src/java/org/thdl/lex/LoginServlet.java | 17 +- src/java/org/thdl/lex/LogoutServlet.java | 71 ++++-- src/java/org/thdl/lex/UserSessionManager.java | 161 ++----------- src/java/org/thdl/lex/Visit.java | 220 ++++++++++++++++++ .../org/thdl/lex/commands/DisplayCommand.java | 5 +- .../org/thdl/lex/commands/FindCommand.java | 7 +- .../lex/commands/GetInsertFormCommand.java | 12 +- .../lex/commands/GetUpdateFormCommand.java | 8 +- .../org/thdl/lex/commands/InsertCommand.java | 15 +- .../org/thdl/lex/commands/NullCommand.java | 44 +++- .../thdl/lex/commands/PreferencesCommand.java | 8 +- .../org/thdl/lex/commands/RemoveCommand.java | 4 +- .../org/thdl/lex/commands/UpdateCommand.java | 14 +- src/jsp/jsp/debug.jsf | 2 +- src/jsp/jsp/displayDefinition.jsf | 10 +- src/jsp/jsp/displayEncyclopediaArticle.jsf | 4 +- src/jsp/jsp/displayEntry.jsp | 24 +- src/jsp/jsp/displayEtymology.jsf | 16 +- src/jsp/jsp/displayFunction.jsf | 4 +- src/jsp/jsp/displayKeyword.jsf | 3 +- src/jsp/jsp/displayMeta.jsf | 20 +- src/jsp/jsp/displayModelSentence.jsf | 16 +- src/jsp/jsp/displayNotes.jsf | 16 +- src/jsp/jsp/displayPassage.jsf | 18 +- src/jsp/jsp/displayPronunciation.jsf | 4 +- src/jsp/jsp/displayRegister.jsf | 4 +- src/jsp/jsp/displayRelatedTerm.jsf | 5 +- src/jsp/jsp/displaySpelling.jsf | 4 +- src/jsp/jsp/displaySubdefinition.jsf | 10 +- src/jsp/jsp/displayTerm.jsf | 2 +- src/jsp/jsp/displayTransitionalData.jsf | 6 +- src/jsp/jsp/displayTranslationEquivalent.jsf | 4 +- src/jsp/jsp/displayTree.jsf | 156 ++++++------- src/jsp/jsp/displayTreeToc.jsf | 84 +++---- src/jsp/jsp/footer.jsf | 4 +- src/jsp/jsp/header.jsf | 2 +- src/jsp/jsp/menu.jsp | 29 +-- src/jsp/jsp/metaDefaultsForm.jsp | 54 ++--- src/jsp/jsp/metaForm.jsf | 58 ++--- src/jsp/jsp/metaPrefsForm.jsp | 20 +- src/jsp/jsp/navLinks.jsf | 26 ++- src/jsp/jsp/search.jsp | 53 +++++ 51 files changed, 1014 insertions(+), 622 deletions(-) create mode 100644 src/java/org/thdl/lex/Visit.java create mode 100644 src/jsp/jsp/search.jsp diff --git a/src/css/lex-advanced.css b/src/css/lex-advanced.css index 7455c5e..3341d70 100644 --- a/src/css/lex-advanced.css +++ b/src/css/lex-advanced.css @@ -24,8 +24,13 @@ border: solid 1px gray; padding: 2px 0 2px 2px; } -#entry +#recentTerms h3 { +margin-bottom: 2px; +} +#recentTerms p +{ +margin-top: 2px; } #termChildren, #defChildren, #subdefChildren @@ -50,6 +55,19 @@ margin: 5px 5px 5px 5px; } /* Class Selectors.*/ +ul.navLinks +{ + list-style-type: none; + margin: 0 0 0 0 !important; + padding: 0 0 0 0; +} +ul.navLinks li +{ + display: inline; + margin: 0 0 0 0 !important; + padding: 0 0 0 0; +} + .highlightBox ol { margin: 0 0 0 20px; diff --git a/src/java/org/thdl/lex/AuthenticationFilter.java b/src/java/org/thdl/lex/AuthenticationFilter.java index ce52bb2..1af0d3e 100644 --- a/src/java/org/thdl/lex/AuthenticationFilter.java +++ b/src/java/org/thdl/lex/AuthenticationFilter.java @@ -1,71 +1,117 @@ package org.thdl.lex; - -import org.thdl.users.*; +import java.io.IOException; +import java.util.Enumeration; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; +import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import javax.servlet.ServletException; -import java.io.IOException; -import java.util.Enumeration; +import org.thdl.users.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 21, 2003 + */ public class AuthenticationFilter implements Filter { //attributes private String loginPage; - private UserSessionManager sessionMgr; - + //accessors - public void setLoginPage(String loginPage) { + /** + * Sets the loginPage attribute of the AuthenticationFilter object + * + * @param loginPage The new loginPage value + */ + public void setLoginPage( String loginPage ) + { this.loginPage = loginPage; } - public String getLoginPage() { + + + /** + * Gets the loginPage attribute of the AuthenticationFilter object + * + * @return The loginPage value + */ + public String getLoginPage() + { return loginPage; } - public void setSessionManager() { - this.sessionMgr = UserSessionManager.getInstance(); - } - public UserSessionManager getSessionManager() { - return sessionMgr; - } //contract methods - public void init(FilterConfig config) throws ServletException + /** + * Description of the Method + * + * @param config Description of the Parameter + * @exception ServletException Description of the Exception + */ + public void init( FilterConfig config ) throws ServletException { - setSessionManager(); - setLoginPage( config.getInitParameter("loginPage") ); + setLoginPage( config.getInitParameter( "loginPage" ) ); if ( null == getLoginPage() ) - throw new ServletException("The loginPage parameter must be specified"); + { + throw new ServletException( "The loginPage parameter must be specified" ); + } } - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException + + + /** + * Description of the Method + * + * @param request Description of the Parameter + * @param response Description of the Parameter + * @param chain Description of the Parameter + * @exception IOException Description of the Exception + * @exception ServletException Description of the Exception + */ + public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException { - if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse) + if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse ) { HttpServletRequest req = (HttpServletRequest) request; - HttpSession session = req.getSession(true); - ThdlUser user = sessionMgr.getSessionUser(session); - if (null == user ) + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + ThdlUser user = visit.getUser(); + if ( null == user ) { - requireLogin(req, (HttpServletResponse)response, session); + requireLogin( req, (HttpServletResponse) response, req.getSession( true ) ); } else { - chain.doFilter(request, response); + chain.doFilter( request, response ); } } else { - throw new ServletException("Filter only applicable to HTTP and HTTPS requests"); + throw new ServletException( "Filter only applicable to HTTP and HTTPS requests" ); } } - public void destroy() {} + + + /** + * Description of the Method + */ + public void destroy() { } //helper methods - public void requireLogin(HttpServletRequest request, HttpServletResponse response, HttpSession session) throws IOException + + /** + * Description of the Method + * + * @param request Description of the Parameter + * @param response Description of the Parameter + * @param session Description of the Parameter + * @exception IOException Description of the Exception + */ + public void requireLogin( HttpServletRequest request, HttpServletResponse response, HttpSession session ) throws IOException { StringBuffer buffer = request.getRequestURL(); String query = request.getQueryString(); @@ -73,20 +119,25 @@ public class AuthenticationFilter implements Filter boolean paramsExist; if ( params.hasMoreElements() ) { - paramsExist=true; - buffer.append('?'); + paramsExist = true; + buffer.append( '?' ); while ( params.hasMoreElements() ) { - String temp = (String)params.nextElement(); - buffer.append( temp + "=" +request.getParameter( temp ) ); + String temp = (String) params.nextElement(); + buffer.append( temp + "=" + request.getParameter( temp ) ); if ( params.hasMoreElements() ) - buffer.append("&"); + { + buffer.append( "&" ); + } } } else - paramsExist=false; + { + paramsExist = false; + } - sessionMgr.setSessionLoginTarget( session, buffer.toString() ); - UserSessionManager.doRedirect(request, response, loginPage); + UserSessionManager.getInstance().setSessionLoginTarget( session, buffer.toString() ); + UserSessionManager.doRedirect( request, response, loginPage ); } } + diff --git a/src/java/org/thdl/lex/DisplayHelper.java b/src/java/org/thdl/lex/DisplayHelper.java index 77cadfa..5635a40 100644 --- a/src/java/org/thdl/lex/DisplayHelper.java +++ b/src/java/org/thdl/lex/DisplayHelper.java @@ -1,4 +1,5 @@ package org.thdl.lex; +import java.text.DateFormat; import java.util.*; import org.apache.commons.beanutils.*; @@ -16,13 +17,36 @@ public class DisplayHelper private Collection collection; private ILexComponent component; private ILexComponent note; - + private Date date; + private final static DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.LONG ); private boolean showNotes; private boolean showMeta; private boolean showEditOptions; private boolean showTranslations; + /** + * Sets the date attribute of the DisplayHelper object + * + * @param date The new date value + */ + public void setDate( Date date ) + { + this.date = date; + } + + + /** + * Gets the date attribute of the DisplayHelper object + * + * @return The date value + */ + public Date getDate() + { + return date; + } + + /** * Sets the note attribute of the DisplayHelper object * @@ -177,7 +201,7 @@ public class DisplayHelper return collection; } - +//composite properties /** * Gets the collectionSize attribute of the DisplayHelper object * @@ -211,6 +235,17 @@ public class DisplayHelper return b; } + + /** + * Gets the formattedDate attribute of the DisplayHelper object + * + * @return The formattedDate value + */ + public String getFormattedDate() + { + return DATE_FORMAT.format( getDate() ); + } + // helpers /** * Description of the Method diff --git a/src/java/org/thdl/lex/Global.java b/src/java/org/thdl/lex/Global.java index cd9cf4c..b44842b 100644 --- a/src/java/org/thdl/lex/Global.java +++ b/src/java/org/thdl/lex/Global.java @@ -1,6 +1,7 @@ package org.thdl.lex; -import java.util.List; +import java.util.*; +import org.thdl.lex.component.*; /** @@ -12,43 +13,33 @@ import java.util.List; public class Global { private static long refreshDelay; - private static int recentUpdatesCount; + private static int recentTermsCount; private static long lastRefresh; private int entryCount; - private List recentUpdates; - private boolean requiresRefresh; + private List recentTerms; /** - * Sets the requiresRefresh attribute of the Global object + * Gets the lastUpdateAsDate attribute of the LexComponentRepository class * - * @param requiresRefresh The new requiresRefresh value + * @return The lastUpdateAsDate value + * @exception LexRepositoryException Description of the Exception */ - public void setRequiresRefresh( boolean requiresRefresh ) + public Date getLastUpdate() throws LexRepositoryException { - this.requiresRefresh = requiresRefresh; + ITerm term = (ITerm) getRecentTerms().get( 0 ); + return term.getMeta().getModifiedOn(); } /** - * Gets the requiresRefresh attribute of the Global object + * Sets the recentTermsCount attribute of the Global object * - * @return The requiresRefresh value + * @param recentTermsCount The new recentTermsCount value */ - public boolean getRequiresRefresh() + public void setRecentTermsCount( int recentTermsCount ) { - return requiresRefresh; - } - - - /** - * Sets the recentUpdatesCount attribute of the Global object - * - * @param recentUpdatesCount The new recentUpdatesCount value - */ - public void setRecentUpdatesCount( int recentUpdatesCount ) - { - this.recentUpdatesCount = recentUpdatesCount; + this.recentTermsCount = recentTermsCount; } @@ -64,13 +55,13 @@ public class Global /** - * Gets the recentUpdatesCount attribute of the Global object + * Gets the recentTermsCount attribute of the Global object * - * @return The recentUpdatesCount value + * @return The recentTermsCount value */ - public int getRecentUpdatesCount() + public int getRecentTermsCount() { - return recentUpdatesCount; + return recentTermsCount; } @@ -108,13 +99,13 @@ public class Global /** - * Sets the recentUpdates attribute of the Global object + * Sets the recentTerms attribute of the Global object * - * @param recentUpdates The new recentUpdates value + * @param recentTerms The new recentTerms value */ - public void setRecentUpdates( List recentUpdates ) + public void setRecentTerms( List recentTerms ) { - this.recentUpdates = recentUpdates; + this.recentTerms = recentTerms; setLastRefresh( System.currentTimeMillis() ); } @@ -131,37 +122,66 @@ public class Global /** - * Gets the recentUpdates attribute of the Global object + * Gets the recentTerms attribute of the Global object * - * @return The recentUpdates value + * @return The recentTerms value * @exception LexRepositoryException Description of the Exception */ - public List getRecentUpdates() throws LexRepositoryException + public List getRecentTerms() throws LexRepositoryException { - if ( null == recentUpdates ) + if ( null == recentTerms ) { - refresh( getRecentUpdatesCount() ); + doRefresh(); } - return recentUpdates; + return recentTerms; } //helpers /** * Description of the Method * - * @param limit Description of the Parameter + * @return Description of the Return Value + */ + public boolean requiresRefresh() + { + boolean requiresRefresh = false; + long now = System.currentTimeMillis(); + long lastUpdate = LexComponentRepository.getLastUpdate(); + long sinceLastRefresh = now - getLastRefresh(); + if ( sinceLastRefresh > getRefreshDelay() && lastUpdate > getLastRefresh() ) + { + requiresRefresh = true; + } + return requiresRefresh; + } + + + /** + * Description of the Method + * * @exception LexRepositoryException Description of the Exception */ - public void refresh( int limit ) throws LexRepositoryException + public void refresh() throws LexRepositoryException { - long now = System.currentTimeMillis(); - if ( now - getLastRefresh() > getRefreshDelay() ) + if ( requiresRefresh() ) { - setRecentUpdates( LexComponentRepository.getRecentTerms( limit ) ); + doRefresh(); } } + /** + * Description of the Method + * + * @exception LexRepositoryException Description of the Exception + */ + public void doRefresh() throws LexRepositoryException + { + int limit = getRecentTermsCount(); + setRecentTerms( LexComponentRepository.getRecentTerms( limit ) ); + } + + /** *Constructor for the Global object */ @@ -176,7 +196,7 @@ public class Global */ public Global( int recentItems, long refreshDelay ) { - setRecentUpdatesCount( recentItems ); + setRecentTermsCount( recentItems ); setRefreshDelay( refreshDelay ); } } diff --git a/src/java/org/thdl/lex/GuestFilter.java b/src/java/org/thdl/lex/GuestFilter.java index 07c8355..43eb1f6 100644 --- a/src/java/org/thdl/lex/GuestFilter.java +++ b/src/java/org/thdl/lex/GuestFilter.java @@ -50,25 +50,6 @@ public class GuestFilter implements Filter } - /** - * Sets the sessionManager attribute of the GuestFilter object - */ - public void setSessionManager() - { - this.sessionMgr = UserSessionManager.getInstance(); - } - - - /** - * Gets the sessionManager attribute of the GuestFilter object - * - * @return The sessionManager value - */ - public UserSessionManager getSessionManager() - { - return sessionMgr; - } - //contract methods /** * Description of the Method @@ -78,7 +59,6 @@ public class GuestFilter implements Filter */ public void init( FilterConfig config ) throws ServletException { - setSessionManager(); } @@ -96,8 +76,8 @@ public class GuestFilter implements Filter if ( request instanceof HttpServletRequest && response instanceof HttpServletResponse ) { HttpServletRequest req = (HttpServletRequest) request; - HttpSession session = req.getSession( true ); - ThdlUser user = getSessionManager().getSessionUser( session ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + ThdlUser user = visit.getUser(); if ( null == user ) { try @@ -109,8 +89,8 @@ public class GuestFilter implements Filter throw new ServletException( e ); } user.setRoles( "guest" ); - getSessionManager().setSessionUser( session, user ); - getSessionManager().setDisplayMode( session, "full" ); + visit.setUser( user ); + visit.setDisplayMode( "full" ); } chain.doFilter( request, response ); } diff --git a/src/java/org/thdl/lex/LexActionServlet.java b/src/java/org/thdl/lex/LexActionServlet.java index 90c6349..e2984de 100644 --- a/src/java/org/thdl/lex/LexActionServlet.java +++ b/src/java/org/thdl/lex/LexActionServlet.java @@ -97,7 +97,7 @@ public class LexActionServlet extends HttpServlet String recent = config.getInitParameter( "recentItems" ); int recentItems = Integer.parseInt( recent ); Global global = new Global( recentItems, refreshDelay ); - config.getServletContext().setAttribute( "global", global ); + config.getServletContext().setAttribute( LexConstants.GLOBAL_CONTEXT_ATTR, global ); LexLogger.debugComponent( global ); } @@ -162,6 +162,7 @@ public class LexActionServlet extends HttpServlet LexLogger.debug( "Checking Request state at end of LexActionServlet.service()" ); LexLogger.logRequestState( req ); LexLogger.logSessionState( req ); + LexLogger.logContextState( getServletContext() ); } diff --git a/src/java/org/thdl/lex/LexComponentRepository.java b/src/java/org/thdl/lex/LexComponentRepository.java index f8c9be8..447dae2 100644 --- a/src/java/org/thdl/lex/LexComponentRepository.java +++ b/src/java/org/thdl/lex/LexComponentRepository.java @@ -8,6 +8,7 @@ import org.apache.log4j.*; import org.thdl.lex.component.*; + /** * Description of the Class * @@ -16,6 +17,7 @@ import org.thdl.lex.component.*; */ public class LexComponentRepository { + /** * Description of the Field */ @@ -30,6 +32,32 @@ public class LexComponentRepository public final static String ANYWHERE = "anywhere"; private static long start; + private static long lastUpdate; + + + /** + * Sets the lastUpdate attribute of the LexComponentRepository class + * + * @param last The new lastUpdate value + */ + public static void setLastUpdate( long last ) + { + lastUpdate = last; + } + + + /** + * Gets the lastUpdate attribute of the LexComponentRepository class + * + * @return The lastUpdate value + */ + public static long getLastUpdate() + { + return lastUpdate; + } + + + /** * Sets the start attribute of the LexComponentRepository object @@ -359,7 +387,7 @@ public class LexComponentRepository * @param component Description of the Parameter * @exception LexRepositoryException Description of the Exception */ - public static void saveOrUpdate( ILexComponent component ) throws LexRepositoryException + public static void save( ILexComponent component ) throws LexRepositoryException { try @@ -367,6 +395,7 @@ public class LexComponentRepository beginTransaction(); getSession().saveOrUpdate( component ); endTransaction( true ); + setLastUpdate( now() ); } catch ( HibernateException he ) { diff --git a/src/java/org/thdl/lex/LexConstants.java b/src/java/org/thdl/lex/LexConstants.java index 03f5f5d..e3686bc 100644 --- a/src/java/org/thdl/lex/LexConstants.java +++ b/src/java/org/thdl/lex/LexConstants.java @@ -237,9 +237,13 @@ public class LexConstants /** * Description of the Field */ - public final static String DISPLAY_HELPER_SESSION_ATT = "helper"; + public final static String VISIT_SESSION_ATTR = "visit"; + /** + * Description of the Field + */ + public final static String GLOBAL_CONTEXT_ATTR = "global"; -//public final static String URL = "jdbc:mysql://localhost/LexTorque"; + //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 e652566..9000c9a 100644 --- a/src/java/org/thdl/lex/LexLogger.java +++ b/src/java/org/thdl/lex/LexLogger.java @@ -1,6 +1,7 @@ package org.thdl.lex; import java.io.*; import java.util.*; +import javax.servlet.ServletContext; import javax.servlet.http.*; import org.apache.commons.beanutils.*; @@ -56,22 +57,39 @@ public class LexLogger LOGGER.debug( "Session was null" ); return; } + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); Enumeration enum = ses.getAttributeNames(); while ( enum.hasMoreElements() ) { String att = (String) enum.nextElement(); LOGGER.debug( "Session Attribute " + att + " = " + ses.getAttribute( att ) ); } - LexQuery query = (LexQuery) ses.getAttribute( "query" ); - if ( null == query ) + + if ( null == visit ) { + LOGGER.debug( "Visit was null" ); return; } - LOGGER.debug( "Query Entry: " + query.getEntry() ); - LOGGER.debug( "Query QueryComponent: " + query.getQueryComponent() ); - LOGGER.debug( "Query UpdateComponent: " + query.getUpdateComponent() ); - LOGGER.debug( "Query Results, " + query.getResults() + "\n" ); - debugComponent( UserSessionManager.getInstance().getSessionUser( ses ) ); + debugComponent( visit ); + debugComponent( visit.getQuery() ); + debugComponent( visit.getUser() ); + } + + + /** + * Description of the Method + * + * @param context Description of the Parameter + */ + public static void logContextState( ServletContext context ) + { + Enumeration enum = context.getAttributeNames(); + while ( enum.hasMoreElements() ) + { + String att = (String) enum.nextElement(); + LOGGER.debug( "Context Attribute " + att + " = " + context.getAttribute( att ) ); + } + debugComponent( context.getAttribute( LexConstants.GLOBAL_CONTEXT_ATTR ) ); } diff --git a/src/java/org/thdl/lex/LoginServlet.java b/src/java/org/thdl/lex/LoginServlet.java index da91151..300086f 100644 --- a/src/java/org/thdl/lex/LoginServlet.java +++ b/src/java/org/thdl/lex/LoginServlet.java @@ -171,28 +171,29 @@ public class LoginServlet extends HttpServlet /** * Description of the Method * - * @param request Description of Parameter * @param response Description of Parameter * @param user Description of Parameter + * @param req Description of the Parameter * @exception IOException Description of Exception * @exception LexRepositoryException Description of Exception * @exception LexComponentException Description of Exception * @since */ - private void doLoginSuccess( HttpServletRequest request, HttpServletResponse response, ThdlUser user ) throws IOException, LexRepositoryException, LexComponentException + private void doLoginSuccess( HttpServletRequest req, HttpServletResponse response, ThdlUser user ) throws IOException, LexRepositoryException, LexComponentException { - HttpSession session = request.getSession( true ); - getSessionManager().setSessionUser( session, user ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + + visit.setUser( user ); Preferences preferences = new Preferences( user ); - getSessionManager().setPreferences( session, preferences ); + visit.setPreferences( preferences ); - getSessionManager().setDisplayMode( session, "brief" ); - String targetPage = getSessionManager().getSessionLoginTarget( session, true ); + visit.setDisplayMode( "brief" ); + String targetPage = UserSessionManager.getInstance().getSessionLoginTarget( req.getSession( true ), true ); if ( targetPage == null ) { - UserSessionManager.doRedirect( request, response, getWelcomePage() ); + UserSessionManager.doRedirect( req, response, getWelcomePage() ); } else { diff --git a/src/java/org/thdl/lex/LogoutServlet.java b/src/java/org/thdl/lex/LogoutServlet.java index 2e4daee..f54de65 100644 --- a/src/java/org/thdl/lex/LogoutServlet.java +++ b/src/java/org/thdl/lex/LogoutServlet.java @@ -1,34 +1,77 @@ package org.thdl.lex; +import java.io.IOException; import javax.servlet.*; import javax.servlet.http.*; -import java.io.IOException; + +/** + * Description of the Class + * + * @author travis + * @created October 21, 2003 + */ public class LogoutServlet extends HttpServlet { private String goodbyePage; - private UserSessionManager sessionMgr = UserSessionManager.getInstance(); - public void setGoodbyePage(String goodbyePage) { - this.goodbyePage = goodbyePage; + + /** + * Sets the goodbyePage attribute of the LogoutServlet object + * + * @param goodbyePage The new goodbyePage value + */ + public void setGoodbyePage( String goodbyePage ) + { + this.goodbyePage = goodbyePage; } - public String getGoodbyePage() { + + + /** + * Gets the goodbyePage attribute of the LogoutServlet object + * + * @return The goodbyePage value + */ + public String getGoodbyePage() + { return goodbyePage; } - public void init(ServletConfig config) throws ServletException + + /** + * Description of the Method + * + * @param config Description of the Parameter + * @exception ServletException Description of the Exception + */ + public void init( ServletConfig config ) throws ServletException { - setGoodbyePage( config.getInitParameter("goodbyePage") ); - if (goodbyePage == null) - throw new ServletException( "The goodbyePage init parameter must be specified."); + setGoodbyePage( config.getInitParameter( "goodbyePage" ) ); + if ( goodbyePage == null ) + { + throw new ServletException( "The goodbyePage init parameter must be specified." ); + } } - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException + + + /** + * Description of the Method + * + * @param request Description of the Parameter + * @param response Description of the Parameter + * @exception ServletException Description of the Exception + */ + public void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException { - HttpSession session = request.getSession(true); - sessionMgr.removeSessionUser(session); + HttpSession session = request.getSession( true ); + UserSessionManager.getInstance().removeVisit( session ); try { - UserSessionManager.doRedirect( request, response, goodbyePage); + UserSessionManager.doRedirect( request, response, goodbyePage ); + } + catch ( IOException e ) + { + throw new ServletException( "could not redirect to goodbye page" ); } - catch (IOException e) {throw new ServletException("could not redirect to goodbye page");} } } + diff --git a/src/java/org/thdl/lex/UserSessionManager.java b/src/java/org/thdl/lex/UserSessionManager.java index eb01bdc..57e2318 100644 --- a/src/java/org/thdl/lex/UserSessionManager.java +++ b/src/java/org/thdl/lex/UserSessionManager.java @@ -21,79 +21,41 @@ public class UserSessionManager /** - * Gets the displayHelper attribute of the UserSessionManager object + * Gets the visit attribute of the UserSessionManager object * * @param session Description of the Parameter - * @return The displayHelper value + * @return The visit value */ - public DisplayHelper getDisplayHelper( HttpSession session ) + public Visit getVisit( HttpSession session ) { - if ( null == session.getAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT ) ) + if ( null == session.getAttribute( LexConstants.VISIT_SESSION_ATTR ) ) { - setDisplayHelper( session, new DisplayHelper() ); + setVisit( session, new Visit( session ) ); } - return (DisplayHelper) session.getAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT ); + return (Visit) session.getAttribute( LexConstants.VISIT_SESSION_ATTR ); } /** - * Sets the displayHelper attribute of the UserSessionManager object + * Sets the visit attribute of the UserSessionManager object * - * @param session The new displayHelper value - * @param helper The new displayHelper value + * @param session The new visit value + * @param visit The new visit value */ - public void setDisplayHelper( HttpSession session, DisplayHelper helper ) + public void setVisit( HttpSession session, Visit visit ) { - session.setAttribute( LexConstants.DISPLAY_HELPER_SESSION_ATT, helper ); + session.setAttribute( LexConstants.VISIT_SESSION_ATTR, visit ); } /** - * Sets the preferences attribute of the UserSessionManager object + * Description of the Method * - * @param session The new preferences value - * @param preferences The new preferences value - * @since + * @param session Description of the Parameter */ - public void setPreferences( HttpSession session, Preferences preferences ) + public void removeVisit( HttpSession session ) { - session.setAttribute( LexConstants.PREFERENCES_SESS_ATTR, preferences ); - } - - - /** - * Sets the query attribute of the UserSessionManager object - * - * @param session The new query value - * @param terms The new query value - * @since - */ - public void setQuery( HttpSession session, LexQuery terms ) - { - session.setAttribute( LexConstants.QUERY_SESS_ATTR, terms ); - } - - - /** - * Sets the sessionUser attribute of the UserSessionManager object - * - * @param session The new sessionUser value - * @param user The new sessionUser value - * @since - */ - public void setSessionUser( HttpSession session, ThdlUser user ) - { - session.setAttribute( LexConstants.USER_SESS_ATTR, user ); - String roleParam = "administrator"; - if ( user.hasRole( roleParam ) ) - { - //roles from Lex.Users.userRoleList (references Lex.UserRoles) - session.setMaxInactiveInterval( 60 * 60 * 8 ); - } - else - { - session.setMaxInactiveInterval( 60 * 45 ); - } + session.setAttribute( LexConstants.VISIT_SESSION_ATTR, null ); } @@ -110,32 +72,6 @@ public class UserSessionManager } - /** - * Sets the displayMode attribute of the UserSessionManager object - * - * @param session The new displayMode value - * @param displayMode The new displayMode value - * @since - */ - public void setDisplayMode( HttpSession session, String displayMode ) - { - session.setAttribute( LexConstants.DISPLAYMODE_SESS_ATTR, displayMode ); - } - - - /** - * Sets the entry attribute of the UserSessionManager object - * - * @return The instance value - * @since - */ - /* - public void setEntry( HttpSession session, ITerm entry ) - { - session.setAttribute( LexConstants.TERMENTRYBEAN_SESS_ATTR, entry ); - } - */ -//helper methods /** * Gets the instance attribute of the UserSessionManager class * @@ -148,59 +84,6 @@ public class UserSessionManager } - /** - * Gets the query attribute of the UserSessionManager object - * - * @param session Description of Parameter - * @return The query value - * @since - */ - public LexQuery getQuery( HttpSession session ) - { - Object query = session.getAttribute( LexConstants.QUERY_SESS_ATTR ); - if ( null == query || !( query instanceof LexQuery ) ) - { - query = new LexQuery(); - session.setAttribute( LexConstants.QUERY_SESS_ATTR, query ); - } - return (LexQuery) query; - } - - - /** - * Gets the preferences attribute of the UserSessionManager object - * - * @param session Description of Parameter - * @return The preferences value - * @exception LexRepositoryException Description of the Exception - * @exception LexComponentException Description of the Exception - * @since - */ - 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 ); - } - - - /** - * Gets the sessionUser attribute of the UserSessionManager object - * - * @param session Description of Parameter - * @return The sessionUser value - * @since - */ - public ThdlUser getSessionUser( HttpSession session ) - { - return (ThdlUser) session.getAttribute( LexConstants.USER_SESS_ATTR ); - } - - /** * Gets the sessionLoginTarget attribute of the UserSessionManager object * @@ -221,20 +104,6 @@ public class UserSessionManager - /** - * Description of the Method - * - * @param session Description of Parameter - * @since - */ - public void removeSessionUser( HttpSession session ) - { - session.removeAttribute( LexConstants.USER_SESS_ATTR ); - session.removeAttribute( LexConstants.PREFERENCES_SESS_ATTR ); - } - - - /** * Description of the Method * diff --git a/src/java/org/thdl/lex/Visit.java b/src/java/org/thdl/lex/Visit.java new file mode 100644 index 0000000..b103cfb --- /dev/null +++ b/src/java/org/thdl/lex/Visit.java @@ -0,0 +1,220 @@ +package org.thdl.lex; +import java.io.IOException; + +import javax.servlet.http.*; +import org.thdl.lex.component.*; + +import org.thdl.users.*; + + +/** + * Description of the Class + * + * @author travis + * @created October 1, 2003 + */ +public class Visit +{ +//attributes + HttpSession session; + DisplayHelper helper; + Preferences preferences; + LexQuery query; + ThdlUser user; + String displayMode; + + + /** + * Sets the session attribute of the Visit object + * + * @param session The new session value + */ + public void setSession( HttpSession session ) + { + this.session = session; + } + + + /** + * Gets the session attribute of the Visit object + * + * @return The session value + */ + public HttpSession getSession() + { + return session; + } + + + /** + * Sets the helper attribute of the Visit object + * + * @param helper The new helper value + */ + public void setHelper( DisplayHelper helper ) + { + this.helper = helper; + } + + + /** + * Sets the preferences attribute of the Visit object + * + * @param preferences The new preferences value + */ + public void setPreferences( Preferences preferences ) + { + this.preferences = preferences; + } + + + /** + * Sets the query attribute of the Visit object + * + * @param query The new query value + */ + public void setQuery( LexQuery query ) + { + this.query = query; + } + + + /** + * Sets the user attribute of the Visit object + * + * @param user The new user value + */ + public void setUser( ThdlUser user ) + { + if ( user.hasRole( "guest" ) ) + { + getSession().setMaxInactiveInterval( 60 * 5 ); + } + else + { + getSession().setMaxInactiveInterval( 60 * 60 * 8 ); + } + this.user = user; + } + + + /** + * Sets the displayMode attribute of the Visit object + * + * @param displayMode The new displayMode value + */ + public void setDisplayMode( String displayMode ) + { + this.displayMode = displayMode; + } + + + /** + * Gets the helper attribute of the Visit object + * + * @return The helper value + */ + public DisplayHelper getHelper() + { + if ( null == helper ) + { + setHelper( new DisplayHelper() ); + } + return helper; + } + + + /** + * Gets the preferences attribute of the Visit object + * + * @return The preferences value + */ + public Preferences getPreferences() + { + if ( null == preferences ) + { + try + { + setPreferences( new Preferences( getUser() ) ); + } + catch ( Exception e ) + { + setPreferences( new Preferences() ); + } + } + return preferences; + } + + + /** + * Gets the query attribute of the Visit object + * + * @return The query value + */ + public LexQuery getQuery() + { + if ( null == query ) + { + setQuery( new LexQuery() ); + } + return query; + } + + + /** + * Gets the user attribute of the Visit object + * + * @return The user value + */ + public ThdlUser getUser() + { + return user; + } + + + + /** + * Gets the displayMode attribute of the Visit object + * + * @return The displayMode value + */ + public String getDisplayMode() + { + return displayMode; + } + + + + //constructor + /** + *Constructor for the Visit object + */ + public Visit() { } + + + /** + *Constructor for the Visit object + * + * @param session Description of the Parameter + */ + public Visit( HttpSession session ) + { + this(); + setSession( session ); + } + + + /** + *Constructor for the Visit object + * + * @param session Description of the Parameter + * @param user Description of the Parameter + */ + public Visit( HttpSession session, ThdlUser user ) + { + this( session ); + setUser( user ); + } + +} + diff --git a/src/java/org/thdl/lex/commands/DisplayCommand.java b/src/java/org/thdl/lex/commands/DisplayCommand.java index c1b596e..0343613 100644 --- a/src/java/org/thdl/lex/commands/DisplayCommand.java +++ b/src/java/org/thdl/lex/commands/DisplayCommand.java @@ -59,10 +59,11 @@ public class DisplayCommand extends LexCommand implements Command { String msg = null; String next = getNext(); - DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + DisplayHelper displayHelper = visit.getHelper(); try { - LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); + LexQuery query = visit.getQuery(); if ( null != component ) { component.populate( req.getParameterMap() ); diff --git a/src/java/org/thdl/lex/commands/FindCommand.java b/src/java/org/thdl/lex/commands/FindCommand.java index d0ed7b4..1e2f2bb 100644 --- a/src/java/org/thdl/lex/commands/FindCommand.java +++ b/src/java/org/thdl/lex/commands/FindCommand.java @@ -34,8 +34,9 @@ public class FindCommand extends LexCommand implements Command { String msg = null; String next = getNext(); - DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); - LexQuery query = getSessionManager().getQuery( req.getSession( true ) ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + DisplayHelper displayHelper = visit.getHelper(); + LexQuery query = visit.getQuery(); query.populate( req.getParameterMap() ); if ( component instanceof ITerm ) @@ -47,7 +48,7 @@ public class FindCommand extends LexCommand implements Command Iterator iterator = query.getResults().keySet().iterator(); if ( iterator.hasNext() ) { - getSessionManager().setQuery( req.getSession( true ), query ); + visit.setQuery( query ); msg = "There are " + query.getResults().size() + " terms matching " + term.getTerm(); } else diff --git a/src/java/org/thdl/lex/commands/GetInsertFormCommand.java b/src/java/org/thdl/lex/commands/GetInsertFormCommand.java index 04ce29b..c253dd1 100644 --- a/src/java/org/thdl/lex/commands/GetInsertFormCommand.java +++ b/src/java/org/thdl/lex/commands/GetInsertFormCommand.java @@ -56,15 +56,15 @@ public class GetInsertFormCommand extends LexCommand implements Command public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { String next = getNext(); - HttpSession ses = req.getSession( true ); - LexQuery query = getSessionManager().getQuery( ses ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + LexQuery query = visit.getQuery(); ITerm term = query.getEntry(); String msg = null; try { - LexUser user = (LexUser) getSessionManager().getSessionUser( ses ); - Preferences prefs = getSessionManager().getPreferences( ses ); + LexUser user = (LexUser) visit.getUser(); + Preferences prefs = visit.getPreferences(); if ( isTermMode() ) { @@ -75,7 +75,7 @@ public class GetInsertFormCommand extends LexCommand implements Command { msg = newTerm.getTerm() + " is present in the dictionary, please add to this term."; next = "displayEntry.jsp"; - getSessionManager().setQuery( req.getSession( true ), query ); + visit.setQuery( query ); } component = newTerm; } @@ -141,7 +141,7 @@ public class GetInsertFormCommand extends LexCommand implements Command } msg = "You have reached the Insert Form"; - getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); + visit.setDisplayMode( "addEditForm" ); req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, msg ); diff --git a/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java b/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java index 1bf4278..2e4231d 100644 --- a/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java +++ b/src/java/org/thdl/lex/commands/GetUpdateFormCommand.java @@ -57,11 +57,11 @@ public class GetUpdateFormCommand extends LexCommand implements Command public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { String next = getNext(); - HttpSession ses = req.getSession( true ); - LexQuery query = getSessionManager().getQuery( ses ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + LexQuery query = visit.getQuery( ); ITerm term = query.getEntry(); String msg = null; - ThdlUser user = getSessionManager().getSessionUser( req.getSession( true ) ); + ThdlUser user = visit.getUser(); if ( validate( user, component ) ) { @@ -122,7 +122,7 @@ public class GetUpdateFormCommand extends LexCommand implements Command } msg = "You have reached the Update Form"; - getSessionManager().setDisplayMode( req.getSession( true ), "addEditForm" ); + visit.setDisplayMode( "addEditForm" ); } else { diff --git a/src/java/org/thdl/lex/commands/InsertCommand.java b/src/java/org/thdl/lex/commands/InsertCommand.java index 18776d7..7f39886 100644 --- a/src/java/org/thdl/lex/commands/InsertCommand.java +++ b/src/java/org/thdl/lex/commands/InsertCommand.java @@ -59,8 +59,8 @@ public class InsertCommand extends LexCommand implements Command { String msg = null; String next = getNext(); - DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); - Global global = (Global) req.getServletContext().getAttribute( "global" ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + DisplayHelper displayHelper = visit.getHelper(); try { HttpSession ses = req.getSession( false ); @@ -69,10 +69,10 @@ public class InsertCommand extends LexCommand implements Command throw new CommandException( "Could not update component, user's session has expired" ); } - LexQuery query = getSessionManager().getQuery( ses ); + LexQuery query = visit.getQuery(); ITerm term = query.getEntry(); - LexUser user = (LexUser) getSessionManager().getSessionUser( ses ); - Preferences prefs = getSessionManager().getPreferences( ses ); + LexUser user = (LexUser) visit.getUser(); + Preferences prefs = visit.getPreferences(); if ( CommandToken.isValid( req ) && validate( user, component ) ) { @@ -124,10 +124,9 @@ public class InsertCommand extends LexCommand implements Command LexLogger.debugComponent( component ); LexLogger.debugComponent( term ); - LexComponentRepository.saveOrUpdate( term ); - global.setRequiresRefresh( true ); + LexComponentRepository.save( term ); msg = "Successful Update"; - getSessionManager().setDisplayMode( req.getSession( true ), "edit" ); + visit.setDisplayMode( "edit" ); } else { diff --git a/src/java/org/thdl/lex/commands/NullCommand.java b/src/java/org/thdl/lex/commands/NullCommand.java index d97643b..8f2d230 100644 --- a/src/java/org/thdl/lex/commands/NullCommand.java +++ b/src/java/org/thdl/lex/commands/NullCommand.java @@ -1,23 +1,49 @@ package org.thdl.lex.commands; +import javax.servlet.http.HttpServletRequest; + import org.thdl.lex.*; import org.thdl.lex.component.*; -import javax.servlet.http.HttpServletRequest; +/** + * Description of the Class + * + * @author travis + * @created October 21, 2003 + */ public class NullCommand extends LexCommand implements Command { - public String execute(HttpServletRequest req, ILexComponent component) throws CommandException + /** + * Description of the Method + * + * @param req Description of the Parameter + * @param component Description of the Parameter + * @return Description of the Return Value + * @exception CommandException Description of the Exception + */ + public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { - if( null == req.getParameter( LexConstants.COMMAND_REQ_PARAM ) ) - req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, "Start from here." ); - if( "login" == req.getParameter( LexConstants.COMMAND_REQ_PARAM ) - && null != getSessionManager().getSessionUser( req.getSession(true) ) ) - setNext("menu.jsp"); + /* + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + if( null == req.getParameter( LexConstants.COMMAND_REQ_PARAM ) ) + req.setAttribute( LexConstants.MESSAGE_REQ_ATTR, "Start from here." ); + if( "login" == req.getParameter( LexConstants.COMMAND_REQ_PARAM ) + && null != visit.getUser()) + setNext("menu.jsp"); + */ return getNext(); } - public NullCommand(String next) + + + /** + *Constructor for the NullCommand object + * + * @param next Description of the Parameter + */ + public NullCommand( String next ) { - super(next); + super( next ); } } + diff --git a/src/java/org/thdl/lex/commands/PreferencesCommand.java b/src/java/org/thdl/lex/commands/PreferencesCommand.java index a56fd5e..a4c8ac2 100644 --- a/src/java/org/thdl/lex/commands/PreferencesCommand.java +++ b/src/java/org/thdl/lex/commands/PreferencesCommand.java @@ -26,8 +26,9 @@ public class PreferencesCommand extends LexCommand implements Command { try { + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); - Preferences isb = UserSessionManager.getInstance().getPreferences( req.getSession( true ) ); + Preferences isb = visit.getPreferences(); if ( req.getParameter( LexConstants.COMMAND_REQ_PARAM ).equals( "setMetaPrefs" ) ) { isb.setLanguageSet( LexUtilities.convertToIntegerArray( req.getParameterValues( "languages" ) ) ); @@ -99,10 +100,7 @@ public class PreferencesCommand extends LexCommand implements Command { throw new CommandException( "LexComponentException says: " + lre.getMessage() ); } - catch ( LexRepositoryException lre ) - { - throw new CommandException( "LexComponentException says: " + lre.getMessage() ); - } + return getNext(); } diff --git a/src/java/org/thdl/lex/commands/RemoveCommand.java b/src/java/org/thdl/lex/commands/RemoveCommand.java index a62c020..a1ae449 100644 --- a/src/java/org/thdl/lex/commands/RemoveCommand.java +++ b/src/java/org/thdl/lex/commands/RemoveCommand.java @@ -29,7 +29,9 @@ public class RemoveCommand extends LexCommand implements Command */ public String execute( HttpServletRequest req, ILexComponent component ) throws CommandException { - DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + + DisplayHelper displayHelper = visit.getHelper(); /* try diff --git a/src/java/org/thdl/lex/commands/UpdateCommand.java b/src/java/org/thdl/lex/commands/UpdateCommand.java index 2b29b4e..2ce44c1 100644 --- a/src/java/org/thdl/lex/commands/UpdateCommand.java +++ b/src/java/org/thdl/lex/commands/UpdateCommand.java @@ -59,8 +59,9 @@ public class UpdateCommand extends LexCommand implements Command { String msg = null; String next = getNext(); - DisplayHelper displayHelper = getSessionManager().getDisplayHelper( req.getSession( true ) ); - Global global = (Global) req.getServletContext().getAttribute( "global" ); + Visit visit = UserSessionManager.getInstance().getVisit( req.getSession( true ) ); + + DisplayHelper displayHelper = visit.getHelper( ); try { HttpSession ses = req.getSession( false ); @@ -69,8 +70,8 @@ public class UpdateCommand extends LexCommand implements Command throw new CommandException( "Could not update component, user's session has expired" ); } - ThdlUser user = getSessionManager().getSessionUser( ses ); - LexQuery query = getSessionManager().getQuery( ses ); + ThdlUser user = visit.getUser(); + LexQuery query = visit.getQuery(); ITerm term = query.getEntry(); if ( CommandToken.isValid( req ) && validate( user, component ) ) @@ -104,10 +105,9 @@ public class UpdateCommand extends LexCommand implements Command LexLogger.debugComponent( component ); LexLogger.debugComponent( term ); - LexComponentRepository.update( term ); - global.setRequiresRefresh( true ); + LexComponentRepository.save( term ); msg = "Successful Update"; - getSessionManager().setDisplayMode( req.getSession( true ), "edit" ); + visit.setDisplayMode( "edit" ); } else { diff --git a/src/jsp/jsp/debug.jsf b/src/jsp/jsp/debug.jsf index e82b4c6..07b94cc 100644 --- a/src/jsp/jsp/debug.jsf +++ b/src/jsp/jsp/debug.jsf @@ -18,7 +18,7 @@ Validate CSS

USER INFO

-User Roles: +User Roles: diff --git a/src/jsp/jsp/displayDefinition.jsf b/src/jsp/jsp/displayDefinition.jsf index b63ee7b..20ed789 100644 --- a/src/jsp/jsp/displayDefinition.jsf +++ b/src/jsp/jsp/displayDefinition.jsf @@ -5,7 +5,7 @@ - +

@@ -19,7 +19,7 @@ -
+ @@ -28,7 +28,7 @@ - + @@ -37,10 +37,10 @@ view/edit translation -
+
- +
diff --git a/src/jsp/jsp/displayEncyclopediaArticle.jsf b/src/jsp/jsp/displayEncyclopediaArticle.jsf index ed62429..30472ca 100644 --- a/src/jsp/jsp/displayEncyclopediaArticle.jsf +++ b/src/jsp/jsp/displayEncyclopediaArticle.jsf @@ -1,7 +1,7 @@ <%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - +

@@ -12,7 +12,7 @@ -
+ diff --git a/src/jsp/jsp/displayEntry.jsp b/src/jsp/jsp/displayEntry.jsp index 6eebdc7..784eadc 100644 --- a/src/jsp/jsp/displayEntry.jsp +++ b/src/jsp/jsp/displayEntry.jsp @@ -5,22 +5,22 @@ - + <%-- - + - + - + --%> @@ -28,9 +28,9 @@

Search Results

    - + - +
  1. @@ -70,33 +70,33 @@ Display: - + credits | - + analysis | - + translations - + - + -edit options + | edit options diff --git a/src/jsp/jsp/displayEtymology.jsf b/src/jsp/jsp/displayEtymology.jsf index f59e2f7..90a6da0 100644 --- a/src/jsp/jsp/displayEtymology.jsf +++ b/src/jsp/jsp/displayEtymology.jsf @@ -5,7 +5,7 @@ - +

    @@ -28,7 +28,7 @@ <%-- Derivation: --%> -
    +
    @@ -38,10 +38,10 @@ - + - - + +

    Translations

      @@ -61,13 +61,13 @@
      -
      + - + - +
    diff --git a/src/jsp/jsp/displayFunction.jsf b/src/jsp/jsp/displayFunction.jsf index c83cca1..1b456b1 100644 --- a/src/jsp/jsp/displayFunction.jsf +++ b/src/jsp/jsp/displayFunction.jsf @@ -1,7 +1,7 @@ <%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - +

    @@ -11,7 +11,7 @@ -
    + diff --git a/src/jsp/jsp/displayKeyword.jsf b/src/jsp/jsp/displayKeyword.jsf index 06bcfb8..c895173 100644 --- a/src/jsp/jsp/displayKeyword.jsf +++ b/src/jsp/jsp/displayKeyword.jsf @@ -4,7 +4,7 @@ - +

    @@ -16,7 +16,6 @@ -
    diff --git a/src/jsp/jsp/displayMeta.jsf b/src/jsp/jsp/displayMeta.jsf index dc6126a..2096ad0 100644 --- a/src/jsp/jsp/displayMeta.jsf +++ b/src/jsp/jsp/displayMeta.jsf @@ -1,10 +1,12 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - - - + + + - + + +
     view metadata @@ -12,18 +14,20 @@

    @@ -17,7 +17,7 @@ -
    + @@ -26,10 +26,10 @@ - + - - + +

    Translations

      @@ -43,14 +43,14 @@ view/edit translation --%> -
      +
      - + - +
    diff --git a/src/jsp/jsp/displayNotes.jsf b/src/jsp/jsp/displayNotes.jsf index 6622bbe..4767aa8 100644 --- a/src/jsp/jsp/displayNotes.jsf +++ b/src/jsp/jsp/displayNotes.jsf @@ -2,25 +2,25 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - + - - + +

    Notes

      - +
    1. -
      + - + - + - +
    2. diff --git a/src/jsp/jsp/displayPassage.jsf b/src/jsp/jsp/displayPassage.jsf index 09dca0d..d6a2d4d 100644 --- a/src/jsp/jsp/displayPassage.jsf +++ b/src/jsp/jsp/displayPassage.jsf @@ -4,7 +4,7 @@ - +

      @@ -15,7 +15,7 @@ - + @@ -33,7 +33,7 @@ -
      + @@ -42,9 +42,9 @@ - - - + + +

      Translations

        @@ -71,14 +71,14 @@
        -
        + <%-- --%> - + - +
        diff --git a/src/jsp/jsp/displayPronunciation.jsf b/src/jsp/jsp/displayPronunciation.jsf index cb601a6..10cd228 100644 --- a/src/jsp/jsp/displayPronunciation.jsf +++ b/src/jsp/jsp/displayPronunciation.jsf @@ -5,7 +5,7 @@ - +

        @@ -18,7 +18,7 @@
        -
        + diff --git a/src/jsp/jsp/displayRegister.jsf b/src/jsp/jsp/displayRegister.jsf index a1d356e..4fa3600 100644 --- a/src/jsp/jsp/displayRegister.jsf +++ b/src/jsp/jsp/displayRegister.jsf @@ -4,7 +4,7 @@ - +

        @@ -15,7 +15,7 @@ -
        + diff --git a/src/jsp/jsp/displayRelatedTerm.jsf b/src/jsp/jsp/displayRelatedTerm.jsf index 5ecfd5c..8b27de0 100644 --- a/src/jsp/jsp/displayRelatedTerm.jsf +++ b/src/jsp/jsp/displayRelatedTerm.jsf @@ -3,7 +3,7 @@ - +

        @@ -17,8 +17,7 @@
        -
        - + diff --git a/src/jsp/jsp/displaySpelling.jsf b/src/jsp/jsp/displaySpelling.jsf index 07983fa..4d6008a 100644 --- a/src/jsp/jsp/displaySpelling.jsf +++ b/src/jsp/jsp/displaySpelling.jsf @@ -1,7 +1,7 @@ <%@ page import="org.thdl.lex.*,org.thdl.lex.component.*" buffer="512kb" autoFlush="false"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> - +

        @@ -14,7 +14,7 @@
        -
        + diff --git a/src/jsp/jsp/displaySubdefinition.jsf b/src/jsp/jsp/displaySubdefinition.jsf index 10342b3..51375f9 100644 --- a/src/jsp/jsp/displaySubdefinition.jsf +++ b/src/jsp/jsp/displaySubdefinition.jsf @@ -5,7 +5,7 @@ - +

        @@ -26,14 +26,14 @@ -
        + - + @@ -42,11 +42,11 @@ view/edit translation -
        +
        - + diff --git a/src/jsp/jsp/displayTerm.jsf b/src/jsp/jsp/displayTerm.jsf index 67726b2..d1f096b 100644 --- a/src/jsp/jsp/displayTerm.jsf +++ b/src/jsp/jsp/displayTerm.jsf @@ -24,7 +24,7 @@ - + diff --git a/src/jsp/jsp/displayTransitionalData.jsf b/src/jsp/jsp/displayTransitionalData.jsf index f846495..51edfee 100644 --- a/src/jsp/jsp/displayTransitionalData.jsf +++ b/src/jsp/jsp/displayTransitionalData.jsf @@ -5,8 +5,7 @@ - - +

        @@ -18,7 +17,7 @@
        -
        + @@ -30,6 +29,5 @@

        - diff --git a/src/jsp/jsp/displayTranslationEquivalent.jsf b/src/jsp/jsp/displayTranslationEquivalent.jsf index f39d390..0e84013 100644 --- a/src/jsp/jsp/displayTranslationEquivalent.jsf +++ b/src/jsp/jsp/displayTranslationEquivalent.jsf @@ -4,7 +4,7 @@ - +

        @@ -16,7 +16,7 @@ -
        + diff --git a/src/jsp/jsp/displayTree.jsf b/src/jsp/jsp/displayTree.jsf index d73cad1..d86c154 100644 --- a/src/jsp/jsp/displayTree.jsf +++ b/src/jsp/jsp/displayTree.jsf @@ -4,27 +4,27 @@ - + - +

          - - + +
        1. - +

          Special Guests

            - - + +
          • - +
          • @@ -33,16 +33,16 @@ - - + +
          • - +

            Pronunciations

              - - + +
            • - +
            • @@ -51,16 +51,16 @@ - - + +
            • - +

              Etymologies

                - - + +
              • - +
              • @@ -69,16 +69,16 @@ - - + +
              • - +

                Spellings

                  - - + +
                • - +
                • @@ -87,16 +87,16 @@ - - + +
                • - +

                  Functions

                    - - + +
                  • - +
                  • @@ -105,16 +105,16 @@ - - + +
                  • - +

                    Encyclopedia Articles

                      - - + +
                    • - +
                    • @@ -123,41 +123,41 @@ - - + +
                    • - +

                      Definitions

                      - - - + + + - - + +
                        - +
                      1. - +
                          - - + +
                        1. - +

                          Keywords

                            - +
                          • - +
                          • @@ -166,16 +166,16 @@ - - + +
                          • - +

                            Model Sentences

                              - +
                            • - +
                            • @@ -184,16 +184,16 @@ - - + +
                            • - +

                              Translation Equivalents

                                - +
                              • - +
                              • @@ -202,16 +202,16 @@ - - + +
                              • - +

                                RelatedTerm

                                  - +
                                • - +
                                • @@ -220,16 +220,16 @@ - - + +
                                • - +

                                  Passages

                                    - +
                                  • - +
                                  • @@ -238,17 +238,17 @@ - - + +
                                  • - +

                                    Registers

                                      - +
                                    • - +
                                    • diff --git a/src/jsp/jsp/displayTreeToc.jsf b/src/jsp/jsp/displayTreeToc.jsf index 84eaa81..6c12684 100644 --- a/src/jsp/jsp/displayTreeToc.jsf +++ b/src/jsp/jsp/displayTreeToc.jsf @@ -5,65 +5,65 @@

                                      Term Map

                                      - +

                                        - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + +
                                        1. - - + +
                                        2. @@ -71,43 +71,43 @@
                                            - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/jsp/jsp/footer.jsf b/src/jsp/jsp/footer.jsf index 0290964..e0e8198 100644 --- a/src/jsp/jsp/footer.jsf +++ b/src/jsp/jsp/footer.jsf @@ -2,8 +2,8 @@ <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix = "req" uri = "http://jakarta.apache.org/taglibs/request-1.0" %> -<%-- - +<%-- + diff --git a/src/jsp/jsp/header.jsf b/src/jsp/jsp/header.jsf index dc93424..1d684ed 100644 --- a/src/jsp/jsp/header.jsf +++ b/src/jsp/jsp/header.jsf @@ -12,7 +12,7 @@ THDL Tibetan Collaborative Dictionaries