Author: dolander Date: Tue Dec 7 12:51:05 2004 New Revision: 111135 URL: http://svn.apache.org/viewcvs?view=rev&rev=111135 Log: Remove the IHtmlIdWritter interface and the IdMapper support. This was all put into place to support name attribute rewritting (id transparency) which we are not doing.
Removed: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IdMapper.java incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IHtmlIdWriter.java Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd Deleted: /incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IdMapper.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IdMapper.java?view=auto&rev=111134 ============================================================================== Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java?view=diff&rev=111135&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java&r1=111134&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java&r2=111135 ============================================================================== --- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java (original) +++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java Tue Dec 7 12:51:05 2004 @@ -30,7 +30,6 @@ import org.apache.beehive.netui.script.ExpressionEvaluator; import org.apache.beehive.netui.script.ExpressionEvaluatorFactory; import org.apache.beehive.netui.script.ExpressionUpdateException; -import org.apache.beehive.netui.script.el.NetUIUpdateVariableResolver; import org.apache.beehive.netui.script.common.ImplicitObjectUtil; import org.apache.beehive.netui.util.Bundle; import org.apache.beehive.netui.util.logging.Logger; @@ -167,7 +166,6 @@ boolean isMultipart = false; // if this returns null, it's not a mulitpart request - HashMap expressionMap = null; Map params = MultipartRequestUtils.handleMultipartRequest(request, form); // make adjustments @@ -184,11 +182,6 @@ /* explicitly build a variable resolver that is used to provide objects that may be updated to the expression engine */ VariableResolver variableResolver = ImplicitObjectUtil.getUpdateVariableResolver(form, request, response, true); - String[] idMap = (String[]) params.get(IDMAP_PARAMETER_NAME); - if (idMap != null) { - expressionMap = IdMapper.getExpressionMap(idMap[0]); - } - /* todo: are there any ordering issues with using an Iterator vs. an Enumeration here? */ Iterator iterator = params.keySet().iterator(); while (iterator.hasNext()) @@ -197,17 +190,7 @@ String expr = null; // if there is an expression map, lookup the real expression from the name - if (expressionMap != null) { - expr = (String) expressionMap.get(key); - if (expr == null) - expr = key; - //System.err.println("Expr: '" + expr + "' key: '" + key + "'"); - } - else { - expr = key; - //System.err.println("NonExpr: '" + key + "'"); - } - + expr = key; if (_logger.isDebugEnabled()) _logger.debug("key: " + key + " value type: " + params.get(key).getClass().getName() + " value: " + params.get(key)); Deleted: /incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IHtmlIdWriter.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IHtmlIdWriter.java?view=auto&rev=111134 ============================================================================== Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java?view=diff&rev=111135&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java&r1=111134&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java&r2=111135 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java Tue Dec 7 12:51:05 2004 @@ -23,7 +23,6 @@ import org.apache.beehive.netui.pageflow.internal.ContextCache; import org.apache.beehive.netui.pageflow.internal.InternalUtils; import org.apache.beehive.netui.script.common.ImplicitObjectUtil; -import org.apache.beehive.netui.tags.IHtmlIdWriter; import org.apache.beehive.netui.tags.internal.PageFlowTagUtils; import org.apache.beehive.netui.tags.rendering.*; import org.apache.beehive.netui.util.Bundle; @@ -192,7 +191,7 @@ * expressioninfo="workshop.netui.jspdesigner.tldx.expression.NetuiActionFormExpressionInfo" */ public class Form extends HtmlBaseTag - implements URLParams, IHtmlIdWriter + implements URLParams { /** * This is the name of the counter stored in the request used to genereate the @@ -234,7 +233,6 @@ private Map _params; private int _nextId; - private IdMapper _idMapper; /** * Return the name of the Tag. @@ -537,30 +535,6 @@ return _beanName; } - //********************************************* IHtmlIdWriter interface ******************************************* - /** - * This method will add a id and expression to the map maintained by the implementor. This map should be - * written to the form as a set of hidden fields that will contain the id. - * @param id - * @param expression - */ - public String writeId(String id, String expression) - { - if (_idMapper == null) { - _idMapper = new IdMapper(); - } - return _idMapper.writeId(id, expression); - } - - /** - * Return the next id - */ - public String getNextId() - { - return ID_PREFIX + _nextId++; - } - - //********************************************* Do the Work ******************************************************* /** * Render the beginning of this form. @@ -800,13 +774,6 @@ pageContext.removeAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE); ImplicitObjectUtil.unloadActionForm(pageContext); - // output the hidden fields for id transparency if this is turned on - if (IdMapper.isIdTransparency() && _idMapper != null) { - String encoded = _idMapper.getExpressions(); - writeHiddenParam(ProcessPopulate.IDMAP_PARAMETER_NAME, encoded, writer, request, false); - writer.append("\n"); - } - // Render a tag representing the end of our current form br.doEndTag(writer); @@ -881,7 +848,6 @@ _mapping = null; _servlet = null; _focusMap = null; - _idMapper = null; _appConfig = null; _flowController = null; _setRealName = false; Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java?view=diff&rev=111135&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java&r1=111134&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java&r2=111135 ============================================================================== --- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java (original) +++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java Tue Dec 7 12:51:05 2004 @@ -468,59 +468,6 @@ } /** - * Return the closest IHtmlIdWritter. - */ - protected IHtmlIdWriter getNearestIdWriter() - { - Tag parentTag = getParent(); - while (parentTag != null) { - if (parentTag instanceof IHtmlIdWriter) - return (IHtmlIdWriter) parentTag; - parentTag = parentTag.getParent(); - } - return null; - } - - /** - * The method handles processing the id attribute. - * @param state - * @param realName - * @param outputAsId - * @param addToForm - * @return String - */ - /* - protected final String renderTagId(AbstractHtmlState state, String realName, boolean outputAsId, boolean addToForm) - { - assert (state != null) : "Parameter 'state' must not be null."; - - if (state.id == null) - return null; - - if (realName == null) - realName = rewriteName(state.id); - - String idScript = addTagIdMapping(state.id, realName); - - // form keeps track of this so that it can add this control to it's focus map - if (addToForm) { - Form parentForm = getNearestForm(); - if (parentForm != null) - parentForm.addTagID(state.id, realName); - } - - // some tags will output the id attribute themselves so they don't write this out - if (outputAsId) - state.id = realName; - else - state.id = null; - - return idScript; - } - */ - - - /** * Assumptions: * <ul> * <li>The state.name must be fully formed or the "real name" of the form.</li> @@ -532,10 +479,11 @@ */ protected final String renderNameAndId(AbstractHtmlState state, Form parentForm) { - //System.err.println("NameAndId:" + state.id); + // if id is not set then we need to exit if (state.id == null) return null; + // check to see if this is an instance of a HTML Control boolean ctrlState = (state instanceof AbstractHtmlControlState); // form keeps track of this so that it can add this control to it's focus map @@ -543,27 +491,19 @@ parentForm.addTagID(state.id, ((AbstractHtmlControlState) state).name); } - // rewrite the id + // rewrite the id, save the original value so it can be used in maps String id = state.id; state.id = rewriteName(id); - // Find out if there is an Id writer... - //IHtmlIdWriter idWriter = getNearestIdWriter(); - //if (idWriter != null) { - - // map the tagId to the real id - //String idScript = addTagIdMappings(id, state.id, state.name); - // @todo: add this back under the compat javascript flag - // add the state mapping + // Legacy Java Script support -- This writes out a single table with both the id and names + // mixed. This is legacy support to match the pre beehive behavior. String idScript = null; if (!ctrlState) { - //System.err.println("adding Id:" + id + " " + state.id); idScript = addTagIdMapping(id, state.id); } else { AbstractHtmlControlState cState = (AbstractHtmlControlState) state; - //System.err.println("adding Id:" + id + " " + cState.name + " " + cState.id); if (cState.name != null) idScript = addTagIdMapping(id, cState.name); else @@ -571,12 +511,24 @@ } //if (idScript != null) // javaScript.setRef(idScript); - return idScript; //} + // map the tagId to the real id + /* + if (ctrlState) { + AbstractHtmlControlState cState = (AbstractHtmlControlState) state; + idScript = addTagIdMappings(id, cState.id, cState.name); + } + else { + idScript = addTagIdMapping(id, state.id); + } + */ + //System.out.println("Writting:" + id + " " + state.id); //String idScript = addTagIdMapping(id, state.id); //return idScript; + + return idScript; } /** Modified: incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd?view=diff&rev=111135&p1=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r1=111134&p2=incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd&r2=111135 ============================================================================== --- incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd (original) +++ incubator/beehive/trunk/netui/src/util/schema/netui-config.xsd Tue Dec 7 12:51:05 2004 @@ -97,6 +97,8 @@ <xsd:complexType name="jsp-tag-config"> <xsd:sequence> <xsd:element name="doctype" type="xsd:string" minOccurs="0" maxOccurs="1"/> + <xsd:element name="id-javascript" type="xsd:string" minOccurs="0" maxOccurs="1"/> + <!-- @TODO: This needs to be removed. We don't support this at the moment. --> <xsd:element name="id-transparency" type="xsd:string" minOccurs="0" maxOccurs="1" default="false"/> </xsd:sequence> </xsd:complexType>
