View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Controller_Action_Helper_ContentNegotiation - Matthew Turland
{zone-data}

{zone-data:proposer-list}
[Matthew Turland|mailto:matt@ishouldbecoding.com]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 17 September 2008: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Controller_Action_Helper_ContentNegotiation is an action helper for facilitating content negotiation, which is useful for developing RESTful web services and web applications in general when requested resources may have multiple potential representations.
{zone-data}

{zone-data:references}
* [HTTP/1.1: Content Negotiation|http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html]
* [Content Negotiation - Apache HTTP Server|http://httpd.apache.org/docs/2.2/content-negotiation.html]
* [RFC 2295 - Transparent Content Negotiation in HTTP|http://tools.ietf.org/html/rfc2295]
{zone-data}

{zone-data:requirements}
* This component *will* evaluate any Accept header included in the application request, accept manual additions of server-supported content types, and optionally integrates with Zend_Controller_Action_Helper_ContextSwitch to obtain those types if it is in use.
* This component *will* evaluate any Accept-Language included in the application request, accept manual additions of server-supported languages, and optionally integrates with Zend_Locale to determine the current language in use by the application.
* This component *will* evaluate any Accept-Charset header included in the application request, accept manual additions of server-supported character sets, and optionally integrate with Zend_View to determine the current character encoding in use by the application.
* This component *will* evaluate any Accept-Encoding header included in the application request, accept a manual specification of a server-supported content encoding, and use a Zend_View output filter to apply the selected encoding algorithm.
* This component *will not* provide feature negotiation features described in RFC 2295 and 2296 in its initial iteration. These features *may* be added in the future depending on demand.
{zone-data}

{zone-data:dependencies}
* Zend_Controller_Action_Helper_Abstract
* Zend_Controller_Action_Helper_ContextSwitch (optional)
* Zend_Locale (optional)
* Zend_View
{zone-data}

{zone-data:operation}
User accesses the action helper normally through the helper broker within the action controller preDispatch hook method and explicitly provides any custom configuration settings. These include content types, languages, character sets, and content encoding. In the absence of custom configuration, optional integration with other components with other components is used to infer values. The action helper will then apply all necessary modifications to the response headers and view.
{zone-data}

{zone-data:milestones}
* Milestone 1: [Design notes will be published here|http://framework.zend.com/wiki/x/sg].
* Milestone 2: Working prototype checked into the incubator supporting use cases.
* Milestone 3: Unit tests exist, work, and are checked into SVN.
* Milestone 4: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend_Controller_Action_Helper_ContentNegotiation
{zone-data}

{zone-data:use-cases}
||UC-01||

... (see good use cases book)
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Controller_Action_Helper_ContentNegotiation extends Zend_Controller_Action_Helper_Abstract {
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>