You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2011/09/30 20:15:45 UTC
svn commit: r1177762 - in /tapestry/tapestry5/trunk/tapestry-core/src:
main/java/org/apache/tapestry5/corelib/pages/
main/java/org/apache/tapestry5/internal/t5internal/
main/java/org/apache/tapestry5/internal/t5internal/components/
main/java/org/apache...
Author: hlship
Date: Fri Sep 30 18:15:45 2011
New Revision: 1177762
URL: http://svn.apache.org/viewvc?rev=1177762&view=rev
Log:
TAP5-1678: Create an internal library, with an internal layout for builtin pages (PageCatalog, ServiceStatus)
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/InternalLayout.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/InternalLayout.tml
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/bluerobot-layout.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/internal-layout.css
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ServiceStatus.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PageCatalog.tml
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ServiceStatus.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ServiceStatus.java?rev=1177762&r1=1177761&r2=1177762&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ServiceStatus.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/pages/ServiceStatus.java Fri Sep 30 18:15:45 2011
@@ -16,6 +16,7 @@ package org.apache.tapestry5.corelib.pag
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.annotations.ContentType;
+import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.beaneditor.BeanModel;
import org.apache.tapestry5.ioc.Messages;
@@ -34,6 +35,7 @@ import java.util.List;
* TODO: Add filters to control which services are displayed
*/
@ContentType("text/html")
+@Import(stylesheet = "ServiceStatus.css")
public class ServiceStatus
{
@Inject
@@ -65,7 +67,7 @@ public class ServiceStatus
model.add("serviceInterface", null);
// There's no line number information for interfaces, so we'll reorder the
- // propreties manually.
+ // proprieties manually.
model.reorder("serviceId", "serviceInterface", "scope", "status");
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/InternalLayout.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/InternalLayout.java?rev=1177762&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/InternalLayout.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/t5internal/components/InternalLayout.java Fri Sep 30 18:15:45 2011
@@ -0,0 +1,35 @@
+package org.apache.tapestry5.internal.t5internal.components;
+
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Parameter;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.annotations.Symbol;
+
+/**
+ * A default layout for a number of internal pages in Tapestry, such as {@link org.apache.tapestry5.corelib.pages.ServiceStatus} and {@link org.apache.tapestry5.corelib.pages.PageCatalog}.
+ * <strong>This component is not intended for use in user applications, and may change at any time.</strong>
+ *
+ * @tapestrydoc
+ * @since 5.3
+ */
+@Import(stylesheet = {"bluerobot-layout.css", "internal-layout.css"})
+public class InternalLayout
+{
+ @Property
+ @Parameter
+ private Block leftNav;
+
+ @Property
+ @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
+ private String title;
+
+ @Inject
+ @Symbol(SymbolConstants.TAPESTRY_VERSION)
+ @Property
+ private String frameworkVersion;
+
+}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=1177762&r1=1177761&r2=1177762&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Fri Sep 30 18:15:45 2011
@@ -491,6 +491,7 @@ public final class TapestryModule
String appRootPackage)
{
configuration.add(new LibraryMapping(InternalConstants.CORE_LIBRARY, "org.apache.tapestry5.corelib"));
+ configuration.add(new LibraryMapping("t5internal", "org.apache.tapestry5.internal.t5internal"));
configuration.add(new LibraryMapping("", appRootPackage));
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PageCatalog.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PageCatalog.tml?rev=1177762&r1=1177761&r2=1177762&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PageCatalog.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PageCatalog.tml Fri Sep 30 18:15:45 2011
@@ -1,49 +1,46 @@
-<html xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
-<head>
- <title>Tapestry Page Catalog</title>
-</head>
-<body>
-
-<h1>Tapestry Page Catalog</h1>
-
-<p>
- This page provides a list of pages currently loaded in the application. There are currently
- <strong>${pages.size()}</strong> page instances in the page cache.
-</p>
-
-<p>Actions:</p>
-<ul>
- <li>
- <t:pagelink page="pagecatalog">refresh this page</t:pagelink>
- </li>
- <li>
- <t:actionlink t:id="forceLoad" zone="pages">load all pages</t:actionlink>
- </li>
- <t:if test="! productionMode">
- <li>
- <t:actionlink t:id="clearCache">clear the cache</t:actionlink>
- </li>
- <li>
- <t:actionlink t:id="runGC">Run the Java Garbage Collector</t:actionlink>
- </li>
- </t:if>
-</ul>
-
-<t:alerts/>
-
-<t:zone t:id="pagesZone" id="pages">
-
- <t:grid source="pages" row="page" add="selector" reorder="name,selector">
- <p:assemblyTimeCell>
- ${formatElapsed(page.assemblyTime)}
- </p:assemblyTimeCell>
- <p:selectorCell>
- ${page.selector.toShortString()}
- </p:selectorCell>
- </t:grid>
+<i:internallayout title="Page Catalog" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
+ xmlns:p="tapestry:parameter"
+ xmlns:i="tapestry-library:t5internal">
+
+ <p:leftnav>
+
+ <ul class="t-menu">
+ <li>
+ <t:pagelink page="pagecatalog">refresh this page</t:pagelink>
+ </li>
+ <li>
+ <t:actionlink t:id="forceLoad" zone="pages">load all pages</t:actionlink>
+ </li>
+ <t:if test="! productionMode">
+ <li>
+ <t:actionlink t:id="clearCache">clear the cache</t:actionlink>
+ </li>
+ <li>
+ <t:actionlink t:id="runGC">Run the GC</t:actionlink>
+ </li>
+ </t:if>
+ </ul>
+
+ </p:leftnav>
+
+
+ <t:zone t:id="pagesZone" id="pages">
+
+ <p>
+ This page provides a list of pages currently loaded in the application. There are currently
+ <strong>${pages.size()}</strong> page instances in the page cache.
+ </p>
+
+
+ <t:grid source="pages" row="page" add="selector" reorder="name,selector">
+ <p:assemblyTimeCell>
+ ${formatElapsed(page.assemblyTime)}
+ </p:assemblyTimeCell>
+ <p:selectorCell>
+ ${page.selector.toShortString()}
+ </p:selectorCell>
+ </t:grid>
-</t:zone>
+ </t:zone>
-</body>
-
-</html>
\ No newline at end of file
+</i:internallayout>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css?rev=1177762&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css Fri Sep 30 18:15:45 2011
@@ -0,0 +1,16 @@
+TR.DEFINED {
+ color: #666666;
+ font-style: italic;
+}
+
+TR.VIRTUAL {
+ color: blue;
+}
+
+TR.REAL {
+ color: green;
+}
+
+DL {
+ font-size: small;
+}
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.tml?rev=1177762&r1=1177761&r2=1177762&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.tml Fri Sep 30 18:15:45 2011
@@ -1,79 +1,64 @@
-<html xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter">
- <head>
- <title>Tapestry IoC Services Status</title>
- <style>
- TR.defined {
- color: #666666;
- font-style: italic;
- }
+<i:internallayout title="Tapestry IoC Services Status" xml:space="default"
+ xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter"
+ xmlns:i="tapestry-library:t5internal">
+
+ <p><strong>${activity.size()}</strong> services defined in the IoC Registry.</p>
+
+ <p:leftNav>
+ <p>
+ Explanation of status:
+ <dl>
+ <dt>Builtin</dt>
+ <dd>
+ A fundamental service that exists even before the Registry is
+ created.
+ </dd>
+
+ <dt>Defined</dt>
+ <dd>
+ The service is defined, but has not yet been referenced.
+ </dd>
+
+ <dt>Virtual</dt>
+ <dd>
+ The service has been referenced (usually for injection into
+ another service) but has not yet been
+ <em>realized</em>
+ into an instantiated service. Realization occurs with the
+ first method invocation on the proxy.
+ </dd>
+
+ <dt>Real</dt>
+ <dd>
+ The service has been realized: instantiated, dependencies
+ injected, decorated with interceptors and is fully in
+ operation.
+ </dd>
+
+ </dl>
+ </p>
+ </p:leftNav>
+
+
+ <t:if test="! productionMode">
+
+ <t:grid rowsperpage="100" model="model" rowClass="row.status" source="activity" row="row">
+
+ <p:serviceInterfaceCell>
+ <t:if test="! row.serviceInterface.interface">
+ <em>Class</em>
+ </t:if>
+ ${row.serviceInterface.name}
+ </p:serviceInterfaceCell>
- TR.virtual
- {
- color: blue;
- }
+ </t:grid>
- TR.real
- {
- color: green;
- }
-
-
- </style>
- </head>
- <body>
-
- <h1>Tapestry IoC Services Status</h1>
-
- <p>${activity.size()} services defined in the IoC Registry.</p>
-
- <t:unless test="productionMode">
-
- <t:grid rowsperpage="100" model="model" rowClass="row.status" source="activity" row="row">
-
- <p:serviceInterfaceCell>
- ${row.serviceInterface}
- </p:serviceInterfaceCell>
-
- </t:grid>
+ <p:else>
<p>
- Explanation of status:
- <dl>
- <dt>Builtin</dt>
- <dd>
- A fundamental service that exists even before the Registry is
- created.
- </dd>
-
- <dt>Defined</dt>
- <dd>
- The service is defined, but has not yet been referenced.
- </dd>
-
- <dt>Virtual</dt>
- <dd>
- The service has been referenced (usually for injection into
- another service) but has not yet been
- <em>realized</em>
- into an instantiated service. Realization occurs with the
- first method invocation on the proxy.
- </dd>
-
- <dt>Real</dt>
- <dd>
- The service has been realized: instantiated, dependencies
- injected, decorated with interceptors and is fully in
- operation.
- </dd>
-
- </dl>
+ <em>${message:service-status-hidden}</em>
</p>
+ </p:else>
+ </t:if>
- <p:else>
- <p>
- <em>${message:service-status-hidden}</em>
- </p>
- </p:else>
- </t:unless>
- </body>
-</html>
\ No newline at end of file
+</i:internallayout>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/InternalLayout.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/InternalLayout.tml?rev=1177762&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/InternalLayout.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/InternalLayout.tml Fri Sep 30 18:15:45 2011
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+<head><title>Tapestry 5: ${title}</title></head>
+<body>
+
+
+<div class="t-header">
+ <a href="http://tapestry.apache.org" title="Tapestry 5">Tapestry 5</a>
+ <span class="detail">version ${frameworkVersion}</span>
+</div>
+
+<div class="t-content">
+ <h1>${title}</h1>
+
+ <t:alerts/>
+
+ <t:body/>
+</div>
+
+<div class="t-menu">
+ <t:delegate to="leftNav"/>
+</div>
+
+</body>
+</html>
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/bluerobot-layout.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/bluerobot-layout.css?rev=1177762&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/bluerobot-layout.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/bluerobot-layout.css Fri Sep 30 18:15:45 2011
@@ -0,0 +1,106 @@
+/* From: http://bluerobot.com/web/layouts/view_css.php?layout=layout1
+ with some modifications
+ License: free to reuse */
+
+body {
+ margin: 0px;
+ padding: 0px;
+ font-family: verdana, arial, helvetica, sans-serif;
+ color: #333;
+ background-color: white;
+}
+
+h1 {
+ margin: 0px 0px 15px 0px;
+ padding: 0px;
+ font-size: 28px;
+ line-height: 28px;
+ font-weight: 900;
+ color: #ccc;
+}
+
+p {
+ font: 11px/20px verdana, arial, helvetica, sans-serif;
+ margin: 0px 0px 16px 0px;
+ padding: 0px;
+}
+
+div.t-content>p {
+ margin: 0px;
+}
+
+div.t-content>p+p {
+ text-indent: 30px;
+}
+
+a {
+ color: #09c;
+ font-size: 11px;
+ text-decoration: none;
+ font-weight: 600;
+ font-family: verdana, arial, helvetica, sans-serif;
+}
+
+a:link {
+ color: #09c;
+}
+
+a:visited {
+ color: #07a;
+}
+
+div.t-header {
+ margin: 50px 0px 10px 0px;
+ padding: 17px 0px 0px 20px;
+ /* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */
+ height: 33px; /* 14px + 17px + 2px = 33px */
+ border-style: solid;
+ border-color: black;
+ border-width: 1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */
+ line-height: 11px;
+ background-color: #eee;
+
+ /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
+Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
+IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
+declaration. The incorrect IE5/Win value is above, while the correct value is
+below. See http://glish.com/css/hacks.asp for details. */
+ voice-family: "\"}\"";
+ voice-family: inherit;
+ height: 14px; /* the correct height */
+}
+
+/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
+length values to user agents that exhibit the parsing error exploited above yet get
+the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
+a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
+body>div.t-header {
+ height: 14px;
+}
+
+div.t-content {
+ margin: 0px 50px 50px 200px;
+ padding: 10px;
+}
+
+div.t-menu {
+ position: absolute;
+ top: 100px;
+ left: 20px;
+ width: 172px;
+ padding: 10px;
+ background-color: #eee;
+ border: 1px dashed #999;
+ line-height: 17px;
+ /* Again, the ugly brilliant hack. */
+ voice-family: "\"}\"";
+ voice-family: inherit;
+ width: 150px;
+}
+
+/* Again, "be nice to Opera 5". */
+body>div.t-menu {
+ width: 150px;
+}
+
+
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/internal-layout.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/internal-layout.css?rev=1177762&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/internal-layout.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/t5internal/components/internal-layout.css Fri Sep 30 18:15:45 2011
@@ -0,0 +1,26 @@
+SPAN.detail {
+ font-size: small;
+}
+
+UL.t-menu {
+ list-style-type: none;
+ margin-left: 0;
+ padding: 0
+}
+
+UL.t-menu LI {
+ padding: 2px;
+ background: #809fff;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ margin-bottom: 7px;
+}
+
+UL.t-menu A {
+ color: white;
+}
+
+UL.t-menu A:hover {
+ text-decoration: underline;
+}
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy?rev=1177762&r1=1177761&r2=1177762&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/PageCatalogTests.groovy Fri Sep 30 18:15:45 2011
@@ -19,7 +19,7 @@ class PageCatalogTests extends SeleniumT
assertTextPresent "Page cache cleared"
- clickAndWait "link=Run the Java Garbage Collector"
+ clickAndWait "link=Run the GC"
assertTextPresent "Garbage collection freed"