Changeset 1911

Show
Ignore:
Timestamp:
08/01/08 17:57:07
Author:
johnsa
Message:

user client: many changes to calendar/subscription code; this work is only partially complete and parts of the UI may produce peculiar results at the moment.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/appjars.xml

    r1894 r1911  
    4444              name="jta" /> 
    4545 
    46       <!-- Struts --> 
     46      <!-- Struts and JSTL --> 
    4747 
    4848      <property name="org.bedework.struts.tlds" 
     
    7272      <getJar lib="${org.bedework.app.lib}" 
    7373              name="jakarta-oro" version="2.0.8" /> 
     74 
     75      <getJar lib="${org.bedework.app.lib}" 
     76              name="jstl-standard" version="1.1.2" /> 
     77 
     78      <getJar lib="${org.bedework.app.lib}" 
     79              name="jstl" version="1.1.2" /> 
    7480 
    7581      <!-- Java mail --> 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.css

    r1909 r1911  
    19271927  font-style: italic; 
    19281928} 
     1929#bedework .left { 
     1930  float: left; 
     1931} 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1909 r1911  
    107107  <xsl:variable name="calendar-initAddExternal" select="/bedework/urlPrefixes/calendar/initAddExternal/a/@href"/> 
    108108  <xsl:variable name="calendar-initAddAlias" select="/bedework/urlPrefixes/calendar/initAddAlias/a/@href"/> 
     109  <xsl:variable name="calendar-initAddPublicAlias" select="/bedework/urlPrefixes/calendar/initAddPublicAlias/a/@href"/> 
    109110  <xsl:variable name="calendar-delete" select="/bedework/urlPrefixes/calendar/delete/a/@href"/> 
    110111  <xsl:variable name="calendar-fetchForDisplay" select="/bedework/urlPrefixes/calendar/fetchForDisplay/a/@href"/> 
     
    265266                    <xsl:call-template name="subsMenu"/> 
    266267                  </xsl:when> 
     268                  <!-- DEPRECATED 
    267269                  <xsl:when test="/bedework/page='subscriptions' or 
    268270                                  /bedework/page='modSubscription'"> 
    269271                    <xsl:apply-templates select="/bedework/subscriptions"/> 
    270                   </xsl:when> 
     272                  </xsl:when> --> 
    271273                  <xsl:when test="/bedework/page='addAlias'"> 
    272274                    <xsl:call-template name="addAlias"/> 
     275                  </xsl:when> 
     276                  <xsl:when test="/bedework/page='addPublicAlias'"> 
     277                    <xsl:call-template name="addPublicAlias"/> 
    273278                  </xsl:when> 
    274279                  <xsl:when test="/bedework/page='subInaccessible'"> 
     
    44244429  </xsl:template> 
    44254430 
     4431  <xsl:template name="selectCalForPublicAlias"> 
     4432  <!-- selectCalForPublicAlias creates a calendar tree in a pop-up window. 
     4433      Used when selecting a public calendar subscription (alias). --> 
     4434 
     4435    <input type="button" onclick="javascript:changeClass('calSelectWidget','visible')" value="select calendar" class="small"/> 
     4436    <div id="calSelectWidget" class="invisible"> 
     4437      <h2>select a calendar</h2> 
     4438      <a href="javascript:changeClass('calSelectWidget','invisible')" id="calSelectWidgetCloser" title="close">x</a> 
     4439      <ul class="calendarTree"> 
     4440        <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true']" mode="selectCalForPublicAliasCalTree"/> 
     4441      </ul> 
     4442      <!-- Uncomment the following to use a three column format 
     4443      <xsl:variable name="topCalsCount" select="count(/bedework/calendars/calendar/calendar)"/> 
     4444      <xsl:variable name="topCalsDivThree" select="floor($topCalsCount div 3)"/> 
     4445      <xsl:variable name="topCalsTopSet" select="number($topCalsCount - $topCalsDivThree)"/> 
     4446      <ul class="calendarTree left"> 
     4447        <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &lt;= $topCalsDivThree)]" mode="selectCalForPublicAliasCalTree"/> 
     4448      </ul> 
     4449      <ul class="calendarTree left"> 
     4450        <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &gt; $topCalsDivThree) and (position() &lt;= $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/> 
     4451      </ul> 
     4452      <ul class="calendarTree left"> 
     4453        <xsl:apply-templates select="/bedework/calendars/calendar/calendar[canAlias='true' and (position() &gt; $topCalsTopSet)]" mode="selectCalForPublicAliasCalTree"/> 
     4454      </ul> 
     4455      --> 
     4456    </div> 
     4457  </xsl:template> 
     4458 
     4459  <xsl:template match="calendar" mode="selectCalForPublicAliasCalTree"> 
     4460    <xsl:variable name="id" select="id"/> 
     4461    <li> 
     4462      <xsl:attribute name="class"> 
     4463        <xsl:choose> 
     4464          <xsl:when test="/bedework/selectionState/selectionType = 'calendar' 
     4465                          and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when> 
     4466          <xsl:when test="name='Trash'">trash</xsl:when> 
     4467          <xsl:when test="calendarCollection='false'">folder</xsl:when> 
     4468          <xsl:otherwise>calendar</xsl:otherwise> 
     4469        </xsl:choose> 
     4470      </xsl:attribute> 
     4471      <xsl:variable name="calPath" select="path"/> 
     4472      <xsl:variable name="calDisplay" select="path"/> 
     4473      <xsl:variable name="calendarCollection" select="calendarCollection"/> 
     4474      <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}','{$calendarCollection}')"> 
     4475        <strong><xsl:value-of select="name"/></strong> 
     4476      </a> 
     4477      <xsl:if test="calendar"> 
     4478        <ul> 
     4479          <xsl:apply-templates select="calendar" mode="selectCalForPublicAliasCalTree"/> 
     4480        </ul> 
     4481      </xsl:if> 
     4482    </li> 
     4483  </xsl:template> 
     4484 
    44264485  <xsl:template match="currentCalendar" mode="addCalendar"> 
    44274486    <h3>Add Calendar / Folder</h3> 
     
    48004859      <table class="common" cellspacing="0"> 
    48014860        <tr> 
    4802           <th class="commonHeader" colspan="3"> 
     4861          <th class="commonHeader" colspan="2"> 
    48034862              Event date limits: 
    48044863              <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> today forward 
     
    48084867        </tr> 
    48094868        <tr id="exportDateRange" class="invisible"> 
    4810           <td colspan="3" class="dates"> 
     4869          <td colspan="2" class="dates"> 
    48114870            <strong>Start:</strong> 
    48124871            <div class="dateFields"> 
     
    48274886          <th class="borderRight"> 
    48284887            My Calendars 
    4829           </th> 
    4830           <th class="borderRight"> 
    4831             Subscriptions (underlying calendars) 
    48324888          </th> 
    48334889          <th> 
     
    48634919            </ul> 
    48644920          </td> 
    4865           <td class="borderRight"> 
    4866             <!-- My Subscriptions (underlying calendars) --> 
     4921          <td> 
    48674922            <ul class="calendarTree"> 
    4868               <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 
    4869               <xsl:for-each select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]"> 
    4870                 <xsl:choose> 
    4871                   <xsl:when test="calendarDeleted='true'"> 
    4872                     <li class="deleted"> 
    4873                       <xsl:value-of select="name"/><br/> 
    4874                       <em>calendar not available</em> 
    4875                     </li> 
    4876                   </xsl:when> 
    4877                   <xsl:when test="count(calendars//calendar[calendarCollection='true']) = 1"> 
    4878                     <xsl:for-each select="calendars//calendar[calendarCollection='true']"> 
    4879                       <li class="calendar"> 
    4880                         <xsl:variable name="calPath" select="path"/> 
    4881                         <xsl:variable name="name" select="name"/> 
    4882                         <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> 
    4883                           <xsl:value-of select="name"/> 
    4884                         </a> 
    4885                       </li> 
    4886                     </xsl:for-each> 
    4887                   </xsl:when> 
    4888                   <xsl:otherwise> 
    4889                     <li class="folder"> 
    4890                       <xsl:value-of select="name"/>: 
    4891                       <xsl:if test="calendars//calendar[calendarCollection='true']"> 
    4892                         <ul> 
    4893                           <xsl:for-each select="calendars//calendar[calendarCollection='true']"> 
    4894                             <li class="calendar"> 
    4895                               <xsl:variable name="calPath" select="path"/> 
    4896                               <xsl:variable name="name" select="name"/> 
    4897                               <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> 
    4898                                 <xsl:value-of select="name"/> 
    4899                               </a> 
    4900                             </li> 
    4901                           </xsl:for-each> 
    4902                         </ul> 
    4903                       </xsl:if> 
    4904                     </li> 
    4905                   </xsl:otherwise> 
    4906                 </xsl:choose> 
    4907               </xsl:for-each> 
    4908             </ul> 
    4909           </td> 
    4910           <td> 
    4911             <ul class="calendarTree"> 
    4912               <xsl:for-each select=".//calendar[calendarCollection='true']"> 
    4913                 <li class="calendar"> 
    4914                   <xsl:variable name="calPath" select="path"/> 
    4915                   <xsl:variable name="name" select="name"/> 
    4916                   <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> 
    4917                     <xsl:value-of select="name"/> 
    4918                   </a> 
    4919                 </li> 
    4920               </xsl:for-each> 
     4923              <xsl:apply-templates select="./calendar" mode="buildExportTree"/> 
    49214924            </ul> 
    49224925          </td> 
     
    49264929  </xsl:template> 
    49274930 
     4931  <xsl:template match="calendar" mode="buildExportTree"> 
     4932    <xsl:choose> 
     4933      <xsl:when test="calendarCollection='true'"> 
     4934        <li class="calendar"> 
     4935          <xsl:variable name="calPath" select="path"/> 
     4936          <xsl:variable name="name" select="name"/> 
     4937          <a href="javascript:exportCalendar('exportCalendarForm','{$name}','{$calPath}')"> 
     4938            <xsl:value-of select="name"/> 
     4939          </a> 
     4940        </li> 
     4941      </xsl:when> 
     4942      <xsl:otherwise> 
     4943        <li class="folder"> 
     4944          <xsl:value-of select="name"/> 
     4945          <xsl:if test="calendar"> 
     4946            <ul> 
     4947              <xsl:apply-templates select="calendar" mode="buildExportTree"/> 
     4948            </ul> 
     4949          </xsl:if> 
     4950        </li> 
     4951      </xsl:otherwise> 
     4952    </xsl:choose> 
     4953  </xsl:template> 
     4954 
    49284955  <!--+++++++++++++++ Subscriptions ++++++++++++++++++++--> 
    49294956  <xsl:template name="subsMenu"> 
     4957    <!-- This top-level menu adds subscriptions to the root of the user's calendar tree. 
     4958         Contextual menus on the calendar tree (will) allow for adding subscriptions under 
     4959         subfolders.  --> 
     4960    <xsl:variable name="userid" select="/bedework/userid"/> 
    49304961    <h2>Add Subscriptions</h2> 
    49314962    <div id="content"> 
     
    49334964      <ul id="subsMenu"> 
    49344965        <li> 
    4935           <a href="{$subscriptions-fetch}" title="manage subscriptions"> 
     4966          <a href="{$calendar-initAddPublicAlias}&amp;calPath=/user/{$userid}" title="subscribe to a public calendar"> 
    49364967            a public calendar (in this system) 
    49374968          </a> 
    49384969        </li> 
    49394970        <li> 
    4940           <a href="{$calendar-initAddAlias}&amp;calPath=/user/johnsa"> 
     4971          <a href="{$calendar-initAddAlias}&amp;calPath=/user/{$userid}" title="subscribe to a user calendar"> 
    49414972            a user calendar (in this system) 
    49424973          </a> 
    49434974        </li> 
    49444975        <li> 
    4945            an external iCal feed (e.g. Google, Eventful, etc) 
     4976          <a href="{$calendar-initAddExternal}&amp;calPath=/user/{$userid}" title="subscribe to an external calendar"> 
     4977            an external iCal feed (e.g. Google, Eventful, etc) 
     4978          </a> 
    49464979        </li> 
    49474980      </ul> 
     
    49494982  </xsl:template> 
    49504983 
    4951   <xsl:template match="subscriptions"> 
     4984  <xsl:template name="addPublicAlias"> 
    49524985    <h2>Subscribe to a Public Calendar</h2> 
    4953     <table id="subsTable"> 
    4954       <tr> 
    4955         <td class="cals"> 
    4956           <h3>Public calendars</h3> 
    4957           <ul class="calendarTree"> 
    4958             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar[canAlias='true']" mode="subscribe"/> 
    4959           </ul> 
    4960         </td> 
    4961         <td class="subs"> 
    4962           <h3>Add a public subscription</h3> 
    4963           <p> 
    4964             Select a calendar to the left to add a new internal public subscription. 
    4965           </p> 
    4966           <h3>Add a public subscription</h3> 
    4967           <p class="note">*the subsciption name must be unique</p> 
    4968           <form name="subscribeForm" action="{$calendar-update}" onsubmit="return setSubscriptionUri(this,'bwcal://')" method="post"> 
    4969             <input type="hidden" value="" name="aliasUri"/> 
    4970             <table class="common" cellspacing="0"> 
    4971               <tr> 
    4972                 <td class="fieldname">Name:</td> 
    4973                 <td> 
    4974                   <xsl:variable name="subName" select="name"/> 
    4975                   <input type="text" value="{$subName}" name="calendar.name" size="60"/> 
    4976                 </td> 
    4977               </tr> 
    4978               <!--<xsl:if test="internal='false'"> 
    4979                 <tr> 
    4980                   <td class="fieldname">Uri:</td> 
    4981                   <td> 
    4982                     <xsl:variable name="calPath" select="uri"/> 
    4983                     <input type="text" value="{$calPath}" name="aliasUri" size="60"/> 
    4984                   </td> 
    4985                 </tr> 
    4986               </xsl:if> 
    4987               <tr> 
    4988                 <td class="fieldname">Display:</td> 
    4989                 <td> 
    4990                   <input type="radio" value="true" name="subscription.display" checked="checked"/> yes 
    4991                   <input type="radio" value="false" name="subscription.display"/> no 
    4992                 </td> 
    4993               </tr>--> 
    4994               <tr> 
    4995                 <td class="fieldname">Affects Free/Busy:</td> 
    4996                 <td> 
    4997                   <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes 
    4998                   <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no 
    4999                 </td> 
    5000               </tr> 
    5001               <tr> 
    5002                 <td class="fieldname">Style:</td> 
    5003                 <td> 
    5004                   <select name="subscription.style"> 
    5005                     <option value="default">default</option> 
    5006                     <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> 
    5007                       <xsl:variable name="subColor" select="."/> 
    5008                       <option value="{$subColor}" class="{$subColor}"> 
    5009                         <xsl:value-of select="@name"/> 
    5010                       </option> 
    5011                     </xsl:for-each> 
    5012                   </select> 
    5013                 </td> 
    5014               </tr> 
    5015               <!--<tr> 
    5016                 <td class="fieldname">Unremovable:</td> 
    5017                 <td> 
    5018                   <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true 
    5019                   <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false 
    5020                 </td> 
    5021               </tr>--> 
    5022             </table> 
    5023             <table border="0" id="submitTable"> 
    5024               <tr> 
    5025                 <td> 
    5026                   <input type="submit" name="addSubscription" value="Add Subscription"/> 
    5027                   <input type="submit" name="cancelled" value="cancel"/> 
    5028                 </td> 
    5029               </tr> 
    5030             </table> 
    5031           </form> 
    5032         </td> 
    5033       </tr> 
    5034     </table> 
     4986    <div id="content"> 
     4987      <h3>Add a public subscription</h3> 
     4988      <p class="note">*the subsciption name must be unique</p> 
     4989      <form name="subscribeForm" action="{$calendar-update}" onsubmit="return setSubscriptionUri(this,'bwcal://')" method="post"> 
     4990        <table class="common" cellspacing="0"> 
     4991          <tr> 
     4992            <td class="fieldname">Calendar:</td> 
     4993            <td> 
     4994              <input type="hidden" value="" name="aliasUri" size="60" id="bwNewCalPathField"/> 
     4995              <input type="hidden" value="" name="calendarCollection" id="bwCalCollectionField"/> 
     4996              <span id="bwEventCalDisplay"> 
     4997                <xsl:text> </xsl:text> 
     4998              </span> 
     4999              <xsl:call-template name="selectCalForPublicAlias"/> 
     5000            </td> 
     5001          </tr> 
     5002          <tr> 
     5003            <td class="fieldname">Name:</td> 
     5004            <td> 
     5005              <xsl:variable name="subName" select="name"/> 
     5006              <input type="text" value="{$subName}" name="calendar.name" size="30"/> 
     5007            </td> 
     5008          </tr> 
     5009          <!--<tr> 
     5010            <td class="fieldname">Display:</td> 
     5011            <td> 
     5012              <input type="radio" value="true" name="subscription.display" checked="checked"/> yes 
     5013              <input type="radio" value="false" name="subscription.display"/> no 
     5014            </td> 
     5015          </tr>--> 
     5016          <tr> 
     5017            <td class="fieldname">Affects Free/Busy:</td> 
     5018            <td> 
     5019              <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes 
     5020              <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no 
     5021            </td> 
     5022          </tr> 
     5023          <tr> 
     5024            <td class="fieldname">Style:</td> 
     5025            <td> 
     5026              <select name="calendar.color"> 
     5027                <option value="">default</option> 
     5028                <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> 
     5029                  <xsl:variable name="subColor" select="@rgb"/> 
     5030                  <xsl:variable name="subColorClass" select="."/> 
     5031                  <option value="{$subColor}" class="{$subColorClass}"> 
     5032                    <xsl:value-of select="@name"/> 
     5033                  </option> 
     5034                </xsl:for-each> 
     5035              </select> 
     5036            </td> 
     5037          </tr> 
     5038          <!--<tr> 
     5039            <td class="fieldname">Unremovable:</td> 
     5040            <td> 
     5041              <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true 
     5042              <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false 
     5043            </td> 
     5044          </tr>--> 
     5045        </table> 
     5046        <table border="0" id="submitTable"> 
     5047          <tr> 
     5048            <td> 
     5049              <input type="submit" name="addSubscription" value="Add Subscription"/> 
     5050              <input type="submit" name="cancelled" value="cancel"/> 
     5051            </td> 
     5052          </tr> 
     5053        </table> 
     5054      </form> 
     5055    </div> 
    50355056  </xsl:template> 
    50365057 
     
    50595080  <!-- add a subscription to a user calendar by user and path --> 
    50605081  <xsl:template name="addAlias"> 
    5061     <h2>Subscribe to User Calendar</h2> 
     5082    <h2>Subscribe to a User Calendar</h2> 
    50625083    <div id="content"> 
    50635084      <p class="note">*the subsciption name must be unique</p> 
     
    51095130            <td class="fieldname">Style:</td> 
    51105131            <td> 
    5111               <select name="style"> 
     5132              <select name="calendar.color"> 
    51125133                <option value="default">default</option> 
    51135134                <xsl:for-each select="document('subColors.xml')/subscriptionColors/color"> 
     
    51395160 
    51405161      <ul class="note" style="margin-left: 2em;"> 
     5162        <li> 
     5163          You must be granted at least read access to the other user's calendar 
     5164          to subscribe to it. 
     5165        </li> 
    51415166        <li>The <strong>Name</strong> is anything you want to call your subscription.</li> 
    51425167        <li>The <strong>User ID</strong> is the user id that owns the calendar</li> 
     
    51455170          the remote user's calendar tree.  For example, to subscribe to 
    51465171          janedoe/someFolder/someCalendar, enter "someFolder/someCalendar".  To subscribe to janedoe's root folder, leave this field blank. 
    5147         </li> 
    5148         <li> 
    5149           You must be granted at least read access to the other user's calendar 
    5150           to subscribe to it. 
    51515172        </li> 
    51525173        <li> 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/subColors.xml

    r1909 r1911  
    4343 --> 
    4444 
    45  
    4645<subscriptionColors> 
    4746  <!-- light pastels --> 
    48   <color name="white" rgb="ffffff" rgb="">bwwhite</color> 
     47  <color name="white" rgb="ffffff">bwwhite</color> 
    4948  <color name="lt pink" rgb="fddeee">bwltpink</color> 
    5049  <color name="lt purple" rgb="ddd4e8">bwltpurple</color> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedework.js

    r1909 r1911  
    166166// the calSelect pop-up widget.  We must do three things: update the hidden 
    167167// calendar input field, update the displayed text, and close widget 
    168 function updateEventFormCalendar(newCalPath,calDisplay) { 
     168function updateEventFormCalendar(newCalPath,calDisplay,calendarCollection) { 
    169169  newCalPathField = document.getElementById("bwNewCalPathField"); 
    170170  newCalPathField.value = newCalPath; 
    171171  bwCalDisplay = document.getElementById("bwEventCalDisplay"); 
    172172  bwCalDisplay.innerHTML = calDisplay; 
     173  if (calendarCollection != '') { 
     174    bwCalCollectionField = document.getElementById("bwCalCollectionField"); 
     175    bwCalCollectionField.value = calendarCollection; 
     176  } 
    173177  changeClass("calSelectWidget","invisible"); 
    174178}