Changeset 319

Show
Ignore:
Timestamp:
03/31/06 16:43:49
Author:
johnsa
Message:

Beginning the process of implementing real subscriptions (and calendars) in the personal client. Much of the code base is directly from the admin client (and may want to be common code at some point in the future).

Files:

Legend:

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

    r318 r319  
    5555  <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/> 
    5656  <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/> 
    57   <xsl:variable name="subscribe" select="/bedework/urlPrefixes/subscribe"/> 
    5857  <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/> 
    5958  <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/> 
    6059  <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/> 
    6160  <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/> 
     61 
     62  <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/> 
     63  <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/> 
     64  <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/> 
     65  <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/> 
    6266 
    6367  <!-- URL of the web application - includes web context 
     
    131135                  <xsl:apply-templates select="/bedework/locationform"/> 
    132136                </xsl:when> 
     137                <xsl:when test="/bedework/page='subscriptions' or /bedework/page='modSubscription'"> 
     138                  <xsl:apply-templates select="/bedework/subscriptions"/> 
     139                </xsl:when> 
    133140                <xsl:when test="/bedework/page='calendars'"> 
    134                   <!-- show a list of all calendars and manage subscriptions --> 
    135141                  <xsl:apply-templates select="/bedework/calendars"/> 
    136142                </xsl:when> 
     
    262268      <li><a href="{$initUpload}">Upload Events (iCal)</a></li> 
    263269      <li><a href="{$manageLocations}">Manage Locations</a></li> 
    264       <li><a href="{$fetchPublicCalendars}">Manage Subscriptions</a></li> 
     270      <li><a href="{$subscriptions-fetch}">Manage Subscriptions</a></li> 
    265271      <li>Preferences</li> 
    266272    </ul> 
     
    942948 
    943949  <!--==== CALENDAR LISTING / MANAGE SUBSCRIPTIONS ====--> 
     950  <!-- DEPRECATED 
    944951  <xsl:template match="calendars"> 
    945952    <xsl:variable name="publicCalCount" select="count(calendar[name='public']/calendar)"/> 
     
    987994      </xsl:if> 
    988995    </li> 
    989   </xsl:template> 
     996  </xsl:template> --> 
    990997 
    991998  <!--==== SINGLE EVENT ====--> 
     
    17781785  </xsl:template> 
    17791786 
     1787  <!--+++++++++++++++ Subscriptions ++++++++++++++++++++--> 
     1788  <xsl:template match="subscriptions"> 
     1789    <table id="subsTable"> 
     1790      <tr> 
     1791        <td class="cals"> 
     1792          <h3>Public calendars</h3> 
     1793          <p class="smaller"> 
     1794            Select a calendar below to add a <em><strong>new</strong></em> 
     1795            internal subscription. <!-- or 
     1796            <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri"> 
     1797            subscribe to an external calendar</a>.--> 
     1798          </p> 
     1799          <ul id="calendarTree"> 
     1800            <xsl:apply-templates select="/bedeworkadmin/subscriptions/subscribe/calendars/calendar" mode="subscribe"/> 
     1801          </ul> 
     1802        </td> 
     1803        <td class="subs"> 
     1804          <xsl:choose> 
     1805            <xsl:when test="/bedeworkadmin/page='subscriptions'"> 
     1806              <xsl:call-template name="subscriptionList"/> 
     1807            </xsl:when> 
     1808            <xsl:when test="/bedeworkadmin/creating='true'"> 
     1809              <xsl:apply-templates select="subscription" mode="addSubscription"/> 
     1810            </xsl:when> 
     1811            <xsl:otherwise> 
     1812              <xsl:apply-templates select="subscription" mode="modSubscription"/> 
     1813            </xsl:otherwise> 
     1814          </xsl:choose> 
     1815        </td> 
     1816      </tr> 
     1817    </table> 
     1818  </xsl:template> 
     1819 
     1820  <xsl:template match="calendar" mode="subscribe"> 
     1821    <xsl:variable name="id" select="id"/> 
     1822    <xsl:variable name="itemClass"> 
     1823      <xsl:choose> 
     1824        <xsl:when test="calendarCollection='false'">folder</xsl:when> 
     1825        <xsl:otherwise>calendar</xsl:otherwise> 
     1826      </xsl:choose> 
     1827    </xsl:variable> 
     1828    <li class="{$itemClass}"> 
     1829      <a href="{$subscriptions-initAdd}&amp;calId={$id}"> 
     1830        <xsl:value-of select="name"/> 
     1831      </a> 
     1832      <xsl:if test="calendar"> 
     1833        <ul> 
     1834          <xsl:apply-templates select="calendar" mode="subscribe"> 
     1835            <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--> 
     1836          </xsl:apply-templates> 
     1837        </ul> 
     1838      </xsl:if> 
     1839    </li> 
     1840  </xsl:template> 
     1841 
     1842  <xsl:template match="subscription" mode="addSubscription"> 
     1843    <h2>Add New Subscription</h2> 
     1844    <p class="note">*the subsciption name must be unique</p> 
     1845    <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post"> 
     1846      <table class="eventFormTable"> 
     1847        <tr> 
     1848          <th>Name*:</th> 
     1849          <td> 
     1850            <xsl:variable name="subName" select="name"/> 
     1851            <input type="text" value="{$subName}" name="subscription.name" size="60"/> 
     1852          </td> 
     1853        </tr> 
     1854        <xsl:if test="internal='false'"> 
     1855          <tr> 
     1856            <th>Uri:</th> 
     1857            <td> 
     1858              <xsl:variable name="subUri" select="uri"/> 
     1859              <input type="text" value="{$subUri}" name="subscription.uri" size="60"/> 
     1860            </td> 
     1861          </tr> 
     1862        </xsl:if> 
     1863        <tr> 
     1864          <th>Display:</th> 
     1865          <td> 
     1866            <input type="radio" value="true" name="subscription.display"/> yes 
     1867            <input type="radio" value="false" name="subscription.display" checked="checked"/> no 
     1868          </td> 
     1869        </tr> 
     1870        <tr> 
     1871          <th>Style:</th> 
     1872          <td> 
     1873            <xsl:variable name="subStyle" select="style"/> 
     1874            <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> 
     1875          </td> 
     1876        </tr> 
     1877        <tr> 
     1878          <th>Unremovable:</th> 
     1879          <td> 
     1880            <input type="radio" value="true" name="unremoveable" size="60"/> true 
     1881            <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false 
     1882          </td> 
     1883        </tr> 
     1884      </table> 
     1885      <table border="0" id="submitTable"> 
     1886        <tr> 
     1887          <td> 
     1888            <input type="submit" name="addSubscription" value="Add Subscription"/> 
     1889            <input type="submit" name="cancelled" value="Cancel"/> 
     1890            <input type="reset" value="Clear"/> 
     1891          </td> 
     1892        </tr> 
     1893      </table> 
     1894    </form> 
     1895  </xsl:template> 
     1896 
     1897  <xsl:template match="subscription" mode="modSubscription"> 
     1898    <h2>Modify Subscription</h2> 
     1899    <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post"> 
     1900      <table class="eventFormTable"> 
     1901        <tr> 
     1902          <th>Name*:</th> 
     1903          <td> 
     1904            <xsl:value-of select="name"/> 
     1905            <xsl:variable name="subName" select="name"/> 
     1906            <input type="hidden" value="{$subName}" name="name"/> 
     1907          </td> 
     1908        </tr> 
     1909        <xsl:choose> 
     1910          <xsl:when test="internal='false'"> 
     1911            <tr> 
     1912              <th>Uri:</th> 
     1913              <td> 
     1914                <xsl:variable name="subUri" select="uri"/> 
     1915                <input type="text" value="{$subUri}" name="subscription.uri" size="60"/> 
     1916              </td> 
     1917            </tr> 
     1918          </xsl:when> 
     1919          <xsl:otherwise> 
     1920            <tr> 
     1921              <th>Uri:</th> 
     1922              <td> 
     1923                <xsl:value-of select="uri"/> 
     1924              </td> 
     1925            </tr> 
     1926          </xsl:otherwise> 
     1927        </xsl:choose> 
     1928        <tr> 
     1929          <th>Display:</th> 
     1930          <td> 
     1931            <xsl:choose> 
     1932              <xsl:when test="display='true'"> 
     1933                <input type="radio" value="true" name="subscription.display" checked="checked"/> yes 
     1934                <input type="radio" value="false" name="subscription.display"/> no 
     1935              </xsl:when> 
     1936              <xsl:otherwise> 
     1937                <input type="radio" value="true" name="subscription.display"/> yes 
     1938                <input type="radio" value="false" name="subscription.display" checked="checked"/> no 
     1939              </xsl:otherwise> 
     1940            </xsl:choose> 
     1941          </td> 
     1942        </tr> 
     1943        <tr> 
     1944          <th>Style:</th> 
     1945          <td> 
     1946            <xsl:variable name="subStyle" select="style"/> 
     1947            <input type="text" value="{$subStyle}" name="subscription.style" size="60"/> 
     1948          </td> 
     1949        </tr> 
     1950        <tr> 
     1951          <th>Unremovable:</th> 
     1952          <td> 
     1953            <xsl:choose> 
     1954              <xsl:when test="unremoveable='true'"> 
     1955                <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true 
     1956                <input type="radio" value="false" name="unremoveable" size="60"/> false 
     1957              </xsl:when> 
     1958              <xsl:otherwise> 
     1959                <input type="radio" value="true" name="unremoveable" size="60"/> true 
     1960                <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false 
     1961              </xsl:otherwise> 
     1962            </xsl:choose> 
     1963          </td> 
     1964        </tr> 
     1965      </table> 
     1966      <table border="0" id="submitTable"> 
     1967        <tr> 
     1968          <td> 
     1969            <input type="submit" name="updateSubscription" value="Update Subscription"/> 
     1970            <input type="submit" name="cancelled" value="Cancel"/> 
     1971            <input type="reset" value="Reset"/> 
     1972          </td> 
     1973          <td align="right"> 
     1974            <input type="submit" name="delete" value="Delete Subscription"/> 
     1975          </td> 
     1976        </tr> 
     1977      </table> 
     1978    </form> 
     1979  </xsl:template> 
     1980 
     1981  <xsl:template name="subscriptionList"> 
     1982    <h3>Current subscriptions</h3> 
     1983    <table id="commonListTable"> 
     1984      <tr> 
     1985        <th>Name</th> 
     1986        <th>URI</th> 
     1987        <th>Style</th> 
     1988        <th>Display</th> 
     1989        <th>Unremovable</th> 
     1990        <th>External</th> 
     1991        <th>Deleted?</th> 
     1992      </tr> 
     1993      <xsl:for-each select="subscription"> 
     1994        <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>--> 
     1995        <tr> 
     1996          <td> 
     1997            <xsl:variable name="subname" select="name"/> 
     1998            <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}"> 
     1999              <xsl:value-of select="name"/> 
     2000            </a> 
     2001          </td> 
     2002          <td> 
     2003            <xsl:value-of select="uri"/> 
     2004          </td> 
     2005          <td> 
     2006            <xsl:value-of select="style"/> 
     2007          </td> 
     2008          <td class="center"> 
     2009            <xsl:if test="display='true'"> 
     2010              <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/> 
     2011            </xsl:if> 
     2012          </td> 
     2013          <td class="center"> 
     2014            <xsl:if test="unremoveable='true'"> 
     2015              <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/> 
     2016            </xsl:if> 
     2017          </td> 
     2018          <td class="center"> 
     2019            <xsl:if test="internal='false'"> 
     2020              <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/> 
     2021            </xsl:if> 
     2022          </td> 
     2023          <td class="center"> 
     2024            <xsl:if test="calendarDeleted='true'"> 
     2025              <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/> 
     2026            </xsl:if> 
     2027          </td> 
     2028        </tr> 
     2029      </xsl:for-each> 
     2030    </table> 
     2031    <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>--> 
     2032  </xsl:template> 
     2033 
    17802034  <!--==== ALARM OPTIONS ====--> 
    17812035  <xsl:template name="alarmOptions"> 
  • trunk/calendar3/webclient/war/WEB-INF/struts-config.xml

    r316 r319  
    416416    <!-- ..................... subscriptionss .......................... --> 
    417417 
    418     <action    path="/subscribe" 
     418     <action    path="/subs/showSubs" 
     419               type="org.bedework.webclient.BwRenderAction" 
     420               name="calForm" 
     421               scope="session" 
     422               validate="false"> 
     423      <forward name="success" path="/docs/subs/subscriptions.jsp"/> 
     424    </action> 
     425 
     426    <action    path="/subs/showModForm" 
     427               type="org.bedework.webclient.BwRenderAction" 
     428               name="calForm" 
     429               scope="session" 
     430               validate="false"> 
     431      <forward name="success" path="/docs/subs/modSubscription.jsp"/> 
     432    </action> 
     433 
     434    <action    path="/subs/fetch" 
     435               type="org.bedework.webcommon.subs.GetSubscriptionsAction" 
     436               name="peForm" 
     437               scope="session" 
     438               validate="false"> 
     439      <forward name="success" path="/subs/showSubs.rdo" redirect="true" /> 
     440    </action> 
     441 
     442    <action    path="/subs/fetchForUpdate" 
     443               type="org.bedework.webcommon.subs.FetchSubscriptionAction" 
     444               name="peForm" 
     445               scope="session" 
     446               validate="false"> 
     447      <forward name="notFound" path="/admin/showMain.rdo" redirect="true" /> 
     448      <forward name="continue" path="/subs/showModForm.rdo" redirect="true" /> 
     449    </action> 
     450 
     451    <action    path="/subs/initAdd" 
     452               type="org.bedework.webcommon.subs.InitSubscribeAction" 
     453               name="peForm" 
     454               scope="session" 
     455               validate="false"> 
     456      <forward name="cancelled" path="/subs/showSubs.rdo" redirect="true"/> 
     457      <forward name="success" path="/subs/showModForm.rdo" redirect="true" /> 
     458    </action> 
     459 
     460 
     461    <action    path="/subs/subscribe" 
    419462               type="org.bedework.webcommon.subs.SubscribeAction" 
    420                name="calForm" 
    421                scope="session" 
    422                validate="false"> 
    423     </action> 
    424  
    425     <action    path="/unsubscribe" 
     463               name="peForm" 
     464               scope="session" 
     465               validate="false"> 
     466      <forward name="cancelled" path="/subs/showSubs.rdo" redirect="true"/> 
     467      <forward name="retry" path="/subs/showModForm.rdo" redirect="true"/> 
     468      <forward name="reffed" path="/subs/showSubs.rdo" redirect="true"/> 
     469      <forward name="success" path="/subs/showSubs.rdo" redirect="true" /> 
     470    </action> 
     471 
     472    <action    path="/subs/unsubscribe" 
    426473               type="org.bedework.webcommon.subs.UnsubscribeAction" 
    427                name="calForm" 
    428                scope="session" 
    429                validate="false"> 
     474               name="peForm" 
     475               scope="session" 
     476               validate="false"> 
     477      <forward name="success" path="/subs/showSubs.rdo" redirect="true" /> 
    430478    </action> 
    431479 
  • trunk/calendar3/webclient/war/docs/header.jsp

    r196 r319  
    135135    <editLocation><genurl:rewrite action="editLoc.do"/></editLocation> 
    136136    <delLocation><genurl:rewrite action="delLocation.do"/></delLocation> 
    137     <subscribe><genurl:rewrite action="subscribe.do"/></subscribe> 
     137    <subscriptions> <!-- only those listed are used here (no need to clean up) --> 
     138      <fetch><genurl:link page="/subs/fetch.do?b=de"/></fetch> 
     139      <fetchForUpdate><genurl:link page="/subs/fetchForUpdate.do?b=de"/></fetchForUpdate> 
     140      <initAdd><genurl:link page="/subs/initAdd.do?b=de"/></initAdd> 
     141      <subscribe><genurl:link page="/subs/subscribe.do?b=de"/></subscribe> 
     142    </subscriptions> 
    138143    <export><genurl:rewrite action="export.do"/></export> 
    139144