Changeset 509

Show
Ignore:
Timestamp:
05/28/06 20:16:48
Author:
douglm
Message:

Caldav updates to finish current-user-prvilege-set

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java

    r415 r509  
    217217//        Acl acl = svci.getAcl(getEvent()); 
    218218        Acl acl = eventInfo.getCurrentAccess().acl; 
    219         xmlAccess = AccessAppUtil.getXmlAclString(acl); 
     219        xmlAccess = AccessXmlUtil.getXmlAclString(acl); 
    220220      } 
    221221    } catch (Throwable t) { 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWIntf.java

    r508 r509  
    5454package edu.rpi.cct.uwcal.caldav; 
    5555 
    56 import org.bedework.appcommon.AccessAppUtil; 
     56import org.bedework.appcommon.AccessXmlUtil; 
    5757import org.bedework.calfacade.BwCalendar; 
    5858import org.bedework.calfacade.BwEvent; 
     
    785785    findPriv: { 
    786786      // ENUM 
    787       for (priv = 0; priv < AccessAppUtil.privTags.length; priv++) { 
    788         if (MethodBase.nodeMatches(el, AccessAppUtil.privTags[priv])) { 
     787      for (priv = 0; priv < AccessXmlUtil.privTags.length; priv++) { 
     788        if (MethodBase.nodeMatches(el, AccessXmlUtil.privTags[priv])) { 
    789789          break findPriv; 
    790790        } 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavCalNode.java

    r507 r509  
    6363import org.bedework.icalendar.VFreeUtil; 
    6464 
     65import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    6566import edu.rpi.cct.webdav.servlet.shared.WebdavIntfException; 
    6667 
     68import java.util.ArrayList; 
    6769import java.util.Collection; 
    68 import java.util.Enumeration; 
    69 import java.util.Vector; 
    7070 
    7171import net.fortuna.ical4j.model.Calendar; 
     
    139139 
    140140      if (events == null) { 
    141         return new Vector(); 
     141        return new ArrayList(); 
    142142      } 
    143143 
     
    187187   * ==================================================================== */ 
    188188 
    189   /** Return all properties special to this namespace for this node. 
    190    * For example, if there is a creator property there will be a 
    191    * WebdavProperty object for the property 
    192    * 
    193    * @return Enumeration 
    194    */ 
    195   public Enumeration properties() { 
    196     return null; 
     189  public CurrentAccess getCurrentAccess() throws WebdavIntfException { 
     190    BwCalendar cal = getCDURI().getCal(); 
     191    if (cal == null) { 
     192      return null; 
     193    } 
     194 
     195    return cal.getCurrentAccess(); 
    197196  } 
    198197 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavComponentNode.java

    r508 r509  
    6464//import org.bedework.icalendar.IcalUtil; 
    6565 
     66import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    6667import edu.rpi.cct.uwcal.caldav.calquery.CalendarData; 
    6768import edu.rpi.cct.webdav.servlet.shared.WebdavIntfException; 
     
    316317   * ==================================================================== */ 
    317318 
     319  public CurrentAccess getCurrentAccess() throws WebdavIntfException { 
     320    if (eventInfo == null) { 
     321      return null; 
     322    } 
     323 
     324    return eventInfo.getCurrentAccess(); 
     325  } 
     326 
    318327  public void setLastmodDate(String val) throws WebdavIntfException { 
    319328    init(true); 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavUserNode.java

    r2 r509  
    5858import org.bedework.icalendar.IcalTranslator; 
    5959 
     60import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    6061import edu.rpi.cct.webdav.servlet.shared.WebdavIntfException; 
    6162 
    6263import java.util.Collection; 
    63 import java.util.Enumeration; 
    6464 
    6565/** Class to represent a user in caldav. 
     
    127127   * ==================================================================== */ 
    128128 
    129   /** Return all properties special to this namespace for this node. 
    130    * For example, if there is a creator property there will be a 
    131    * WebdavProperty object for the property 
    132    * 
    133    * @return Enumeration 
    134    */ 
    135   public Enumeration properties() { 
     129  public CurrentAccess getCurrentAccess() throws WebdavIntfException { 
    136130    return null; 
    137131  } 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/EmitAccess.java

    r415 r509  
    5454package edu.rpi.cct.uwcal.caldav; 
    5555 
    56 import org.bedework.appcommon.AccessAppUtil; 
     56import org.bedework.appcommon.AccessXmlUtil; 
     57 
    5758import edu.rpi.sss.util.xml.XmlEmit; 
    5859 
     
    6162 * 
    6263 */ 
    63 public class EmitAccess extends AccessAppUtil { 
     64public class EmitAccess extends AccessXmlUtil { 
    6465  private String namespacePrefix; 
    6566 
  • trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/shared/WebdavNsIntf.java

    r508 r509  
    5555package edu.rpi.cct.webdav.servlet.shared; 
    5656 
     57import org.bedework.appcommon.AccessXmlUtil; 
    5758import org.bedework.davdefs.WebdavTags; 
    5859 
     
    6061import edu.rpi.sss.util.xml.XmlEmit; 
    6162import edu.rpi.sss.util.xml.XmlUtil; 
     63import edu.rpi.cct.uwcal.access.PrivilegeSet; 
     64import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    6265import edu.rpi.cct.webdav.servlet.common.MethodBase; 
    6366import edu.rpi.cct.webdav.servlet.common.WebdavServlet; 
     
    672675      } else if (tag.equals(WebdavTags.currentUserPrivilegeSet)) { 
    673676        // access 5.3 
     677        CurrentAccess ca = node.getCurrentAccess(); 
     678        if (ca != null) { 
     679          PrivilegeSet ps = ca.privileges; 
     680          char[] privileges = ps.getPrivileges(); 
     681 
     682          openPropstat(); 
     683          AccessXmlUtil.emitCurrentPrivSet(xml, privileges); 
     684          closePropstat(); 
     685        } 
    674686      } else if (tag.equals(WebdavTags.acl)) { 
    675687        // access 5.4 
  • trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/shared/WebdavNsNode.java

    r2 r509  
    5555package edu.rpi.cct.webdav.servlet.shared; 
    5656 
     57import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
     58 
    5759import java.io.Serializable; 
    5860import javax.servlet.http.HttpServletResponse; 
     
    155157   */ 
    156158  public abstract String getOwner() throws WebdavIntfException; 
     159 
     160  /** Get the current access granted to this principal for this node. 
     161   * 
     162   * @return CurrentAccess 
     163   * @throws WebdavIntfException 
     164   */ 
     165  public abstract CurrentAccess getCurrentAccess() throws WebdavIntfException; 
    157166 
    158167  /* ==================================================================== 
  • trunk/calendar3/test/caldavTestData/eg/content/eg15.xml

    r423 r509  
    55    <D:owner/> 
    66    <D:acl/> 
     7    <D:current-user-privilege-set/> 
    78    <C:calendar-timezone/> 
    89    <C:max-resource-size/> 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitAclTag.java

    r331 r509  
    5454package org.bedework.webcommon.taglib; 
    5555 
    56 import org.bedework.appcommon.AccessAppUtil; 
     56 
     57import org.bedework.appcommon.AccessXmlUtil; 
    5758 
    5859import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
     
    105106    } 
    106107     
    107     return AccessAppUtil.getXmlAclString(ca.acl); 
     108    return AccessXmlUtil.getXmlAclString(ca.acl); 
    108109  } 
    109110} 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitCurrentPrivsTag.java

    r415 r509  
    5454package org.bedework.webcommon.taglib; 
    5555 
    56 import org.bedework.appcommon.AccessAppUtil; 
     56 
     57import org.bedework.appcommon.AccessXmlUtil; 
    5758 
    5859import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
     
    122123    } 
    123124 
    124     return AccessAppUtil.getCurrentPrivSetString(ca.privileges); 
     125    return AccessXmlUtil.getCurrentPrivSetString(ca.privileges); 
    125126  } 
    126127