[seam-commits] Seam SVN: r9858 - trunk/doc/Seam_Reference_Guide/en-US.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sat Jan 3 19:15:12 EST 2009


Author: danielc.roth
Date: 2009-01-03 19:15:12 -0500 (Sat, 03 Jan 2009)
New Revision: 9858

Modified:
   trunk/doc/Seam_Reference_Guide/en-US/Controls.xml
Log:
JBSEAM-1350 Docs

Modified: trunk/doc/Seam_Reference_Guide/en-US/Controls.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Controls.xml	2009-01-03 12:21:16 UTC (rev 9857)
+++ trunk/doc/Seam_Reference_Guide/en-US/Controls.xml	2009-01-04 00:15:12 UTC (rev 9858)
@@ -1133,6 +1133,93 @@
          </section>
 
          <section>
+            <title><literal>&lt;s:resource&gt;</literal></title>
+ 
+            <para><emphasis>Description</emphasis></para>
+            <para>
+			A tag that acts a file download provider. It must be alone in the JSF page.
+			To be able to use this contol, web.xml must be set up as follows.
+            </para>
+
+            <para><emphasis>Configuration</emphasis></para>
+			
+            <programlisting role="XML"><![CDATA[<servlet>
+   <servlet-name>Document Store Servlet</servlet-name>
+   <servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>
+</servlet>
+<servlet-mapping>
+   <servlet-name>Document Store Servlet</servlet-name>
+   <url-pattern>/seam/docstore/*</url-pattern>
+</servlet-mapping>
+]]></programlisting>
+				
+
+            <para><emphasis>Attributes</emphasis></para>
+            <itemizedlist>
+               <listitem>
+                  <para>
+                     <literal>data</literal> &#8212; Data that should be downloaded.
+					 May be a java.util.File, an InputStream or a byte array.
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>
+                     <literal>fileName</literal> &#8212; Filename of the file to be served
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>
+                     <literal>contentType</literal> &#8212; content type of the file to be downloaded
+                  </para>
+               </listitem>
+               <listitem>
+                  <para>
+                     <literal>disposition</literal> &#8212; disposition to use. Default is inline
+                  </para>
+               </listitem>			   
+            </itemizedlist>			
+
+            <para><emphasis>Usage</emphasis></para>
+			<para>Here is an example on how to use the tag:</para>
+            <programlisting role="XHTML"><![CDATA[<s:resource xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:s="http://jboss.com/products/seam/taglib"
+	data="#{resources.data}"
+	contentType="#{resources.contentType}"
+	fileName="#{resources.fileName}" />
+]]></programlisting>		
+		    
+			<para>The bean named <literal>resources</literal> is some backing bean that given
+			some request parameters servers a specific file, see <literal>s:download</literal>.</para>			
+			</section>
+		 
+		 <section>
+		    <title><literal>&lt;s:download&gt;</literal></title>
+            <para><emphasis>Description</emphasis></para>
+            <para>Builds a RESTful link to a <literal>&lt;s:resource&gt;</literal>.
+				Nested <literal>f:param</literal> build up the url.
+			</para>
+
+
+            <itemizedlist>
+               <listitem>
+                  <para>
+                     <literal>src</literal> &#8212; Resource file serving files.
+                  </para>
+               </listitem>
+			</itemizedlist>		
+		 
+            <para><emphasis>Attributes</emphasis></para>
+            <programlisting role="XHTML"><![CDATA[<s:download src="/resources.xhtml">
+    <f:param name="fileId" value="#{someBean.downloadableFileId}"/>
+</s:download>]]></programlisting>			
+
+			<para>
+				Will produce something like: 
+				<literal><![CDATA[http://localhost/resources.seam?fileId=1]]></literal>
+			</para>		 
+		 </section>
+		 
+         <section>
             <title><literal>&lt;s:graphicImage&gt;</literal></title>
  
             <para><emphasis>Description</emphasis></para>




More information about the seam-commits mailing list