lenya/src/webapp/lenya/xslt/scheduler common.xsl,1.1,1.2 scheduler-page.xsl,1.2,1.3

Andreas Hartmann <[email protected]> Fri, 16 May 2003 17:55:36 +0200
Newsgroups gmane.comp.cms.wyona.cvs
Message-ID <[email protected]>
Update of /repository/lenya/src/webapp/lenya/xslt/scheduler
In directory erbium:/tmp/cvs-serv30699/src/webapp/lenya/xslt/scheduler

Modified Files:
	common.xsl scheduler-page.xsl 
Log Message:
- updated scheduling menu entry
- bugfixes in scheduler XSLTs
- corrected scheduler usecase pattern in sitemap.xmap

Index: common.xsl
===================================================================
RCS file: /repository/lenya/src/webapp/lenya/xslt/scheduler/common.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** common.xsl	16 May 2003 15:29:30 -0000	1.1
--- common.xsl	16 May 2003 15:55:34 -0000	1.2
***************
*** 22,27 ****
      <xsl:variable name="date" select="//sch:current-date"/>
    
!     <input type="hidden" name="lenya.usecase" value="schedule-page"/>
!     <input type="hidden" name="lenya.step" value="add"/>
      
      <table class="scheduler-job" border="0" cellpadding="0" cellspacing="0">
--- 22,27 ----
      <xsl:variable name="date" select="//sch:current-date"/>
    
!     <input type="hidden" name="lenya.usecase" value="schedule"/>
!     <input type="hidden" name="lenya.step" value="showscreen"/>
      
      <table class="scheduler-job" border="0" cellpadding="0" cellspacing="0">

Index: scheduler-page.xsl
===================================================================
RCS file: /repository/lenya/src/webapp/lenya/xslt/scheduler/scheduler-page.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** scheduler-page.xsl	13 May 2003 17:26:06 -0000	1.2
--- scheduler-page.xsl	16 May 2003 15:55:34 -0000	1.3
***************
*** 16,19 ****
--- 16,21 ----
      >
  
+ <xsl:import href="common.xsl"/>    
+     
  <xsl:param name="document-uri"/>
  <xsl:param name="area"/>
***************
*** 58,75 ****
        <table class="scheduler-job" border="0" cellpadding="0" cellspacing="0">
  
-         <tr> 
-           <th><strong>Add new job</strong></th>
-           <th>Task</th>
-           <th>Day</th>
-           <th>Time</th>
-           <th>&#160;</th>
-           <th>&#160;</th>
-         </tr>
-         <xsl:call-template name="schedulerForm"/>
- 
-         <tr>
-           <td colspan="6" class="scheduler-empty">&#160;</td>
-         </tr>
- 
          <tr>
            <th><strong>Edit existing jobs</strong></th>
--- 60,63 ----
***************
*** 134,239 ****
  
    <!-- ============================================================= -->
!   <!--   Generate the necessary form to schedule new jobs -->
!   <!-- ============================================================= -->
!   <xsl:template name="schedulerForm">
!     <tr>
!       <form method="GET">
!         
!         <!-- hidden input fields for parameters -->
!         
!         <td>
!           <xsl:call-template name="parameters-as-inputs"/>
!           &#160;
!         </td>
!         
!         <!-- task selection combobox -->
! 	<td><xsl:call-template name="tasks"/></td>
!         
! 	<td>
! 	  <font size="2">
! 	    <select name="trigger.startDay">
! 	      <xsl:call-template name="generateSelectionNames">
! 		<xsl:with-param name="currentValue" select="1"/>
! 		<xsl:with-param name="selectedValue" select="/sch:scheduler/sch:current-date/sch:day"/>
! 		<xsl:with-param name="maxValue" select="31"/>
! 	      </xsl:call-template>
! 	    </select>
! 	    <select name="trigger.startMonth">
! 	      <xsl:call-template name="generateSelectionNames">
! 		<xsl:with-param name="currentValue" select="1"/>
! 		<xsl:with-param name="selectedValue"
!                     select="/sch:scheduler/sch:current-date/sch:month"/>
! 		<xsl:with-param name="maxValue" select="12"/>
! 	      </xsl:call-template>
! 	    </select>
! 	    <select name="trigger.startYear">
!               <xsl:variable name="year"><xsl:value-of select="/sch:scheduler/sch:current-date/sch:year"/></xsl:variable>
!               <xsl:call-template name="generateSelectionNames">
!                 <xsl:with-param name="currentValue" select="$year"/>
!                 <xsl:with-param name="selectedValue" select="$year"/>
!                 <xsl:with-param name="maxValue" select="$year + 2"/>
!               </xsl:call-template>
! 	    </select>
! 	  </font>
! 	</td>
! 	<td>
! 	  <font size="2">
! 	    <input name="trigger.startHour" type="text" size="2" maxlength="2">
!               <xsl:attribute name="value">
!                 <xsl:value-of select="format-number(/sch:scheduler/sch:current-date/sch:hour, '00')"/>
!               </xsl:attribute>
!             </input>
! 	    :
! 	    <input name="trigger.startMin" type="text" size="2" maxlength="2">
!               <xsl:attribute name="value">
!                 <xsl:value-of select="format-number(/sch:scheduler/sch:current-date/sch:minute, '00')"/>
!               </xsl:attribute>
!             </input>
! 	  </font>
! 	</td>
!         <td>&#160;</td>
! 	<td>
! 	  <input type="submit" name="Action" value="Add"/>
! 	</td>
!       </form>
!     </tr>
!   </xsl:template>
!   
!   <!-- ============================================================= -->
!   <!--   Generate numbers from 1 to maxValue for a <select> and select a -->
!   <!--   given value -->
!   <!-- ============================================================= -->
!   <xsl:template name="generateSelectionNames">
!     <xsl:param name="currentValue"/>
!     <xsl:param name="selectedValue"/>
!     <xsl:param name="maxValue"/>
!     <xsl:choose>
!       <xsl:when test="$currentValue = $selectedValue">
! 	<option>
! 	  <xsl:attribute name="selected"/>
! 	  <xsl:value-of select="$currentValue"/>
! 	</option>
!       </xsl:when>
!       <xsl:otherwise>
! 	<option><xsl:value-of select="$currentValue"/></option>
!       </xsl:otherwise>
!     </xsl:choose>
!     <xsl:if test="$currentValue &lt; $maxValue">
!       <xsl:call-template name="generateSelectionNames">
! 	<xsl:with-param name="currentValue" select="$currentValue + 1"/> 
! 	<xsl:with-param name="selectedValue" select="$selectedValue"/> 
! 	<xsl:with-param name="maxValue" select="$maxValue"/> 
!       </xsl:call-template>
!     </xsl:if>
!   </xsl:template>
! 
! 
!   <!-- ============================================================= -->
!   <!-- create hidden inputs for all request parameters -->
    <!-- ============================================================= -->
!   <xsl:template name="parameters-as-inputs">
! <!--    <ul>-->
!     <input type="hidden" name="lenya.usecase" value="schedule-page"/>
!     <input type="hidden" name="lenya.step" value="showscreen"/>
      
      <xsl:for-each select="/sch:scheduler/sch:parameters/sch:parameter">
--- 122,129 ----
  
    <!-- ============================================================= -->
!   <!-- create new request parameters for all request parameters -->
    <!-- ============================================================= -->
!   <xsl:template name="parameters-as-request-parameters">
!     <xsl:text>lenya.usecase=schedule&amp;lenya.step=showscreen&amp;</xsl:text>
      
      <xsl:for-each select="/sch:scheduler/sch:parameters/sch:parameter">
***************
*** 242,247 ****
        <xsl:if test="not(starts-with(@name, 'task.id'))">
        <xsl:if test="not(translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'action')">
!         <input type="hidden" name="{@name}" value="{@value}"/>
! <!--        <li>Parameter: <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/></li>-->
        </xsl:if>
        </xsl:if>
--- 132,140 ----
        <xsl:if test="not(starts-with(@name, 'task.id'))">
        <xsl:if test="not(translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'action')">
!         <xsl:if test="position() &gt; 1">
!           <xsl:text>&amp;</xsl:text>
!         </xsl:if>
!         <xsl:value-of select="concat(@name, '=', @value)"/>
!         <xsl:text/>
        </xsl:if>
        </xsl:if>
***************
*** 249,260 ****
        </xsl:if>
      </xsl:for-each>
- <!--    </ul>-->
    </xsl:template>
    
    <!-- ============================================================= -->
!   <!-- create new request parameters for all request parameters -->
    <!-- ============================================================= -->
!   <xsl:template name="parameters-as-request-parameters">
!     <xsl:text>lenya.usecase=schedule-page&amp;lenya.step=showscreen&amp;</xsl:text>
      
      <xsl:for-each select="/sch:scheduler/sch:parameters/sch:parameter">
--- 142,154 ----
        </xsl:if>
      </xsl:for-each>
    </xsl:template>
    
    <!-- ============================================================= -->
!   <!-- create hidden inputs for all request parameters -->
    <!-- ============================================================= -->
!   <xsl:template name="parameters-as-inputs">
! <!--    <ul>-->
!     <input type="hidden" name="lenya.usecase" value="schedule"/>
!     <input type="hidden" name="lenya.step" value="showscreen"/>
      
      <xsl:for-each select="/sch:scheduler/sch:parameters/sch:parameter">
***************
*** 263,271 ****
        <xsl:if test="not(starts-with(@name, 'task.id'))">
        <xsl:if test="not(translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'action')">
!         <xsl:if test="position() &gt; 1">
!           <xsl:text>&amp;</xsl:text>
!         </xsl:if>
!         <xsl:value-of select="concat(@name, '=', @value)"/>
!         <xsl:text/>
        </xsl:if>
        </xsl:if>
--- 157,162 ----
        <xsl:if test="not(starts-with(@name, 'task.id'))">
        <xsl:if test="not(translate(@name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'action')">
!         <input type="hidden" name="{@name}" value="{@value}"/>
! <!--        <li>Parameter: <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/></li>-->
        </xsl:if>
        </xsl:if>
***************
*** 273,300 ****
        </xsl:if>
      </xsl:for-each>
    </xsl:template>
    
-   <!-- ============================================================= -->
-   <!-- Create ComboBox entries for all available tasks -->
-   <!-- ============================================================= -->
-   <xsl:template name="tasks">
-     <xsl:param name="current-task-id"/>
-       <select name="task.id">
-       <!--
-         <xsl:attribute name="selected">
-           <xsl:value-of select="/sch:scheduler/sch:tasks/sch:task[@id = $current-task-id]/@label"/>
-         </xsl:attribute>
-         -->
-         <xsl:for-each select="/sch:scheduler/sch:tasks/sch:task">
-           <option value="{@id}">
-             <xsl:if test="@id = $current-task-id">
-               <xsl:attribute name="selected"/>
-             </xsl:if>
-             <xsl:value-of select="label"/>
-           </option>
-         </xsl:for-each>
-       </select>
-   </xsl:template>
- 
    <xsl:template match="sch:trigger">
      <td>
--- 164,170 ----
        </xsl:if>
      </xsl:for-each>
+ <!--    </ul>-->
    </xsl:template>
    
    <xsl:template match="sch:trigger">
      <td>
***************
*** 368,371 ****
--- 238,263 ----
  <font color="red">EXCEPTION: <xsl:value-of select="@type"/></font> (check the log files)
  </xsl:template>
+ 
+   <!-- ============================================================= -->
+   <!-- Create ComboBox entries for all available tasks -->
+   <!-- ============================================================= -->
+   <xsl:template name="tasks">
+     <xsl:param name="current-task-id"/>
+       <select name="task.id">
+       <!--
+         <xsl:attribute name="selected">
+           <xsl:value-of select="/sch:scheduler/sch:tasks/sch:task[@id = $current-task-id]/@label"/>
+         </xsl:attribute>
+         -->
+         <xsl:for-each select="/sch:scheduler/sch:tasks/sch:task">
+           <option value="{@id}">
+             <xsl:if test="@id = $current-task-id">
+               <xsl:attribute name="selected"/>
+             </xsl:if>
+             <xsl:value-of select="label"/>
+           </option>
+         </xsl:for-each>
+       </select>
+   </xsl:template>
  
  </xsl:stylesheet>