CVS: Tapestry/framework/src/net/sf/tapestry Tapestry.java,1.9.2.2,1.9.2.3 TapestryStrings.properties,1.36.2.4,1.36.2.5 RequestContext.java,1.18,1.18.2.1 IAsset.java,1.6,1.6.2.1 IResourceLocation.java,1.1.2.2,1.1.2.3 INamespace.java,1.7.2.1,1.7.2.2 IPageSource.java,1.6.2.3,1.6.2.4
Howard Lewis Ship <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry
In directory sc8-pr-cvs1:/tmp/cvs-serv15280/framework/src/net/sf/tapestry
Modified Files:
Tag: hship-2-3
Tapestry.java TapestryStrings.properties RequestContext.java
IAsset.java IResourceLocation.java INamespace.java
IPageSource.java
Log Message:
Check in support for templates in the application root.
Index: Tapestry.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/Tapestry.java,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -C2 -d -r1.9.2.2 -r1.9.2.3
*** Tapestry.java 5 Dec 2002 11:54:00 -0000 1.9.2.2
--- Tapestry.java 11 Dec 2002 14:02:25 -0000 1.9.2.3
***************
*** 16,19 ****
--- 16,22 ----
import java.util.Set;
+ import javax.servlet.ServletContext;
+
+ import net.sf.tapestry.resource.ContextResourceLocation;
import net.sf.tapestry.spec.ComponentSpecification;
import net.sf.tapestry.util.AdaptorRegistry;
***************
*** 641,644 ****
--- 644,668 ----
return result;
+ }
+
+ /**
+ * Returns the application root location, which is in the
+ * {@link javax.servlet.ServletContext}, based on
+ * the {@link javax.servlet.http.HttpServletRequest#getServletPath() servlet path}.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public static IResourceLocation getApplicationRootLocation(IRequestCycle cycle)
+ {
+ RequestContext context = cycle.getRequestContext();
+ ServletContext servletContext = context.getServlet().getServletContext();
+ String servletPath = context.getRequest().getServletPath();
+
+ // Could strip off the servlet name (i.e., "app" in "/app") but
+ // there's no need.
+
+ return new ContextResourceLocation(servletContext, servletPath);
}
}
Index: TapestryStrings.properties
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/TapestryStrings.properties,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -C2 -d -r1.36.2.4 -r1.36.2.5
*** TapestryStrings.properties 7 Dec 2002 13:26:13 -0000 1.36.2.4
--- TapestryStrings.properties 11 Dec 2002 14:02:25 -0000 1.36.2.5
***************
*** 143,148 ****
DefaultSpecificationSource.unable-to-parse-specification=Could not parse specification {0}.
! DefaultTemplateSource.no-template=Could not find template for component {0}.
! DefaultTemplateSource.no-template-in-locale=Could not find template for component {0} in locale {1}.
DefaultTemplateSource.unable-to-parse-template=Could not parse template {0}.
DefaultTemplateSource.unable-to-read-template=Could not read template {0}.
--- 143,148 ----
DefaultSpecificationSource.unable-to-parse-specification=Could not parse specification {0}.
! DefaultTemplateSource.no-template-for-component=Could not find template for component {0} in locale {1}.
! DefaultTemplateSource.no-template-for-page=Could not find template for page {0} in locale {1}.
DefaultTemplateSource.unable-to-parse-template=Could not parse template {0}.
DefaultTemplateSource.unable-to-read-template=Could not read template {0}.
Index: RequestContext.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/RequestContext.java,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -d -r1.18 -r1.18.2.1
*** RequestContext.java 27 Nov 2002 17:58:45 -0000 1.18
--- RequestContext.java 11 Dec 2002 14:02:25 -0000 1.18.2.1
***************
*** 740,744 ****
writer.end("tr");
!
return;
}
--- 740,744 ----
writer.end("tr");
! writer.println();
return;
}
***************
*** 765,768 ****
--- 765,769 ----
writer.print(value);
writer.end("tr");
+ writer.println();
}
Index: IAsset.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IAsset.java,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -d -r1.6 -r1.6.2.1
*** IAsset.java 27 Nov 2002 17:58:45 -0000 1.6
--- IAsset.java 11 Dec 2002 14:02:25 -0000 1.6.2.1
***************
*** 25,28 ****
--- 25,30 ----
* If the asset can be localized, the localized version (matching the
* {@link java.util.Locale} of the current {@link IPage page}) is returned.
+ *
+ * @throws ApplicationRuntimeException if the asset does not exist.
*
**/
***************
*** 34,37 ****
--- 36,42 ----
* an input stream. A version of the resource localized to the
* current {@link IPage page} is returned.
+ *
+ * @throws ApplicationRuntimeException if the asset does not exist, or
+ * can't be read.
*
**/
***************
*** 42,45 ****
--- 47,53 ----
* Accesses the localized version of the resource (if possible) and
* returns it as an input stream.
+ *
+ * @throws ApplicationRuntimeException if the asset does not exist, or
+ * can't be read.
*
* @since 2.2
Index: IResourceLocation.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/Attic/IResourceLocation.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** IResourceLocation.java 8 Dec 2002 15:04:47 -0000 1.1.2.2
--- IResourceLocation.java 11 Dec 2002 14:02:25 -0000 1.1.2.3
***************
*** 26,29 ****
--- 26,32 ----
* null if the resource doesn't exist. {@link #getLocalization(Locale)}
* returns only real resource locations, where the resource exists.
+ *
+ * <p>
+ * Folders must be represented with a trailing slash.
*
* @author Howard Lewis Ship
***************
*** 57,60 ****
--- 60,65 ----
*
* @param locale to localize for, or null for no localization.
+ * @return a localized version of this resource, of null if the resource
+ * itself does not exist.
*
**/
Index: INamespace.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/INamespace.java,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -d -r1.7.2.1 -r1.7.2.2
*** INamespace.java 7 Dec 2002 13:26:13 -0000 1.7.2.1
--- INamespace.java 11 Dec 2002 14:02:26 -0000 1.7.2.2
***************
*** 59,62 ****
--- 59,74 ----
/**
+ * Returns a version of the extended id appropriate for error
+ * messages. This is the based on
+ * {@link #getExtendedId()}, unless this is the
+ * application or framework namespace, in which case
+ * special strings are returned.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public String getNamespaceId();
+ /**
* Returns the parent namespace; the namespace which
* contains this namespace.
***************
*** 93,97 ****
/**
! * Returns the path for the page specification of the named
* page (defined within the namespace).
*
--- 105,109 ----
/**
! * Returns the page specification of the named
* page (defined within the namespace).
*
***************
*** 197,199 ****
--- 209,232 ----
public IResourceLocation getSpecificationLocation();
+
+ /**
+ * Returns true if the namespace is the special
+ * application namespace.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public boolean isApplicationNamespace();
+
+ /**
+ * Used to specify additional pages beyond those that came from
+ * the namespace's specification. This is used when pages
+ * in the application namespace are dynamically discovered.
+ *
+ * @since 2.4
+ *
+ **/
+
+ public void installPageSpecification(String pageName, ComponentSpecification specification);
}
Index: IPageSource.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/framework/src/net/sf/tapestry/IPageSource.java,v
retrieving revision 1.6.2.3
retrieving revision 1.6.2.4
diff -C2 -d -r1.6.2.3 -r1.6.2.4
*** IPageSource.java 8 Dec 2002 15:04:47 -0000 1.6.2.3
--- IPageSource.java 11 Dec 2002 14:02:26 -0000 1.6.2.4
***************
*** 20,25 ****
* loaded page from a pool of available pages, or the page may be loaded as needed.
*
! * <p>Incompatible change in 2.2: First parameter changed from
! * {@link IEngine} to {@link IRequestCycle}.
*
**/
--- 20,28 ----
* loaded page from a pool of available pages, or the page may be loaded as needed.
*
! * @param cycle the current request cycle
! * @param pageName the name of the page. May be qualified with a library id prefix, which
! * may even be nested. Unqualified names are searched for extensively in the application
! * namespace, and then in the framework namespace.
! * @param monitor informed of any page loading activity
*
**/
***************
*** 49,53 ****
* the existing binding is returned.
*
! * @since 1.0.2
**/
--- 52,57 ----
* the existing binding is returned.
*
! * @since 1.0.2
! *
**/
***************
*** 57,61 ****
* Like {@link #getFieldBinding(String)}, except for static bindings.
*
! * @since 1.0.2
**/
--- 61,66 ----
* Like {@link #getFieldBinding(String)}, except for static bindings.
*
! * @since 1.0.2
! *
**/
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/