Easy there, Paul. Nobody is lying to you. You are misunderstanding how the
Print Friendliness is being implemented in the tutorial.
I'm sure either Dan (project leader) or Ezra (2nd in command & author of the
training materials) would do a better job of explaining the materials, but
they're both busy at the CFUnited conference for the rest of this week so
I'll try to fill in for them as best as I can.
The key here is "less is more". In order to display a Print Friendly view,
we want to omit the standard HTML skin that we are wrapping around our
requests. This standard skin is being applied though "after" views in the
"templatedPage" event type, so all we need to do is to tell Model-Glue to
not include those views for print-friendly requests.
We can exclude a views section from a request by limiting the section to a
request format that does *not* match the current request format. We still
want the views included for standard requests, so the best option is to
limit the section's request format to the default request format ("html").
As long as the request contains a value for url.requestformat or
form.requestformat *other *than "html", those views will be excluded.
Note that we do *not* want to specify the format for the views section in
the "Shipment.Display" event handler because we want those views to be
included for *all* request formats.
If we needed to *add* content to the response to implement Print
Friendliness then we could add a <views format="print"> section to the event
handler or event type in ModelGlue.xml. However in this particular case it
is not necessary: simply omitting the standard HTML layout is sufficient.
If you need further assistance, please provide what you have for
ModelGlue.xml and Display.Shipment.cfm via http://modelglue.pastebin.com/ so
we can see we're you're at and show you what you need to change to make it
work.
Regards,
-- Dennis
On Wed, Jul 28, 2010 at 4:20 AM, Paul Milleson <[email protected]>wrote:
> If a views block has a format attribute, we match it to the requestformat
> value.
> <views format="html">
> If a views block does NOT have a format attribute, we render it. (Since
> there are no exclusions or filtering indicated).
> <views>
>
> *precisely, so this page:*
> http://docs.model-glue.com/wiki/Training/Section04* is dropping the ball
> completely.*
>
> *we are being instructed to create a new requestformat value to use for
> printing as follows:*
>
>
> 1. We will now add in a request format URL parameter to the link.
> Append the following to the link:
>
> view plain <http://docs.model-glue.com/wiki/Training/Section04#>copy to
> clipboard
> <http://docs.model-glue.com/wiki/Training/Section04#>print<http://docs.model-glue.com/wiki/Training/Section04#>
> ? <http://docs.model-glue.com/wiki/Training/Section04#>
>
> 1. &requestformat=print
>
> *then we are told to:*
>
>
> 1. Next, open /PlantOMatic/config/ModelGlue.xml and find <event-types>.
> Add a new attribute to the <views> tag called format and assign the value
> of
> html.
>
> view plain <http://docs.model-glue.com/wiki/Training/Section04#>copy to
> clipboard
> <http://docs.model-glue.com/wiki/Training/Section04#>print<http://docs.model-glue.com/wiki/Training/Section04#>
> ? <http://docs.model-glue.com/wiki/Training/Section04#>
>
> 1. <views format="html">
>
> *AND THAT IS ALL THAT WE'RE BEING TOLD TO DO - PERIOD - END OF EDITS ! We
> are not told to make an additional section where we just have a <view> tag
> by itself (as you indicated), nor are we being told to make a new view
> section (*<views format="print">*) with special omissions which would
> allow the popup print page to render without the header and footer... so
> when we are shown the example of how our print page now pops up, we are
> being lied to (because we've done nothing to make it behave in this way).
> *
> *
> *
> *And when the text makes this claim, we are also being lied to:*
> *
> *
> *We excluded the Navigation, Footer and Master.Layout.cfm content through
> the use of the requestformat URL parameter and format attribute on our
> templatedPage Event Type.*
> *
> *
> *because we did nothing of the sort... the ball was dropped several lines
> above and no editing instructions were given that would accomplish any of
> this.*
> *
> *
> *but the edit that was skipped is simple, and all that's lacking is
> instructions to add the missing section in here: *
> /PlantOMatic/config/ModelGlue.xml
> *
> *
> <event-handler name="Shipment.Display" type="templatedPage">
> <broadcasts> <message name="needShipmentDetail" /> </broadcasts> <views
> format="html"> <include name="primary" template="Display.Shipment.cfm">
> <value name="xe_ShipmentList" value="Shipment.List" /> <value
> name="xe_ItemForm" value="Item.Form" /> <value name="xe_ShipmentDisplay"
> value="Shipment.Display" /> <value name="xe_ItemRemove"
> value="doItem.Remove" /> </include> </views> * <views format="print">
> <include name="main" template="Print.Layout.cfm" /> </views> *
> *...*
> *with a new additional page: /views/Print.Layout.cfm with the following
> code:*
> *
> *
> *<h3>#ShipmentDetail.name#</h3>*
> *<a href="#linkShipment#">Back to List</a>*
> *<table class="feature">*
> * **<caption><form action="#linkItemForm#" method="post"><input
> type="submit" name="New Item" value="New Item"></form></caption>*
> * **<thead>*
> * **<tr>*
> * **<th> </th>*
> * **<th> </th>*
> * **<th>Count Available</th>*
> * **<th>Size</th>*
> * **<th>Date Available</th>*
> * **<th> </th>** *
> * **</tr>*
> * **</thead>*
> * **<tbody>*
> * **<cfloop query="ShipmentDetail">*
> * **<tr <cfif ShipmentDetail.RecordCount MOD 2 IS 0>class="even"</cfif>>*
> * **<td><a href="#linkItemForm#&ItemID=#ItemID#">Change</a></td>*
> * **<td>#commonname#</td>*
> * **<td class="numeric">#Quantity#</td>*
> * **<td>#Size#</td>*
> * **<td>#DateAvailable#</td>*
> * **<td><a href="#linkItemRemove#&ItemID=#ItemID#">Remove</a></td>*
> * **</tr>*
> * **</cfloop>*
> * **</tbody>*
> *</table>*
> *
> *
> *burma shave*
> *
> *
> On Thu, Jul 22, 2010 at 5:00 AM, Dan Wilson <[email protected]> wrote:
>
>> Paul,
>>
>> I think I see the disconnect now. The way formats work is like this.
>>
>> If you do not pass a requestformat variable, we default the value to html
>> ( http://docs.model-glue.com/wiki/HowTos/HowToUseFormats#Formats )
>>
>> If a views block has a format attribute, we match it to the requestformat
>> value.
>>
>> <views format="html">
>>
>> If a views block does NOT have a format attribute, we render it. (Since
>> there are no exclusions or filtering indicated).
>>
>> <views>
>>
>> By the way, have you been building the training application as part of
>> the process or have you just been trying to read along?
>>
>>
>> DW
>>
>>
>>
>>
>>
>> On Thu, Jul 22, 2010 at 1:29 AM, Paul Milleson
>> <[email protected]>wrote:
>>
>>> correction, green hyperlinks on a white background... (not on black) if
>>> there is a navigation path that i missed which reveals the attached, please
>>> advise ?
>>>
>>>
>>>
>>> On Wed, Jul 21, 2010 at 2:16 AM, Paul <[email protected]> wrote:
>>>
>>>> Has anyone noticed that in the Model Glue training section 4 where
>>>> there are supposed to be instructions for setting up and making a
>>>> printer ready page that uses a <views format="print"> - calling a
>>>> section where the header and footer are excluded - that the example
>>>> never goes on to show how to make this section ?
>>>>
>>>> Paul
>>>
>>>
>>> --
>>> Model-Glue Sites:
>>> Home Page: http://www.model-glue.com
>>> Documentation: http://docs.model-glue.com
>>> Bug Tracker: http://bugs.model-glue.com
>>> Blog: http://www.model-glue.com/blog
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "model-glue" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]<model-glue%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/group/model-glue?hl=en
>>>
>>
>>
>>
>> --
>> William Osler - "We are here to add what we can to life, not to get what
>> we can from life."
>>
>> --
>> Model-Glue Sites:
>> Home Page: http://www.model-glue.com
>> Documentation: http://docs.model-glue.com
>> Bug Tracker: http://bugs.model-glue.com
>> Blog: http://www.model-glue.com/blog
>>
>> You received this message because you are subscribed to the Google
>> Groups "model-glue" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<model-glue%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/model-glue?hl=en
>>
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<model-glue%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en
>
--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en