[Yanel-commits] rev 50217 - in public/yanel/trunk/src/realms/yanel-website/content: . documentation.xhtml.yarep

memo at wyona.com memo at wyona.com
Mon Jun 7 13:32:50 CEST 2010


Author: memo
Date: 2010-06-07 13:32:49 +0200 (Mon, 07 Jun 2010)
New Revision: 50217

Added:
   public/yanel/trunk/src/realms/yanel-website/content/d0c1e38e-07e6-4474-9578-4312f6daa9e4
Modified:
   public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml
   public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml.yarep/meta
Log:
Guillaume's documentation for custom serialization added

Added: public/yanel/trunk/src/realms/yanel-website/content/d0c1e38e-07e6-4474-9578-4312f6daa9e4
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/d0c1e38e-07e6-4474-9578-4312f6daa9e4	                        (rev 0)
+++ public/yanel/trunk/src/realms/yanel-website/content/d0c1e38e-07e6-4474-9578-4312f6daa9e4	2010-06-07 11:32:49 UTC (rev 50217)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?><html xmlns="http://www.w3.org/1999/xhtml"><head>  <title>Serialization</title>  <link rel="neutron-introspection" type="application/neutron+xml" href="?yanel.resource.usecase=introspection"/></head><body>
+<h1>Custom serialization</h1>
+<p>Ways to customize serialization in Yanel:<br /> <br /> This can be done at two levels:<br /> - in the RC files<br /> - in Java code<br /> <br /> First the following formats already exist in Yanel, so no need for  customization to use them: XHTML Strict, HTML Transitional, XML, text.<br /> <br /> <br /> <br /> To implement the following formats the following output properties must  be set:<br /> <br /> <br /> *HTML Strict*: set serializer key to HTML_TRANSITIONAL to get the base  HTML properties right, then force the public doctype to the standard  HTML Strict value: "-//W3C//DTD HTML 4.01//EN", the system doctype may  be left alone as AFAIK mainstream browsers do not care and anyway Yanel  still has a bug on that, see comment example below)<br /> <br /> Example:<br /> ---8&lt;---<br /> &lt;?xml version="1.0"?&gt;<br /> <br /> &lt;yanel:resource-config xmlns:yanel="<a href="http://www.wyona.org/yanel/rti/1.0" target="_blank">http://www.wyona.org/yanel/rti/1.0</a>"&gt;<br !
 /> &#160;[...]<br /> &#160;&lt;yanel:custom-config&gt;<br /> &#160; &#160;&lt;views xmlns="<a href="http://www.wyona.org/yanel/rti/1.0" target="_blank">http://www.wyona.org/yanel/rti/1.0</a>"&gt;<br /> &#160; &#160; &#160;&lt;view id="[...]"&gt;<br /> &#160; &#160; &#160; &#160;[...]<br /> &#160; &#160; &#160; &#160;&lt;mime-type&gt;text/html&lt;/mime-</p>
+<div id=":164" class="ii gt">type&gt;<br /> &#160; &#160; &#160; &#160;&lt;serializer key="HTML_TRANSITIONAL"&gt;<br /> &#160; &#160; &#160; &#160;&lt;!--XXX HACK: forcing the doctype manually since Yanel does  not know about HTML Strict ATM: --&gt;<br /> &#160; &#160; &#160; &#160; &#160;&lt;doctype-public&gt;-//W3C//DTD HTML  4.01//EN&lt;/doctype-public&gt;<br /> &#160; &#160; &#160; &#160; &#160;&lt;!-- does not seem to work (!?!), the system doctype is  stuck with the 'loose' value: --&gt;<br /> <br /> &lt;doctype-system&gt;<a href="http://www.w3.org/TR/html4/strict.dtd" target="_blank">http://www.w3.org/TR/html4/strict.dtd</a>&lt;/doctype-system&gt;<br /> &lt;!--<br /> &#160; &#160; &#160; &#160; &#160;&lt;indent&gt;no&lt;/indent&gt;<br /> --&gt;<br /> &#160; &#160; &#160; &#160;&lt;/serializer&gt;<br /> &#160; &#160; &#160;&lt;/view&gt;<br /> &#160; &#160; &#160;[...]<br /> &#160; &#160;&lt;/views&gt;<br /> &#160;&lt;/yanel:custom-config&gt;<br /> &lt;/yanel:resource-!
 config&gt;<br /> ---8&lt;---<br /> <br /> *XHTML Transitional*: set serializer key to XHTML_STRICT to get the base  XML properties right, then force the public doctype to the standard  XHTML Transitional value: "-//W3C//DTD XHTML 1.0 Transitional//EN", the  system doctype may remain wrong (same as above).<br /> <br /> Sadly this alone does not quite work yet because of one Yanel bug and  one missing workaround, see <a href="http://lists.wyona.org/pipermail/yanel-development/2010-June/004840.html" target="_blank">http://lists.wyona.org/pipermail/yanel-development/2010-June/004840.html</a><br /> <br /> This can however been done in Java code by overriding  #getViewDescriptor(String viewId) in every resource-type that needs the  right format, using the following helper code example:<br /> ---8&lt;---<br /> &#160; &#160;/**<br /> &#160; &#160; * Reconfigure the view to use XHTML 1.0 strict.<br /> &#160; &#160; */<br /> &#160; &#160;private static final void reconfigureViewDescr!
 iptor(ConfigurableViewDescriptor  cvd) {<br /> &#160; &#160; &!
 #160; &#
160;cvd.setMimeType("text/html");<br /> &#160; &#160; &#160; &#160;cvd.setSerializerKey(SerializerFactory.XHTML_STRICT_KEY);<br /> &#160; &#160; &#160; &#160;Properties serializerProperties = new Properties();<br /> &#160; &#160; &#160; &#160;serializerProperties.setProperty(OutputKeys.INDENT, "no");<br /> <br /> serializerProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION,  "yes");<br /> &#160; &#160; &#160; &#160;serializerProperties.setProperty(OutputKeys.ENCODING,  "UTF-8");<br /> &#160; &#160; &#160; &#160;serializerProperties.setProperty(OutputKeys.DOCTYPE_PUBLIC,  "-//W3C//DTD XHTML 1.0 Transitional//EN");<br /> &#160; &#160; &#160; &#160;serializerProperties.setProperty(OutputKeys.DOCTYPE_SYSTEM,  "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>");<br /> &#160; &#160; &#160; &#160;serializerProperties.setProperty(OutputKeys.METHOD,  "html"); //XXX HACK: needed to force r!
 oot element name in doctype  declaration, see <a href="http://lists.wyona.org/pipermail/yanel-development/2010-June/004840.html" target="_blank">http://lists.wyona.org/pipermail/yanel-development/2010-June/004840.html</a><br /> &#160; &#160; &#160; &#160;cvd.setSerializerProperties(serializerProperties);<br /> &#160; &#160;}<br /> ---8&lt;---<br /> <br /> <br /> Other interesting format may be: JSON, HTML 5, XHTML 5, etc.<br /></div>
+<p>&#160;</p>
+</body></html>
\ No newline at end of file

Modified: public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml	2010-06-07 11:32:39 UTC (rev 50216)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml	2010-06-07 11:32:49 UTC (rev 50217)
@@ -8,28 +8,28 @@
 <p><br />See also the "<a href="http://documentation.yanel.wyona.org/wiki/">scratch pad</a>" for more information. If you do not understand some terms, then please see the <a href="glossary.html">glossary</a>.</p>
 <p>&#160;</p>
 <ul>
-<li>Installation            
+<li>Installation             
 <ul>
 <li><a href="../getting-started/unix.html">Unix</a></li>
 <li><a href="../getting-started/windows.html">Windows</a></li>
 </ul>
 </li>
-<li>Tutorials                   
+<li>Tutorials                    
 <ul>
 <li><a href="tutorials/write-documentation/index.html">Writing english documentation for Yanel using Yulup</a></li>
 </ul>
 </li>
-<li>Best Practices               
+<li>Best Practices                
 <ul>
 <li><a href="best-practices/rapid-development-of-components.html">Rapid development of components</a></li>
 </ul>
 </li>
-<li>Architecture             
+<li>Architecture              
 <ul>
 <li><a href="architecture/overview.html">Overview</a></li>
 </ul>
 </li>
-<li>Realms             
+<li>Realms              
 <ul>
 <li><a href="what-is-a-realm.html">What is a realm?</a></li>
 <li><a href="how-to-add-a-new-realm.html">How to add and configure a new realm (publication/site)</a></li>
@@ -40,7 +40,7 @@
 <li><a href="realm/realm-configuration.html">Realm Configuration (realm.xml)</a></li>
 </ul>
 </li>
-<li>Resource Types            
+<li>Resource Types             
 <ul>
 <li><a href="resources/what-is-a-resource-type.html">What is a resource type</a></li>
 <li><a href="resources/using-a-resource-type.html">Registering and using a resource type</a></li>
@@ -48,11 +48,11 @@
 <li><a href="resources/rc-map.html">Resource Type Configuration Map</a></li>
 </ul>
 </li>
-<li>Development               
+<li>Development                
 <ul>
 <li><a href="configuration/build_setup.html">Setup your build environement</a></li>
 <li><a href="development/build_setup_eclipse_ide.html">Setup Yanel in Eclipse IDE</a></li>
-<li>Enhancing a resource type (CRUD: Create, Read, Update, Delete)                 
+<li>Enhancing a resource type (CRUD: Create, Read, Update, Delete)                  
 <ul>
 <li><a href="resources/viewable.html">Making a resource type Readable/Viewable</a></li>
 <li><a href="resources/creatable.html">Making a resource type Createable</a></li>
@@ -62,8 +62,9 @@
 </li>
 <li><a href="access-data-in-resourcetype.html">Access global and resource type specific data from a resource type</a></li>
 <li><a href="basic-xml-resource-type.html">BasicXMLResource</a></li>
+<li><a href="development/serialization.html">Custom serialization</a></li>
 <li><a href="executable-usecase-resource.html">ExecutableUsecaseResource</a> (stateless usecase framework)</li>
-<li>Tutorials                   
+<li>Tutorials                    
 <ul>
 <li><a href="tutorials/custom-realm/index.html">Development of a custom realm</a></li>
 <li><a href="create-new-resource.html">Create a new resource type from scratch</a></li>
@@ -74,7 +75,7 @@
 </li>
 </ul>
 </li>
-<li>Security             
+<li>Security              
 <ul>
 <li><a href="security/overview.html">Overview</a></li>
 <li><a href="security/access-policies.html">Access Control Policies</a></li>
@@ -83,12 +84,12 @@
 <li><a href="security/custom-identity-manager-custom-policy-manager.html">Custom IdentityManager, custom PolicyManager and custom WebAuthenticator<br /></a></li>
 </ul>
 </li>
-<li>Workflow             
+<li>Workflow              
 <ul>
 <li><a href="workflow/index.html">Overview</a></li>
 </ul>
 </li>
-<li>Yarep as Data Abstraction Layer             
+<li>Yarep as Data Abstraction Layer              
 <ul>
 <li><a href="svn.html">SVN</a></li>
 <li><a href="yarep/instantiation-of-repository.html">Instantiation of a Repository</a></li>
@@ -97,7 +98,7 @@
 <li><a href="yarep/yarepsearch.html">Yarep Search</a></li>
 </ul>
 </li>
-<li>Yanel Configuration            
+<li>Yanel Configuration             
 <ul>
 <li><a href="configuration/yanel_xml.html">conf/yanel.xml</a></li>
 <li><a href="configuration/realms_xml.html">conf/realms.xml</a></li>
@@ -123,7 +124,7 @@
 <li>Versioned API ...</li>
 </ul>
 </li>
-<li>Deployment             
+<li>Deployment              
 <ul>
 <li><a href="deployment/deployment_all_in_one.html">All In One</a></li>
 <li><a href="deployment/deployment-static.html">Serving Content Statically</a></li>
@@ -136,7 +137,7 @@
 <li><a href="i18n.html">Yanel and i18n</a></li>
 <li><a href="jmeter.html">JMeter</a></li>
 <li><a href="testing-framework.html">Yanel Testing Framework</a></li>
-<li>Misc                   
+<li>Misc                    
 <ul>
 <li><a href="misc/scalability.html">Scalability</a></li>
 <li><a href="misc/performance.html">Performance</a></li>

Modified: public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml.yarep/meta
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml.yarep/meta	2010-06-07 11:32:39 UTC (rev 50216)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation.xhtml.yarep/meta	2010-06-07 11:32:49 UTC (rev 50217)
@@ -1,7 +1,7 @@
-yarep_size<long>:7498
-yarep_checkinDate<date>:2010-06-02T10:35:08:925+0200
-yarep_lastModifed<long>:1275467708000
+yarep_size<long>:7589
+yarep_checkinDate<date>:2010-06-07T14:21:16:766+0200
 yarep_type<string>:resource
+yarep_lastModifed<long>:1275913276000
 yarep_checkoutUserID<string>:lenya
-yarep_checkoutDate<date>:2010-06-02T10:34:53:630+0200
 yarep_isCheckedOut<boolean>:false
+yarep_checkoutDate<date>:2010-06-07T14:20:22:714+0200



More information about the Yanel-commits mailing list