Author: dolander
Date: Fri Apr 1 14:19:35 2005
New Revision: 159741
URL: http://svn.apache.org/viewcvs?view=rev&rev=159741
Log:
Jira 162 -- The legacy TagId were not being generated for linkName enabled
anchors.
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&r1=159740&r2=159741
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
Fri Apr 1 14:19:35 2005
@@ -559,7 +559,7 @@
// if the tagId was set then rewrite it and output it.
if (_state.id != null) {
_state.id = getIdForTagId(_state.id);
- renderDefaultNameAndId((HttpServletRequest) req, _state,
_state.id, null);
+ renderDefaultNameAndId((HttpServletRequest) req, _state,
_state.id, _state.id);
}
// write out the tag.
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml?view=diff&r1=159740&r2=159741
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
(original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/J162.xml
Fri Apr 1 14:19:35 2005
@@ -2,7 +2,7 @@
<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
<ses:sessionName>J162</ses:sessionName>
<ses:tester>Daryl</ses:tester>
- <ses:startDate>29 Mar 2005, 09:42:18.173 AM MST</ses:startDate>
+ <ses:startDate>01 Apr 2005, 02:53:08.262 PM MST</ses:startDate>
<ses:description>Daryl</ses:description>
<ses:tests>
<ses:test>
@@ -18,7 +18,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>BA2FBB0E95DC2FF882CECA0FB3BF9B48</ses:value>
+ <ses:value>03EE55AB827FC69162943322438E4AAA</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -44,7 +44,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=BA2FBB0E95DC2FF882CECA0FB3BF9B48; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0;
JSESSIONID=03EE55AB827FC69162943322438E4AAA; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>host</ses:name>
@@ -56,7 +56,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>1b325bd5:102ef2c7065:-7ba6</ses:value>
+ <ses:value>-15ffc26:102ffbc4ce1:-7bab</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -67,33 +67,41 @@
<ses:response>
<ses:statusCode>200</ses:statusCode>
<ses:reason/>
- <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
+ <ses:responseBody><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="en">
- <head>
- <base href="http://localhost:8080/coreWeb/bugs/j162/index.jsp">
- </head>
- <body>
- <p style="color:green">This test will verify that an anchor
+ <head>
+ <base href="http://localhost:8080/coreWeb/bugs/j162/index.jsp">
+ </head>
+ <body>
+ <p style="color:green">This test will verify that an anchor
with just a linkName and tagId attribute will output the
lookup JavaScript.
- </p>
- <div netui:idScope="one" >
- <a id="one.top"></a>
- <h4>Anchor Fragment Identifier Test</h4>
- <a id="one.linkBottom" href="#one.bottom">Bottom</a>
- <div style="border: thin solid;height: 400px;">
- <p id="javaOut"></p>
- </div>
- <a id="one.bottom"></a>
- <a id="one.linkTop" href="#one.top">Top</a>
- </div>
- <script language="JavaScript" type="text/JavaScript">
-<!--
+ </p>
+ <div netui:idScope="one" >
+ <a id="one.top"></a>
+ <h4>Anchor Fragment Identifier Test</h4>
+ <a id="one.linkBottom" href="#one.bottom">Bottom</a>
+ <div style="border: thin solid;height: 400px;">
+ <p id="javaOut"></p>
+ </div>
+ <a id="one.bottom"></a>
+ <a id="one.linkTop" href="#one.top">Top</a>
+ </div>
+ <script language="JavaScript" type="text/JavaScript">
+<!--
// **** Start the NetUI Framework Generated JavaScript ****
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+ var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.one___one.linkBottom="one.linkBottom"
+netui_tagIdNameMap.one___one.linkTop="one.linkTop"
+
+
// lookup by tagId to "real id"
function lookupIdByTagId(id, tag)
{
@@ -101,12 +109,22 @@
return (idScope == "") ? id : idScope + id;
}
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,"_");
+ if (idScope == "")
+ return netui_tagIdNameMap[id];
+ else
+ return netui_tagIdNameMap[idScope + "__" + id];
+}
+
//Non-Legacy lookup method creating a fully qualified scope id
function lookupIdScope(tag,sep)
{
var val = "";
if (sep == null) sep = "";
- while (tag != null && tag.getAttribute != null) {
+ while (tag != null && tag.getAttribute != null) {
try {
var attrVal = tag.getAttribute("netui:idScope");
} catch (e) { /* ignore, in IE6 calling on a table results in an
exception */ }
@@ -117,22 +135,22 @@
return val;
}
-->
-</script></body>
- <script language="JavaScript" type="text/JavaScript">
+</script></body>
+ <script language="JavaScript" type="text/JavaScript">
var p = document.getElementById("javaOut");
- var val = "<b>Document Access</b><br>";
+ var val = "<b>Document Access</b><br>";
var anchorTag = document.getElementById(lookupIdByTagId("linkBottom",p));
- val = val + "LinkBottom Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
- val = val + "LinkBottom ID: <b>" + lookupIdByTagId("linkBottom",anchorTag)
+ "</b><br/>";
+ val = val + "LinkBottom Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
+ val = val + "LinkBottom ID: <b>" +
lookupIdByTagId("linkBottom",anchorTag) + "</b><br/>";
anchorTag = document.getElementById(lookupIdByTagId("linkTop",p));
- val = val + "LinkTop Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
- val = val + "LinkTop ID: <b>" + lookupIdByTagId("linkTop",anchorTag) +
"</b><br/>";
+ val = val + "LinkTop Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
+ val = val + "LinkTop ID: <b>" + lookupIdByTagId("linkTop",anchorTag) +
"</b><br/>";
p.innerHTML = val;
- </script>
+ </script>
-</html>]]></ses:responseBody>
+</html></ses:responseBody>
</ses:response>
<ses:testResults>
<ses:testStatus>fail</ses:testStatus>
@@ -151,7 +169,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>BA2FBB0E95DC2FF882CECA0FB3BF9B48</ses:value>
+ <ses:value>03EE55AB827FC69162943322438E4AAA</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -181,7 +199,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=BA2FBB0E95DC2FF882CECA0FB3BF9B48; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0;
JSESSIONID=03EE55AB827FC69162943322438E4AAA; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>host</ses:name>
@@ -193,7 +211,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>1b325bd5:102ef2c7065:-7ba6</ses:value>
+ <ses:value>-15ffc26:102ffbc4ce1:-7bab</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -204,33 +222,41 @@
<ses:response>
<ses:statusCode>200</ses:statusCode>
<ses:reason/>
- <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
+ <ses:responseBody><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
+<html lang="en">
- <head>
- <base href="http://localhost:8080/coreWeb/bugs/j162/index.jsp">
- </head>
- <body>
- <p style="color:green">This test will verify that an anchor
+ <head>
+ <base href="http://localhost:8080/coreWeb/bugs/j162/index.jsp">
+ </head>
+ <body>
+ <p style="color:green">This test will verify that an anchor
with just a linkName and tagId attribute will output the
lookup JavaScript.
- </p>
- <div netui:idScope="one" >
- <a id="one.top"></a>
- <h4>Anchor Fragment Identifier Test</h4>
- <a id="one.linkBottom" href="#one.bottom">Bottom</a>
- <div style="border: thin solid;height: 400px;">
- <p id="javaOut"></p>
- </div>
- <a id="one.bottom"></a>
- <a id="one.linkTop" href="#one.top">Top</a>
- </div>
- <script language="JavaScript" type="text/JavaScript">
-<!--
+ </p>
+ <div netui:idScope="one" >
+ <a id="one.top"></a>
+ <h4>Anchor Fragment Identifier Test</h4>
+ <a id="one.linkBottom" href="#one.bottom">Bottom</a>
+ <div style="border: thin solid;height: 400px;">
+ <p id="javaOut"></p>
+ </div>
+ <a id="one.bottom"></a>
+ <a id="one.linkTop" href="#one.top">Top</a>
+ </div>
+ <script language="JavaScript" type="text/JavaScript">
+<!--
// **** Start the NetUI Framework Generated JavaScript ****
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+ var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.one___one.linkBottom="one.linkBottom"
+netui_tagIdNameMap.one___one.linkTop="one.linkTop"
+
+
// lookup by tagId to "real id"
function lookupIdByTagId(id, tag)
{
@@ -238,12 +264,22 @@
return (idScope == "") ? id : idScope + id;
}
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,"_");
+ if (idScope == "")
+ return netui_tagIdNameMap[id];
+ else
+ return netui_tagIdNameMap[idScope + "__" + id];
+}
+
//Non-Legacy lookup method creating a fully qualified scope id
function lookupIdScope(tag,sep)
{
var val = "";
if (sep == null) sep = "";
- while (tag != null && tag.getAttribute != null) {
+ while (tag != null && tag.getAttribute != null) {
try {
var attrVal = tag.getAttribute("netui:idScope");
} catch (e) { /* ignore, in IE6 calling on a table results in an
exception */ }
@@ -254,29 +290,29 @@
return val;
}
-->
-</script></body>
- <script language="JavaScript" type="text/JavaScript">
+</script></body>
+ <script language="JavaScript" type="text/JavaScript">
var p = document.getElementById("javaOut");
- var val = "<b>Document Access</b><br>";
+ var val = "<b>Document Access</b><br>";
var anchorTag = document.getElementById(lookupIdByTagId("linkBottom",p));
- val = val + "LinkBottom Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
- val = val + "LinkBottom ID: <b>" + lookupIdByTagId("linkBottom",anchorTag)
+ "</b><br/>";
+ val = val + "LinkBottom Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
+ val = val + "LinkBottom ID: <b>" +
lookupIdByTagId("linkBottom",anchorTag) + "</b><br/>";
anchorTag = document.getElementById(lookupIdByTagId("linkTop",p));
- val = val + "LinkTop Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
- val = val + "LinkTop ID: <b>" + lookupIdByTagId("linkTop",anchorTag) +
"</b><br/>";
+ val = val + "LinkTop Scope Id: <b>" + lookupIdScope(anchorTag,".") +
"</b><br/>";
+ val = val + "LinkTop ID: <b>" + lookupIdByTagId("linkTop",anchorTag) +
"</b><br/>";
p.innerHTML = val;
- </script>
+ </script>
-</html>]]></ses:responseBody>
+</html></ses:responseBody>
</ses:response>
<ses:testResults>
<ses:testStatus>fail</ses:testStatus>
</ses:testResults>
</ses:test>
</ses:tests>
- <ses:endDate>29 Mar 2005, 09:42:18.874 AM MST</ses:endDate>
+ <ses:endDate>01 Apr 2005, 02:53:08.803 PM MST</ses:endDate>
<ses:sessionStatus>fail</ses:sessionStatus>
<ses:testCount>2</ses:testCount>
<ses:passedCount>0</ses:passedCount>