You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/09/09 13:34:40 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/xslt/scheduler filter-document.xsl

andreas     2003/09/09 04:34:40

  Modified:    src/webapp/lenya/xslt/navigation sitetree2nav.xsl
               src/webapp/lenya/xslt/info sitetree2tree.xsl info.xsl
                        root.xsl
               src/webapp/lenya info.xmap usecase.xmap
               src/webapp/lenya/xslt/scheduler filter-document.xsl
  Added:       src/webapp/lenya/xslt/info scheduler.xsl
               src/webapp/lenya scheduler.xmap
  Log:
  moved scheduler screen to info area
  
  Revision  Changes    Path
  1.11      +1 -1      cocoon-lenya/src/webapp/lenya/xslt/navigation/sitetree2nav.xsl
  
  Index: sitetree2nav.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/navigation/sitetree2nav.xsl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- sitetree2nav.xsl	4 Sep 2003 15:22:24 -0000	1.10
  +++ sitetree2nav.xsl	9 Sep 2003 11:34:40 -0000	1.11
  @@ -34,7 +34,7 @@
   
   <xsl:template match="tree:site">
   
  -  <nav:site>
  +  <nav:site url="{$url}">
       <xsl:copy-of select="@*"/> 
       <xsl:apply-templates/>
     </nav:site>
  
  
  
  1.29      +2 -2      cocoon-lenya/src/webapp/lenya/xslt/info/sitetree2tree.xsl
  
  Index: sitetree2tree.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/sitetree2tree.xsl,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- sitetree2tree.xsl	5 Sep 2003 14:42:38 -0000	1.28
  +++ sitetree2tree.xsl	9 Sep 2003 11:34:40 -0000	1.29
  @@ -31,7 +31,7 @@
   HIGHLIGHT = 1
   HIGHLIGHT_BG = "#DDDCCF;"
   HIGHLIGHT_COLOR = "#666666;"
  -foldersTree = gFld("&lt;strong&gt;<xsl:value-of select="$publicationid"/>&lt;/strong&gt;", "<xsl:value-of select="$contextprefix"/>/<xsl:value-of select="$publicationid"/>?lenya.usecase=info-overview&amp;lenya.step=showscreen")
  +foldersTree = gFld("&lt;strong&gt;<xsl:value-of select="$publicationid"/>&lt;/strong&gt;")
   		<xsl:apply-templates select="s:site"/>
   
   //Set this string if Treeview and other configuration files may also be loaded in the same session
  
  
  
  1.40      +7 -2      cocoon-lenya/src/webapp/lenya/xslt/info/info.xsl
  
  Index: info.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/info.xsl,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- info.xsl	5 Sep 2003 08:10:36 -0000	1.39
  +++ info.xsl	9 Sep 2003 11:34:40 -0000	1.40
  @@ -44,6 +44,7 @@
   				</xsl:if>
   				<td><a><xsl:call-template name="activate"><xsl:with-param name="currenttab">ac-authoring</xsl:with-param></xsl:call-template>AC&#160;Auth</a></td>
   				<td><a><xsl:call-template name="activate"><xsl:with-param name="currenttab">ac-live</xsl:with-param></xsl:call-template>AC&#160;Live</a></td>
  +				<td><a><xsl:call-template name="activate"><xsl:with-param name="currenttab">scheduler</xsl:with-param></xsl:call-template>Scheduler</a></td>
   			</xsl:if>
   		</tr>
   	</table>
  @@ -71,7 +72,7 @@
   <xsl:template name="activate">
   <xsl:param name="currenttab"/>
   <xsl:variable name="urlhead">?lenya.usecase=info-</xsl:variable> 
  -<xsl:variable name="urltail">&amp;lenya.step=showscreen&amp;lenya.area=authoring</xsl:variable> 
  +<xsl:variable name="urltail">&amp;lenya.step=showscreen</xsl:variable> 
   <xsl:attribute name="href"><xsl:value-of select="$urlhead"/><xsl:value-of select="$currenttab"/><xsl:value-of select="$urltail"/></xsl:attribute>
   <xsl:attribute name="class">lenya-tablink<xsl:if test="$currenttab = $tab">-active</xsl:if></xsl:attribute>
   </xsl:template>
  @@ -402,6 +403,10 @@
     		</xsl:if>
     	</td>
     </tr>
  +</xsl:template>
  +
  +<xsl:template match="lenya-info:scheduler">
  +	<xsl:copy-of select="node()"/>
   </xsl:template>
   
   </xsl:stylesheet> 
  
  
  
  1.29      +2 -2      cocoon-lenya/src/webapp/lenya/xslt/info/root.xsl
  
  Index: root.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/root.xsl,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- root.xsl	5 Sep 2003 14:42:38 -0000	1.28
  +++ root.xsl	9 Sep 2003 11:34:40 -0000	1.29
  @@ -148,7 +148,7 @@
           <xsl:text>overview</xsl:text>
     	</xsl:otherwise>
     </xsl:choose>
  -  <xsl:text>&amp;lenya.step=showscreen&amp;lenya.area=authoring</xsl:text>
  +  <xsl:text>&amp;lenya.step=showscreen</xsl:text>
   </xsl:template>
   
   
  
  
  
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/info/scheduler.xsl
  
  Index: scheduler.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <!--
      Document   : scheduler-page.xsl
      Created on : 12. Mai 2003, 17:26
      Author     : andreas
      Description:
          Purpose of transformation follows.
  -->
  
  <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"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:sch="http://apache.org/cocoon/lenya/scheduler/1.0"
      xmlns:task="http://apache.org/cocoon/lenya/task/1.0"
      xmlns:lenya-info="http://apache.org/cocoon/lenya/info/1.0"
      >
  
  <xsl:import href="../scheduler/common.xsl"/>
      
  <xsl:param name="document-url"/>
  <xsl:param name="document-id"/>
  <xsl:param name="area"/>
  <xsl:param name="publication-id"/>
  <xsl:param name="context-prefix"/>
  
  
  <xsl:template match="/sch:scheduler">
  	<lenya-info:info>
      <lenya-info:scheduler>
  	    <xsl:apply-templates select="sch:exception"/>
        <xsl:apply-templates select="sch:job-group"/>
      </lenya-info:scheduler>
    </lenya-info:info>
  </xsl:template>
  
  
  <xsl:template match="sch:job-group">
      
    <table class="lenya-table">
  
      <tr>
        <th>Task</th>
        <th>Day</th>
        <th colspan="3">Time</th>
      </tr>
  
      <xsl:choose>
        <xsl:when test="sch:job">
          <xsl:apply-templates select="sch:job"/>
        </xsl:when>
        <xsl:otherwise>
          <tr><td colspan="6">No active jobs.</td></tr>
        </xsl:otherwise>
      </xsl:choose>
  
    </table>
  </xsl:template>
  
  
  <xsl:template match="sch:job">
  	<xsl:if test="$document-id = '/'">
      <xsl:variable name="job-document-url" select="substring-after(@url, concat('/', ../@name, '/'))"/>
      <xsl:variable name="link-url" select="concat($context-prefix, '/', ../@name, '/info-', $job-document-url)"/>
  		<tr>
  			<td colspan="5"><strong>Document:&#160;</strong>
  				<a href="{$link-url}"><xsl:value-of select="$job-document-url"/></a>
  			</td>
  		</tr>
  	</xsl:if>
        
    <tr>
      <form method="GET">
      	
  			<td>
          <!-- hidden input fields for parameters -->
          <input type="hidden" name="lenya.usecase" value="info-scheduler"/>
          <input type="hidden" name="lenya.step" value="showscreen"/>
          <input type="hidden" name="scheduler.publication-id" value="{$publication-id}"/>
          <input type="hidden" name="scheduler.job.id" value="{@id}"/>
          
  				<xsl:variable name="current-task-id" select="task:task/task:parameter[@name='wrapper.task-id']/@value"/>
  				<xsl:value-of select="/sch:scheduler/sch:tasks/sch:task[@id = $current-task-id]/sch:label"/>
  			</td>
        <xsl:choose>
          <xsl:when test="sch:trigger">
            <xsl:apply-templates select="sch:trigger"/>
            <td>
              <input type="submit" name="scheduler.action" value="modify"/>
            </td>
          </xsl:when>
          <xsl:otherwise>
            <td colspan="2">The job date has expired.</td>
            <td>&#160;</td>
          </xsl:otherwise>
        </xsl:choose>
        <td>
          <input type="submit" name="scheduler.action" value="delete"/>
        </td>
      </form>
    </tr>
  </xsl:template>
  
  
    <xsl:template match="sch:trigger">
      <td>
      	<span style="white-space: nobreak">
  			<xsl:apply-templates select="sch:parameter[@name='year']"/> -
  			<xsl:apply-templates select="sch:parameter[@name='month']"/> -
  			<xsl:apply-templates select="sch:parameter[@name='day']"/>
  			</span>
      </td>
      <td>
  			<xsl:apply-templates select="sch:parameter[@name='hour']"/>
  			<xsl:text>&#160;:&#160;</xsl:text>
  			<xsl:apply-templates select="sch:parameter[@name='minute']"/>
      </td>
    </xsl:template>
    
    <xsl:template match="sch:trigger/sch:parameter[@name='day']">
      <select name="scheduler.trigger.{@name}">
        <xsl:call-template name="generateSelectionNames">
  	<xsl:with-param name="currentValue" select="1"/> 
  	<xsl:with-param name="selectedValue" select="@value"/>
  	<xsl:with-param name="maxValue" select="31"/>
        </xsl:call-template>      
      </select>
    </xsl:template>
  
    <xsl:template match="sch:trigger/sch:parameter[@name='month']">
      <select name="scheduler.trigger.{@name}">
        <xsl:call-template name="generateSelectionNames">
  	<xsl:with-param name="currentValue" select="1"/> 
  	<xsl:with-param name="selectedValue" select="@value"/>
  	<xsl:with-param name="maxValue" select="12"/>
        </xsl:call-template>      
      </select>
    </xsl:template>
  
    <xsl:template match="sch:trigger/sch:parameter[@name='year']">
      <select name="scheduler.trigger.{@name}">
        <xsl:call-template name="generateSelectionNames">
  	<xsl:with-param name="currentValue" select="@value"/> 
  	<xsl:with-param name="selectedValue" select="@value"/>
  	<xsl:with-param name="maxValue" select="@value + 2"/>
        </xsl:call-template>      
      </select>
    </xsl:template>
  
    <xsl:template match="sch:trigger/sch:parameter[@name='hour' or @name='minute']">
        <input type="text" name="scheduler.trigger.{@name}" size="2" maxlength="2">
        <xsl:attribute name="value">
          <xsl:value-of select="format-number(@value, '00')"/>
        </xsl:attribute>
      </input>
    </xsl:template>
  
  <xsl:template match="sch:exception">
  <span style="color: red">EXCEPTION: <xsl:value-of select="@type"/></span> (check the log files)
  </xsl:template>
  
  
  </xsl:stylesheet> 
  
  
  
  1.44      +32 -8     cocoon-lenya/src/webapp/lenya/info.xmap
  
  Index: info.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/info.xmap,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- info.xmap	8 Sep 2003 16:18:08 -0000	1.43
  +++ info.xmap	9 Sep 2003 11:34:40 -0000	1.44
  @@ -83,14 +83,6 @@
         </map:match>
       </map:pipeline>
   
  -    <!-- Sitetree Javascript array      -->
  -    <map:pipeline>
  -      <map:match pattern="*/*/info-sitetree/tabs.js">
  -        <map:read src="resources/javascript/tabs.js"/>
  -        <map:serialize type="text"/>
  -      </map:match>
  -    </map:pipeline>
  -
       <map:pipeline internal-only="true">
       	
       	<!-- areas (default language) -->
  @@ -142,6 +134,7 @@
       <!-- tabs -->
       <map:pipeline internal-only="true">        
         
  +      <!-- meta -->
         <map:match pattern="tabs/meta">
         	
         	<!-- update -->
  @@ -157,6 +150,7 @@
   				
         </map:match>
         
  +      <!-- access control -->
         <map:match pattern="tabs/ac-*">
   				<map:generate src="content/info/access-control.xsp" type="serverpages">
   					<map:parameter name="area" value="{1}"/>
  @@ -164,6 +158,7 @@
   				<map:serialize type="xml"/>
         </map:match>
   
  +			<!-- workflow -->
         <map:match pattern="tabs/workflow">
         	<!-- check if history path exists -->
           <map:select type="parameter">
  @@ -175,6 +170,35 @@
               <map:serialize type="xml"/>
             </map:otherwise>
           </map:select>
  +      </map:match>
  +      
  +      <!-- scheduler -->
  +      <map:match pattern="tabs/scheduler">
  +      	
  +      	<map:select type="parameter">
  +      		<map:parameter name="parameter-selector-test" value="{page-envelope:document-id}"/>
  +      		
  +      		<!-- areas -->
  +      		<map:when test="/">
  +						<map:generate src="cocoon://scheduler/publication/{page-envelope:publication-id}"/>
  +      		</map:when>
  +      		
  +      		<!-- documents -->
  +      		<map:otherwise>
  +						<map:generate src="cocoon://scheduler/document/{page-envelope:publication-id}/{page-envelope:area}{page-envelope:document-url}"/>
  +      		</map:otherwise>
  +      		
  +      	</map:select>
  +      	
  +				<map:transform src="xslt/info/scheduler.xsl">
  +					<map:parameter name="publication-id" value="{page-envelope:publication-id}"/>
  +					<map:parameter name="area" value="{page-envelope:area}"/>
  +					<map:parameter name="document-url" value="{page-envelope:document-url}"/>
  +					<map:parameter name="document-id" value="{page-envelope:document-id}"/>
  +					<map:parameter name="context-prefix" value="{request:contextPath}"/>
  +				</map:transform>
  +				<map:serialize type="xml"/>
  +				
         </map:match>
         
         <map:match pattern="tabs/*">
  
  
  
  1.101     +3 -55     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.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- usecase.xmap	9 Sep 2003 08:56:01 -0000	1.100
  +++ usecase.xmap	9 Sep 2003 11:34:40 -0000	1.101
  @@ -93,58 +93,6 @@
     <!-- FIXME: Reorder the pipelines in here neatly. Maybe alphabetically? -->
     <map:pipelines>
       
  -    <map:pipeline>
  -      
  -      <!-- load task list -->
  -      <map:match pattern="tasks/*">
  -        <map:generate src="pubs/{1}/config/tasks/tasks.xconf"/>
  -        <map:serialize type="xml"/>
  -      </map:match>
  -      
  -      <!-- create the current job snapshot -->
  -      <map:match pattern="scheduler-servlet">
  -        <map:generate src="{request:contextPath}/servlet/QuartzSchedulerServlet" type="servletproxy"/>
  -        <map:transform src="xslt/scheduler/sort.xsl"/>
  -        <map:serialize type="xml"/>
  -      </map:match>
  -      
  -      <!-- {publication-id} -->
  -      <map:match pattern="scheduler-page-publication/*">
  -        <map:aggregate element="scheduler" label="aggregation" ns="http://apache.org/cocoon/lenya/scheduler/1.0" prefix="sch">
  -          <map:part src="cocoon:/tasks/{1}"/>
  -          <map:part src="cocoon:/scheduler-servlet" strip-root="true"/>
  -          <map:part src="cocoon:/scheduler-xsp" strip-root="true"/>
  -        </map:aggregate>
  -        <map:transform src="xslt/scheduler/filter-publication.xsl">
  -          <map:parameter name="publication-id" value="{1}"/>
  -        </map:transform>
  -        <map:serialize type="xml"/>
  -      </map:match>
  -      
  -      <!-- {publication-id}/{area-document-url} -->
  -      <map:match pattern="scheduler-page-document/*/**">
  -      	<map:generate src="cocoon:/scheduler-page-publication/{1}"/>
  -        <map:transform src="xslt/scheduler/filter-document.xsl">
  -          <map:parameter name="document-url" value="/{1}/{2}"/>
  -        </map:transform>
  -        <map:serialize type="xml"/>
  -      </map:match>
  -    
  -    	<!-- scheduler/{publication-id}/{area-document-url}.xsl -->
  -    	<map:match pattern="scheduler/*/**.xsl">
  -    		<map:generate src="cocoon:/scheduler-page-document/{1}/{2}"/>
  -    		<map:transform src="xslt/scheduler/jobs2xslt.xsl"/>
  -    		<map:serialize type="xml"/>
  -    	</map:match>
  -    	
  -    	<!-- scheduler-xsp -->
  -    	<map:match pattern="scheduler-xsp">
  -    		<map:generate type="serverpages" src="content/scheduler/scheduler.xsp"/>
  -    		<map:serialize type="xml"/>
  -    	</map:match>
  -    	
  -    </map:pipeline>
  -    
       <!-- =================================================================== -->
       <!-- Notification Pipelines -->
       <!-- =================================================================== -->
  @@ -200,7 +148,7 @@
           	
           	<!-- show scheduler screen -->
             <map:match pattern="showscreen" type="step">
  -          	<map:generate src="cocoon:/scheduler-page-publication/{../../1}"/>
  +          	<map:generate src="cocoon://scheduler/publication/{../../1}"/>
               <map:transform src="xslt/scheduler/scheduler-page.xsl">
                 <map:parameter name="context-prefix" value="{request:contextPath}"/>
                 <map:parameter name="publication-id" value="{../../1}"/>
  @@ -211,7 +159,7 @@
             </map:match>
             
             <!-- other steps: add job (redirect to page) -->
  -         	<map:generate src="cocoon:/scheduler-page-publication/{../1}"/>
  +         	<map:generate src="cocoon://scheduler/publication/{../1}"/>
   					<map:transform src="xslt/util/redirect.xsl">
   						<map:parameter name="url" value="{request:requestURI}"/>
   					</map:transform>
  @@ -289,7 +237,7 @@
                 <map:parameter name="stylesheet" value="publishing/publish-screen.xsl"/>
               </map:call>
               <map:transform src="cocoon:/notification/{../../1}/publish.xsl"/>
  -            <map:transform src="cocoon:/scheduler/{../../1}/{../../2}/{../../3}.xsl"/>
  +            <map:transform src="cocoon://scheduler/{../../1}/{../../2}/{../../3}.xsl"/>
               <map:call resource="style-cms-page"/>
             </map:match>
             
  
  
  
  1.3       +91 -123   cocoon-lenya/src/webapp/lenya/scheduler.xmap
  
  
  
  
  1.2       +1 -7      cocoon-lenya/src/webapp/lenya/xslt/scheduler/filter-document.xsl
  
  Index: filter-document.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/scheduler/filter-document.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- filter-document.xsl	29 Aug 2003 18:24:33 -0000	1.1
  +++ filter-document.xsl	9 Sep 2003 11:34:40 -0000	1.2
  @@ -7,15 +7,9 @@
       
   <!-- remove other jobs -->
   <xsl:template match="sch:job[@url != $document-url]"/>
  -
       
  -<!-- only jobs for this document -->  
  -<!--
  -<xsl:template match="sch:job[($document-url != '') and (@url != $document-url)]"/>
  --->
  -  
   <!-- Identity transformation -->
  -<xsl:template match="@*|*">
  +<xsl:template match="@*|node()">
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
  
  
  

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