update to older Venice sources to modernize things - revamped the build system

using techniques from newer Dynamo version, allow source to compile and work
using newer versions of J2SDK, Tomcat, BSF, other libraries; bugfixes to get
everything running in a newer environment
This commit is contained in:
Eric J. Bowersox
2004-03-08 05:13:29 +00:00
parent 281df572b8
commit 372f548f7f
38 changed files with 1003 additions and 584 deletions

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -148,6 +148,33 @@ public final class ServletMultipartHandler
} // end position
public int setBytes(long pos, byte[] bytes) throws SQLException
{
return setBytes(pos,bytes,0,bytes.length);
} // end setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
{
logger.warn("setBytes() function is not implemented for MultipartDataValue");
throw new SQLException("function not implemented");
} // end setBytes
public OutputStream setBinaryStream(long pos) throws SQLException
{
logger.warn("setBinaryStream() function is not implemented for MultipartDataValue");
throw new SQLException("function not implemented");
} // end setBinaryStream
public void truncate(long len) throws SQLException
{
logger.warn("truncate() function is not implemented for MultipartDataValue");
throw new SQLException("function not implemented");
} // end truncate
} // end class MultipartDataValue
/*--------------------------------------------------------------------------------

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -35,7 +35,7 @@ public class ObjectCache
*--------------------------------------------------------------------------------
*/
private SoftRefHashMap the_data = new SoftRefHashMap(); // actual main data store
private ReferenceMap the_data = new ReferenceMap(ReferenceMap.HARD,ReferenceMap.SOFT); // actual main data store
private LRUMap mru_cache; // most-recently-used map
private ObjectFactory factory; // used to create new objects
@@ -85,7 +85,6 @@ public class ObjectCache
*/
public synchronized Object get(Object key)
{
the_data.purge();
Object rc = mru_cache.get(key);
if (rc==null)
{ // retrieve from main map, poke back into cache
@@ -137,7 +136,6 @@ public class ObjectCache
*/
public synchronized void register(Object key, Object data)
{
the_data.purge();
if (the_data.get(key)!=null)
throw new ObjectCacheException("object already in cache",key);
the_data.put(key,data);
@@ -154,7 +152,6 @@ public class ObjectCache
{
mru_cache.remove(key);
the_data.remove(key);
the_data.purge();
} // end detach
@@ -162,7 +159,6 @@ public class ObjectCache
{
mru_cache.clear();
the_data.clear();
the_data.purge();
} // end shutdown

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -386,7 +386,7 @@ class WrappedConnection implements Connection
* this connection. The type map will be used for the
* custom mapping of SQL structured types and distinct types.
*
* @param the <code>java.util.Map</code> object to install
* @param map the <code>java.util.Map</code> object to install
* as the replacement for this <code>Connection</code>
* object's default type map
* @since 1.2
@@ -398,8 +398,280 @@ class WrappedConnection implements Connection
} // end setTypeMap
/**
* Changes the holdability of <code>ResultSet</code> objects created using this <code>Connection</code>
* object to the given holdability.
*
* @param holdability a <code>ResultSet</code> holdability constant; one of
* <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
* @exception java.sql.SQLException if a database access occurs, the given parameter is not a <code>ResultSet</code>
* constant indicating holdability, or the given holdability is not supported
* @since 1.4
* @see #getHoldability()
* @see java.sql.ResultSet
*/
public void setHoldability(int holdability) throws SQLException
{
conn.setHoldability(holdability);
} // end setHoldability
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created using this <code>Connection</code>
* object.
*
* @return the holdability, one of <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
* @exception java.sql.SQLException if a database access occurs
* @since 1.4
* @see #setHoldability(int)
* @see java.sql.ResultSet
*/
public int getHoldability() throws SQLException
{
return conn.getHoldability();
} // end getHoldability
/**
* Creates an unnamed savepoint in the current transaction and returns the new <code>Savepoint</code> object that
* represents it.
*
* @return the new <code>Savepoint</code> object
* @exception java.sql.SQLException if a database access error occurs or this <code>Connection</code> object is
* currently in auto-commit mode
* @since 1.4
* @see java.sql.Savepoint
*/
public Savepoint setSavepoint() throws SQLException
{
return conn.setSavepoint();
} // end setSavepoint
/**
* Creates a savepoint with the given name in the current transaction and returns the new <code>Savepoint</code>
* object that represents it.
*
* @param name a <code>String</code> containing the name of the savepoint
* @return the new <code>Savepoint</code> object
* @exception java.sql.SQLException if a database access error occurs or this <code>Connection</code> object is
* currently in auto-commit mode
* @since 1.4
* @see java.sql.Savepoint
*/
public Savepoint setSavepoint(String name) throws SQLException
{
return conn.setSavepoint(name);
} // end setSavepoint
/**
* Undoes all changes made after the given <code>Savepoint</code> object was set.<p>
* This method should be used only when auto-commit has been disabled.
*
* @param savepoint the <code>Savepoint</code> object to roll back to
* @exception java.sql.SQLException if a database access error occurs, the Z<code>Savepoint</code> object is
* no longer valid, or this <code>Connection</code> object is currently in auto-commit mode
* @since 1.4
* @see java.sql.Savepoint
* @see #rollback()
*/
public void rollback(Savepoint savepoint) throws SQLException
{
conn.rollback(savepoint);
} // end rollback
/**
* Removes the given <code>Savepoint</code> object from the current transaction. Any reference to the savepoint
* after it have been removed will cause an <code>SQLException</code> to be thrown.
*
* @param savepoint the <code>Savepoint</code> object to be removed
* @exception java.sql.SQLException if a database access error occurs or the given <code>Savepoint</code> object
* is not a valid savepoint in the current transaction
* @since 1.4
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException
{
conn.releaseSavepoint(savepoint);
} // end releaseSavepoint
/**
* Creates a <code>Statement</code> object that will generate <code>ResultSet</code> objects with the given type,
* concurrency, and holdability. This method is the same as the <code>createStatement</code> method above, but it
* allows the default result set type, concurrency, and holdability to be overridden.
*
* @param resultSetType one of the following <code>ResultSet</code> constants:
* <code>ResultSet.TYPE_FORWARD_ONLY</code>, <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
* or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
* @param resultSetConcurrency one of the following <code>ResultSet</code> constants:
* <code>ResultSet.CONCUR_READ_ONLY</code> or <code>ResultSet.CONCUR_UPDATABLE</code>
* @param resultSetHoldability one of the following <code>ResultSet</code> constants:
* <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
* @return a new <code>Statement</code> object that will generate <code>ResultSet</code> objects with the given
* type, concurrency, and holdability
* @exception java.sql.SQLException if a database access error occurs or the given parameters are not
* <code>ResultSet</code> constants indicating type, concurrency, and holdability
* @since 1.4
* @see java.sql.ResultSet
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
throws SQLException
{
return conn.createStatement(resultSetType,resultSetConcurrency,resultSetHoldability);
} // end createStatement
/**
* Creates a <code>PreparedStatement</code> object that will generate <code>ResultSet</code> objects with the
* given type, concurrency, and holdability.<p>
* This method is the same as the <code>prepareStatement</code> method above, but it allows the default result
* set type, concurrency, and holdability to be overridden.
*
* @param sql a <code>String</code> object that is the SQL statement to be sent to the database; may contain one
* or more ? IN parameters
* @param resultSetType one of the following <code>ResultSet</code> constants:
* <code>ResultSet.TYPE_FORWARD_ONLY</code>, <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
* or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
* @param resultSetConcurrency one of the following <code>ResultSet</code> constants:
* <code>ResultSet.CONCUR_READ_ONLY</code> or <code>ResultSet.CONCUR_UPDATABLE</code>
* @param resultSetHoldability one of the following <code>ResultSet</code> constants:
* <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
* @return a new <code>PreparedStatement</code> object, containing the pre-compiled SQL statement, that will
* generate <code>ResultSet</code> objects with the given type, concurrency, and holdability
* @exception java.sql.SQLException if a database access error occurs or the given parameters are not
* <code>ResultSet</code> constants indicating type, concurrency, and holdability
* @since 1.4
* @see java.sql.ResultSet
*/
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException
{
return conn.prepareStatement(sql,resultSetType,resultSetConcurrency,resultSetHoldability);
} // end prepareStatement
/**
* Creates a <code>CallableStatement</code> object that will generate <code>ResultSet</code> objects with the
* given type and concurrency. This method is the same as the <code>prepareCall</code> method above, but it
* allows the default result set type, result set concurrency type and holdability to be overridden.
*
* @param sql a <code>String</code> object that is the SQL statement to be sent to the database; may contain one
* or more ? parameters
* @param resultSetType one of the following <code>ResultSet</code> constants:
* <code>ResultSet.TYPE_FORWARD_ONLY</code>, <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
* or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
* @param resultSetConcurrency one of the following <code>ResultSet</code> constants:
* <code>ResultSet.CONCUR_READ_ONLY</code> or <code>ResultSet.CONCUR_UPDATABLE</code>
* @param resultSetHoldability one of the following <code>ResultSet</code> constants:
* <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
* @return a new <code>CallableStatement</code> object, containing the pre-compiled SQL statement, that will
* generate <code>ResultSet</code> objects with the given type, concurrency, and holdability
* @exception java.sql.SQLException if a database access error occurs or the given parameters are not
* <code>ResultSet</code> constants indicating type, concurrency, and holdability
* @since 1.4
* @see java.sql.ResultSet
*/
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException
{
return conn.prepareCall(sql,resultSetType,resultSetConcurrency,resultSetHoldability);
} // end prepareCall
/**
* Creates a default <code>PreparedStatement</code> object that has the capability to retrieve auto-generated
* keys. The given constant tells the driver whether it should make auto-generated keys available for retrieval.
* This parameter is ignored if the SQL statement is not an <code>INSERT</code> statement.<p>
* <b>Note:</b> This method is optimized for handling parametric SQL statements that benefit from precompilation.
* If the driver supports precompilation, the method <code>prepareStatement</code> will send the statement to the
* database for precompilation. Some drivers may not support precompilation. In this case, the statement may not
* be sent to the database until the <code>PreparedStatement</code> object is executed. This has no direct effect
* on users; however, it does affect which methods throw certain <code>SQLException</code>s.<p>
* Result sets created using the returned <code>PreparedStatement</code> object will by default be type
* <code>TYPE_FORWARD_ONLY</code> and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
*
* @param sql an SQL statement that may contain one or more '?' IN parameter placeholders
* @param autoGeneratedKeys a flag indicating whether auto-generated keys should be returned; one of
* <code>Statement.RETURN_GENERATED_KEYS</code> or <code>Statement.NO_GENERATED_KEYS</code>
* @return a new <code>PreparedStatement</code> object, containing the pre-compiled SQL statement, that will
* generate <code>ResultSet</code> objects with the given type, concurrency, and holdability
* @exception java.sql.SQLException if a database access error occurs or the given parameter is not a
* <code>Statement</code> constant indicating whether auto-generated keys should be returned
* @since 1.4
*/
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
{
return conn.prepareStatement(sql,autoGeneratedKeys);
} // end prepareStatement
/**
* Creates a default <code>PreparedStatement</code> object capable of returning the auto-generated keys designated
* by the given array. This array contains the indexes of the columns in the target table that contain the
* auto-generated keys that should be made available. This array is ignored if the SQL statement is not an
* <code>INSERT</code> statement.<p>
* An SQL statement with or without IN parameters can be pre-compiled and stored in a <code>PreparedStatement</code>
* object. This object can then be used to efficiently execute this statement multiple times.<p>
* <b>Note:</b> This method is optimized for handling parametric SQL statements that benefit from precompilation.
* If the driver supports precompilation, the method <code>prepareStatement</code> will send the statement to the
* database for precompilation. Some drivers may not support precompilation. In this case, the statement may not
* be sent to the database until the <code>PreparedStatement</code> object is executed. This has no direct effect
* on users; however, it does affect which methods throw certain <code>SQLException</code>s.<p>
* Result sets created using the returned <code>PreparedStatement</code> object will by default be type
* <code>TYPE_FORWARD_ONLY</code> and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
*
* @param sql an SQL statement that may contain one or more '?' IN parameter placeholders
* @param columnIndexes an array of column indexes indicating the columns that should be returned from the
* inserted row or rows
* @return a new <code>PreparedStatement</code> object, containing the pre-compiled statement, that is capable
* of returning the auto-generated keys designated by the given array of column indexes
* @exception java.sql.SQLException if a database access error occurs
* @since 1.4
*/
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
{
return conn.prepareStatement(sql,columnIndexes);
} // end prepareStatement
/**
* Creates a default <code>PreparedStatement</code> object capable of returning the auto-generated keys designated
* by the given array. This array contains the names of the columns in the target table that contain the
* auto-generated keys that should be returned. This array is ignored if the SQL statement is not an
* <code>INSERT</code> statement.<p>
* An SQL statement with or without IN parameters can be pre-compiled and stored in a <code>PreparedStatement</code>
* object. This object can then be used to efficiently execute this statement multiple times.<p>
* <b>Note:</b> This method is optimized for handling parametric SQL statements that benefit from precompilation.
* If the driver supports precompilation, the method <code>prepareStatement</code> will send the statement to the
* database for precompilation. Some drivers may not support precompilation. In this case, the statement may not
* be sent to the database until the <code>PreparedStatement</code> object is executed. This has no direct effect
* on users; however, it does affect which methods throw certain <code>SQLException</code>s.<p>
* Result sets created using the returned <code>PreparedStatement</code> object will by default be type
* <code>TYPE_FORWARD_ONLY</code> and have a concurrency level of <code>CONCUR_READ_ONLY</code>.
*
* @param sql an SQL statement that may contain one or more '?' IN parameter placeholders
* @param columnNames an array of column names indicating the columns that should be returned from the inserted
* row or rows
* @return a new <code>PreparedStatement</code> object, containing the pre-compiled statement, that is capable
* of returning the auto-generated keys designated by the given array of column names
* @exception java.sql.SQLException if a database access error occurs
* @since 1.4
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
{
return conn.prepareStatement(sql,columnNames);
} // end prepareStatement
/*--------------------------------------------------------------------------------
* Attributes
* External operations
*--------------------------------------------------------------------------------
*/

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -21,11 +21,19 @@ import java.io.IOException;
import java.util.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import org.apache.log4j.*;
import com.silverwrist.venice.ui.*;
import com.silverwrist.venice.ui.helpers.HTMLRendering;
public class PostBoxTag extends VeniceConfBodyTagSupport
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static Category logger = Category.getInstance(PostBoxTag.class);
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
@@ -52,24 +60,30 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
public int doStartTag() throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.doStartTag(): entry");
if (action==null)
throw new JspTagException("<post:box/> action= attribute not specified!");
HTMLRendering html = (HTMLRendering)(getRequestInput().queryService(HTMLRendering.class));
real_type = html.convertLinkType(type);
if (real_type<0)
throw new JspTagException("<post:box/> type= attribute not a valid link type");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
public int doAfterBody()
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.doAfterBody(): entry");
return SKIP_BODY;
} // end doAfterBody
public int doEndTag() throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.doEndTag(): entry");
if (pseud_name==null)
throw new JspTagException("<post:box/> tag has no <post:pseud/> tag inside it!");
if (attach_name==null)
@@ -150,17 +164,10 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
} // end catch
return EVAL_PAGE;
} // end doEndTag
public void release()
{
super.release();
action = null;
type = "servlet";
real_type = -1;
// anything set by subtags must be cleared in doEndTag, not release
params.clear();
newtopic_name = null;
newtopic_value = null;
pseud_name = null;
pseud_value = null;
attach_name = null;
@@ -168,6 +175,18 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
text_name = null;
text_value = null;
buttons.clear();
return EVAL_PAGE;
} // end doEndTag
public void release()
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.release(): entry");
super.release();
action = null;
type = "servlet";
real_type = -1;
} // end release
@@ -195,6 +214,8 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
final void addParam(String name, String value)
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.addParam(\"" + name + "\",\"" + value + "\") entry");
params.put(name,value);
} // end addParam
@@ -212,6 +233,8 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
final void setPseud(String param_name, String value) throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.setPseud(\"" + param_name + "\",\"" + value + "\") entry");
if (pseud_name!=null)
throw new JspTagException("<post:pseud/> may only appear once inside a <post:box/>!");
if (param_name==null)
@@ -234,6 +257,8 @@ public class PostBoxTag extends VeniceConfBodyTagSupport
final void setText(String param_name, String value) throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostBoxTag.setText(\"" + param_name + "\",<value>) entry");
if (text_name!=null)
throw new JspTagException("<post:text/> may only appear once inside a <post:box/>!");
if (param_name==null)

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -40,7 +40,7 @@ public class PostNewTopicTag extends VeniceConfBodyTagSupport
{
if (name==null)
throw new JspTagException("<post:newtopic/> name= attribute not specified!");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -40,7 +40,7 @@ public class PostParamTag extends VeniceConfBodyTagSupport
{
if (name==null)
throw new JspTagException("<post:param/> name= attribute not specified!");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -30,6 +30,7 @@ public class PostPseudTag extends VeniceConfBodyTagSupport
*/
private String name = null;
private String bodytext = null;
/*--------------------------------------------------------------------------------
* Overrides from class BodyTagSupport
@@ -40,20 +41,28 @@ public class PostPseudTag extends VeniceConfBodyTagSupport
{
if (name==null)
throw new JspTagException("<post:pseud/> name= attribute not specified!");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
public int doAfterBody() throws JspException
{
PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
if (postbox==null)
throw new JspTagException("<post:pseud/> tag must be within a <post:box/> tag!");
postbox.setPseud(name,getBodyContent().getString());
bodytext = getBodyContent().getString();
return SKIP_BODY;
} // end doAfterBody
public int doEndTag() throws JspException
{
PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
if (postbox==null)
throw new JspTagException("<post:pseud/> tag must be within a <post:box/> tag!");
postbox.setPseud(name,bodytext);
bodytext = null;
return EVAL_PAGE;
} // end doEndTag
public void release()
{
super.release();

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -20,16 +20,25 @@ package com.silverwrist.venice.ui.conf.jsp;
import java.io.IOException;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import org.apache.log4j.*;
import com.silverwrist.venice.ui.*;
public class PostTextTag extends VeniceConfBodyTagSupport
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static Category logger = Category.getInstance(PostTextTag.class);
/*--------------------------------------------------------------------------------
* Attributes
*--------------------------------------------------------------------------------
*/
private String name = null;
private String bodytext = null;
/*--------------------------------------------------------------------------------
* Overrides from class BodyTagSupport
@@ -38,22 +47,36 @@ public class PostTextTag extends VeniceConfBodyTagSupport
public int doStartTag() throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostTextTag.doStartTag(): entry");
if (name==null)
throw new JspTagException("<post:text/> name= attribute not specified!");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
public int doAfterBody() throws JspException
{
PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
if (postbox==null)
throw new JspTagException("<post:text/> tag must be within a <post:box/> tag!");
postbox.setText(name,getBodyContent().getString());
if (logger.isDebugEnabled())
logger.debug("PostTextTag.doAfterBody(): entry");
bodytext = getBodyContent().getString();
return SKIP_BODY;
} // end doAfterBody
public int doEndTag() throws JspException
{
if (logger.isDebugEnabled())
logger.debug("PostTextTag.doEndTag(): entry");
PostBoxTag postbox = (PostBoxTag)findAncestorWithClass(this,PostBoxTag.class);
if (postbox==null)
throw new JspTagException("<post:text/> tag must be within a <post:box/> tag!");
postbox.setText(name,bodytext);
bodytext = null;
return EVAL_PAGE;
} // end doEndTag
public void release()
{
super.release();
@@ -68,6 +91,8 @@ public class PostTextTag extends VeniceConfBodyTagSupport
public void setName(String v)
{
if (logger.isDebugEnabled())
logger.debug("PostTextTag.setName(\"" + v + "\"): entry");
name = v;
} // end setName

View File

@@ -11,13 +11,14 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.ui.helpers;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import javax.servlet.*;
import com.silverwrist.util.StringUtil;
@@ -103,7 +104,16 @@ public class LogInOrCreate extends ThrowableContent implements ContentJSP
public final String getTargetParam()
{
return (rinput!=null) ? URLEncoder.encode(rinput.getLocation()) : null;
try
{ // encode and return the location
return (rinput!=null) ? URLEncoder.encode(rinput.getLocation(),"UTF-8") : null;
} // end try
catch (UnsupportedEncodingException e)
{ // shouldn't happen
return null;
} // end catch
} // end getTargetParam

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -67,12 +67,12 @@ public class UtilFormTag extends VeniceTagSupport
if (ityp==-1)
throw new JspTagException("<util:form/> invalid action type!");
// Do parameter replacement on the ACTION string if necessary.
if (action.indexOf(LOCATION_PARAM)>=0)
action = StringUtil.replaceAllInstances(action,LOCATION_PARAM,URLEncoder.encode(ri.getLocation()));
try
{ // write out what we came here to accomplish
{ // Do parameter replacement on the ACTION string if necessary.
if (action.indexOf(LOCATION_PARAM)>=0)
action = StringUtil.replaceAllInstances(action,LOCATION_PARAM,URLEncoder.encode(ri.getLocation(),"UTF-8"));
// write out what we came here to accomplish
JspWriter out = pageContext.getOut();
out.write("<FORM METHOD=\"" + verb + "\" ");
if (cls!=null)

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -44,7 +44,7 @@ public class UtilHeaderTag extends VeniceBodyTagSupport
public int doStartTag()
{
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end UtilHeaderTag
@@ -87,6 +87,8 @@ public class UtilHeaderTag extends VeniceBodyTagSupport
} // end catch
title = null;
subtitle = null;
return EVAL_PAGE;
} // end doEndTag
@@ -94,9 +96,7 @@ public class UtilHeaderTag extends VeniceBodyTagSupport
public void release()
{
super.release();
title = null;
stocktitle = null;
subtitle = null;
stocksubtitle = null;
} // end release

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -45,7 +45,7 @@ public class UtilHrefTag extends VeniceBodyTagSupport
real_type = html.convertLinkType(type);
if (real_type<0)
throw new JspTagException("<util:href/> type= attribute not a valid link type");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -78,7 +78,7 @@ public class UtilImageTag extends VeniceBodyTagSupport
if (src==null)
throw new JspTagException("<util:image/> src= attribute not specified");
return EVAL_BODY_TAG;;
return EVAL_BODY_BUFFERED;
} // end doStartTag
@@ -130,6 +130,7 @@ public class UtilImageTag extends VeniceBodyTagSupport
} // end catch
other_alt = null;
return EVAL_PAGE;
} // end doEndTag
@@ -143,7 +144,6 @@ public class UtilImageTag extends VeniceBodyTagSupport
width = null;
height = null;
border = "0";
other_alt = null;
align = null;
hspace = null;
vspace = null;

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -65,12 +65,12 @@ public class UtilLinkTag extends VeniceTagSupport
if (ityp==-1)
throw new JspTagException("<util:link/> invalid link type!");
// Do parameter replacement on the HREF string if necessary.
if (href.indexOf(LOCATION_PARAM)>=0)
href = StringUtil.replaceAllInstances(href,LOCATION_PARAM,URLEncoder.encode(ri.getLocation()));
try
{ // write out what we came here to accomplish
{ // Do parameter replacement on the HREF string if necessary.
if (href.indexOf(LOCATION_PARAM)>=0)
href = StringUtil.replaceAllInstances(href,LOCATION_PARAM,URLEncoder.encode(ri.getLocation(),"UTF-8"));
// write out what we came here to accomplish
JspWriter out = pageContext.getOut();
out.write("<A ");
if (cls!=null)

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -45,7 +45,7 @@ public class UtilMenuHeaderItemTag extends VeniceBodyTagSupport
{
if ((selected!=null) && selected.equals("true"))
is_selected = true;
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
@@ -71,6 +71,9 @@ public class UtilMenuHeaderItemTag extends VeniceBodyTagSupport
if (parent==null)
throw new JspTagException("<util:menuheaderitem/> must be inside a <util:menuheader/>");
parent.pushItem(href,real_type,text,is_selected);
href = null;
real_type = -1;
text = null;
return EVAL_PAGE;
} // end doEndTag
@@ -78,11 +81,8 @@ public class UtilMenuHeaderItemTag extends VeniceBodyTagSupport
public void release()
{
super.release();
href = null;
selected = null;
real_type = -1;
is_selected = false;
text = null;
} // end release

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -80,7 +80,7 @@ public class UtilMenuHeaderTag extends VeniceBodyTagSupport
{
if (caption==null)
throw new JspTagException("<util:menuheader/> caption= attribute not specified");
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
@@ -133,6 +133,8 @@ public class UtilMenuHeaderTag extends VeniceBodyTagSupport
} // end catch
items.clear();
selected_item = null;
return EVAL_PAGE;
} // end doEndTag
@@ -141,8 +143,6 @@ public class UtilMenuHeaderTag extends VeniceBodyTagSupport
{
super.release();
caption = null;
items.clear();
selected_item = null;
} // end release

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -36,7 +36,7 @@ public class UtilURLEncodeTag extends VeniceBodyTagSupport
try
{ // write the escaped information
JspWriter out = body.getEnclosingWriter();
out.write(URLEncoder.encode(body.getString()));
out.write(URLEncoder.encode(body.getString(),"UTF-8"));
} // end try
catch (IOException e)

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -53,7 +53,7 @@ public class UtilXLinkTag extends VeniceBodyTagSupport
public int doStartTag()
{
return EVAL_BODY_TAG;
return EVAL_BODY_BUFFERED;
} // end doStartTag
@@ -73,15 +73,16 @@ public class UtilXLinkTag extends VeniceBodyTagSupport
if (text==null)
throw new JspTagException("<util:xlink/> does not have a <util:text/>!");
// Do parameter replacement on the HREF string if necessary.
// Dig out the RequestInput and HTMLRendering service.
RequestInput ri = getRequestInput();
if (href.indexOf(LOCATION_PARAM)>=0)
href = StringUtil.replaceAllInstances(href,LOCATION_PARAM,URLEncoder.encode(ri.getLocation()));
HTMLRendering html = (HTMLRendering)(ri.queryService(HTMLRendering.class));
try
{ // write out what we came here to accomplish
{ // Do parameter replacement on the HREF string if necessary.
if (href.indexOf(LOCATION_PARAM)>=0)
href = StringUtil.replaceAllInstances(href,LOCATION_PARAM,URLEncoder.encode(ri.getLocation(),"UTF-8"));
// write out what we came here to accomplish
JspWriter out = pageContext.getOut();
out.write("<A ");
if (cls!=null)
@@ -100,6 +101,10 @@ public class UtilXLinkTag extends VeniceBodyTagSupport
} // end catch
href = null;
type = -1;
text = null;
title = null;
return EVAL_PAGE;
} // end doEndTag
@@ -107,12 +112,8 @@ public class UtilXLinkTag extends VeniceBodyTagSupport
public void release()
{
super.release();
href = null;
type = -1;
cls = null;
target = null;
text = null;
title = null;
} // end release

View File

@@ -11,12 +11,13 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
package com.silverwrist.venice.ui.script;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
import org.w3c.dom.*;
@@ -187,7 +188,16 @@ public class ScriptLibrary
public final String encodeURL(String s)
{
return URLEncoder.encode(s);
try
{ // encode and return the string
return URLEncoder.encode(s,"UTF-8");
} // end try
catch (UnsupportedEncodingException e)
{ // shouldn't happen
return s;
} // end catch
} // end encodeURL

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001-02 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -20,7 +20,7 @@ package com.silverwrist.venice.ui.script;
import java.lang.reflect.*;
import java.io.*;
import java.util.*;
import com.ibm.bsf.*;
import org.apache.bsf.*;
import org.apache.log4j.*;
import com.silverwrist.util.*;
import com.silverwrist.venice.ui.*;

View File

@@ -11,7 +11,7 @@
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
* Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
* Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
*
* Contributor(s):
*/
@@ -43,15 +43,24 @@ public class GatewayServlet extends BaseServlet
public Object process(RequestInput req)
{
String target = req.getQueryString();
if (target==null)
return new HTTPError(HttpServletResponse.SC_BAD_REQUEST,"no parameter specified");
if (logger.isDebugEnabled())
logger.debug("they want to redirect to: " + target);
if (req.getUser().isLoggedIn())
return new Redirect(target,LinkTypes.ABSOLUTE);
else
return new Redirect("login.js.vs?tgt=" + URLEncoder.encode(target),LinkTypes.SERVLET);
try
{ // look up the servet we wanna bounce to and try to go there
String target = req.getQueryString();
if (target==null)
return new HTTPError(HttpServletResponse.SC_BAD_REQUEST,"no parameter specified");
if (logger.isDebugEnabled())
logger.debug("they want to redirect to: " + target);
if (req.getUser().isLoggedIn())
return new Redirect(target,LinkTypes.ABSOLUTE);
else
return new Redirect("login.js.vs?tgt=" + URLEncoder.encode(target,"UTF-8"),LinkTypes.SERVLET);
} // end try
catch (UnsupportedEncodingException e)
{ // shouldn't happen
return new HTTPError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"internal error: " + e.toString());
} // end catch
} // end process