You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Apache Wiki <wi...@apache.org> on 2005/05/14 23:00:26 UTC

[Lenya Wiki] Update of "WyonaXopusEditor" by GregorRothfuss

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.

The following page has been changed by GregorRothfuss:
http://wiki.apache.org/lenya/WyonaXopusEditor

The comment on the change is:
obsolete

------------------------------------------------------------------------------
+ deleted
-         <p>The <fork href="http://www.q42.nl/products/xopus/">Xopus 
-         Wysiwyg XML Editor</fork> allows to edit the content of XML files
-         transparently within the Web browser, without confronting the user with 
-         xml/xsl tags. It is currently tested to work with IE 5.5 and IE 6.0.</p> 
-   
-         <p>Xopus communicates with the http server through a series of requests, 
-         and expects the server to return appropriate responses. The structure
-         and content of these requests and responses is defined and explained below.
-         To integrate Xopus into the Cocoon environment, we need to implement an 
-         interface to handle those requests.</p>
- 	</section>
- 	
- 	
- 	<anchor id="req-resp"/>
- 	<section><title>Xopus requests and responses (the interface)</title>
-           
-         <p>The requests Xopus sends to the server and the responses it expects are
-         valid xml streams according to the definitions below.</p>
-   
-         	<anchor id="open-file"/>
-             	<section><title>Opening a file for editing</title>
-             
-             	<p>Xopus uses 3 requests to get the contents 
-             	of the corresponding xml, xsl and xsd files for the content to be edited. 
-             	This file trio follows the well-known MVC (Model-View-Controller) pattern:</p>
-             
-             	<table>
-               	<tr>
-                 <th>File Type</th>
-                 <th>Extension</th>
-                 <th>Function</th>
-              	</tr>
-              	<tr>
-                 <td><link href="http://www.w3.org/XML/" >XML File</link></td>
-                 <td>.xml</td>
-                 <td>Model</td>
-               	</tr>
-               	<tr>
-                 <td><link href="http://www.w3.org/Style/XSL/" >Stylesheet</link></td>
-                 <td>.xsl</td>
-                 <td>View</td>
-               	</tr>
-               	<tr>
-                 <td><link href="http://www.w3.org/XML/Schema" >Schema</link></td>
-                 <td>.xsd</td>
-                 <td>Controller</td>
-               	</tr>
-             	</table>
-             
-             	<p>The <code> &lt;request&gt; </code> element has always the attribute 
-             	<code> type="open"</code>, while the <code> &lt;data&gt;</code> elements,
-             	which are children of the <code> &lt;request&gt;</code> elements, 
-             	have the attributes <code> type="xml||xsl||xsd"</code>, respectively.</p>
-             
-             	<p>For each of these requests, Xopus expects the "right" responses
-             	from the server. These responses are always enclosed in 
-             	<code>&lt;response&gt;</code> tags, and should have the same id 
-             	as the requests, and an attibute <code>status="ok"</code>. In case of an error,
-             	the status attribute will be set to "error" and return an error
-             	message.</p>
-         
-             	<p>After the formal <jump href="xopus.html#def_open">definition</jump> of the "open file" dialog,
-             	there is a (still somewhat generic) <link href="#xmp_open">example</link> to demonstrate 
-             	the use of this interface.</p>
-         
-             	
- 			<anchor id="def_open"/>
-               		<section><title>Interface definition for the open file dialog</title>
-             
-             		<p>Here, we are defining the xml structure of the dialog between Xopus and the server 
-             		for opening a file for editing. We have 3 requests, and 3 corresponding responses, that have to
-             		be exchanged in this order:</p>
-             
-             		<ol>
-               		<li>Request for xml file (Xopus to Server)</li>
-               		<li>Response returning xml file (Server to Xopus)</li>
-               		<li>Request for xsl file (Xopus to Server)</li>
-               		<li>Response returning xsl file (Server to Xopus)</li>
-               		<li>Request for xsd file (Xopus to Server)</li>
-               		<li>Response returning xsd file (Server to Xopus)</li>
-             		</ol>
-             
-             		<p>The structure of these requests and responses is defined as:
-             
-             		<em>Request messages (Xopus to Server)</em></p>
-             		<source><!xsl||xsd"                           <em><!-- One request for each type of data --></em>]></source>
-             <p>
-             		<em>Response messages (Server to Xopus)</em></p>
-             		<source><!xsl||xsd">                       <em><!-- Same type as the request --></em>]></source>
-               		</section>
-               		
- 			<anchor id="xmp_open"/>
-               		<section><title>Implementation Example</title>
-             
-            	 	<p>When everything goes well, i.e. no errors occur, the exchange between
-             		Xopus and the server looks like the following example:</p>
-             
-             		<ol>
-               		<li><jump href="xopus.html#req-01">Request 1 (Xopus to Server)</jump></li>
-               		<li><jump href="xopus.html#rsp-01">Response 1 (Server to Xopus)</jump></li>
-               		<li><jump href="xopus.html#req-02">Request 2 (Xopus to Server)</jump></li>
-               		<li><jump href="xopus.html#rsp-02">Response 2 (Server to Xopus)</jump></li>
-               		<li><jump href="xopus.html#req-03">Request 3 (Xopus to Server)</jump></li>
-               		<li><jump href="xopus.html#rsp-03">Response 3 (Server to Xopus)</jump></li>
-             		</ol>
-             
-             			<anchor id="req-01"/>
-             			<p><em>Xopus (Request 1):</em></p>
-             			<source><![CDATA[<requesttype="open"id="req_somepath/somedoc.xml_someid"><datatype="xml"id="somepath/somedoc.xml"></data></request>]]></source>
-             			
- 				<anchor id="rsp-01"/>
-             			<p><em>Server (Response 1):</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             
-             			<anchor id="req-02"/>
-             			<p><em>Xopus (Request 2):</em></p>
-             			<source><![CDATA[<requesttype="open"id="req_somepath/somestylesheet.xsl_somenewid"><datatype="xml"id="somepath/somestylesheet.xsl"></data></request>]]></source>
-             
-             			<anchor id="rsp-02"/>
-             			<p><em>Server (Response 2):</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             
-             			<anchor id="req-03"/>
-             			<p><em>Xopus (Request 3):</em></p>
-             			<source><![CDATA[<requesttype="open"id="req_someschema.xsd_someotherid"><datatype="xsd"id="someschema.xsd"></data></request>]]></source>
-             
-             			<anchor id="rsp-03"/>
-             			<p><em>Server (Response 3):</em></p>
-             			<source><![http://www.w3.org/xlink">]]><![CDATA[del="closed"name="Meta"><grouporder="seq"><elementmaxOccurs="1"minOccurs="1"type="!ErscheinungsDatum"/><element maxOccurs="1" minOccurs="1" type="!ZeitungsRessort"/><element maxOccurs="1" minOccurs="1" type="!OnlineRessort"/></group></!ElementType>.........<em><!--Furtherdefinitionsskippedtoimprovereadability--></em>......</Schema></data></response>]]></source>
-             
- 	    			</section>
- 	    
-             			<section><title>Exception Handling</title>
-  
-             			<p><em>Error (Request for an xml File):</em></p>
-             			<p>When the xml-file is already checked out by another user, the response looks like :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             
-             			<p><em>Error (Bad data type requested):</em></p>
-             			<p>When the data type isn't one of xml, xsl or xsd:</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p><em>Error (All Requests):</em></p>
-             			<p>When the identity of the user isn't defined, the response looks like :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When we couldn't detemine the filename for request :</p>
-            			 <source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When the file doesn't exist:</p>
-            			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>An other error occurs</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
- 	    			</section>
- 	  	
- 			</section>
-           	
- 			<anchor id="checkin-file"/>
-           		<section><title>Checking in the file when finished editing</title>
-            
-             
-             		<p>At the end of the editing session, when the user clicks on "close", Xopus places a
-             		single request containing the new contents of the edited xml file. As the stylesheet 
-             		and the schema are not modified during editing, there are no requests for the updating
-             		of these.</p>
-             
-             		<p>Again, here is the <jump href="xopus.html#def_checkin">interface definition</jump> and an 
- 			<jump href="xopus.html#xmp_checkin">example</jump> for the implementation.</p>            
-             
-             			<anchor id="def_checkin"/>
-               			<section><title>Interface definition for the checkin file dialog</title>
-             
-             			<p><em>Request message (Xopus to Server)</em></p>
-             			<source><![CDATA[<requesttype="checkin"id="req_<em>path/filename</em>_<em>id</em>"><datatype="xml"<em><!--Onlyxmlfileischeckedbackin--></em>id=<em>path/filename</em>><em>Contentoftheeditor(currentstateofpath/filename)</em></data></request>]]></source>
-             
-             			<p><em>Response message (Server to Xopus)</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
- 	    
-             			</section>
- 	    
-             			<anchor id="xmp_checkin"/>
-               			<section><title>Implementation Example</title>
-            
-             
-             			<p>When everything goes well, i.e. no errors occur, the exchange between
-             			Xopus and the server looks like the following example:</p>
-             
-             			<p><em>Xopus (Request):</em></p>
-             			<source><![CDATA[<requesttype="checkin"id="req_2002/01/17/al/newzzCWKQDEV5-12.nzzoml_1014216332805"><datatype="xml"id="2002/01/17/al/newzzCWKQDEV5-12.nzzoml"><!BerichtId="newzz-2002.01.17-al-newzzCWKQDEV5-12"><id>2002/01/17/al/newzzCWKQDEV5-12</id><Meta><!ErscheinungsDatum><Jahr>2002</Jahr>----snip----</!ErscheinungsDatum>----snip----</Meta><Content>----snip----</Content>----snip----</Bericht></data></request>]]></source>
-             
-             			<p><em>Server (Response):</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
  
- 	    			</section>
- 	    
-               			<section><title>Exception Handling</title>
-             			<p>When the file couldn't be checked in because user Lala already 
- 				checked out the document, the response looks like :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When the identity of the user isn't defined, the response looks like :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When we couldn't detemine the filename for request :</p>
-             			<source><![http://www.w3.org/xlink">]]><![CDATA["1"><title>Aninternalerrorhasoccurred:</title><message>!Caught exception in dispatch Request():Unable to determine filename for request</message></error></response>]]></source>
-  
- 				</section>
-  
-             			<anchor id="save-file"/>
-               			<section><title>Save file temporarily while continuing editing</title>
-             
-             			<p>This request/response pair performs a temporary save of the file being edited. 
-             			From the interface point of view, the only difference to the "checkin" transaction
-             			is the <code>type</code> attribute, which is set to <code>type="save"</code>.</p>
-                         
-               			</section>
-             
- 	    			<anchor id="def_save"/>
-               			<section><title>Interface definition for the save file dialog</title>
-             
-             
-             			<p><em>Request message (Xopus to Server)</em></p>
-             			<source><![CDATA[<requesttype="save"id="req_<em>path/filename</em>_<em>id</em>"><datatype="xml"<em><!--Onlyxmlfileissaved--></em>id=<em>path/filename</em>><em>Contentoftheeditor(currentstateofpath/filename)</em></data></request>]]></source>
-             
-             			<p><em>Response message (Server to Xopus)</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-              			
- 				</section>
- 	      
- 	      			<section><title>Exception Handling</title>
-             			<p>When we couldn't write the file :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When the file hasn't a root element:</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-             			
- 				<p>When we couldn't detemine the filename for request :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
- 	     			
- 				</section>
- 				
- 	  		</section>
-             
- 	    		<anchor id="corr-file"/>
-               		<section><title>Have the content spellchecked while continuing editing</title>
-             
-             
-             		<p>This request/response pair performs a spellcheck of the file being edited. 
-             		For this transaction, the <code>type</code> attribute is set to 
-             		<code>type="checkspelling"</code>, and the misspelled words are surrounded by
-             		<code>&lt;span class="spell_error_xopus"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;</code> tags in
-             		the server's response (see <jump href="xopus.html#xmp_corr">example</jump> below.</p>
-             
-             			<anchor id="def_corr"/>
-               			<section><title>Interface definition for the spellcheck file dialog</title>
-             
-             			<p><em>Request message (Xopus to Server)</em></p>
-             			<source><![CDATA[<requesttype="checkspelling"id="req_<em>path/filename</em>_<em>id</em>"><datatype="xml"id=<em>path/filename</em>><em>Contentoftheeditor(currentstateofpath/filename)</em></data></request>]]></source>
-             
-             			<p><em>Response message (Server to Xopus)</em></p>
-             			<source><![http://www.w3.org/xlink">]]></source>
-            
- 	   			</section>
- 	   
-             			<anchor id="xmp_corr"/>
-               			<section><title>Implementation example</title>
- 
- 			        <p>When everything goes well, i.e. no errors occur, the exchange between
-             			Xopus and the server looks like the following example:</p>
-             
-             			<p><em>Xopus (Request):</em></p>
-             
-             			<source><![http:/www.w3.org/xlink"]]></source>
-             
-             			<p><em>Server (Response):</em></p>
- 
-             			<source><![http://www.w3.org/xlink">]]></source>
- 	    
- 	      			</section>
-               
- 	      			<section><title>Exception Handling</title>
- 
-             			<p>When no spell checker is defined :</p>
-             			<source><![http://www.w3.org/xlink">]]></source>
- 	      			</section>
-             
- 	    		</section>
- 	    
- 	    		<anchor id="exception"/>
-               		<section><title>Exception handling</title>
-            
-             		<p>When the request type is unknown, the response looks like:</p>                                                   
-             		<source><![CDATA[<responsestatus="error"]]><![http://www.w3.org/xlink">]]></source>
- 
-             		<p>When an other exception occurs, the response looks like:</p>
-             		<source><![http://www.w3.org/xlink">]]></source>
- 	  		
- 			</section>
- 		</section>
- 
- 
- 
-       		<anchor id="navigation_bar"/>
-       		<section><title>Navigation Bar and Edit/Open Button</title>
-       
-       		<p>The Xopus navigation bar can be modified by editing the stylesheet <code> xopus.xsl</code> (Currently located at
-       		<code>resources/html/scratchpad/xopus/stylesheets</code>).
-       		The Edit/Open Button can be modified by editing the Javascript function create!EditButton within
-       		the script <code> PREFIX/tomcat/webapps/ROOT/xps/xopus/init.js</code>.
-       		</p>
- 		</section>
- 
- 		
-       		<anchor id="locationXopus"/>
- 		<section><title>Location of Xopus</title>
-       		<p>Because Xopus is not Open Source yet, you won't find it within the snapshot
-       		or CVS. You will have to ask <link href="http://www.q42.nl">Q42</link> to receive a version.
-       		If you have a version, then you have to place it within the ROOT directory of Tomcat, i.e.
-       		<code>PREFIX/tomcat/webapps/ROOT/xps/xopus</code>.
-       		</p>
- 		</section>
- 
- 		
-       		<anchor id="confRequestURL"/>
- 		<section><title>Configuration of requested URL by the client Xopus</title>
-       		<p>The requested URL is configured within two files:
-       		<br/>
-       		<code>PREFIX/tomcat/webapps/ROOT/xps/xopus/init.js</code>
-       		<br/>
-       		<code>PREFIX/tomcat/webapps/ROOT/xps/xopus/logic/index.js</code>
-       		<br/>
-       		For the time being it is <code>/lenya/ethz-mat/xopus/!XopusInterface</code>
-       		</p>
-      		</section>
- 
-       		<anchor id="setupCms"/>
- 		<section><title>Setting up the Lenya CMS for Xopus</title>
-        		<ol>
-           	<li>
-             	Route all Xopus requests to the handler<br/>
- 		For this purpose, we are sending all requests matching "xopus/**" to a subsitemap, 
-             	called <code>xopus.xmap</code>, where they are first routed through
-             	an action, the <code>!XopusHandlerAction</code>.
- 		</li>
-           	<li>
-             	Handle the requests<br/>
-             	The handler is responsible for decoding the attributes of
-             	the request and supplying them to the sitemap, and for handling file operations (i.e. saving), 
-             	when needed. Check out the source source for more info.
-           	</li>
-           	<li>
-             	Provide the responses to Xopus<br/>
-             	Using the request parameters (supplied by the handler), the response 
-             	to Xopus is formatted through a generic stylesheet, <code>xopus_resp.xsl</code>.
-           	</li>
-         	</ol>
-      		</section> 
-       
-       
-       		<anchor id="hookers"/>
-         	<section><title>Hooking Xopus to an existing page</title>
-         	<p>To make a page of a publication available for editing with Xopus, follow the
-         	example of the Department page of the ETHZ-Mat publication:</p>
-         	<ol>
-           	<li>
-             	Create <code>main_xopus.xsl</code><br/>
-             	Make a copy of the existing <code>main.xsl</code> and change the include statement for 
-             	<code>root.xsl</code> to <code>root_xopus.xsl</code>.
-           	</li>
-           	<li>
-             	Edit the authoring (protected) sitemap<br/>
-             	Change the authoring stylesheet for the page to another version. Don't forget to check 
-             	for the browser first, Xopus works only with IE 5.5 or later! <br/>
-             	For an example, look at the Department Authoring snippet, where the 
-             	<code>stylesheets/ethz/mat/Department/authoring/main.xsl</code> stylesheet
-            	is replaced by <code>stylesheets/ethz/mat/Department/authoring/main_xopus.xsl</code>.
-           	</li>
-           	<li>
-             	Edit <code>body.xsl</code><br/>
-                 Add the call to Xopus to the element of the page that you want to edit. The easiest way to do this
-             	is to enwrap the portion that you want to make editable in a <code>&lt;div ...&gt;...&lt;/div&gt;</code>
-             	statement containing the specific attributes to call Xopus. For example:
-             	<code><![CDATA[<divid_xopus="dept"xml_xopus="index.xml"xsl_xopus="Department/Edit/xopus.xsl"xsd_xopus="department.xsd"><spanclass="CONTALBLETITLE">Chairman</span><tableborder="1"cellspacing="0"cellpadding="2"><tr><td><aclass="CONTABLELINK"href="">Department</link></td><td><aclass="CONTABLELINK"href="mailto:{chairman/email}"><xsl:value-ofselect="chairman/name"/></link></td><td><aclass="CONTABLELINK"href="mailto:{chairman/email}"><xsl:value-ofselect="chairman/email"/></link></td></tr></table></div>]]></code> 
- The file paths must be relative to the "root paths" for each filetype, as defined in the 
-             <code>xopus.xmap</code> for the <code>xopushandler</code>. Also, do not use template calls in this
-             stylesheet, as Xopus does not seem to handle those well.
-           	</li>
-           	<li>
-             	Create the schema<br/>
-             	For an example, see <code>config/doctypes/schemas/department.xsd</code>.
-           	</li>
-         	</ol>
-   		</section>
- 
- 
- Xopus has been developed originally by Lon Boonen and Kars Veling from <link href="http://www.q42.nl">Q42</link>.
- The project is hosted at <link href="http://www.xopus.org">http://www.xopus.org</link>.
- </p>
- </section>
- 
- 
- <section><title>Browser Requirements and Remarks</title>
- <section><title>Mozilla</title>
- <p>
- You need Mozilla 1.0 (at least Release Candidate 3) to run Xopus on Windows and Mac OS X.
- When you have opened a Document which you want to edit, then type F7 to turn on caret mode, which
- allows you to edit text within the Browser Window.
- </p>
- </section>
- 
- 
- <section><title>Microsoft's Internet Explorer</title>
- <p>
- On Windows you need IE5.5 or IE6.x and you have to install MSXML4.0 from Microsoft.
- To install MSXML4.0 you can click <link href="http://www.lenya.org/msxml4/index.html">here</link>.
- Unfortunately IE does NOT work on Mac OS X.
- </p>
- </section>
- </section>
- 
- 
- <section><title>Open/Edit and Save</title>
- <p>
- The Open/Edit and Save functionality are implemented by the javascript "xopusPlugins/databasedriver.js".
- This Read/Write interface is initialized within the javascript "xopus/xopus.js".
- Lenya has its own implementation of the databasedriver, which allows to read from and write
- to the server via HTTP POST and XML.
- </p>
- <section><title>Xopus Default Driver</title>
- <p>
- Open/Edit is done by HTTP GET requests.
- </p>
- <p>
- How does Save work?
- </p>
- </section>
- <section><title>Lenya Driver</title>
- <p>
- The Lenya databasedriver reads from and writes to the server via HTTP POST and XML.
- More information on the exchanged XML can be found at <link href="xopus.html#req-resp">here</link>.
- </p>
- <p>
- HTML which tells the Browser to load Xopus and the required data (XML, XSLT, XSD):</p>
- <source><![CDATA[<html><head><scriptlanguage="javascript"src="{$xopus_prefix}/xopus/xopus.js">;</script><scriptlanguage="javascript">xopus_consts.LENYA_CMS_URL="<xsl:value-ofselect="$context_pubprefix"/>/xopus/!XopusInterface";</script>...</head><body>...</body></html>]]></source>
- <p>where for instance $xopus_prefix=/software and $context_pubprefix=/lenya/unipublic
- </p>
- <p>
- Sitemap Component:
- org.apache.lenya.cms.cocoon.acting.!XopusHandlerAction</p>
- <source><![CDATA[<map:actionname="xopushandler"src="org.apache.lenya.cms.cocoon.acting.!XopusHandlerAction"logger="sitemap.action.xopus-handler"><xmlhref="content/authoring"/><xslhref="stylesheets/publication"/><xsdhref="config/doctypes/schemas"/><temphref="temp"/></map:action>]]></source>
- <p>
- Sitemap Pipeline:</p>
- <source><![CDATA[<map:pipeline><map:match pattern="!XopusInterface"><map:acttype="xopushandler"><map:generatesrc="{reqFilePath}"/><map:transformsrc="../../xslt/xopus/response.xsl"><map:parametername="reqId"value="{reqId}"/><map:parametername="reqType"value="{reqType}"/><map:parametername="reqFile"value="{reqFile}"/><map:parametername="fileType"value="{fileType}"/></map:transform><map:serializetype="xml"/></map:act><map:generatesrc="../../content/xopus/error.xml"/><map:serializetype="xml"/></map:match><!--Errorhandling--><map:handle-errors><map:transformsrc="context://stylesheets/system/error2html.xsl"/><map:serializestatus-code="500"/></map:handle-errors></map:pipeline>]]></source>
- <p>
- FIXME:
- org.apache.lenya.cms.cocoon.acting.!XopusHandlerAction: root.get!FirstChild() doesn't work if the Client (Browser Editor) sends white space and line breaks between two elements. There's no problem with Xopusection actually, but the problem occured with the Bitflux editor, although it has been fixed in the case of the Bitflux editor. But it should be fixed nevertheless!
- </p>
- </section>
-     </section>
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org