Moved most objects stored in session into Visit for better lazy initialization control. Also added some date formatting to DisplayHelper

This commit is contained in:
dubtraxis 2003-10-21 18:00:23 +00:00
parent e53d102118
commit 6d27cd40aa
51 changed files with 1014 additions and 622 deletions

View file

@ -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;

View file

@ -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 );
}
}

View file

@ -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

View file

@ -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 );
}
}

View file

@ -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 );
}

View file

@ -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() );
}

View file

@ -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 )
{

View file

@ -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";
}

View file

@ -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 ) );
}

View file

@ -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
{

View file

@ -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");}
}
}

View file

@ -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
*

View file

@ -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 );
}
}

View file

@ -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() );

View file

@ -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

View file

@ -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 );

View file

@ -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
{

View file

@ -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
{

View file

@ -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 );
}
}

View file

@ -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();
}

View file

@ -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

View file

@ -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
{

View file

@ -18,7 +18,7 @@ Validate CSS</a>
<tr>
<td>
<h2>USER INFO</h2>
User Roles: <c:out value="${ sessionScope.user.roles }"/>
User Roles: <c:out value="${ sessionScope.visit.user.roles }"/>
</td>
</tr>

View file

@ -5,7 +5,7 @@
<!--DEFINITION LOOP-->
<c:set var="defintion" value="${ sessionScope.helper.component }"/>
<c:set var="defintion" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ definition }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -19,7 +19,7 @@
<!--<span class="label">Definition ${definition.precedence}:</span>-->
<c:out value="${ definition.definition }" escapeXml="false" />
<br />
<!--metadata-->
@ -28,7 +28,7 @@
<!--translation-->
<c:if test="${sessionScope.helper.showTranslations }">
<c:if test="${sessionScope.visit.helper.showTranslations }">
<c:forEach var="translation" items="${ definition.translations }" >
<c:set var='href' value='#'/>
<c:if test="${ editMode }">
@ -37,10 +37,10 @@
<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" /> <br />
<c:out value="${ translation.definition }" escapeXml="false" />
</span></a>
<!--metadata-->
<c:set target="${ sessionScope.helper }" property="component" value="${ translation }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" />
</c:forEach>
</c:if>

View file

@ -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" %>
<c:set var="encyclopediaArticle" value="${ sessionScope.helper.component }"/>
<c:set var="encyclopediaArticle" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ encyclopediaArticle }" ></a>' escapeXml="false" />
@ -12,7 +12,7 @@
</span>
</c:if>
<!--<span class="label">Encyclopedia Article:</span>-->
<c:out value="${ encyclopediaArticle.articleTitle }" escapeXml="false"/> <br />
<c:out value="${ encyclopediaArticle.articleTitle }" escapeXml="false"/>
<!--metadata-->

View file

@ -5,22 +5,22 @@
<!--displayEntry.jsp-->
<c:set var="editMode" value="${ false }" scope="request" />
<c:if test="${ ! sessionScope.user.guest && sessionScope.helper.showEditOptions }">
<c:if test="${ ! sessionScope.visit.user.guest && sessionScope.visit.helper.showEditOptions }">
<c:set var="editMode" value="${ true }" scope="request"/>
</c:if>
<%--
<c:set var="showNotes" value="${ false }" scope="request" />
<c:if test="${ sessionScope.helper.showNotes }">
<c:if test="${ sessionScope.visit.helper.showNotes }">
<c:set var="showNotes" value="${ true }" scope="request"/>
</c:if>
<c:set var="showMeta" value="${ false }" scope="request" />
<c:if test="${ sessionScope.helper.showMeta }">
<c:if test="${ sessionScope.visit.helper.showMeta }">
<c:set var="showMeta" value="${ true }" scope="request"/>
</c:if>
<c:set var="showTranslations" value="${ false }" scope="request" />
<c:if test="${ sessionScope.helper.showTranslations }">
<c:if test="${ sessionScope.visit.helper.showTranslations }">
<c:set var="showTranslations" value="${ true }" scope="request"/>
</c:if> --%>
@ -28,9 +28,9 @@
<div id="results" class="highlightBox">
<h2> Search Results </h2>
<ol>
<c:forEach var="resultsMapItem" items="${query.results}">
<c:forEach var="resultsMapItem" items="${sessionScope.visit.query.results}">
<c:set var="cls" value="" />
<c:if test="${ resultsMapItem.key == query.entry.metaId }">
<c:if test="${ resultsMapItem.key == sessionScope.visit.query.entry.metaId }">
<c:set var="cls" value="class='selected'" />
</c:if>
<li>
@ -70,33 +70,33 @@
<span class="label">Display</span>:
<c:set var="ckd" value=""/>
<c:if test="${ sessionScope.helper.showMeta }">
<c:if test="${ sessionScope.visit.helper.showMeta }">
<c:set var="ckd" value='checked="checked"'/>
</c:if>
<c:out value='<input name="showMeta" type="checkbox" value="true" ${ckd}/>' escapeXml='false'/>
credits |
<c:set var="ckd" value=""/>
<c:if test="${ sessionScope.helper.showNotes }">
<c:if test="${ sessionScope.visit.helper.showNotes }">
<c:set var="ckd" value='checked="checked"'/>
</c:if>
<c:out value='<input name="showNotes" type="checkbox" value="true" ${ckd}/>' escapeXml='false'/>
analysis |
<c:set var="ckd" value=""/>
<c:if test="${ sessionScope.helper.showTranslations }">
<c:if test="${ sessionScope.visit.helper.showTranslations }">
<c:set var="ckd" value='checked="checked"'/>
</c:if>
<c:out value='<input name="showTranslations" type="checkbox" value="true" ${ckd}/>' escapeXml='false'/>
translations
<c:if test="${ ! sessionScope.user.guest }">
<c:if test="${ ! sessionScope.visit.user.guest }">
<c:set var="ckd" value=""/>
<c:if test="${ sessionScope.helper.showEditOptions }">
<c:if test="${ sessionScope.visit.helper.showEditOptions }">
<c:set var="ckd" value='checked="checked"'/>
</c:if>
<c:out value='<input name="showEditOptions" type="checkbox" value="true" ${ckd}/>' escapeXml='false'/>
edit options
| edit options
</c:if>
<input type="hidden" name="cmd" value="displayFull"/>

View file

@ -5,7 +5,7 @@
<!--ETYMOLOGY-->
<c:set var="etymology" value="${ sessionScope.helper.component }"/>
<c:set var="etymology" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ etymology }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -28,7 +28,7 @@
<c:if test="${ empty etymology.derivation != 'none' }">
<%-- <span class="label">Derivation</span>: --%>
<c:out value="${ etymology.derivation }" escapeXml="false" /> <br />
<c:out value="${ etymology.derivation }" escapeXml="false" />
</span>
</c:if>
@ -38,10 +38,10 @@
<!--translation-->
<c:if test="${sessionScope.helper.showTranslations }">
<c:if test="${sessionScope.visit.helper.showTranslations }">
<c:set value="${etymology.translations}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${etymology.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3>
<ul>
@ -61,13 +61,13 @@
<!--<span class="label">Loan Language:</span>-->
<c:out value="${ applicationScope.flatData.languages[ translation.loanLanguage ] }" escapeXml="false" /> <br />
<!--<span class="label">Derivation:</span>-->
<c:out value="${ translation.derivation }" escapeXml="false" /> <br />
<c:out value="${ translation.derivation }" escapeXml="false" />
<!--metadata-->
</span>
<c:set var="originalComponent" value="${ etymology }" />
<c:set target="${ sessionScope.helper }" property="component" value="${ translation }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.helper }" property="component" value="${ originalComponent }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" />
</li>
</c:forEach>
</ul>

View file

@ -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" %>
<c:set var="function" value="${ sessionScope.helper.component }"/>
<c:set var="function" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:if test="${ editMode }">
<span class="compEditOptions">
@ -11,7 +11,7 @@
</c:if>
<c:out value='<a name="${ function }" ></a>' escapeXml="false" />
<!--<span class="label">Grammatical Function:</span>-->
<c:out value="${ applicationScope.flatData.functionsGeneral[function.function] }" escapeXml="false" /> <br />
<c:out value="${ applicationScope.flatData.functionsGeneral[function.function] }" escapeXml="false" />
<!--metadata-->

View file

@ -4,7 +4,7 @@
<c:set var="keyword" value="${ sessionScope.helper.component }"/>
<c:set var="keyword" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ keyword }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -16,7 +16,6 @@
<!--<span class="label">Keyword:</span>-->
<c:out value="${ keyword.keyword }" escapeXml="false" />
<br />
<!--metadata-->

View file

@ -1,10 +1,12 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c:set var="isNote" value='${ sessionScope.helper.component.label == "analyticalNote" }'/>
<c:set var="isTranslation" value='${ sessionScope.helper.componentIsTranslation }'/>
<c:set var="component" value='${ sessionScope.helper.component }'/>
<c:set var="isNote" value='${ sessionScope.visit.helper.component.label == "analyticalNote" }'/>
<c:set var="isTranslation" value='${ sessionScope.visit.helper.componentIsTranslation }'/>
<c:set var="component" value='${ sessionScope.visit.helper.component }'/>
<c:if test='${ sessionScope.helper.showMeta }'>
<c:if test='${ sessionScope.visit.helper.showMeta }'>
<br/>
<c:if test='${ !( isNote || isTranslation ) }'>
<a class="meta" href="#"><img src="/lex/images/meta.gif" alt=" view metadata" />
@ -12,18 +14,20 @@
<span class="metadata">
<c:if test="${ sessionScope.user.developer }">
<c:if test="${ sessionScope.visit.user.developer }">
<span class="label"> Id: </span><c:out value="${ component.metaId }" />
<br />
</c:if>
<span class="label">Created by </span><c:out value="${ applicationScope.flatData.users[ component.meta.createdBy ] }" escapeXml="false"/>
<c:if test="${ ! sessionScope.user.guest }">
<span class="label">on </span><c:out value="${ component.meta.createdOn }" default="unknown" escapeXml="false"/>
<c:if test="${ ! sessionScope.visit.user.guest }">
<c:set target="${ sessionScope.visit.helper }" property="date" value="${ component.meta.createdOn }"/>
<span class="label">on </span><c:out value="${ sessionScope.visit.helper.formattedDate }" default="unknown" escapeXml="false"/>
<span class="label">for </span><c:out value="${ applicationScope.flatData.projectSubjects[ component.meta.createdByProjSub ] }" default="none" escapeXml="false"/>
<br />
<span class="label">Modified by </span><c:out value="${ applicationScope.flatData.users[ component.meta.modifiedBy ] }" default="unknown" escapeXml="false"/>
<span class="label">on </span><c:out value="${ component.meta.modifiedOn }" default="unknown" escapeXml="false"/>
<c:set target="${ sessionScope.visit.helper }" property="date" value="${ component.meta.modifiedOn }"/>
<span class="label">on </span><c:out value="${ sessionScope.visit.helper.formattedDate }" default="unknown" escapeXml="false"/>
<span class="label">for </span><c:out value="${ applicationScope.flatData.projectSubjects[ component.meta.modifiedByProjSub ] }" default="none" escapeXml="false"/>
<br />
<span class="label">Source: </span><c:out value="${ applicationScope.flatData.sources[ component.meta.source ] }" default="unknown" escapeXml="false"/>

View file

@ -4,7 +4,7 @@
<c:set var="modelSentence" value="${ sessionScope.helper.component }"/>
<c:set var="modelSentence" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ modelSentence }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -17,7 +17,7 @@
<!--<span class="label">Model Sentence:</span>-->
<c:out value="${ modelSentence.modelSentence }" escapeXml="false" />
<br />
<!--metadata-->
@ -26,10 +26,10 @@
<!--translation-->
<c:if test="${sessionScope.helper.showTranslations }">
<c:if test="${sessionScope.visit.helper.showTranslations }">
<c:set value="${modelSentence.translations}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${modelSentence.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3>
<ul>
@ -43,14 +43,14 @@
<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">Model Sentence:</span>-->
<c:out value="${ translation.modelSentence }" escapeXml="false" /> <br />
<c:out value="${ translation.modelSentence }" escapeXml="false" />
</span>
<!--metadata-->
<c:set var="originalComponent" value="${ modelSentence }" />
<c:set target="${ sessionScope.helper }" property="component" value="${ translation }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.helper }" property="component" value="${ originalComponent }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" />
</li>
</c:forEach>
</ul>

View file

@ -2,25 +2,25 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!--displayNotes.jsf-->
<c:if test="${ sessionScope.helper.showNotes }">
<c:if test="${ sessionScope.visit.helper.showNotes }">
<c:set value="${sessionScope.helper.component.analyticalNotes}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.helper.component.analyticalNotes}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Notes</h3>
<ol class="notes">
<c:forEach var="note" items="${ sessionScope.helper.component.analyticalNotes }">
<c:forEach var="note" items="${ sessionScope.visit.helper.component.analyticalNotes }">
<li>
<span class="analysis">
<c:out value="${ note.analyticalNote }" escapeXml="false" /><br />
<c:out value="${ note.analyticalNote }" escapeXml="false" />
<!--metadata-->
<c:set var="parent" value="${ sessionScope.helper.component }" />
<c:set var="parent" value="${ sessionScope.visit.helper.component }" />
<c:set target="${ sessionScope.helper }" property="component" value="${ note }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ note }" />
<jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.helper }" property="component" value="${ parent }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ parent }" />
</span>
</li>
</c:forEach>

View file

@ -4,7 +4,7 @@
<c:set var="passage" value="${ sessionScope.helper.component }"/>
<c:set var="passage" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ passage }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -15,7 +15,7 @@
</span>
</c:if>
<c:set var="source" value="${ LexFlatDataRepository.literarySources[ passage.literarySource ] }"/>
<c:set var="source" value="${ applicationScope.flatData.literarySources[ passage.literarySource ] }"/>
<c:if test="${ ! empty source }">
<!--<span class="label">Literary Source:</span>-->
@ -33,7 +33,7 @@
</c:if>
<!--<span class="label">Passage:</span>-->
<c:out value="${ passage.passage }" escapeXml="false" /> <br />
<c:out value="${ passage.passage }" escapeXml="false" />
<!--metadata-->
@ -42,9 +42,9 @@
<!--translation-->
<c:if test="${sessionScope.helper.showTranslations }">
<c:set value="${passage.translations}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:if test="${sessionScope.visit.helper.showTranslations }">
<c:set value="${passage.translations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<h3>Translations</h3>
<ul>
<c:forEach var="translation" items="${ passage.translations }" >
@ -71,14 +71,14 @@
<c:out value="${ translation.pagination }" /> <br />
</c:if>
<c:out value="${ translation.passage }" /> <br />
<c:out value="${ translation.passage }" />
<%-- </span> --%>
<!--metadata-->
<c:set var="originalComponent" value="${ passage }" />
<c:set target="${ sessionScope.helper }" property="component" value="${ translation }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" />
<c:set target="${ sessionScope.helper }" property="component" value="${ originalComponent }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ originalComponent }" />
</li>
</c:forEach>

View file

@ -5,7 +5,7 @@
<!--PRONUNCIATION-->
<c:set var="pronunciation" value="${ sessionScope.helper.component }"/>
<c:set var="pronunciation" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ pronunciation }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -18,7 +18,7 @@
<!--<span class="label">Phonetic Rendering:</span>-->
<c:out value="${ pronunciation.phonetics }" escapeXml="false"/> <br />
<!--<span class="label">Type of Phonetics:</span> -->
<c:out value="${ applicationScope.flatData.phoneticsTypes[ pronunciation.phoneticsType ] }" escapeXml="false"/> <br />
<c:out value="${ applicationScope.flatData.phoneticsTypes[ pronunciation.phoneticsType ] }" escapeXml="false"/>
<!--metadata-->

View file

@ -4,7 +4,7 @@
<c:set var="register" value="${ sessionScope.helper.component }"/>
<c:set var="register" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ register }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -15,7 +15,7 @@
</c:if>
<!--<span class="label">Speech Register:</span>-->
<c:out value="${ applicationScope.flatData.registers[register.register] }" escapeXml="false" />
<br />
<!--metadata-->

View file

@ -3,7 +3,7 @@
<c:set var="relatedTerm" value="${ sessionScope.helper.component }"/>
<c:set var="relatedTerm" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ relatedTerm }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -17,8 +17,7 @@
<c:out value="${ relatedTerm.relatedTerm }" escapeXml="false" /> <br />
<!--<span class="label">Related Term Type:</span> -->
<c:out value="${ applicationScope.flatData.relatedTermTypes[relatedTerm.relatedTermType] }" escapeXml="false" />
<br />
<!--metadata-->

View file

@ -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" %>
<c:set var="spelling" value="${ sessionScope.helper.component }"/>
<c:set var="spelling" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:if test="${ editMode }">
<span class="compEditOptions">
@ -14,7 +14,7 @@
<!--<span class="label">Spelling:</span> -->
<c:out value="${ spelling.spelling }" escapeXml="false" /> <br />
<!--<span class="label">Spelling Type:</span> -->
<c:out value="${ applicationScope.flatData.spellingTypes[ spelling.spellingType ] }" escapeXml="false" /> <br />
<c:out value="${ applicationScope.flatData.spellingTypes[ spelling.spellingType ] }" escapeXml="false" />
<!--metadata-->

View file

@ -5,7 +5,7 @@
<!--SUBDEFINITION-->
<c:set var="subdefinition" value="${ sessionScope.helper.component }"/>
<c:set var="subdefinition" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ subdefinition }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -26,14 +26,14 @@
<!--<span class="label">Subdefinition:</span>-->
<c:out value="${ subdefinition.subdefinition }" escapeXml="false" />
<br />
<!--metadata-->
<jsp:include page="displayMeta.jsf" />
<!--translation-->
<c:if test="${sessionScope.helper.showTranslations }">
<c:if test="${sessionScope.visit.helper.showTranslations }">
<c:forEach var="translation" items="${ subdefinition.translations }">
<c:set var='href' value='#'/>
<c:if test="${ editMode }">
@ -42,11 +42,11 @@
<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">Subdefinition:</span>-->
<c:out value="${ translation.subdefinition }" escapeXml="false" /> <br />
<c:out value="${ translation.subdefinition }" escapeXml="false" />
</span>
</a>
<!--metadata-->
<c:set target="${ sessionScope.helper }" property="component" value="${ translation }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ translation }" />
<jsp:include page="displayMeta.jsf" />
</c:forEach>
</c:if>

View file

@ -24,7 +24,7 @@
</c:if>
<!--metadata-->
<c:set target="${ sessionScope.helper }" property="component" value="${ query.entry }" />
<c:set target="${ sessionScope.visit.helper }" property="component" value="${ query.entry }" />
<jsp:include page="displayMeta.jsf" />
<!--notes-->

View file

@ -5,8 +5,7 @@
<!--TRANSITIONAL DATA-->
<c:forEach var="transitionalData" items="${ query.entry.transitionalData }">
<c:set var="transitionalData" value="${ sessionScope.helper.component }"/>
<c:set var="transitionalData" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ transitionalData }" ></a>' escapeXml="false" />
@ -18,7 +17,7 @@
</c:if>
<span><c:out value="${ applicationScope.flatData.transitionalDataLabels[ transitionalData.transitionalDataLabel ] }" /></span> <c:out value="${ pronunciation.phonetics }" escapeXml="false"/> <br />
<c:out value="${ transitionalData.transitionalDataText }" escapeXml="false"/> <br />
<c:out value="${ transitionalData.transitionalDataText }" escapeXml="false"/>
@ -30,6 +29,5 @@
<jsp:include page="displayNotes.jsf" />
</p>
</c:forEach>

View file

@ -4,7 +4,7 @@
<c:set var="translationEquivalent" value="${ sessionScope.helper.component }"/>
<c:set var="translationEquivalent" value="${ sessionScope.visit.helper.component }"/>
<p class="data">
<c:out value='<a name="${ translationEquivalent }" ></a>' escapeXml="false" />
<c:if test="${ editMode }">
@ -16,7 +16,7 @@
<!--<span class="label">Translation Equivalent: </span> -->
<c:out value="${ translationEquivalent.translationEquivalent }" escapeXml="false" />
<br />
<!--metadata-->

View file

@ -4,27 +4,27 @@
<!--displayTree.jsf-->
<c:set var="editMode" value="${ false }" />
<c:if test="${ ! sessionScope.user.guest }">
<c:if test="${ ! sessionScope.visit.user.guest }">
<c:set var="editMode" value="${ true }" />
</c:if>
<c:if test="${ ! empty query.entry }">
<c:if test="${ ! empty sessionScope.visit.query.entry }">
<jsp:include page="displayTerm.jsf" flush="false"/>
<ol>
<!--TRANSITIONAL DATA-->
<c:set value="${query.entry.transitionalData}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.transitionalData}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Special Guests</h2>
<ul>
<c:forEach var="transitionalData" items="${ query.entry.transitionalData }">
<c:set target="${ sessionScope.helper }" property="component" value="${transitionalData}"/>
<c:forEach var="transitionalData" items="${ sessionScope.visit.query.entry.transitionalData }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${transitionalData}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayTransitionalData.jsf" flush="false"/>
</li>
</c:forEach>
@ -33,16 +33,16 @@
</c:if>
<!--PRONUNCIATION-->
<c:set value="${query.entry.pronunciations}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.pronunciations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Pronunciations</h2>
<ul>
<c:forEach var="pronunciation" items="${ query.entry.pronunciations }">
<c:set target="${ sessionScope.helper }" property="component" value="${pronunciation}"/>
<c:forEach var="pronunciation" items="${ sessionScope.visit.query.entry.pronunciations }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${pronunciation}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayPronunciation.jsf" flush="false"/>
</li>
</c:forEach>
@ -51,16 +51,16 @@
</c:if>
<!--ETYMOLOGY-->
<c:set value="${query.entry.etymologies}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.etymologies}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Etymologies</h2>
<ul>
<c:forEach var="etymology" items="${ query.entry.etymologies }">
<c:set target="${ sessionScope.helper }" property="component" value="${etymology}"/>
<c:forEach var="etymology" items="${ sessionScope.visit.query.entry.etymologies }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${etymology}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayEtymology.jsf" flush="false"/>
</li>
</c:forEach>
@ -69,16 +69,16 @@
</c:if>
<!--SPELLINGS-->
<c:set value="${query.entry.spellings}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.spellings}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Spellings</h2>
<ul>
<c:forEach var="spelling" items="${ query.entry.spellings }">
<c:set target="${ sessionScope.helper }" property="component" value="${spelling}"/>
<c:forEach var="spelling" items="${ sessionScope.visit.query.entry.spellings }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${spelling}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displaySpelling.jsf" flush="false"/>
</li>
</c:forEach>
@ -87,16 +87,16 @@
</c:if>
<!--FUNCTIONS-->
<c:set value="${query.entry.functions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.functions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Functions</h2>
<ul>
<c:forEach var="function" items="${ query.entry.functions }">
<c:set target="${ sessionScope.helper }" property="component" value="${function}"/>
<c:forEach var="function" items="${ sessionScope.visit.query.entry.functions }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${function}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayFunction.jsf" flush="false"/>
</li>
</c:forEach>
@ -105,16 +105,16 @@
</c:if>
<!--ENCYCLOPEDIA ARTICLES-->
<c:set value="${query.entry.encyclopediaArticles}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.encyclopediaArticles}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Encyclopedia Articles</h2>
<ul>
<c:forEach var="encyclopediaArticle" items="${ query.entry.encyclopediaArticles }">
<c:set target="${ sessionScope.helper }" property="component" value="${encyclopediaArticle}"/>
<c:forEach var="encyclopediaArticle" items="${ sessionScope.visit.query.entry.encyclopediaArticles }">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${encyclopediaArticle}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayEncyclopediaArticle.jsf" flush="false"/>
</li>
</c:forEach>
@ -123,41 +123,41 @@
</c:if>
<!--DEFINITION LOOP-->
<c:set value="${query.entry.definitions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${sessionScope.visit.query.entry.definitions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Definitions</h2>
<c:forEach var="definition" items="${query.entry.definitions}">
<c:set target="${ sessionScope.helper }" property="component" value="${definition}"/>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:forEach var="definition" items="${sessionScope.visit.query.entry.definitions}">
<c:set target="${ sessionScope.visit.helper }" property="component" value="${definition}"/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayDefinition.jsf" flush="false"/>
<!--SUBDEFINITION-->
<c:set value="${definition.subdefinitions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${definition.subdefinitions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<ol>
<c:forEach var="subdefinition" items="${ definition.subdefinitions }">
<c:set target="${ sessionScope.helper }" property="component" value="${subdefinition}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${subdefinition}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displaySubdefinition.jsf" flush="false"/>
<ol>
<!--KEYWORD-->
<c:set value="${subdefinition.keywords}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.keywords}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Keywords</h2>
<ul>
<c:forEach var="keyword" items="${ subdefinition.keywords }">
<c:set target="${ sessionScope.helper }" property="component" value="${keyword}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${keyword}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayKeyword.jsf" flush="false"/>
</li>
</c:forEach>
@ -166,16 +166,16 @@
</c:if>
<!--MODEL SENTENCE-->
<c:set value="${subdefinition.modelSentences}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.modelSentences}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Model Sentences</h2>
<ul>
<c:forEach var="modelSentence" items="${ subdefinition.modelSentences }">
<c:set target="${ sessionScope.helper }" property="component" value="${modelSentence}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${modelSentence}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayModelSentence.jsf" flush="false"/>
</li>
</c:forEach>
@ -184,16 +184,16 @@
</c:if>
<!--TRANSLATION EQUIVALENT-->
<c:set value="${subdefinition.translationEquivalents}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.translationEquivalents}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Translation Equivalents</h2>
<ul>
<c:forEach var="translationEquivalent" items="${ subdefinition.translationEquivalents }">
<c:set target="${ sessionScope.helper }" property="component" value="${translationEquivalent}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${translationEquivalent}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayTranslationEquivalent.jsf" flush="false"/>
</li>
</c:forEach>
@ -202,16 +202,16 @@
</c:if>
<!--RELATED TERM-->
<c:set value="${subdefinition.relatedTerms}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.relatedTerms}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>RelatedTerm</h2>
<ul>
<c:forEach var="relatedTerm" items="${ subdefinition.relatedTerms }">
<c:set target="${ sessionScope.helper }" property="component" value="${relatedTerm}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${relatedTerm}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayRelatedTerm.jsf" flush="false"/>
</li>
</c:forEach>
@ -220,16 +220,16 @@
</c:if>
<!--PASSAGE-->
<c:set value="${subdefinition.passages}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.passages}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Passages</h2>
<ul>
<c:forEach var="passage" items="${ subdefinition.passages }">
<c:set target="${ sessionScope.helper }" property="component" value="${passage}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${passage}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayPassage.jsf" flush="false"/>
</li>
</c:forEach>
@ -238,17 +238,17 @@
</c:if>
<!--REGISTER-->
<c:set value="${subdefinition.registers}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.registers}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<li>
<c:out value='<a name="${ sessionScope.helper.collection }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.collection }"></a>' escapeXml='false'/>
<h2>Registers</h2>
<ul>
<c:forEach var="register" items="${ subdefinition.registers }">
<c:set target="${ sessionScope.helper }" property="component" value="${register}"/>
<c:set target="${ sessionScope.visit.helper }" property="component" value="${register}"/>
<li>
<c:out value='<a name="${ sessionScope.helper.component }"></a>' escapeXml='false'/>
<c:out value='<a name="${ sessionScope.visit.helper.component }"></a>' escapeXml='false'/>
<jsp:include page="displayRegister.jsf" flush="false"/>
</li>
</c:forEach>

View file

@ -5,65 +5,65 @@
<h2>Term Map</h2>
<h3>
<c:out value="${ query.entry.term }"/>
<c:out value="${ sessionScope.visit.query.entry.term }"/>
</h3>
<ol>
<!--TRANSITIONAL DATA-->
<c:set value="${query.entry.transitionalData}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.transitionalData}">Special Guests</a></li>' escapeXml='false' />
<c:forEach var="transitionalData" items="${ query.entry.transitionalData }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.transitionalData}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.transitionalData}">Special Guests</a></li>' escapeXml='false' />
<c:forEach var="transitionalData" items="${ sessionScope.visit.query.entry.transitionalData }"></c:forEach>
</c:if>
<!--PRONUNCIATION-->
<c:set value="${query.entry.pronunciations}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.pronunciations}">Pronunciations</a></li>' escapeXml='false' />
<c:forEach var="pronunciation" items="${ query.entry.pronunciations }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.pronunciations}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.pronunciations}">Pronunciations</a></li>' escapeXml='false' />
<c:forEach var="pronunciation" items="${ sessionScope.visit.query.entry.pronunciations }"></c:forEach>
</c:if>
<!--ETYMOLOGY-->
<c:set value="${query.entry.etymologies}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.etymologies}">Etymologies</a></li>' escapeXml='false' />
<c:forEach var="etymology" items="${ query.entry.etymologies }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.etymologies}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.etymologies}">Etymologies</a></li>' escapeXml='false' />
<c:forEach var="etymology" items="${ sessionScope.visit.query.entry.etymologies }"></c:forEach>
</c:if>
<!--SPELLINGS-->
<c:set value="${query.entry.spellings}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.spellings}">Spellings</a></li>' escapeXml='false' />
<c:forEach var="spelling" items="${ query.entry.spellings }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.spellings}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.spellings}">Spellings</a></li>' escapeXml='false' />
<c:forEach var="spelling" items="${ sessionScope.visit.query.entry.spellings }"></c:forEach>
</c:if>
<!--FUNCTIONS-->
<c:set value="${query.entry.functions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.functions}">Functions</a></li>' escapeXml='false' />
<c:forEach var="function" items="${ query.entry.functions }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.functions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.functions}">Functions</a></li>' escapeXml='false' />
<c:forEach var="function" items="${ sessionScope.visit.query.entry.functions }"></c:forEach>
</c:if>
<!--ENCYCLOPEDIA ARTICLES-->
<c:set value="${query.entry.encyclopediaArticles}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${query.entry.encyclopediaArticles}">Encyclopedia Articles</a></li>' escapeXml='false' />
<c:forEach var="encyclopediaArticle" items="${ query.entry.encyclopediaArticles }"></c:forEach>
<c:set value="${sessionScope.visit.query.entry.encyclopediaArticles}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${sessionScope.visit.query.entry.encyclopediaArticles}">Encyclopedia Articles</a></li>' escapeXml='false' />
<c:forEach var="encyclopediaArticle" items="${ sessionScope.visit.query.entry.encyclopediaArticles }"></c:forEach>
</c:if>
<!--DEFINITION LOOP-->
<c:set value="${query.entry.definitions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:forEach var="definition" items="${query.entry.definitions}">
<c:set value="${sessionScope.visit.query.entry.definitions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:forEach var="definition" items="${sessionScope.visit.query.entry.definitions}">
<li>
<c:out value='<a href="#${definition}">Definition ${ definition.precedence + 1}</a>' escapeXml='false' />
<ol>
<!--SUBDEFINITION-->
<c:set value="${definition.subdefinitions}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${definition.subdefinitions}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:forEach var="subdefinition" items="${ definition.subdefinitions }">
<li>
<c:out value='<a href="#${subdefinition}">Subdefinition ${ subdefinition.precedence + 1 }</a>' escapeXml='false' />
@ -71,43 +71,43 @@
<ol>
<!--KEYWORD-->
<c:set value="${subdefinition.keywords}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.keywords}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.keywords}">Keywords</a></li>' escapeXml='false' />
<c:forEach var="keyword" items="${ subdefinition.keywords }"></c:forEach>
</c:if>
<!--MODEL SENTENCE-->
<c:set value="${subdefinition.modelSentences}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.modelSentences}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.modelSentences}">Model Sentences</a></li>' escapeXml='false' />
<c:forEach var="modelSentence" items="${ subdefinition.modelSentences }"></c:forEach>
</c:if>
<!--TRANSLATION EQUIVALENT-->
<c:set value="${subdefinition.translationEquivalents}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.translationEquivalents}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.translationEquivalents}">Translation Equivalents</a></li>' escapeXml='false' />
<c:forEach var="translationEquivalent" items="${ subdefinition.translationEquivalents }"></c:forEach>
</c:if>
<!--RELATED TERM-->
<c:set value="${subdefinition.relatedTerms}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.relatedTerms}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.relatedTerms}">RelatedTerm</a></li>' escapeXml='false' />
<c:forEach var="relatedTerm" items="${ subdefinition.relatedTerms }"></c:forEach>
</c:if>
<!--PASSAGE-->
<c:set value="${subdefinition.passages}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.passages}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.passages}">Passages</a></li>' escapeXml='false' />
<c:forEach var="passage" items="${ subdefinition.passages }"></c:forEach>
</c:if>
<!--REGISTER-->
<c:set value="${subdefinition.registers}" target="${sessionScope.helper}" property="collection"/>
<c:if test="${ sessionScope.helper.collectionSize > 0 }">
<c:set value="${subdefinition.registers}" target="${sessionScope.visit.helper}" property="collection"/>
<c:if test="${ sessionScope.visit.helper.collectionSize > 0 }">
<c:out value='<li><a href="#${subdefinition.registers}">Registers</a></li>' escapeXml='false' />
<c:forEach var="register" items="${ subdefinition.registers }"></c:forEach>
</c:if>

View file

@ -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" %>
<%-- <c:if test="${ ! empty sessionScope.user }">
<c:if test="${ sessionScope.user.developer }">
<%-- <c:if test="${ ! empty sessionScope.visit.user }">
<c:if test="${ sessionScope.visit.user.developer }">
<jsp:include page="debug.jsf" flush="false" />
</c:if>
</c:if>

View file

@ -12,7 +12,7 @@
<title>THDL Tibetan Collaborative Dictionaries</title>
<style type="text/css">
<c:if test="${ ! sessionScope.helper.showEditOptions }">
<c:if test="${ ! sessionScope.visit.helper.showEditOptions }">
p.data
{
border: none;

View file

@ -4,7 +4,7 @@
<jsp:include page="header.jsf" flush="false" />
<!--menu.jsp-->
<c:set var="editMode" value="${ false }" />
<c:if test="${ ! sessionScope.user.guest }">
<c:if test="${ ! sessionScope.visit.user.guest }">
<c:set var="editMode" value="${ true }" />
</c:if>
@ -12,7 +12,7 @@
<div class="highlightBox">
<form action="/lex/action" method="get" >
<h2>Find a term</h2>
<h2>Dictionary Quick Search</h2>
<p>
<input type="hidden" name="cmd" value="find" />
<input type="hidden" name="comp" value="term" />
@ -72,26 +72,29 @@
</div><!--END COLUMN LEFT-->
<div id="columnCenter">
<jsp:include page="navLinks.jsf" flush="false"/>
<h1>THDL Tibetan Collaborative Dictionaries: Main Menu</h1>
<p>
<c:set target="${ sessionScope.visit.helper }" property="date" value="${ applicationScope.global.lastUpdate }"/>
<span class="label">Last Update</span>: <c:out value="${ sessionScope.visit.helper.formattedDate }"/>
</p>
<c:if test="${ ! empty message }">
<p id="message">
Message: <c:out value="${ message }" />
<c:out value="${ message }" />
</p>
</c:if>
<h2>Recently Updated Terms</h2>
<c:forEach var="term" items="${applicationScope.global.recentUpdates }">
<h3><c:out value="${ term.term }"/></h3>
<h2>Recently Modified Terms</h2>
<div id="recentTerms">
<c:forEach var="term" items="${applicationScope.global.recentTerms }">
<p>
<span class="label">Created by </span><c:out value="${ applicationScope.flatData.users[ term.meta.createdBy ] }" escapeXml="false"/>
<span class="label">on </span><c:out value="${ term.meta.createdOn }" default="unknown" escapeXml="false"/>
<br/>
<span class="label">Modified by </span><c:out value="${ applicationScope.flatData.users[ term.meta.modifiedBy ] }" default="unknown" escapeXml="false"/>
<span class="label">on </span><c:out value="${ term.meta.modifiedOn }" default="unknown" escapeXml="false"/>
<c:out value='<a href="/lex/action?cmd=displayFull&comp=term&metaId=${term.metaId}">${ term.term}</a>' escapeXml='false' /><br/>
Modified by <c:out value="${ applicationScope.flatData.users[ term.meta.modifiedBy ] }" /><br/>
<c:set target="${ sessionScope.visit.helper }" property="date" value="${ term.meta.modifiedOn }"/>
<c:out value="${ sessionScope.visit.helper.formattedDate }" />
</p>
</c:forEach>
</div><!--END RECENT TERMS-->
</div><!--END COLUMN CENTER-->
<jsp:include page="footer.jsf" flush="false" />

View file

@ -17,18 +17,18 @@ Message:
<div id="columnSingle">
<form id="preferencesForm" action="/lex/action" method="post">
<c:set var="language" value="${ sessionScope.preferences.language }" />
<c:set var="dialect" value="${ sessionScope.preferences.dialect }" />
<c:set var="source" value="${ sessionScope.preferences.source }" />
<c:set var="projectSubject" value="${ sessionScope.preferences.projectSubject }" />
<c:set var="script" value="${ sessionScope.preferences.script }" />
<c:set var="note" value="${ sessionScope.preferences.note }" />
<c:set var="language" value="${ sessionScope.visit.preferences.language }" />
<c:set var="dialect" value="${ sessionScope.visit.preferences.dialect }" />
<c:set var="source" value="${ sessionScope.visit.preferences.source }" />
<c:set var="projectSubject" value="${ sessionScope.visit.preferences.projectSubject }" />
<c:set var="script" value="${ sessionScope.visit.preferences.script }" />
<c:set var="note" value="${ sessionScope.visit.preferences.note }" />
<%-- <c:out value="${ sessionScope.preferences.language }" /> <br />
<c:out value="${ sessionScope.preferences.dialect }" /> <br />
<c:out value="${ sessionScope.preferences.source }" /> <br />
<c:out value="${ sessionScope.preferences.projectSubject }" /> <br />
<c:out value="${ sessionScope.preferences.script }" /> --%>
<%-- <c:out value="${ sessionScope.visit.preferences.language }" /> <br />
<c:out value="${ sessionScope.visit.preferences.dialect }" /> <br />
<c:out value="${ sessionScope.visit.preferences.source }" /> <br />
<c:out value="${ sessionScope.visit.preferences.projectSubject }" /> <br />
<c:out value="${ sessionScope.visit.preferences.script }" /> --%>
<p>
In the metadata categories below, indicate the option you would like to appear by default.
@ -39,7 +39,7 @@ When this box is checked, the dropdown for that field will not appear
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultLanguage }">
<c:if test="${ sessionScope.visit.preferences.useDefaultLanguage }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultLanguage" value="true" ${checked}/>' escapeXml="false" />
@ -50,7 +50,7 @@ Use Default Language: <br />
<c:set var="sel" value='selected="selected"' />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:set var="sel" value="" />
<c:if test="${ language == prefLangs }">
<c:set var="sel" value='selected="selected"' />
@ -60,7 +60,7 @@ Use Default Language: <br />
<option disabled="disabled" value="">----------------</option>
<c:forEach var="langs" items="${ applicationScope.flatData.languages }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:if test="${ prefLangs == langs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -78,7 +78,7 @@ Use Default Language: <br />
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultScript }">
<c:if test="${ sessionScope.visit.preferences.useDefaultScript }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultScript" value="true" ${checked}/>' escapeXml="false" />
@ -89,7 +89,7 @@ Use Default Script: <br />
<c:set var="sel" value='selected="selected"' />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:set var="sel" value="" />
<c:if test="${ script == prefScripts }">
<c:set var="sel" value='selected="selected"' />
@ -99,7 +99,7 @@ Use Default Script: <br />
<option disabled="disabled" value="">----------------</option>
<c:forEach var="scripts" items="${ applicationScope.flatData.scripts }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:if test="${ prefScripts == scripts.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -118,7 +118,7 @@ Use Default Script: <br />
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultDialect }">
<c:if test="${ sessionScope.visit.preferences.useDefaultDialect }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultDialect" value="true" ${checked}/>' escapeXml="false" />
@ -129,7 +129,7 @@ Use Default Dialect: <br />
<c:set var="sel" value='selected="selected"' />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:set var="sel" value="" />
<c:if test="${ dialect == prefDials }">
<c:set var="sel" value='selected="selected"' />
@ -139,7 +139,7 @@ Use Default Dialect: <br />
<option disabled="disabled" value="">----------------</option>
<c:forEach var="dials" items="${ applicationScope.flatData.majorDialectFamilies }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:if test="${ prefDials == dials.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -157,7 +157,7 @@ Use Default Dialect: <br />
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultSource }">
<c:if test="${ sessionScope.visit.preferences.useDefaultSource }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultSource" value="true" ${checked}/>' escapeXml="false" />
@ -168,7 +168,7 @@ Use Default Source: <br />
<c:set var="sel" value='selected="selected"' />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:set var="sel" value="" />
<c:if test="${ source == prefSources }">
<c:set var="sel" value='selected="selected"' />
@ -178,7 +178,7 @@ Use Default Source: <br />
<option disabled="disabled" value="">----------------</option>
<c:forEach var="srcs" items="${ applicationScope.flatData.sources }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:if test="${ prefSources == srcs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -196,7 +196,7 @@ Use Default Source: <br />
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultProjSub }">
<c:if test="${ sessionScope.visit.preferences.useDefaultProjSub }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultProjSub" value="true" ${checked}/>' escapeXml="false" />
@ -207,7 +207,7 @@ Use Default Project/Subject: <br />
<c:set var="sel" value='selected="selected"' />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:set var="sel" value="" />
<c:if test="${ projectSubject == prefProjSub }">
<c:set var="sel" value='selected="selected"' />
@ -217,7 +217,7 @@ Use Default Project/Subject: <br />
<option disabled="disabled" value="">----------------</option>
<c:forEach var="projSubs" items="${ applicationScope.flatData.projectSubjects }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:if test="${ prefProjSub == projSubs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -237,7 +237,7 @@ Use Default Project/Subject: <br />
<p>
<c:set var="checked" value="" />
<c:if test="${ sessionScope.preferences.useDefaultNote }">
<c:if test="${ sessionScope.visit.preferences.useDefaultNote }">
<c:set var="checked" value="checked='checked'" />
</c:if>
<c:out value='<input type="checkbox" name="useDefaultNote" value="true" ${checked}/>' escapeXml="false" />

View file

@ -7,13 +7,13 @@
<c:choose>
<c:when test="${ ! empty param.formMode && param.formMode == 'insert'}">
<c:set var="updateMode" value="${ false }" />
<c:set var="language" value="${ sessionScope.preferences.language }" />
<c:set var="dialect" value="${ sessionScope.preferences.dialect }" />
<c:set var="source" value="${ sessionScope.preferences.source }" />
<c:set var="projectSubject" value="${ sessionScope.preferences.projectSubject }" />
<c:set var="script" value="${ sessionScope.preferences.script }" />
<c:set var="language" value="${ sessionScope.visit.preferences.language }" />
<c:set var="dialect" value="${ sessionScope.visit.preferences.dialect }" />
<c:set var="source" value="${ sessionScope.visit.preferences.source }" />
<c:set var="projectSubject" value="${ sessionScope.visit.preferences.projectSubject }" />
<c:set var="script" value="${ sessionScope.visit.preferences.script }" />
<%-- <c:set var="precedence" value="1" /> --%>
<c:set var="note" value="${ sessionScope.preferences.note }" />
<c:set var="note" value="${ sessionScope.visit.preferences.note }" />
</c:when>
<c:when test="${ ! empty param.formMode && param.formMode == 'update'}">
<c:set var="updateMode" value="${ true }" />
@ -52,10 +52,10 @@ Analysis: <br />
</c:if>
<!--Add Token-->
<c:out value='<input type="hidden" name="token" value="${ sessionScope.token }" />' escapeXml="false" />
<c:out value='<input type="hidden" name="token" value="${ sessionScope.visit.token }" />' escapeXml="false" />
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultLanguage || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultLanguage || updateMode }">
<p>
Language:
<select name="language">
@ -64,7 +64,7 @@ Language:
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:set var="sel" value="" />
<c:if test="${ language == prefLangs }">
<c:set var="sel" value="selected='selected'" />
@ -74,7 +74,7 @@ Language:
<%-- <option disabled="disabled" value="">----------------</option> --%>
<c:forEach var="langs" items="${ applicationScope.flatData.languages }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:if test="${ prefLangs == langs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -91,12 +91,12 @@ Language:
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="language" value="${ sessionScope.preferences.language }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="language" value="${ sessionScope.visit.preferences.language }" />' escapeXml='false' />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultScript || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultScript || updateMode }">
<p>
Script:
<select name="script">
@ -105,7 +105,7 @@ Script:
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:set var="sel" value="" />
<c:if test="${ script == prefScripts }">
<c:set var="sel" value="selected='selected'" />
@ -115,7 +115,7 @@ Script:
<option disabled="disabled" value="">----------------</option>
<c:forEach var="scripts" items="${ applicationScope.flatData.scripts }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:if test="${ prefScripts == scripts.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -133,12 +133,12 @@ Script:
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="script" value="${ sessionScope.preferences.script }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="script" value="${ sessionScope.visit.preferences.script }" />' escapeXml='false' />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultDialect || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultDialect || updateMode }">
<%-- <c:if test="${ ! translateMode }"> --%>
<p>
Dialect:
@ -148,7 +148,7 @@ Dialect:
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:set var="sel" value="" />
<c:if test="${ dialect == prefDials }">
<c:set var="sel" value="selected='selected'" />
@ -158,7 +158,7 @@ Dialect:
<option disabled="disabled" value="">----------------</option>
<c:forEach var="dials" items="${ applicationScope.flatData.majorDialectFamilies }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:if test="${ prefDials == dials.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -175,12 +175,12 @@ Dialect:
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="dialect" value="${ sessionScope.preferences.dialect }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="dialect" value="${ sessionScope.visit.preferences.dialect }" />' escapeXml='false' />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultSource || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultSource || updateMode }">
<p>
Source:
<select name="source">
@ -189,7 +189,7 @@ Source:
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:set var="sel" value="" />
<c:if test="${ source == prefSources }">
<c:set var="sel" value="selected='selected'" />
@ -199,7 +199,7 @@ Source:
<option disabled="disabled" value="">----------------</option>
<c:forEach var="srcs" items="${ applicationScope.flatData.sources }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:if test="${ prefSources == srcs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -216,12 +216,12 @@ Source:
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="source" value="${ sessionScope.preferences.source }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="source" value="${ sessionScope.visit.preferences.source }" />' escapeXml='false' />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultProjSub || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultProjSub || updateMode }">
<p>
Project/Subject:
<select name="projectSubject" style="width: 80%;">
@ -230,7 +230,7 @@ Project/Subject:
<c:set var="sel" value="selected='selected'" />
</c:if>
<c:out value="<option value='0' ${sel}>none</option>" escapeXml="false" />
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:set var="sel" value="" />
<c:if test="${ projectSubject == prefProjSub }">
<c:set var="sel" value="selected='selected'" />
@ -240,7 +240,7 @@ Project/Subject:
<option disabled="disabled" value="">----------------</option>
<c:forEach var="projSubs" items="${ applicationScope.flatData.projectSubjects }">
<c:set var="printOption" value="${ true }" />
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:if test="${ prefProjSub == projSubs.key }">
<c:set var="printOption" value="${ false }" />
</c:if>
@ -257,12 +257,12 @@ Project/Subject:
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="projectSubject" value="${ sessionScope.preferences.projectSubject }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="projectSubject" value="${ sessionScope.visit.preferences.projectSubject }" />' escapeXml='false' />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${ ! sessionScope.preferences.useDefaultNote || updateMode }">
<c:when test="${ ! sessionScope.visit.preferences.useDefaultNote || updateMode }">
<p>
<c:out value="${ originalNote }" escapeXml="false"/>
@ -271,7 +271,7 @@ Metadata Note: <br />
</p>
</c:when>
<c:otherwise>
<c:out value='<input type="hidden" name="note" value="${ sessionScope.preferences.note }" />' escapeXml='false' />
<c:out value='<input type="hidden" name="note" value="${ sessionScope.visit.preferences.note }" />' escapeXml='false' />
</c:otherwise>
</c:choose>

View file

@ -27,14 +27,14 @@ in the metadata section of every form in this application.
Languages: <br />
<select name="languages" multiple="multiple" size="10">
<optgroup label="Preferred Languages">
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:out value='<option value="${ prefLangs }" selected="selected">${ applicationScope.flatData.languages[ prefLangs ] }</option>' escapeXml="false" />
</c:forEach>
</optgroup>
<optgroup label="All Languages">
<c:forEach var="langs" items="${ applicationScope.flatData.languages }">
<c:set var="disabled" value="" />
<c:forEach var="prefLangs" items="${ sessionScope.preferences.languageSet }">
<c:forEach var="prefLangs" items="${ sessionScope.visit.preferences.languageSet }">
<c:if test="${ prefLangs == langs.key }">
<c:set var="disabled" value='disabled="disabled"' />
</c:if>
@ -48,14 +48,14 @@ Languages: <br />
Dialects: <br />
<select name="dialects" multiple="multiple" size="10">
<optgroup label="Preferred Dialects">
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:out value='<option value="${ prefDials }" selected="selected">${ applicationScope.flatData.majorDialectFamilies[ prefDials ] }</option>' escapeXml="false" />
</c:forEach>
</optgroup>
<optgroup label="All Dialects">
<c:forEach var="dials" items="${ applicationScope.flatData.majorDialectFamilies }">
<c:set var="disabled" value="" />
<c:forEach var="prefDials" items="${ sessionScope.preferences.dialectSet }">
<c:forEach var="prefDials" items="${ sessionScope.visit.preferences.dialectSet }">
<c:if test="${ prefDials == dials.key }">
<c:set var="disabled" value='disabled="disabled"' />
</c:if>
@ -69,14 +69,14 @@ Dialects: <br />
Sources: <br />
<select name="sources" multiple="multiple" size="10">
<optgroup label="Preferred Sources">
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:out value='<option value="${ prefSources }" selected="selected">${ applicationScope.flatData.sources[ prefSources ] }</option>' escapeXml="false" />
</c:forEach>
</optgroup>
<optgroup label="All Sources">
<c:forEach var="srcs" items="${ applicationScope.flatData.sources }">
<c:set var="disabled" value="" />
<c:forEach var="prefSources" items="${ sessionScope.preferences.sourceSet }">
<c:forEach var="prefSources" items="${ sessionScope.visit.preferences.sourceSet }">
<c:if test="${ prefSources == srcs.key }">
<c:set var="disabled" value='disabled="disabled"' />
</c:if>
@ -91,14 +91,14 @@ Sources: <br />
Project/Subject: <br />
<select name="projectSubjects" multiple="multiple" size="10">
<optgroup label="Preferred Project/Subjects">
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:out value='<option value="${ prefProjSub }" selected="selected">${ applicationScope.flatData.projectSubjects[ prefProjSub ] }</option>' escapeXml="false" />
</c:forEach>
</optgroup>
<optgroup label="All Project/Subjects">
<c:forEach var="projSubs" items="${ applicationScope.flatData.projectSubjects }">
<c:set var="disabled" value="" />
<c:forEach var="prefProjSub" items="${ sessionScope.preferences.projectSubjectSet }">
<c:forEach var="prefProjSub" items="${ sessionScope.visit.preferences.projectSubjectSet }">
<c:if test="${ prefProjSub == projSubs.key }">
<c:set var="disabled" value='disabled="disabled"' />
</c:if>
@ -112,14 +112,14 @@ Project/Subject: <br />
Scripts: <br />
<select name="scripts" multiple="multiple" size="10">
<optgroup label="Preferred Scripts">
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:out value='<option value="${ prefScripts }" selected="selected">${ applicationScope.flatData.scripts[ prefScripts ] }</option>' escapeXml="false" />
</c:forEach>
</optgroup>
<optgroup label="All Scripts">
<c:forEach var="scripts" items="${ applicationScope.flatData.scripts }">
<c:set var="disabled" value="" />
<c:forEach var="prefScripts" items="${ sessionScope.preferences.scriptSet }">
<c:forEach var="prefScripts" items="${ sessionScope.visit.preferences.scriptSet }">
<c:if test="${ prefScripts == scripts.key }">
<c:set var="disabled" value='disabled="disabled"' />
</c:if>

View file

@ -1,5 +1,25 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<ul class="navLinks">
<li>
<a href="http://iris.lib.virginia.edu/tibet/reference/dictionary.html">Dictionary Home</a> |
<a href="/lex/action?cmd=menu">Search</a> |
<a href="/lex/login.jsp">Login</a> |
<a href="/lex/logout.jsp">Logout</a>
</li>
<li>
<a href="/lex/action?cmd=menu" label="Main Menu">Main Menu</a> |
</li>
<li>
<a href="/lex/action?cmd=search" label="Advanced Search">Advanced Search</a>
</li>
<c:choose>
<c:when test="${ sessionScope.visit.user.guest }">
<li>
| <a href="/lex/login.jsp">Login</a>
</li>
</c:when>
<c:otherwise>
<li>
| <a href="/lex/logout.jsp">Logout</a>
</li>
</c:otherwise>
</c:choose>
</ul>

53
src/jsp/jsp/search.jsp Normal file
View file

@ -0,0 +1,53 @@
<%@ page buffer="512kb" autoFlush="false" import="org.thdl.lex.*,org.thdl.lex.component.*" errorPage="/jsp/error.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<jsp:include page="header.jsf" flush="false" />
<!--menu.jsp-->
<c:set var="editMode" value="${ false }" />
<c:if test="${ ! sessionScope.visit.user.guest }">
<c:set var="editMode" value="${ true }" />
</c:if>
<div id="columnLeft">
<div class="highlightBox">
<form action="/lex/action" method="get" >
<h2>Find a term</h2>
<p>
<input type="hidden" name="cmd" value="find" />
<input type="hidden" name="comp" value="term" />
Term: <input type="text" name="term" id="term" size="20" value="" /> <br />
Find:
<select name="findMode">
<option value="exact">Exact match</option>
<option value="startsWith">At beginning of term</option>
<option value="anywhere">Anywhere in term</option>
</select>
</p>
<p>
<input type="submit" value="Find Term"/>
</p>
</form>
</div>
</div><!--END COLUMN LEFT-->
<div id="columnCenter">
<jsp:include page="navLinks.jsf" flush="false"/>
<h1>THDL Tibetan Collaborative Dictionaries: Advanced Search</h1>
<p>
<span class="label">Last Update</span>: <c:out value="${ applicationScope.global.lastUpdate }"/>
</p>
<p>
This page is under Construction
</p>
<c:if test="${ ! empty message }">
<p id="message">
<c:out value="${ message }" />
</p>
</c:if>
</div><!--END COLUMN CENTER-->
<jsp:include page="footer.jsf" flush="false" />