lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject cvs commit: cocoon-lenya/src/webapp/lenya usecase.xmap
Date Mon, 18 Aug 2003 09:26:08 GMT
egli        2003/08/18 02:26:08

  Modified:    src/webapp/lenya usecase.xmap
  Added:       src/webapp/lenya/xslt/exception parent_node_not_found.xsl
  Log:
  Added the Exception selector to the sitemap which catches
  the ParentNotFoundException and returns a nice error message
  when a document is published whose parent doc hasn't been
  published.
  
  Added a nice error screen in the lenya look.
  
  Added usecase pipelines for info-meta saving.
  
  Revision  Changes    Path
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/exception/parent_node_not_found.xsl
  
  Index: parent_node_not_found.xsl
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
    >
    
    <xsl:import href="../util/page-util.xsl"/>
    
    <xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>
    
    
    <xsl:variable name="separator" select="','"/>
  
    
    <xsl:template match="/">
      
      <page:page>
        <page:title>Parent document not found</page:title>
        <page:body>
  	<div class="lenya-box">
  	  <div class="lenya-box-title">Error while publishing</div>
  	  <div class="lenya-box-body">
  	    <p>
  	      An error occured while publishing. Most likely you are trying
  	      to publish a document whose parent document hasn't been
  	      published yet.</p>
  	    <p>Try to publish the parent document first.</p>
  	  </div>
  	</div>
        </page:body>
      </page:page>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  
  1.64      +41 -11    cocoon-lenya/src/webapp/lenya/usecase.xmap
  
  Index: usecase.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/usecase.xmap,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- usecase.xmap	15 Aug 2003 14:12:15 -0000	1.63
  +++ usecase.xmap	18 Aug 2003 09:26:08 -0000	1.64
  @@ -15,9 +15,13 @@
   
       <map:selectors>
         <map:selector logger="sitemap.selector.exception" name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
  -        <exception class="org.apache.lenya.cms.task.ExecutionException" name="execution"/>
  -        <exception class="org.apache.lenya.cms.publishing.PublishingException" name="publishing"/>
  -        <exception class="org.apache.lenya.cms.publication.SiteTreeException" name="sitetree"/>
  +        <exception class="org.apache.lenya.cms.task.ExecutionException" name="execution"
unroll="true"/>
  +        <exception class="org.apache.tools.ant.BuildException" name="build" unroll="true"/>
  +        <exception class="org.xml.sax.SAXException" name="sax"/>
  +        <exception class="org.apache.lenya.cms.publishing.ParentNodeNotFoundException"
  +	  name="parent-node-not-found"/>
  +<!--         <exception class="org.apache.lenya.cms.publishing.PublishingException"
name="publishing"/> -->
  +<!--         <exception class="org.apache.lenya.cms.publication.SiteTreeException"
name="sitetree"/> -->
         </map:selector>
       </map:selectors>
       
  @@ -213,11 +217,12 @@
             
           </map:match>
           <!-- usecase -->
  -        
  +
  +
           
           <!-- Publish -->
           <map:match pattern="publish" type="usecase">
  -        	
  +          
             <map:match pattern="showscreen" type="step">
               <map:call resource="cms-screen">
                 <map:parameter name="publication-id" value="{../../1}"/>
  @@ -660,7 +665,27 @@
             </map:match>
             
           </map:match>
  -        
  +
  +        <map:match pattern="info-meta" type="usecase">
  +          
  +          <map:match pattern="showscreen" type="step">
  +            <map:generate src="content/info/meta.xsp" type="serverpages"/>
  +            <map:transform src="xslt/info/info.xsl">
  +            	<map:parameter name="tab" value="meta"/>
  +            </map:transform>	
  +            <map:serialize/>
  +          </map:match>
  +          
  +          <map:match pattern="update" type="step">
  +            <map:act type="task">
  +              <map:parameter name="task-id" value="{request-param:task-id}"/>
  +              <map:redirect-to session="true" uri="{request:requestURI}"/>
  +            </map:act>
  +            <map:redirect-to session="true" uri="{request:requestURI}?lenya.usecase=info-meta"/>
  +          </map:match>
  +          
  +        </map:match>
  +
           <map:match pattern="info-workflow" type="usecase">
           	<map:act type="resource-exists" src="pubs/{page-envelope:publication-id}/content/workflow/history/{page-envelope:document-path}">
   						<map:generate src="pubs/{page-envelope:publication-id}/content/workflow/history/{page-envelope:document-path}"/>
  @@ -766,11 +791,16 @@
         </map:match>
         
         <map:handle-errors type="500">
  -<!--         <map:select type="exception">   -->
  -<!--           <map:when test="publishing"> -->
  -<!--             <map:generate src= "sitetreeException.xml"/>  -->
  -<!--           </map:when>   -->
  -<!--         </map:select>   -->
  +        <map:select type="exception">
  +          <map:when test="parent-node-not-found">
  +	    <map:transform src="xslt/exception/parent_node_not_found.xsl"/>
  +	    <map:call resource="style-cms-page"/>
  +          </map:when>
  +	  <map:when test="sax">
  +	    <map:transform src="xslt/exception/not_published_yet.xsl"/>
  +	    <map:call resource="style-cms-page"/>
  +	  </map:when>
  +        </map:select>
           <map:serialize/>
         </map:handle-errors>
         
  
  
  

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


Mime
View raw message