You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Richard Kirby (JIRA)" <ji...@apache.org> on 2010/10/17 08:16:23 UTC

[jira] Created: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
-------------------------------------------------------------------------------------------------

                 Key: TAP5-1312
                 URL: https://issues.apache.org/jira/browse/TAP5-1312
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.2.2
            Reporter: Richard Kirby


I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.

One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921868#action_12921868 ] 

Howard M. Lewis Ship commented on TAP5-1312:
--------------------------------------------

That's an interesting idea, very useful for cached portions of the page.

> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921868#action_12921868 ] 

Howard M. Lewis Ship commented on TAP5-1312:
--------------------------------------------

That's an interesting idea, very useful for cached portions of the page.

> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Richard Kirby (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Kirby updated TAP5-1312:
--------------------------------

    Attachment: TAP-1312-diffs

A wee implementation of my suggestion.

I have tried to minimise the impact across the public API.

A custom component needs to cast MarkupWriter to MarkupWriter2 to access the new writeStream method. The fallback being to just create a String and use writeRaw.



> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>         Attachments: TAP-1312-diffs
>
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Richard Kirby (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Kirby updated TAP5-1312:
--------------------------------

    Attachment: TAP-1312-diffs

Added code to RenderPhaseMethodWorker to cope with render methods taking MarkupWriter2 as arguments instead of MarkupWriter.

No need for casting now - however the minimal cost of potentially coercing a MarkupWriter to a MarkupWriter2 if required is incurred for each render method invoked. There is probably a better way...


> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>         Attachments: TAP-1312-diffs, TAP-1312-diffs
>
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Richard Kirby (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Kirby updated TAP5-1312:
--------------------------------

    Attachment: TAP-1312-diffs

A wee implementation of my suggestion.

I have tried to minimise the impact across the public API.

A custom component needs to cast MarkupWriter to MarkupWriter2 to access the new writeStream method. The fallback being to just create a String and use writeRaw.



> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>         Attachments: TAP-1312-diffs
>
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1312) Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter

Posted by "Richard Kirby (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Kirby updated TAP5-1312:
--------------------------------

    Attachment: TAP-1312-diffs

Added code to RenderPhaseMethodWorker to cope with render methods taking MarkupWriter2 as arguments instead of MarkupWriter.

No need for casting now - however the minimal cost of potentially coercing a MarkupWriter to a MarkupWriter2 if required is incurred for each render method invoked. There is probably a better way...


> Suggestion for a new DOM node that provides a callback at toMarkup time providing the PrintWriter
> -------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1312
>                 URL: https://issues.apache.org/jira/browse/TAP5-1312
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.2
>            Reporter: Richard Kirby
>         Attachments: TAP-1312-diffs, TAP-1312-diffs
>
>
> I would like a new org.apache.tapestry5.dom node that takes an interface which provides a callback method that is passed the PrintWriter being used when toMarkup is called.
> One usecase for this is where you want to insert a large chunk of raw text into a page that is coming from a streamable source (such as the output of a XSLT processor) and so is really not needed to be rendered into a String beforehand (which is what the MarkupWriter.writeRaw would require).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.