From richfaces-svn-commits at lists.jboss.org Sun Apr 3 20:05:54 2011 Content-Type: multipart/mixed; boundary="===============2274800838067996537==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22358 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directory. Date: Sun, 03 Apr 2011 20:05:53 -0400 Message-ID: <201104040005.p3405rY0016833@svn01.web.mwc.hst.phx2.redhat.com> --===============2274800838067996537== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: SeanRogers Date: 2011-04-03 20:05:53 -0400 (Sun, 03 Apr 2011) New Revision: 22358 Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exa= m-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component_= Reference.xml modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Compo= nent_Reference-Resources.xml Log: Added mediaOutput documentation: RFPL-1400 Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Com= ponent_Reference.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component= _Reference.xml 2011-04-01 15:56:54 UTC (rev 22357) +++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/Component= _Reference.xml 2011-04-04 00:05:53 UTC (rev 22358) @@ -11,9 +11,7 @@ Ajax control components - Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/cha= p-Component_Reference-Resources.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp= onent_Reference-Resources.xml 2011-04-01 15:56:54 UTC (rev 22357) +++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Comp= onent_Reference-Resources.xml 2011-04-04 00:05:53 UTC (rev 22358) @@ -192,6 +192,8 @@ --> = + + = - -
<sgmltag><a4j:mediaOutput></sgmltag> - - - - component-type: org.ajax4jsf.Push - - - - - component-class: org.ajax4jsf.compo= nent.html.AjaxPush - - - - - component-family: org.ajax4jsf.comp= onents.AjaxPush - - - - - renderer-type: org.ajax4jsf.compone= nts.AjaxPushRenderer - - - The <a4j:mediaOutput> component is used for ge= nerating images, video, sounds, and other resources defined on the fly. - - The createContent attribute points to the method use= d for generating the displayed content. If necessary, the value attribute can be used to pass input data to the content generation = method specified with createContent. The cachea= ble attribute specifies whether the resulting content will be cac= hed or not. - - - The mimeType attribute describes the type of output = content, and corresponds to the type in the header of the HTTP request. The element attribute defines X= HTML element used to display the content: - - - +
+ Basic usage + + The createContent attribute points to the method us= ed for generating the displayed content. + + + If necessary, the value attribute can be used to pa= ss input data to the content generation method specified with crea= teContent. The cacheable attribute specifies w= hether the resulting content will be cached or not. + +
+ +
+ Handling content + + The mimeType attribute describes the type of output= content, and corresponds to the type in the header of the HTTP request. The element attribute defines = XHTML element used to display the content: + + + + + img + + + + + object + + + + + applet + + + + + script + + + + + link + + + + + a + + + + + <sgmltag><a4j:mediaOutput></sgmltag> example - img + This example uses the <a4j:mediaOutput> comp= onent to generate a JPEG image of verification digits. T= he code on the application page is a single element: - - + - object + The <a4j:mediaOutput> component uses the MediaBean.paint method to create the image. The metho= d generates a random number, which is then converted into an output stream = and rendered to a JPEG image. The MediaBean class is as follows: - - + - applet + Another class, MediaData is required by the value attribute for keeping data to be used as input for t= he content creation method. The MediaData class is a= s follows: - - + - script + The <a4j:mediaOutput> component uses the MediaBean and MediaData classes = to generate a new image on each page refresh. - - + + + + + + + The generated image containing a random verification number. + + + + + + <classname>Serializable</classname> interface - link + A bean class passed using the value attribute of <= sgmltag><a4j:mediaOutput> should implement the S= erializable interface so that it will be encoded to the URL of the resource. - - - - a - - - - - <sgmltag><a4j:mediaOutput></sgmltag> example - - This example uses the <a4j:mediaOutput> compo= nent to generate a JPEG image of verification digits. Th= e code on the application page is a single element: - - = - -<a4j:mediaOutput element=3D"img" cacheable=3D"false" session=3D"false" = createContent=3D"#{mediaBean.paint}" value=3D"#{mediaData}" mimeType=3D"ima= ge/jpeg" /> - - - The <a4j:mediaOutput> component uses the MediaBean.paint method to create the image. The method= generates a random number, which is then converted into an output stream a= nd rendered to a JPEG image. The MediaBean class is as follows: - - = - - - - - Another class, MediaData is required by the value attribute for keeping data to be used as input for th= e content creation method. The MediaData class is as= follows: - - = - - - - - The <a4j:mediaOutput> component uses the MediaBean and MediaData classes t= o generate a new image on each page refresh, which appears as shown in - -
-
- <sgmltag><a4j:mediaOutput></sgmltag> example result</tit= le> - <mediaobject> - <imageobject> - <imagedata fileref=3D"images/figu-Component_Reference-a4jmediaOutpu= t-a4jmediaOutput_example_result.png" format=3D"PNG" /> - </imageobject> - <textobject> - <para> - The generated image containing a random verification number. - </para> - </textobject> - </mediaobject> - </figure> - </blockquote> - </example> - <note> - <title><classname>Serializable</classname> interface - - A bean class passed using the value attribute of <a4j:mediaOutput> should implement the Se= rializable interface so that it will be encoded to the URL of the resource. - - + +
+ +
+ Reference data + + + + component-type: org.ajax4jsf.Push<= /classname> + + + + + component-class: org.ajax4jsf.comp= onent.html.AjaxPush + + + + + component-family: org.ajax4jsf.com= ponents.AjaxPush + + + + + renderer-type: org.ajax4jsf.compon= ents.AjaxPushRenderer + + + +
- --> = = Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras= /exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/ex= am-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample = (rev 0) +++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/ex= am-Component_Reference-a4jmediaOutput-a4jmediaOutput_example.xml_sample 201= 1-04-04 00:05:53 UTC (rev 22358) @@ -0,0 +1,3 @@ + --===============2274800838067996537==--