Changeset 1685

Show
Ignore:
Timestamp:
12/21/07 13:52:29
Author:
johnsa
Message:

bwconfig: beginning steps to providing bedework configuration front-end.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/resources/xsl/default/default/errors.xsl

    r1682 r1685  
    245245      </xsl:when> 
    246246      <xsl:when test="id='org.bedework.validation.error.insubmissionscalendar'"> 
    247         To publish this event, you must move it off the submitted events calendar onto a public calendar. 
     247        To publish this event, you must move it to a public calendar.  Please select a different calendar. 
    248248      </xsl:when> 
    249249 
  • trunk/deployment/webconfig/webapp/resources/default/default/default.xsl

    r1679 r1685  
    77  <!-- ==================================================================== --> 
    88  <xsl:output method="xhtml" indent="yes" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" standalone="yes" omit-xml-declaration="yes"/> 
    9   <xsl:variable name="appRoot" select="/bedework/appRoot"/> 
     9  <xsl:variable name="resourcesRoot" select="/bedework/appRoot"/> 
    1010  <xsl:variable name="urlPrefix" select="/bedework/urlPrefix"/> 
    11  
    12   <xsl:variable name="firstView">welcome</xsl:variable> 
    13   <xsl:variable name="lastView" select="/bedework/propertyGroups/form/propertyGroup[position()=last()]/@name"/> 
    14   <xsl:variable name="currentView"> 
    15     <xsl:choose> 
    16       <xsl:when test="/bedework/appvar/key='setView'"><xsl:value-of select="/bedework/appvar[key='setView']/value"/></xsl:when> 
    17       <xsl:otherwise><xsl:value-of select="$firstView"/></xsl:otherwise> 
    18     </xsl:choose> 
    19   </xsl:variable> 
    20   <xsl:variable name="currentViewPos"> 
    21     <xsl:choose> 
    22       <xsl:when test="$currentView = $firstView">0</xsl:when> 
    23       <xsl:otherwise><xsl:for-each select="/bedework/propertyGroups/form/propertyGroup[@name=$currentView]"><xsl:number/></xsl:for-each></xsl:otherwise> 
    24     </xsl:choose> 
    25   </xsl:variable> 
    26   <xsl:variable name="prevView"> 
    27     <xsl:choose> 
    28       <xsl:when test="$currentView = $firstView">$currentView</xsl:when> 
    29       <xsl:otherwise><xsl:value-of select="/bedework/propertyGroups/form/propertyGroup[position()=number($currentViewPos)-1]/@name"/></xsl:otherwise> 
    30     </xsl:choose> 
    31   </xsl:variable> 
    32   <xsl:variable name="nextView"> 
    33     <xsl:choose> 
    34       <xsl:when test="$currentView = $lastView">$currentView</xsl:when> 
    35       <xsl:otherwise><xsl:value-of select="/bedework/propertyGroups/form/propertyGroup[position()=number($currentViewPos)+1]/@name"/></xsl:otherwise> 
    36     </xsl:choose> 
    37   </xsl:variable> 
    38  
    3911 
    4012  <xsl:template match="/"> 
    4113    <html lang="en"> 
    4214      <head> 
    43         <title>Bedework: open-source enterprise events calendar - <xsl:value-of select="$currentView"/></title> 
    44         <link rel="stylesheet" type="text/css" media="screen,all" href="{$appRoot}/default/default/bedeworkConfig.css"/> 
     15        <title>Bedework Calendar Configuration Builder</title> 
     16        <link rel="stylesheet" type="text/css" media="screen,all" href="{$resourcesRoot}/default/default/bedeworkConfig.css"/> 
     17        <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" /> 
    4518        <script language="JavaScript" type="text/javascript"> 
    4619          <![CDATA[ 
     
    6841        </script> 
    6942      </head> 
    70       <body
     43      <body class="tundra"
    7144        <div id="bodyBlock"> 
    7245          <div id="header"> 
    7346            <h2 id="title"> 
    74               <a href="setup.do"><img src="{$appRoot}/images/bedework.gif" alt="Bedework Calendar" border="0"/></a> 
     47              <a href="/bedework"><img src="{$resourcesRoot}/images/bedework.gif" alt="Bedework Calendar" border="0"/></a> 
    7548            </h2> 
    7649            <div id="configLabel"> 
    77               BedeFig: Bedework Calendar Properties Config 
     50              Bedework Calendar Configuration Builder 
    7851            </div> 
    7952          </div> 
     
    8962          </xsl:if> 
    9063          <div id="content"> 
     64 
    9165            <xsl:choose> 
    9266              <xsl:when test="/bedework/page='main'"> 
    93                 <form action="save.do" method="POST" enctype="multipart/form-data" name="propsForm"> 
    94                   <div id="buttonMenuTop"> 
    95                     <xsl:choose> 
    96                       <xsl:when test="$currentView = $firstView"> 
    97                         <div id="buttonMenuPrev">&lt; prev</div> 
    98                       </xsl:when> 
    99                       <xsl:otherwise> 
    100                         <div id="buttonMenuPrev">&lt; <a href="javascript:setPrevView()">prev</a></div> 
    101                       </xsl:otherwise> 
    102                     </xsl:choose> 
    103                     <xsl:choose> 
    104                       <xsl:when test="$currentView = $lastView"> 
    105                         <div id="buttonMenuNext">next &gt;</div> 
    106                       </xsl:when> 
    107                       <xsl:otherwise> 
    108                         <div id="buttonMenuNext"><a href="javascript:setNextView()">next</a> &gt;</div> 
    109                       </xsl:otherwise> 
    110                     </xsl:choose> 
    111                   </div> 
    112  
    113                   <ul id="buttonMenu"> 
    114                     <li><input type="submit" name="validate" value="validate"/></li> 
    115                     <li><input type="submit" name="save" value="save"/></li> 
    116                   </ul> 
    117  
    118                   <select name="setappvar" onchange="submit()"> 
    119                     <option value="setView(welcome)">welcome</option> 
    120                     <xsl:for-each select="/bedework/propertyGroups/form/propertyGroup"> 
    121                       <xsl:variable name="groupName" select="@name"/> 
    122                       <xsl:choose> 
    123                         <xsl:when test="$currentView = $groupName"> 
    124                           <option name="{$groupName}" value="setView({$groupName})" selected="selected"> 
    125                             <xsl:value-of select="$groupName"/> 
    126                           </option> 
    127                         </xsl:when> 
    128                         <xsl:otherwise> 
    129                           <option name="{$groupName}" value="setView({$groupName})"> 
    130                             <xsl:value-of select="$groupName"/> 
    131                           </option> 
    132                         </xsl:otherwise> 
    133                       </xsl:choose> 
    134                     </xsl:for-each> 
    135                   </select> 
    136  
    137                   advanced: 
    138                   <xsl:choose> 
    139                     <xsl:when test="/bedework/propertyGroups/form/propertyGroup[@name='modules']/property[@name='advanced']/fieldValue='true'"> 
    140                       <input type="radio" name="modules.advanced" value="true" checked="checked" onclick="submit()"/> yes 
    141                       <input type="radio" name="modules.advanced" value="false" onclick="submit()"/> no 
    142                     </xsl:when> 
    143                     <xsl:otherwise> 
    144                       <input type="radio" name="modules.advanced" value="true" onclick="submit()"/> yes 
    145                       <input type="radio" name="modules.advanced" value="false" checked="checked" onclick="submit()"/> no 
    146                     </xsl:otherwise> 
    147                   </xsl:choose> 
    148  
    149     <!-- ======================================================================= --> 
    150     <!-- ========================== GENERATE CONTENT =========================== --> 
    151     <!-- ======================================================================= --> 
    152  
    153                   <xsl:choose> 
    154                     <xsl:when test="$currentView = 'welcome'"> 
    155                       <div id="welcome"> 
    156                         <h1>BedeFig: Configure Bedework Properties</h1> 
    157                         <p> 
    158                           Welcome to the Bedework property configuration tool.  This 
    159                           application allows you to review, modify, validate, and 
    160                           save the properties used for building a Bedework 
    161                           Calendar production-ready application. 
    162                         </p> 
    163                         <p> 
    164                           Options are grouped into pages.  You can select any section 
    165                           at any time by using the pull-down menu above, or you may 
    166                           move from page to page by clicking the "next" button to the upper right. 
    167                         </p> 
    168                         <p> 
    169                           When you have finished reviewing and modifying properties, 
    170                           press "validate" to check your settings, and "save" to download 
    171                           a properly-configured properties file which you can use to build 
    172                           a production-ready version of the Bedework Calendar application. 
    173                         </p> 
    174                       </div> 
    175                     </xsl:when> 
    176                     <xsl:otherwise> 
    177                       <xsl:apply-templates select="/bedework/propertyGroups/form/propertyGroup[@name=$currentView]"/> 
    178                     </xsl:otherwise> 
    179                   </xsl:choose> 
    180  
    181  
    182     <!-- ======================================================================= --> 
    183     <!-- ======================================================================= --> 
    184     <!-- ======================================================================= --> 
    185                 </form> 
     67                <xsl:call-template name="main"/> 
    18668              </xsl:when> 
    18769              <xsl:when test="/bedework/page='save'"> 
    188                 <form action="save.do" method="POST" enctype="multipart/form-data" name="downloadForm"> 
    189                   <input type="hidden" name="contentType" value="text/text"/> 
    190                   <input type="hidden" name="contentName" value="myBedework.properties"/> 
    191                   <input type="hidden" name="skinName" value="outputText"/> 
    192                   <input type="hidden" name="refreshXslt" value="yes"/> 
    193                   <ul id="buttonMenu"> 
    194                     <li><input type="submit" name="save" value="download file"/></li> 
    195                     <li><a href="setup.do">return</a></li> 
    196                   </ul> 
    197                 </form> 
    198                 <h1>Your Configured Properties File:</h1> 
    199                 <div id="propFile"> 
    200                   <xsl:for-each select="/bedework/propertyGroups/propertyGroup"> 
    201                     #<br/> 
    202                     # <xsl:value-of select="@name"/><br/> 
    203                     #<br/> 
    204                     <xsl:for-each select="property"> 
    205                       <xsl:value-of select="@name"/>=<xsl:value-of select="."/><br/> 
    206                     </xsl:for-each> 
    207                     <br/> 
    208                   </xsl:for-each> 
    209                 </div> 
     70                <xsl:call-template name='save'/> 
    21071              </xsl:when> 
     72              <xsl:otherwise> 
     73                <xsl:apply-templates select="/bedework/propertyGroups/form/propertyGroup"/> 
     74              </xsl:otherwise> 
    21175            </xsl:choose> 
     76 
    21277          </div> 
    21378          <div id="footer"> 
    21479            <p> 
    21580              some footer text 
    216  
    21781            </p> 
    21882            <ul class="menu" id="footMenu"> 
    219               <li class="first">first item</li> 
    220               <li>second</li> 
    221               <li>third</li> 
     83              <li class="first"><a href="/bedework">Bedework Quickstart Jump Page</a></li> 
     84              <li><a href="?noxslt=yes">Show XML</a></li> 
     85              <li><a href="?refreshXslt=yes">Refresh XSLT</a></li> 
    22286            </ul> 
    22387          </div> 
     
    22690      </body> 
    22791    </html> 
     92  </xsl:template> 
     93 
     94  <xsl:template name="main"> 
     95    <h1>BedeFig: Configure Bedework Properties</h1> 
     96    <p> 
     97      Welcome to the Bedework property configuration tool.  This 
     98      application allows you to review, modify, validate, and 
     99      save the properties used for building a Bedework 
     100      Calendar production-ready application. 
     101    </p> 
     102    <p> 
     103      Options are grouped into pages.  You can select any section 
     104      at any time by using the pull-down menu above, or you may 
     105      move from page to page by clicking the "next" button to the upper right. 
     106    </p> 
     107    <p> 
     108      When you have finished reviewing and modifying properties, 
     109      press "validate" to check your settings, and "save" to download 
     110      a properly-configured properties file which you can use to build 
     111      a production-ready version of the Bedework Calendar application. 
     112    </p> 
     113  </xsl:template> 
     114 
     115  <xsl:template name="save"> 
     116    <form action="save.do" method="POST" enctype="multipart/form-data" name="downloadForm"> 
     117      <input type="hidden" name="contentType" value="text/text"/> 
     118      <input type="hidden" name="contentName" value="myBedework.properties"/> 
     119      <input type="hidden" name="skinName" value="outputText"/> 
     120      <input type="hidden" name="refreshXslt" value="yes"/> 
     121      <ul id="buttonMenu"> 
     122        <li><input type="submit" name="save" value="download file"/></li> 
     123        <li><a href="setup.do">return</a></li> 
     124      </ul> 
     125    </form> 
     126    <h1>Your Configured Properties File:</h1> 
     127    <div id="propFile"> 
     128      <xsl:for-each select="/bedework/propertyGroups/propertyGroup"> 
     129        #<br/> 
     130        # <xsl:value-of select="@name"/><br/> 
     131        #<br/> 
     132        <xsl:for-each select="property"> 
     133          <xsl:value-of select="@name"/>=<xsl:value-of select="."/><br/> 
     134        </xsl:for-each> 
     135        <br/> 
     136      </xsl:for-each> 
     137    </div> 
    228138  </xsl:template> 
    229139