[seam-commits] Seam SVN: r9334 - trunk/src/debug/META-INF.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Oct 15 03:16:01 EDT 2008


Author: dan.j.allen
Date: 2008-10-15 03:16:01 -0400 (Wed, 15 Oct 2008)
New Revision: 9334

Modified:
   trunk/src/debug/META-INF/debug.xhtml
Log:
qualify JavaScript functions so they don't conflict w/ scriptaculous
add an action to destroy a conversation
show if a conversation is nested
fix spacing issue in activity
update intro paragraph


Modified: trunk/src/debug/META-INF/debug.xhtml
===================================================================
--- trunk/src/debug/META-INF/debug.xhtml	2008-10-15 05:49:42 UTC (rev 9333)
+++ trunk/src/debug/META-INF/debug.xhtml	2008-10-15 07:16:01 UTC (rev 9334)
@@ -1,9 +1,9 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:ui="http://java.sun.com/jsf/facelets"
-	  xmlns:f="http://java.sun.com/jsf/core"
-	  xmlns:h="http://java.sun.com/jsf/html">
+  xmlns:ui="http://java.sun.com/jsf/facelets"
+  xmlns:f="http://java.sun.com/jsf/core"
+  xmlns:h="http://java.sun.com/jsf/html">
 <f:view>
   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -28,75 +28,95 @@
    <style type="text/css" media="print">
       #sessionContext, #conversationContext, #applicationContext, #attributes, #processContext { display: block; }
    </style>
-   <script language="javascript" type="text/javascript">
-      function toggle(id) {
-         var style = document.getElementById(id).style;
-         if ("block" == style.display) {
-            style.display = "none";
+   <script language="Javascript" type="text/javascript">
+      SeamDebugPage = {};
+      SeamDebugPage.toggle = function(id) {
+         var el = document.getElementById(id);
+         var displayStyle = SeamDebugPage.getDisplayStyle(el);
+         if ("block" == displayStyle) {
+            el.style.display = "none";
             document.getElementById(id+"Off").style.display = "inline";
             document.getElementById(id+"On").style.display = "none";
          } 
          else {
-            style.display = "block";
+            el.style.display = "block";
             document.getElementById(id+"Off").style.display = "none";
             document.getElementById(id+"On").style.display = "inline";
          }
       }
-      function show(id) {
-         var style = document.getElementById(id).style;
-         if ("none" == style.display) {
-            style.display = "block";
-            document.getElementById(id+"Off").style.display = "none";
-            document.getElementById(id+"On").style.display = "inline";
+      SeamDebugPage.getDisplayStyle = function(el) {
+         var value = el.style.display;
+   
+         if (!value) {
+            if (document.defaultView) {
+               value = document.defaultView.getComputedStyle(el, "").getPropertyValue("display");
+            }
+            else if (el.currentStyle) {
+               value = el.currentStyle.display;
+            }
          }
+         return value;
       }
+   function foo() {}
    </script>
   </head>
   <body>
     <h1><h:outputLink value="#{facesContext.externalContext.request.requestURI}">JBoss Seam Debug Page</h:outputLink></h1>
     <div>
-      This page allows you to view and inspect any component in any Seam context
-      associated with the current session.
+      This page allows you to browse and inspect components in any of the Seam
+      contexts associated with the current session. It also shows a list of
+      active, long-running conversations. You can select a conversation to view
+      its contents or destroy it.
     </div>
    
     <h2>Conversations</h2>
     <h:outputText value="No long-running conversations exist"
                   rendered="#{empty org.jboss.seam.debug.contexts.conversationEntries}"/>
-    <h:dataTable value="#{org.jboss.seam.debug.contexts.conversationEntries}" 
-                 rendered="#{not empty org.jboss.seam.debug.contexts.conversationEntries}"
-                 var="entry">
-      <h:column>
-        <f:facet name="header">conversation id</f:facet>
-        #{entry.id}
-      </h:column>
-      <h:column>
-        <f:facet name="header">activity</f:facet>
-        <h:outputText value="#{entry.startDatetime}">
-          <f:convertDateTime type="time"/>
-        </h:outputText>
-        - 
-        <h:outputText value="#{entry.lastDatetime}">
-          <f:convertDateTime type="time"/>
-        </h:outputText>
-      </h:column>
-      <h:column>
-        <f:facet name="header">description</f:facet>
-        #{entry.description}
-      </h:column>
-      <h:column>
-        <f:facet name="header">view id</f:facet>
-        #{entry.viewId}
-      </h:column>
-      <h:column>
-        <h:outputLink>
-          Select conversation context
-          <f:param name="#{org.jboss.seam.core.manager.conversationIdParameter}" value="#{entry.id}"/>
-        </h:outputLink>
-      </h:column>
-    </h:dataTable>
+    <h:form rendered="#{not empty org.jboss.seam.debug.contexts.conversationEntries}">
+      <h:dataTable var="_entry" value="#{org.jboss.seam.debug.contexts.conversationEntries}">
+        <h:column>
+          <f:facet name="header">Conversation ID</f:facet>
+          #{_entry.id}
+        </h:column>
+        <h:column>
+          <f:facet name="header">Nested?</f:facet>
+          #{_entry.nested}
+        </h:column>
+        <h:column>
+          <f:facet name="header">Activity</f:facet>
+          <h:outputText value="#{_entry.startDatetime}">
+            <f:convertDateTime type="time" timeZone="#{timeZone}"/>
+          </h:outputText>
+          #{' - '}
+          <h:outputText value="#{_entry.lastDatetime}">
+            <f:convertDateTime type="time" timeZone="#{timeZone}"/>
+          </h:outputText>
+        </h:column>
+        <h:column>
+          <f:facet name="header">Description</f:facet>
+          #{_entry.description}
+        </h:column>
+        <h:column>
+          <f:facet name="header">View ID</f:facet>
+          #{_entry.viewId}
+        </h:column>
+        <h:column>
+          <f:facet name="header">Action</f:facet>
+          <h:outputLink>
+            Select
+            <f:param name="#{org.jboss.seam.core.manager.conversationIdParameter}" value="#{_entry.id}"/>
+          </h:outputLink>
+          #{' '}
+          <h:commandLink actionListener="#{_entry.destroy}" action="#{org.jboss.seam.faces.redirect.execute}" value="Destroy">
+            <f:setPropertyActionListener target="#{org.jboss.seam.faces.redirect.conversationPropagationEnabled}" value="#{false}"/>
+            <f:setPropertyActionListener target="#{org.jboss.seam.faces.redirect.viewId}" value="#{view.viewId}"/>
+          </h:commandLink>
+        </h:column>
+      </h:dataTable>
+    </h:form>
 
     <h2>
-      <a href="#" onclick="toggle('attributes'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('attributes'); return false;">
         <span id="attributesOff" style="display: none;">+</span>
         <span id="attributesOn">-</span>
         &#160;Component&#160;
@@ -122,7 +142,7 @@
     </div>
    
     <h2>
-      <a href="#" onclick="toggle('conversationContext'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('conversationContext'); return false;">
         <span id="conversationContextOff" style="display: none;">+</span>
         <span id="conversationContextOn">-</span>
         &#160;Conversation Context&#160;
@@ -148,7 +168,7 @@
     </div>
     
     <h2>
-      <a href="#" onclick="toggle('processContext'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('processContext'); return false;">
         <span id="processContextOff" style="display: none;">+</span>
         <span id="processContextOn">-</span>
         &#160;Business Process Context
@@ -170,7 +190,7 @@
     </div>
 
     <h2>
-      <a href="#" onclick="toggle('sessionContext'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('sessionContext'); return false;">
         <span id="sessionContextOff" style="display: none;">+</span>
         <span id="sessionContextOn">-</span>
         &#160;Session Context
@@ -192,7 +212,7 @@
     </div>
 
     <h2>
-      <a href="#" onclick="toggle('applicationContext'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('applicationContext'); return false;">
         <span id="applicationContextOff">+</span>
         <span id="applicationContextOn" style="display: none;">-</span>
         &#160;Application Context
@@ -213,7 +233,7 @@
     
     <f:subview rendered="#{org.jboss.seam.debug.contexts.exceptionExists}">
     <h2>
-      <a href="#" onclick="toggle('stackTrace'); return false;">
+      <a href="#" onclick="SeamDebugPage.toggle('stackTrace'); return false;">
         <span id="stackTraceOff" style="display: none;">+</span>
         <span id="stackTraceOn">-</span>
         &#160;Exception




More information about the seam-commits mailing list