Changeset 1439

Show
Ignore:
Timestamp:
06/20/07 17:25:05
Author:
johnsa
Message:

user client: preparatory work for a javascript access control widget.

Files:

Legend:

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

    r1438 r1439  
    1515 
    1616  <!-- ********************************************************************** 
    17     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     17    Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
    1818 
    1919    Redistribution and use of this distribution in source and binary forms, 
     
    30143014    <!-- ========== --> 
    30153015    <div id="bwEventTab-Access" class="invisible"> 
    3016       <div id="sharingBox"> 
     3016      <div id="sharingBox">         
    30173017        <xsl:apply-templates select="/bedework/eventAccess/access/acl" mode="currentAccess"> 
    30183018          <xsl:with-param name="action" select="$event-setAccess"/> 
     
    30223022        </xsl:apply-templates> 
    30233023        <xsl:call-template name="entityAccessForm"> 
    3024           <xsl:with-param name="hideSubmitButton">true</xsl:with-param> 
     3024          <xsl:with-param name="method">2</xsl:with-param> 
    30253025        </xsl:call-template> 
    3026         <p> 
    3027           <input name="updateEventAccess" type="submit" value="update access"/> 
    3028         </p> 
    30293026      </div> 
    30303027    </div> 
     
    34673464               being used to pick out just the freebusy node and 
    34683465               shorten the select statements below. --> 
    3469             <xsl:variable name="formattedStartDate"> 
    3470               <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="number(substring(start,5,2))"/>-<xsl:value-of select="number(substring(start,7,2))"/> 
    3471             </xsl:variable> 
    3472             <xsl:variable name="formattedEndDate"> 
    3473               <xsl:value-of select="substring(end,1,4)"/>-<xsl:value-of select="number(substring(end,5,2))"/>-<xsl:value-of select="number(substring(end,7,2))"/> 
    3474             </xsl:variable> 
    3475  
    34763466            <table id="freeBusyAgg"> 
    34773467              <tr> 
     
    35533543                        </xsl:choose> 
    35543544                        <span class="eventTip"> 
    3555                           <xsl:value-of select="$formattedStartDate"/><br/> 
     3545                          <xsl:value-of select="substring(../dateString,1,4)"/>-<xsl:value-of select="number(substring(../dateString,5,2))"/>-<xsl:value-of select="number(substring(../dateString,7,2))"/> 
     3546                          <br/> 
    35563547                          <strong> 
    35573548                            <xsl:call-template name="timeFormatter"> 
     
    37933784        <tr> 
    37943785          <th> 
    3795             <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="substring(start,5,2)"/>-<xsl:value-of select="substring(start,7,2)"/> 
     3786            <xsl:value-of select="number(substring(dateString,5,2))"/>-<xsl:value-of select="number(substring(dateString,7,2))"/> 
    37963787          </th> 
    37973788          <xsl:for-each select="period"> 
     
    69176908  <xsl:template name="entityAccessForm"> 
    69186909    <xsl:param name="type"/><!-- optional: currently used for inbox and outbox to conditionally display scheduling access --> 
    6919     <xsl:param name="hideSubmitButton">false</xsl:param> 
     6910    <xsl:param name="method">1</xsl:param><!-- optional: 
     6911      there are two methods of setting access 
     6912      - method 1, the older method, uses a single request/response per principal 
     6913      - method 2 constructs a javascript object that commits the entire ACL  
     6914        structure in a single request 
     6915      Both methods are currently supported.  Method one is used for calendars, 
     6916      method two for setting event access.  At some point we may move all access 
     6917      control setting to method two. --> 
     6918    <xsl:param name="acl"/><!-- nodeset of entity acls used to initialize  
     6919      javascript object. Required for method two. --> 
     6920       
     6921    <xsl:if test="$method = '2' and $acl != ''"> 
     6922      <!-- do some initialization here --> 
     6923    </xsl:if> 
    69206924    <table cellpadding="0" id="shareFormTable" class="common"> 
    69216925      <tr> 
     
    71887192      </tr> 
    71897193    </table> 
    7190     <xsl:if test="$hideSubmitButton = 'false'"> 
    7191       <input type="submit" name="submit" value="Submit"/> 
    7192     </xsl:if> 
     7194    <xsl:choose> 
     7195      <xsl:when test="$method = '2'"> 
     7196        <input type="button" name="updateACLs" value="update access" onclick="updateAccessAcl(this.form)"/> 
     7197      </xsl:when> 
     7198      <xsl:otherwise> 
     7199        <input type="submit" name="submit" value="Submit"/> 
     7200      </xsl:otherwise> 
     7201    </xsl:choose> 
    71937202  </xsl:template> 
    71947203 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedework.js

    r1424 r1439  
     1/* ********************************************************************** 
     2    Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     3 
     4    Redistribution and use of this distribution in source and binary forms, 
     5    with or without modification, are permitted provided that: 
     6       The above copyright notice and this permission notice appear in all 
     7        copies and supporting documentation; 
     8 
     9        The name, identifiers, and trademarks of Rensselaer Polytechnic 
     10        Institute are not used in advertising or publicity without the 
     11        express prior written permission of Rensselaer Polytechnic Institute; 
     12 
     13    DISCLAIMER: The software is distributed" AS IS" without any express or 
     14    implied warranty, including but not limited to, any implied warranties 
     15    of merchantability or fitness for a particular purpose or any warrant)' 
     16    of non-infringement of any current or pending patent rights. The authors 
     17    of the software make no representations about the suitability of this 
     18    software for any particular purpose. The entire risk as to the quality 
     19    and performance of the software is with the user. Should the software 
     20    prove defective, the user assumes the cost of all necessary servicing, 
     21    repair or correction. In particular, neither Rensselaer Polytechnic 
     22    Institute, nor the authors of the software are liable for any indirect, 
     23    special, consequential, or incidental damages related to the software, 
     24    to the maximum extent the law permits. */ 
     25 
    126var debug = false; // very basic debugging for now 
    227 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkAccess.js

    r1284 r1439  
    1 // this toggles various elements in the access control form when 
     1/* Bedework Access control form functions 
     2 
     3   Bedework uses to methods to set access control.  The first and older method  
     4   is to send a single access control string per principal in one  
     5   request/response cycle.  The second and more current method (which is  
     6   required in the event form) is to build a javascript object representing  
     7   the acls on an item (e.g. an event), manipulate the object with the GUI, and send 
     8   all the acls in a single request parameter.  Both methods are currently used. 
     9   Method one is used for calendar access, method two for event access.  In time 
     10   we will probably move all access control to use method two. 
     11 
     12/* ********************************************************************** 
     13    Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     14 
     15    Redistribution and use of this distribution in source and binary forms, 
     16    with or without modification, are permitted provided that: 
     17       The above copyright notice and this permission notice appear in all 
     18        copies and supporting documentation; 
     19 
     20        The name, identifiers, and trademarks of Rensselaer Polytechnic 
     21        Institute are not used in advertising or publicity without the 
     22        express prior written permission of Rensselaer Polytechnic Institute; 
     23 
     24    DISCLAIMER: The software is distributed" AS IS" without any express or 
     25    implied warranty, including but not limited to, any implied warranties 
     26    of merchantability or fitness for a particular purpose or any warrant)' 
     27    of non-infringement of any current or pending patent rights. The authors 
     28    of the software make no representations about the suitability of this 
     29    software for any particular purpose. The entire risk as to the quality 
     30    and performance of the software is with the user. Should the software 
     31    prove defective, the user assumes the cost of all necessary servicing, 
     32    repair or correction. In particular, neither Rensselaer Polytechnic 
     33    Institute, nor the authors of the software are liable for any indirect, 
     34    special, consequential, or incidental damages related to the software, 
     35    to the maximum extent the law permits. */ 
     36 
     37// This toggles various elements in the access control form when 
    238// a checkbox for All, Read, Write, Bind, Schedule, or None is clicked. 
    339// Each howItem (checkbox) has a corresponding allow/deny flag (radio button) 
     
    170206} 
    171207// Gather up the how values on access form submission and set the how field. 
     208// This is used for the non-javasscript widget approach to setting access. 
    172209// If in "basic" mode: 
    173210//   Set the value of how to the value of the basicHowItem radio button. 
     
    200237  formObj.how.value = howString; 
    201238} 
     239 
     240 
     241/* METHOD TWO FUNCTIONS*/ 
     242// An array of bwAcl objects are initialized at the point of the XSLT transform. 
     243// This is defined in the XSLT file as "bwAclArray" and is used here.  
     244 
     245// ACL Object 
     246function bwAcl() { 
     247  this.who; 
     248  this.whoType; 
     249  this.how; 
     250} 
     251// Update the bwACL object 
     252function updateAccessAcl(formObj) { 
     253   
     254} 
     255function displayAccessAcl() { 
     256   
     257} 
     258function setAccessHowMethodTwo() { 
     259   
     260} 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1401 r1439  
     1// Bedework event form functions 
     2 
     3/* ********************************************************************** 
     4    Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     5 
     6    Redistribution and use of this distribution in source and binary forms, 
     7    with or without modification, are permitted provided that: 
     8       The above copyright notice and this permission notice appear in all 
     9        copies and supporting documentation; 
     10 
     11        The name, identifiers, and trademarks of Rensselaer Polytechnic 
     12        Institute are not used in advertising or publicity without the 
     13        express prior written permission of Rensselaer Polytechnic Institute; 
     14 
     15    DISCLAIMER: The software is distributed" AS IS" without any express or 
     16    implied warranty, including but not limited to, any implied warranties 
     17    of merchantability or fitness for a particular purpose or any warrant)' 
     18    of non-infringement of any current or pending patent rights. The authors 
     19    of the software make no representations about the suitability of this 
     20    software for any particular purpose. The entire risk as to the quality 
     21    and performance of the software is with the user. Should the software 
     22    prove defective, the user assumes the cost of all necessary servicing, 
     23    repair or correction. In particular, neither Rensselaer Polytechnic 
     24    Institute, nor the authors of the software are liable for any indirect, 
     25    special, consequential, or incidental damages related to the software, 
     26    to the maximum extent the law permits. */ 
     27 
    128dojo.require("dojo.event.*"); 
    229dojo.require("dojo.widget.*"); 
     
    835  setRecurrence(formObj); 
    936  setAccessHow(formObj); 
     37  setAccessAcl(formObj); 
    1038} 
    1139function setDates(formObj) { 
     
    352380 
    353381 
     382