| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 1999-2004 The Apache Software Foundation |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <!-- $Id: checkout.xml 55543 2004-10-26 00:14:59Z gregor $ --> |
| |
| <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd"> |
| |
| <document> |
| <header> |
| <title>Reserved Checkout</title> |
| |
| |
| |
| </header> |
| |
| <body> |
| |
| <section> |
| <title>Revision Controller</title> |
| <p>To check out a file call the method :</p> |
| <source>org.apache.lenya.cms.rc.RevisionController.reservedCheckOut(String source, String identity)</source> |
| <p>where the source is the path of the file from the publication and the identity is the identity of the user.</p> |
| <p>This method is called from the ReservedCheckoutAction.</p> |
| </section> |
| |
| <section> |
| <title>The ReservedCheckoutAction</title> |
| <p>To invoke a reserved check out from a sitemap pipeline, you use The ReservedCheckoutAction.</p> |
| <source><![CDATA[ |
| |
| <map:components> |
| ... |
| <map:actions> |
| <map:action name="reserved-checkout" src="org.apache.lenya.cms.cocoon.acting.ReservedCheckoutAction" logger="sitemap.action.reserved-checkout"/> |
| </map:actions> |
| ... |
| </map:components> |
| |
| ]]></source> |
| |
| <source><![CDATA[ |
| <map:act type="reserved-checkout"> |
| <map:generate src="content/rc/{exception}.xsp" type="serverpages"> |
| <map:parameter name="user" value="{user}"/> |
| <map:parameter name="filename" value="{filename}"/> |
| <map:parameter name="date" value="{date}"/> |
| </map:generate> |
| <map:transform src="xslt/rc/rco-exception.xsl"/> |
| <map:serialize/> |
| </map:act> |
| ]]></source> |
| </section> |
| |
| <section> |
| <title>URL</title> |
| <p>The call</p> |
| <source><![CDATA[{document-URL}?lenya.usecase=checkout&lenya usecase.step=checkout]]></source> |
| <p>invokes a check-out of the document</p> |
| </section> |
| |
| <section> |
| <title>The ReservedCheckoutTestAction</title> |
| <p>The ReservedCheckoutTestAction checks out a document only if this isn't already checked out</p> |
| <source><![CDATA[ |
| |
| <map:components> |
| ... |
| <map:actions> |
| <map:action name="reserved-checkout-test" src="org.apache.lenya.cms.cocoon.acting.ReservedCheckoutTestAction" logger="sitemap.action.reserved-checkout-test"/> |
| </map:actions> |
| ... |
| </map:components> |
| |
| ]]></source> |
| |
| <source><![CDATA[ |
| <map:act type="reserved-checkout-test"> |
| <map:generate type="serverpages" src="../../content/rc/{exception}.xsp"> |
| <map:parameter name="user" value="{user}"/> |
| <map:parameter name="filename" value="{filename}"/> |
| <map:parameter name="date" value="{date}"/> |
| </map:generate> |
| <map:transform src="../../xslt/rc/rco-exception.xsl"/> |
| <map:serialize/> |
| </map:act> |
| ]]></source> |
| </section> |
| |
| <section> |
| <title>FileReservedCheckOutException</title> |
| |
| <p>When the file cannot be checked out because another user has already checked it out, |
| a fileReservedCheckOutException is thrown:</p> |
| <source> |
| File Reserved Checkout Exception |
| |
| Could not check out the file |
| |
| Reason : The resource has already been checked out by another user |
| User: lenya |
| Date: Wed Oct 22 12:02:28 CEST 2003 |
| Filename: /content/authoring/index/index_de.xml |
| </source> |
| <p>The serverpage</p> |
| <source> lenya/src/webapp/lenya/content/rc/fileReservedCheckOutException.xsp</source> |
| <p>generates the xml which will be transformed with </p> |
| <source> lenya/src/webapp/lenya/xslt/rc/rco-exception.xsl</source> |
| </section> |
| |
| <section> |
| <title>Exception</title> |
| |
| <p>The errors are catched as generic Exception</p> |
| <source> |
| Generic Exception |
| |
| Check the log files :-) |
| Filename: /content/authoring/malaVida/index_de.xml </source> |
| <p>The serverpage</p> |
| <source> lenya/src/webapp/lenya/content/rc/exception.xsp</source> |
| <p>generates the xml which will be transformed with </p> |
| <source> lenya/src/webapp/lenya/xslt/rc/rco-exception.xsl</source> |
| </section> |
| |
| </body> |
| </document> |