Changeset 481

Show
Ignore:
Timestamp:
05/15/06 16:46:57
Author:
johnsa
Message:

personal client: add subscription to user calendar form added (currently buggy)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r479 r481  
    7676  <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/> 
    7777  <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/> 
     78  <xsl:variable name="subscriptions-addSubByUri" select="/bedework/urlPrefixes/subscriptions/addSubByUri/a/@href"/> 
     79  <xsl:variable name="subscriptions-subscribeByUri" select="/bedework/urlPrefixes/subscriptions/subscribeByUri/a/@href"/> 
    7880  <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/> 
    7981  <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/> 
     
    160162                      <xsl:apply-templates select="/bedework/formElements" mode="editLocation"/> 
    161163                    </xsl:when> 
    162                     <xsl:when test="/bedework/page='subscriptions' or /bedework/page='modSubscription'"> 
     164                    <xsl:when test="/bedework/page='subscriptions' or 
     165                                    /bedework/page='modSubscription' or 
     166                                    /bedework/page='addSubByUri'"> 
    163167                      <xsl:apply-templates select="/bedework/subscriptions"/> 
    164168                    </xsl:when> 
     
    241245                  /bedework/page='selectCalForEvent' or 
    242246                  /bedework/page='upload' or 
     247                  /bedework/page='addSubByUri' or 
    243248                  /bedework/page='modPrefs'"> 
    244249      <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script> 
     
    723728                    </td> 
    724729                  </xsl:when> 
    725                   <xsl:when test="start/shortdate = end/shortdate and  
     730                  <xsl:when test="start/shortdate = end/shortdate and 
    726731                                  start/time = end/time"> 
    727732                    <td class="{$dateRangeStyle} center" colspan="3"> 
    728733                      <a href="{$eventView}?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    729                         <xsl:value-of select="start/time"/>                       
     734                        <xsl:value-of select="start/time"/> 
    730735                      </a> 
    731736                    </td> 
     
    28782883              <xsl:call-template name="subscriptionList"/> 
    28792884            </xsl:when> 
     2885            <xsl:when test="/bedework/page='addSubByUri'"> 
     2886              <xsl:call-template name="addSubByUri"/> 
     2887            </xsl:when> 
    28802888            <xsl:when test="/bedework/creating='true'"> 
    2881               <xsl:apply-templates select="subscription" mode="addSubscription"/> 
     2889              <xsl:apply-templates select="subscription" mode="addSystemSubscription"/> 
    28822890            </xsl:when> 
    28832891            <xsl:otherwise> 
     
    29142922  </xsl:template> 
    29152923 
    2916   <xsl:template match="subscription" mode="addSubscription"> 
     2924  <!-- add a subscription to a user calendar by user and path; this is actually 
     2925       a subscription to an arbitrary URI (which we can expose later) --> 
     2926  <xsl:template name="addSubByUri"> 
     2927    <h3>Add Subscription to User Calendar</h3> 
     2928    <p class="note">*the subsciption name must be unique</p> 
     2929    <form name="subscribeForm" action="{$subscriptions-subscribe}" onsubmit="return setSubscriptionUri(this)" method="post"> 
     2930      <table class="common" cellspacing="0"> 
     2931        <tr> 
     2932          <td class="fieldname">Name:</td> 
     2933          <td> 
     2934            <input type="text" value="" name="subscription.name" size="60"/> 
     2935          </td> 
     2936        </tr> 
     2937        <!-- the following would be for an arbitrary URI.  We'll add this later. 
     2938        <tr> 
     2939          <td class="fieldname">Uri:</td> 
     2940          <td> 
     2941            <input type="text" value="" name="subscription.uri" size="60"/> 
     2942          </td> 
     2943        </tr>--> 
     2944        <tr> 
     2945          <td class="fieldname">User ID:</td> 
     2946          <td> 
     2947            <input type="hidden" value="" name="subscription.uri"/> 
     2948            <input type="text" value="" name="userId" size="20"/> 
     2949            <span class="note">ex: douglm</span> 
     2950          </td> 
     2951        </tr> 
     2952        <tr> 
     2953          <td class="fieldname">User path:</td> 
     2954          <td> 
     2955            <input type="text" value="" name="userPath" size="20"/> 
     2956            <span class="note">(optional) ex: someDept/meetings</span> 
     2957          </td> 
     2958        </tr> 
     2959        <tr> 
     2960          <td class="fieldname">Display:</td> 
     2961          <td> 
     2962            <input type="radio" value="true" name="subscription.display" checked="checked"/> yes 
     2963            <input type="radio" value="false" name="subscription.display"/> no 
     2964          </td> 
     2965        </tr> 
     2966        <tr> 
     2967          <td class="fieldname">Affects Free/Busy:</td> 
     2968          <td> 
     2969            <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes 
     2970            <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no 
     2971          </td> 
     2972        </tr> 
     2973        <tr> 
     2974          <td class="fieldname">Style:</td> 
     2975          <td> 
     2976            <input type="text" value="" name="subscription.style" size="60"/> 
     2977          </td> 
     2978        </tr> 
     2979        <!--<tr> 
     2980          <td class="fieldname">Unremovable:</td> 
     2981          <td> 
     2982            <input type="radio" value="true" name="unremoveable" size="60"/> true 
     2983            <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false 
     2984          </td> 
     2985        </tr>--> 
     2986      </table> 
     2987      <table border="0" id="submitTable"> 
     2988        <tr> 
     2989          <td> 
     2990            <input type="submit" name="addSubscription" value="Add Subscription"/> 
     2991            <input type="submit" name="cancelled" value="Cancel"/> 
     2992            <input type="reset" value="Clear"/> 
     2993          </td> 
     2994        </tr> 
     2995      </table> 
     2996    </form> 
     2997  </xsl:template> 
     2998 
     2999  <!-- add a subscription to a public calendar within the system --> 
     3000  <xsl:template match="subscription" mode="addSystemSubscription"> 
    29173001    <h3>Add New Subscription</h3> 
    29183002    <p class="note">*the subsciption name must be unique</p> 
     
    31313215      </xsl:for-each> 
    31323216    </table> 
    3133     <h4><a href="{$subscriptions-initAdd}">Subscribe to a calendar</a> (by URI)</h4> 
     3217    <h4><a href="{$subscriptions-addSubByUri}">Subscribe to another user's calendar</a></h4> 
    31343218  </xsl:template> 
    31353219 
     
    34143498    <xsl:call-template name="editLocationList"/> 
    34153499  </xsl:template> 
    3416    
     3500 
    34173501  <xsl:template name="editLocationList"> 
    34183502    <table class="common" cellspacing="0"> 
  • trunk/calendar3/deployment/webuser/webapp/resources/demoskins/resources/includes.js

    r460 r481  
    100100} 
    101101 
     102// build the workdays parameter as a string when submitting user preferences form 
    102103function setWorkDays(formObj) { 
    103104  if (formObj) { 
     
    115116  } 
    116117} 
     118 
     119// build a uri based on user and path in the subscription form 
     120function setSubscriptionUri(formObj) { 
     121  if (formObj) { 
     122    var fullUri = "bwcal:///user/"; 
     123    fullUri += formObj.userId.value; 
     124    if (formObj.userPath.value != "") { 
     125      if (formObj.userPath.value.substring(0,1) == "/") { 
     126        fullUri += formObj.userPath.value; 
     127      } else { 
     128        fullUri += "/" + formObj.userPath.value; 
     129      } 
     130    } 
     131    formObj["subscription.uri"].value = fullUri; 
     132    alert(formObj["subscription.uri"].value); 
     133    return true; 
     134  } else { 
     135    alert("The subscription form is not available."); 
     136    return false; 
     137  } 
     138} 
  • trunk/calendar3/webclient/war/WEB-INF/struts-config.xml

    r479 r481  
    613613    </action> 
    614614 
     615    <!-- renderUrl --> 
     616    <action    path="/subs/showAddByUriForm" 
     617               type="org.bedework.webclient.BwRenderAction" 
     618               name="calForm" 
     619               scope="session" 
     620               validate="false"> 
     621      <forward name="success" path="/docs/subs/addSubByUri.jsp"/> 
     622    </action> 
     623 
    615624    <action    path="/subs/initAdd" 
    616625               type="org.bedework.webcommon.subs.InitSubscribeAction" 
     
    640649      <forward name="retry" path="/subs/showModForm.rdo" redirect="true"/> 
    641650      <forward name="reffed" path="/subs/showSubs.rdo" redirect="true"/> 
     651      <forward name="noAccess" path="/subs/showSubs.rdo" redirect="true"/> 
     652      <forward name="success" path="/subs/showSubs.rdo" redirect="true" /> 
     653    </action> 
     654 
     655    <action    path="/subs/subscribeByUri" 
     656               type="org.bedework.webcommon.subs.SubscribeAction" 
     657               name="calForm" 
     658               scope="session" 
     659               validate="false"> 
     660      <forward name="cancelled" path="/subs/showSubs.rdo" redirect="true"/> 
     661      <forward name="retry" path="/subs/showAddByUriForm.rdo" redirect="true"/> 
     662      <forward name="reffed" path="/subs/showSubs.rdo" redirect="true"/> 
     663      <forward name="noAccess" path="/subs/showSubs.rdo" redirect="true"/> 
    642664      <forward name="success" path="/subs/showSubs.rdo" redirect="true" /> 
    643665    </action> 
  • trunk/calendar3/webclient/war/docs/header.jsp

    r447 r481  
    163163        <fetch><genurl:link page="/subs/fetch.do?b=de"/></fetch> 
    164164        <fetchForUpdate><genurl:link page="/subs/fetchForUpdate.do?b=de"/></fetchForUpdate> 
     165        <addSubByUri><genurl:link page="/subs/showAddByUriForm.rdo?b=de"/></addSubByUri> 
     166        <subscribeByUri><genurl:link page="/subs/subscribeByUri.do?b=de"/></subscribeByUri> 
    165167        <initAdd><genurl:link page="/subs/initAdd.do?b=de"/></initAdd> 
    166168        <subscribe><genurl:link page="/subs/subscribe.do?b=de"/></subscribe>