hlship 2005/08/08 10:53:13
Modified: . status.xml
framework/src/java/org/apache/tapestry/resolver
PageSpecificationResolverImpl.java
framework/src/test/org/apache/tapestry/resolver
TestPageSpecificationResolver.java
Log:
TAPESTRY-365: Set the location for a page that has no specification (just a
template) to be relative to the application (or library) specification
Revision Changes Path
1.192 +1 -0 jakarta-tapestry/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/jakarta-tapestry/status.xml,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- status.xml 8 Aug 2005 17:23:13 -0000 1.191
+++ status.xml 8 Aug 2005 17:53:12 -0000 1.192
@@ -74,6 +74,7 @@
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-530" due-to="Raphael
Jean">Namespace messages are retrieved using page's locale rather than engine's
locale</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-354">Component w/o
.jwc file not visible</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-533" due-to="Raphael
Jean">Generated client-side javascript is wrong when error message or field
display name contains single-quote characters or backslashes</action>
+ <action type="fix" dev="HLS" fixes-bug="TAPESTRY-365">Set the location
for a page that has no specification (just a template) to be relative to the
application (or library) specification</action>
</release>
<release version="4.0-beta-3" date="Jul 22 2005">
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-398" due-to="Jonas
Maurus">HiveMind configuration error breaks the useage of the state: binding
prefix</action>
1.12 +9 -3
jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolverImpl.java
Index: PageSpecificationResolverImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/resolver/PageSpecificationResolverImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- PageSpecificationResolverImpl.java 6 Aug 2005 06:58:28 -0000
1.11
+++ PageSpecificationResolverImpl.java 8 Aug 2005 17:53:12 -0000
1.12
@@ -187,7 +187,7 @@
if (templateResource.getResourceURL() != null)
{
- setupImplicitPage(templateResource);
+ setupImplicitPage(templateResource, namespaceLocation);
return;
}
@@ -224,7 +224,7 @@
}
}
- private void setupImplicitPage(Resource resource)
+ private void setupImplicitPage(Resource resource, Resource
namespaceLocation)
{
if (_log.isDebugEnabled())
_log.debug(ResolverMessages.foundHTMLTemplate(resource));
@@ -232,9 +232,15 @@
// TODO The SpecFactory in Specification parser should be used in
some way to
// create an IComponentSpecification!
+ // The virtual location of the page specification is relative to the
+ // namespace (typically, the application specification). This will
be used when
+ // searching for the page's message catalog or other related assets.
+
+ Resource pageResource =
namespaceLocation.getRelativeResource(_simpleName + ".page");
+
IComponentSpecification specification = new ComponentSpecification();
specification.setPageSpecification(true);
- specification.setSpecificationLocation(resource);
+ specification.setSpecificationLocation(pageResource);
specification.setLocation(new LocationImpl(resource));
setSpecification(specification);
1.5 +10 -1
jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/TestPageSpecificationResolver.java
Index: TestPageSpecificationResolver.java
===================================================================
RCS file:
/home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/resolver/TestPageSpecificationResolver.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestPageSpecificationResolver.java 6 Aug 2005 06:58:27 -0000
1.4
+++ TestPageSpecificationResolver.java 8 Aug 2005 17:53:13 -0000
1.5
@@ -655,8 +655,17 @@
IComponentSpecification spec = application._specification;
assertEquals(true, spec.isPageSpecification());
- assertEquals(resource, spec.getSpecificationLocation());
+ // The specification location is used to find relative assets and
the like, and is baesd
+ // on the page name and the namespace location.
+
+
assertEquals(contextRoot.getRelativeResource("WEB-INF/TemplatePage.page"), spec
+ .getSpecificationLocation());
+
+ // The Location is used for any error reporting, and should be the
actual file
+ // located, the template.
+
+ assertEquals(resource, spec.getLocation().getResource());
assertEquals("TemplatePage", resolver.getSimplePageName());
assertEquals("TemplatePage", application._pageName);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]