tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Andreou (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Resolved: (TAPESTRY-1035) Allow common stylesheets/favicon/geoinfo/doctype settings across pages/requests
Date Tue, 02 Jan 2007 05:46:27 GMT

     [ http://issues.apache.org/jira/browse/TAPESTRY-1035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andreas Andreou resolved TAPESTRY-1035.
---------------------------------------

    Resolution: Won't Fix

I don't see how this is needed...

A custom Border component making use (even conditionally) of 
http://tapestry.apache.org/tapestry4.1/components/general/relation.html
or
http://tapestry.apache.org/tapestry4.1/components/general/style.html
is just a simple way to deal with this.

> Allow common stylesheets/favicon/geoinfo/doctype settings across pages/requests
> -------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1035
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1035
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 4.1.1
>         Environment: Any
>            Reporter: Henrik Vendelbo
>         Assigned To: Andreas Andreou
>            Priority: Minor
>             Fix For: 4.1.2
>
>
> I have been using my own custom Shell component for a while now, and have come up with
an improvement along the lines of the AjaxDelegate.
> On most sites you would want a common setup for :
> doctype
> stylesheet
> stylesheets
> You might even want to implement a skinnable concept and vary the stylesheets depending
on the user.
> How about new parameter IShellDefaults getShellDefaults().
>   <parameter 
>   	name="shellDefaults">
>     <description>
>     If specified, the defaults can provide a common layout and encoding for the site
overall or by user preference.
>     </description>
>   </parameter>
>   
>   public abstract IShellDefaults getShellDefaults();
> interface IShellDefault {
>     String getDoctype(IRequestCycle cycle);
>     boolean getRenderContentType(IRequestCycle cycle);
>     Object getBaseStylesheets(IRequestCycle cycle); // Always used before getStylesheet()
or those specified in Shell tag
>     Object getStylesheets(IRequestCycle cycle); // Used if none are specified in the
Shell tag
>     IAsset getFavicon(IRequestCycle cycle);
>     IDelegate getDelegate(); // Can be used for additional meta tags/links  
> }
> I expect the changes to be something like this(favicon excluded)
> ---------
> IShellDefaults defs = getShellDefaults();
> boolean renderCT = getRenderContentType();
> if (defs != null)
>             renderCT &= defs.getRenderContentType(cycle);
> if (renderCT)
>             writeMetaTag(writer, "http-equiv", "Content-Type", writer.getContentType());
> if (defs != null) {
>    IRender delegate = defs.getDelegate(cycle);
>    if (delegate != null)
>           delegate.render(writer, cycle);
> }
> if (defs != null) {
>            Iterator i = (Iterator) getValueConverter().coerceValue(defs.getBaseStylesheets(cycle),Iterator.class);
>             while (i.hasNext())
>             {
>                 stylesheet = (IAsset) i.next();
>                 writeStylesheetLink(writer, cycle, stylesheet);
>             }
> }
> if (defs != null && getStylesheet()==null && getStylesheets()==null)
{
>            Iterator i = (Iterator) getValueConverter().coerceValue(defs.getStylesheets(cycle),Iterator.class);
>             while (i.hasNext())
>             {
>                 stylesheet = (IAsset) i.next();
>                 writeStylesheetLink(writer, cycle, stylesheet);
>             }
> }          
> IAsset stylesheet = getStylesheet();
>             
> if (stylesheet != null)
>                 writeStylesheetLink(writer, cycle, stylesheet);
>             
> Iterator i = (Iterator) getValueConverter().coerceValue(getStylesheets(), Iterator.class);
>             
> while (i.hasNext())
> {
>     stylesheet = (IAsset) i.next();
>     writeStylesheetLink(writer, cycle, stylesheet);
> }
> ....
>     private void writeDocType(IMarkupWriter writer, IRequestCycle cycle)
>     {
>         String doctype = getDoctype();
>         if (! HiveMind.isNonBlank(doctype) && getShellDefaults() != null)
>            doctype = getShellDefaults().getDoctype(cycle);
>         if (HiveMind.isNonBlank(doctype))

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message