Changeset 2050

Show
Ignore:
Timestamp:
01/28/09 17:40:06
Author:
johnsa
Message:

public and user clients:
- add xproperties to all event output
- change display subscriptions (aliases) instead of calendar in general views
- add some xsl utilities

scripts:
- update windows adduser script

Files:

Legend:

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

    r1978 r2050  
    9191    </xsl:if> 
    9292  </xsl:template> 
     93 
     94  <xsl:template name="substring-afterLastInstanceOf"> 
     95    <xsl:param name="string" /> 
     96    <xsl:param name="char" /> 
     97    <xsl:choose> 
     98      <xsl:when test="contains($string, $char)"> 
     99        <xsl:call-template name="substring-afterLastInstanceOf"> 
     100          <xsl:with-param name="string" select="substring-after($string, $char)" /> 
     101          <xsl:with-param name="char" select="$char" /> 
     102        </xsl:call-template> 
     103      </xsl:when> 
     104      <xsl:otherwise><xsl:value-of select="$string" /></xsl:otherwise> 
     105    </xsl:choose> 
     106  </xsl:template> 
     107 
    93108</xsl:stylesheet> 
    94109 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/blue.css

    r1833 r2050  
    824824  white-space: nowrap; 
    825825} 
     826#listTable .eventSubscription { 
     827  font-size: 0.8em; 
     828} 
    826829#calPageTable ul.calendarTree li { 
    827830  font-weight: bold; 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

    r1999 r2050  
    6161  <xsl:include href="../../../bedework-common/default/default/errors.xsl"/> 
    6262  <xsl:include href="../../../bedework-common/default/default/messages.xsl"/> 
     63  <xsl:include href="../../../bedework-common/default/default/util.xsl"/> 
    6364 
    6465  <!-- DEFINE GLOBAL CONSTANTS --> 
     
    854855        </tr> 
    855856      </xsl:if> 
     857      <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
     858        <tr> 
     859          <td class="fieldname">Topical Area:</td> 
     860          <td class="fieldval"> 
     861            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     862              <xsl:variable name="calUrl" select="values/text"/> 
     863              <a href="{$setSelection}&amp;calUrl={$calUrl}"> 
     864                <xsl:call-template name="substring-afterLastInstanceOf"> 
     865                  <xsl:with-param name="string" select="values/text"/> 
     866                  <xsl:with-param name="char">/</xsl:with-param> 
     867                </xsl:call-template> 
     868              </a><xsl:if test="position()!=last()">, </xsl:if> 
     869            </xsl:for-each> 
     870          </td> 
     871        </tr> 
     872      </xsl:if> 
    856873      <xsl:if test="calendar/path!=''"> 
    857874        <tr> 
     
    10241041                          </xsl:if> 
    10251042                        </em> 
    1026                         - <xsl:value-of select="calendar/name"/> 
     1043                        - 
     1044                        <span class="eventSubscription"> 
     1045                          <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
     1046                            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     1047                              <xsl:call-template name="substring-afterLastInstanceOf"> 
     1048                                <xsl:with-param name="string" select="values/text"/> 
     1049                                <xsl:with-param name="char">/</xsl:with-param> 
     1050                              </xsl:call-template> 
     1051                              <xsl:if test="position()!=last()">, </xsl:if> 
     1052                            </xsl:for-each> 
     1053                          </xsl:if> 
     1054                        </span> 
    10271055                      </a> 
    10281056                      <xsl:if test="link != ''"> 
     
    10351063                        <xsl:value-of select="summary"/> 
    10361064                        <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if> 
    1037                          - <em><xsl:value-of select="calendar/name"/></em> 
     1065                         - 
     1066                        <span class="eventSubscription"> 
     1067                          <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
     1068                            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     1069                              <xsl:call-template name="substring-afterLastInstanceOf"> 
     1070                                <xsl:with-param name="string" select="values/text"/> 
     1071                                <xsl:with-param name="char">/</xsl:with-param> 
     1072                              </xsl:call-template> 
     1073                              <xsl:if test="position()!=last()">, </xsl:if> 
     1074                            </xsl:for-each> 
     1075                          </xsl:if> 
     1076                        </span> 
    10381077                      </a> 
    10391078                    </xsl:otherwise> 
     
    13431382            Location: <xsl:value-of select="location/address"/><br/> 
    13441383          </xsl:if> 
    1345           Calendar: <xsl:value-of select="calendar/name"/> 
     1384          <xsl:if test="xproperties/X-BEDEWORK-ALIAS"> 
     1385            Topical Area: 
     1386              <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     1387                <xsl:call-template name="substring-afterLastInstanceOf"> 
     1388                  <xsl:with-param name="string" select="values/text"/> 
     1389                  <xsl:with-param name="char">/</xsl:with-param> 
     1390                </xsl:call-template> 
     1391                <xsl:if test="position()!=last()">, </xsl:if> 
     1392              </xsl:for-each> 
     1393          </xsl:if> 
    13461394        </span> 
    13471395      </a> 
     
    17711819  </xsl:template> 
    17721820 
    1773   <!--==== UTILITY TEMPLATES ====--> 
    1774  
    1775   <!-- search and replace template taken from 
    1776        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html --> 
    1777   <xsl:template name="replace"> 
    1778     <xsl:param name="string" select="''"/> 
    1779     <xsl:param name="pattern" select="''"/> 
    1780     <xsl:param name="replacement" select="''"/> 
    1781     <xsl:choose> 
    1782       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> 
    1783         <xsl:value-of select="substring-before($string, $pattern)"/> 
    1784         <xsl:copy-of select="$replacement"/> 
    1785         <xsl:call-template name="replace"> 
    1786           <xsl:with-param name="string" select="substring-after($string, $pattern)"/> 
    1787           <xsl:with-param name="pattern" select="$pattern"/> 
    1788           <xsl:with-param name="replacement" select="$replacement"/> 
    1789         </xsl:call-template> 
    1790       </xsl:when> 
    1791       <xsl:otherwise> 
    1792         <xsl:value-of select="$string"/> 
    1793       </xsl:otherwise> 
    1794     </xsl:choose> 
    1795   </xsl:template> 
    1796  
    17971821  <!--==== FOOTER ====--> 
    17981822 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.css

    r2045 r2050  
    16591659  height: 10px; 
    16601660} 
    1661 #freeBusy th.left { 
     1661#freeBusy th.left, 
     1662#freeBusy td.left { 
    16621663  text-align: left; 
    16631664} 
     
    19421943  font-style: italic; 
    19431944} 
    1944 #bedework .left { 
    1945   float: left; 
    1946 } 
    19471945#bedework .titleButton { 
    19481946  display: block; 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r2047 r2050  
    4242    special, consequential, or incidental damages related to the software, 
    4343    to the maximum extent the law permits. --> 
     44 
     45  <!-- GENERATE KEYS --> 
     46  <!-- We occasionally need to pick out unique events from the calendar tree view 
     47       which breaks up an event across multiple days.  In the future, we may 
     48       work from a list of unique events and build the tree from it in the UI. --> 
     49       <xsl:key name="eventUid" match="event" use="guid"/> 
     50 
    4451 
    4552  <!-- DEFINE INCLUDES --> 
     
    392399    <xsl:if test="/bedework/page='attendees'"> 
    393400      <script type="text/javascript" src="/bedework-common/javascript/jquery/jquery-1.2.6.min.js">&#160;</script> 
    394       <script type="text/javascript" src="/bedework-common/javascript/jquery/autocomplete/jquery.autocomplete.js">&#160;</script> 
     401      <script type="text/javascript" src="/bedework-common/javascript/jquery/autocomplete/bw-jquery.autocomplete.js">&#160;</script> 
    395402      <script type="text/javascript" src="/bedework-common/javascript/jquery/autocomplete/jquery.bgiframe.min.js">&#160;</script> 
    396403      <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAttendees.js">&#160;</script> 
     
    966973    <table id="listTable" border="0" cellpadding="0" cellspacing="0"> 
    967974      <xsl:choose> 
    968         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)"> 
     975        <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event[not(entityType=2)])"> 
    969976          <tr> 
    970977            <td class="noEventsCell"> 
     
    15121519        </h3> 
    15131520        <ul class="tasks"> 
    1514           <xsl:apply-templates select="/bedework/eventscalendar//event[entityType=2]" mode="tasks"/> 
     1521          <xsl:apply-templates select="/bedework/eventscalendar//event[entityType=2 and generate-id() = generate-id(key('eventUid',guid)[1])]" mode="tasks"/> 
    15151522        </ul> 
    15161523      </div> 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkAttendees.js

    r2048 r2050  
    1 var entries = { 
    2   "microformats": { 
    3     "vcard": [ 
    4     { 
    5       "version": { 
    6         "value": "4.0" 
    7       }, 
    8  
    9       "rev": { 
    10         "value": "20080811051937Z" 
    11       }, 
    12  
    13       "source": [{ 
    14         "value": "\/ucarddav\/douglm.vcf" 
    15       }], 
    16       "uid": { 
    17         "value": "\/ucarddav\/douglm.vcf" 
    18       }, 
    19       "mail": [{ 
    20         "value": "douglm@mysite.org" 
    21       }], 
    22  
    23       "kind": { 
    24         "value": "individual" 
    25       }, 
    26  
    27       "fn": { 
    28         "value": "Douglass, Mike" 
    29       } 
    30  
    31     }, { 
    32       "version": { 
    33         "value": "4.0" 
    34       }, 
    35  
    36       "rev": { 
    37         "value": "20080812153529Z" 
    38       }, 
    39  
    40       "source": [{ 
    41         "value": "\/ucarddav\/johnsa.vcf" 
    42       }], 
    43       "uid": { 
    44         "value": "\/ucarddav\/johnsa.vcf" 
    45       }, 
    46  
    47       "mail": [{ 
    48         "value": "johnsa@rpi.edu", 
    49         "value": "johnsa@mysite.org" 
    50       }], 
    51  
    52       "kind": { 
    53         "value": "individual" 
    54       }, 
    55  
    56       "fn": { 
    57         "value": "Johnson, Arlen" 
    58       } 
    59  
    60     }, { 
    61       "version": { 
    62         "value": "4.0" 
    63       }, 
    64  
    65       "rev": { 
    66         "value": "20081103181729Z" 
    67       }, 
    68  
    69       "source": [{ 
    70         "value": "\/ucarddav\/calowner01.vcf" 
    71       }], 
    72       "uid": { 
    73         "value": "\/ucarddav\/calowner01.vcf" 
    74       }, 
    75  
    76       "mail": [{ 
    77         "value": "bogus@mysite.org" 
    78       }], 
    79  
    80       "kind": { 
    81         "value": "individual" 
    82       }, 
    83  
    84       "fn": { 
    85         "value": "last, first" 
    86       } 
    87  
    88     }] 
    89   } 
    90 
    91  
    92 //alert(entries.microformats.vcard[0].fn.value); 
     1var carddavUrl = "http://localhost:8080/ucarddav/find"; 
    932 
    943var options = { 
     
    10413  dataType: 'json', 
    10514 
     15  /* override the parse function to map 
     16     our carddav json object to the expected data 
     17     structure for use with autocomplete */ 
    10618  parse: function(data) { 
    10719    var parsed = []; 
     
    10921    for (var i = 0; i < data.length; i++) { 
    11022      dataRow = { 
    111         fn: data[i].fn.value
    112         email: data[i].email[0].value
    113         uri: data[i].caladruri.value
    114         type: data[i].kind.value 
     23        fn: (data[i].fn.value)?data[i].fn.value:""
     24        email: (data[i].email[0].value)?data[i].email[0].value:""
     25        uri: (data[i].caladruri.value)?data[i].caladruri.value:""
     26        type: (data[i].kind.value)?data[i].kind.value:"" 
    11527      }; 
    11628      parsed[i] = { 
     
    12032      }; 
    12133    } 
    122     //alert("parsedlen=" + parsed.length); 
    12334    return parsed; 
    12435  }, 
     
    13647 
    13748jQuery(document).ready(function($) { 
    138   $('#bwRaUri').autocomplete("http://localhost:8080/ucarddav/find", options) 
     49  $('#bwRaUri').autocomplete(carddavUrl, options) 
    13950}); 
    140  
    141 /* 
    142  
    143 var entries = [ 
    144   { name: "Peter Pan", address: "peter@pan.de", uri: "someUri", type: "user"}, 
    145   { name: "Molly", address: "molly@yahoo.com", uri: "someUri", type: "user"}, 
    146   { name: "Forneria Marconi", address: "live@japan.jp", uri: "someUri", type: "user"}, 
    147   { name: "VCC 301", address: "vcc301@rpi.edu", uri: "someUri", type: "resource"}, 
    148   { name: "CMT Communication and Middleware Technologies", address: "cmt@rpi.edu", uri: "someUri", type: "group"}, 
    149   { name: "Don Corleone", address: "don@vegas.com", uri: "someUri", type: "user"}, 
    150   { name: "Mc Chick", address: "info@donalds.org", uri: "someUri", type: "user"}, 
    151   { name: "Donnie Darko", address: "dd@timeshift.info", uri: "someUri", type: "user"}, 
    152   { name: "Quake The Net", address: "webmaster@quakenet.org", uri: "someUri", type: "user"}, 
    153   { name: "Dr. Write", address: "write@writable.com", uri: "someUri", type: "user"} 
    154 ]; 
    155  
    156   $(document).ready(function(){ 
    157  
    158   function formatItem(row) { 
    159     return row[0] + " (<strong>id: " + row[1] + "</strong>)"; 
    160   } 
    161  
    162   function formatResult(row) { 
    163     return row[0].replace(/(<.+?>)/gi, ''); 
    164   } 
    165  
    166   $("#bwRaUri").autocomplete(entries, { 
    167     minChars: 0, 
    168     width: 310, 
    169     matchContains: false, 
    170     autoFill: false, 
    171     formatItem: function(row, i, max) { 
    172       return " \"" + row.name + "\" [" + row.address + "]"; 
    173     }, 
    174     formatMatch: function(row, i, max) { 
    175       return row.name + " " + row.address; 
    176     }, 
    177     formatResult: function(row) { 
    178       return row.address; 
    179     } 
    180   }); 
    181  
    182 }); 
    183  
    184  
    185 */