Changeset 415

Show
Ignore:
Timestamp:
04/22/06 23:27:54
Author:
douglm
Message:

Almost completely javadoc changes. No functional differences except...

Changed one instance of Vector to ArrayList?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Ace.java

    r376 r415  
    399399   * 
    400400   * @param acl 
    401    * @param priv
     401   * @param getPrivilege
    402402   * @param name 
    403403   * @param whoType 
  • trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/PrivilegeDefs.java

    r376 r415  
    7676  public static final char unspecified = '1'; 
    7777 
     78  /** Shows an ace was inherited 
     79   */ 
    7880  public static final char inheritedFlag = 'I'; 
    7981 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/AccessAppUtil.java

    r331 r415  
    7777 */ 
    7878public class AccessAppUtil implements Serializable { 
     79  /** xml rpivilege tags */ 
    7980  public static final QName[] privTags = { 
    8081    WebdavTags.all,              // privAll = 0; 
     
    9596  private XmlEmit xml; 
    9697 
    97   /** Acls use tags in the webdav and caldav namespace.  
     98  /** Acls use tags in the webdav and caldav namespace. 
    9899   * 
    99100   * @param xml 
     
    102103    this.xml = xml; 
    103104  } 
    104    
     105 
     106  /** Represent the acl as an xml string 
     107   * 
     108   * @param acl 
     109   * @return String xml representation 
     110   * @throws CalFacadeException 
     111   */ 
    105112  public static String getXmlAclString(Acl acl) throws CalFacadeException { 
    106113    try { 
     
    109116      xml.startEmit(su); 
    110117      AccessAppUtil au = new AccessAppUtil(xml); 
    111        
     118 
    112119      au.emitAcl(acl); 
    113        
     120 
    114121      su.close(); 
    115        
     122 
    116123      return su.toString(); 
    117124    } catch (CalFacadeException cfe) { 
     
    148155  } 
    149156 
     157  /** Emit an acl as an xml string the current xml writer 
     158   * 
     159   * @param acl 
     160   * @throws CalFacadeException 
     161   */ 
    150162  public void emitAcl(Acl acl) throws CalFacadeException { 
    151163    try { 
     
    159171  } 
    160172 
     173  /** Emit the Collection of aces as an xml sing the current xml writer 
     174   * 
     175   * @param aces 
     176   * @throws CalFacadeException 
     177   */ 
    161178  public void emitAces(Collection aces) throws CalFacadeException { 
    162179    try { 
     
    188205 
    189206  /** Produce an xml representation of supported privileges. This is the same 
    190    * at all points in the system and is identical to the webdav/caldav  
     207   * at all points in the system and is identical to the webdav/caldav 
    191208   * requirements. 
    192    *  
     209   * 
    193210   * @throws CalFacadeException 
    194211   */ 
     
    196213    try { 
    197214      xml.openTag(WebdavTags.supportedPrivilegeSet); 
    198        
     215 
    199216      emitSupportedPriv(Privileges.getPrivAll()); 
    200        
     217 
    201218      xml.closeTag(WebdavTags.supportedPrivilegeSet); 
    202219    } catch (Throwable t) { 
     
    204221    } 
    205222  } 
    206    
     223 
    207224  /** Produce an xml representation of current user privileges from an array 
    208225   * of allowed/disallowed/unspecified flags indexed by a privilege index. 
    209    *  
    210    * @param privs    char[] of allowed/disallowed 
     226   * 
     227   * @param privileges    char[] of allowed/disallowed 
    211228   * @throws CalFacadeException 
    212229   */ 
     
    214231    try { 
    215232      xml.openTag(WebdavTags.currentUserPrivilegeSet); 
    216        
     233 
    217234      for (int pi = 0; pi < privileges.length; pi++) { 
    218235        if (privileges[pi] == PrivilegeDefs.allowed) { 
    219236          // XXX further work - don't emit abstract privs or contained privs. 
    220237          QName pr = privTags[pi]; 
    221            
     238 
    222239          if (pr != null) { 
    223240            xml.propertyTagVal(WebdavTags.privilege, pr); 
     
    225242        } 
    226243      } 
    227        
     244 
    228245      xml.closeTag(WebdavTags.currentUserPrivilegeSet); 
    229246    } catch (Throwable t) { 
     
    231248    } 
    232249  } 
    233    
     250 
    234251  /** Produce an xml representation of current user privileges from an array 
    235252   * of allowed/disallowed/unspecified flags indexed by a privilege index, 
    236253   * returning the representation a a String 
    237    *  
    238    * @param privs    char[] of allowed/disallowed 
    239    * @return String xml  
    240    * @throws CalFacadeException 
    241    */ 
    242   public static String getCurrentPrivSetString(char[] privileges)  
     254   * 
     255   * @param privileges    char[] of allowed/disallowed 
     256   * @return String xml 
     257   * @throws CalFacadeException 
     258   */ 
     259  public static String getCurrentPrivSetString(char[] privileges) 
    243260          throws CalFacadeException { 
    244261    try { 
     
    247264      xml.startEmit(su); 
    248265      AccessAppUtil au = new AccessAppUtil(xml); 
    249        
     266 
    250267      au.emitCurrentPrivSet(privileges); 
    251        
     268 
    252269      su.close(); 
    253        
     270 
    254271      return su.toString(); 
    255272    } catch (CalFacadeException cfe) { 
     
    266283  private void emitSupportedPriv(Privilege priv) throws Throwable { 
    267284    xml.openTag(WebdavTags.supportedPrivilege); 
    268      
     285 
    269286    xml.openTagNoNewline(WebdavTags.privilege); 
    270287    xml.emptyTagSameLine(privTags[priv.getIndex()]); 
    271288    xml.closeTagNoblanks(WebdavTags.privilege); 
    272      
     289 
    273290    if (priv.getAbstractPriv()) { 
    274291      xml.emptyTag(WebdavTags._abstract); 
    275292    } 
    276      
     293 
    277294    xml.property(WebdavTags.description, priv.getDescription()); 
    278295 
     
    281298      emitSupportedPriv((Privilege)it.next()); 
    282299    } 
    283      
     300 
    284301    xml.closeTag(WebdavTags.supportedPrivilege); 
    285302  } 
    286    
     303 
    287304  private boolean emitAce(Ace ace, boolean denials, boolean aceOpen) throws Throwable { 
    288305    Collection privs = ace.getPrivs(); 
     
    315332      } 
    316333    } 
    317      
     334 
    318335    if (tagOpen) { 
    319336      xml.closeTag(tag); 
    320337    } 
    321      
     338 
    322339    return aceOpen; 
    323340  } 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/CalendarInfo.java

    r278 r415  
    368368   * ==================================================================== */ 
    369369 
    370   /** Get a String representation of a particular time field of the object. 
     370  /* Get a String representation of a particular time field of the object. 
    371371   * 
    372372   * @param field The field to be returned, 
     
    388388  } 
    389389 
    390   /** Return the size of the range for a given unit of time 
     390  /* Return the size of the range for a given unit of time 
    391391   * 
    392392   * @param unit      value defined in java.util.Calendar 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java

    r372 r415  
    101101  /** Constructor 
    102102   * 
     103   * @param svci 
    103104   * @param eventInfo 
    104105   * @param calInfo 
     
    207208  } 
    208209 
     210  /** Emit current event access as an xml String 
     211   * 
     212   * @return String 
     213   */ 
    209214  public String getXmlAccess() { 
    210215    try { 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedEvents.java

    r314 r415  
    7676  /** Constructor 
    7777   * 
     78   * @param svci 
    7879   * @param events 
    7980   * @param calInfo 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedFreeBusy.java

    r375 r415  
    9090  private Collection times; 
    9191 
     92  /** Class to represent a free busy period 
     93   * 
     94   * @author Mike Douglass 
     95   */ 
    9296  public static class FbPeriod { 
    9397    int minutesStart; 
     
    9599    int type; // From BwFreeBusyComponent 
    96100 
     101    /** Constructor 
     102     * 
     103     * @param minutesStart 
     104     * @param minutesLength 
     105     * @param type 
     106     */ 
    97107    public FbPeriod(int minutesStart, int minutesLength, int type) { 
    98108      this.minutesStart = minutesStart; 
     
    134144  } 
    135145 
     146  /** Constructor 
     147   * 
     148   * <p>Generates a formatted free busy object suitable for gui interfaces. 
     149   * @param fb 
     150   * @throws CalFacadeException 
     151   */ 
    136152  public FormattedFreeBusy(BwFreeBusy fb) throws CalFacadeException { 
    137153    setWho(fb.getWho()); 
  • trunk/calendar3/appcommon/src/org/bedework/appcommon/TimeZonesParser.java

    r297 r415  
    291291 
    292292  /** Get a logger for messages 
     293   * 
     294   * @return Logger 
    293295   */ 
    294296  protected Logger getLogger() { 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java

    r406 r415  
    7878   * @param cal 
    7979   * @param access 
    80    * @param user 
     80   * @param currentMode 
    8181   * @param debug 
    8282   * @throws CalFacadeException 
     
    346346  } 
    347347 
     348  /** Create the special deleted calendar which holds deletion annotations to 
     349   * entities for which the user has no write access. 
     350   * 
     351   * @param user 
     352   * @throws CalFacadeException 
     353   */ 
    348354  public void createDeletedCalendar(BwUser user) throws CalFacadeException { 
    349355    StringBuffer sb = new StringBuffer(); 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfHelper.java

    r301 r415  
    8585   * @param cal 
    8686   * @param access 
    87    * @param user 
     87   * @param currentMode 
    8888   * @param debug 
    8989   */ 
    9090  public CalintfHelper(Calintf cal, AccessUtil access, 
    91                        int currentMode,   
     91                       int currentMode, 
    9292                       boolean debug) { 
    9393    this.cal = cal; 
     
    104104    return cal.getSyspars(); 
    105105  } 
    106    
     106 
    107107  protected BwUser getUser() throws CalFacadeException { 
    108108    return cal.getUser(); 
     
    110110 
    111111  /** Get a logger for messages 
     112   * 
     113   * @return Logger 
    112114   */ 
    113115  protected Logger getLogger() { 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java

    r406 r415  
    8282import org.bedework.calfacade.ifs.Calintf; 
    8383import org.bedework.calfacade.ifs.CalintfInfo; 
     84import org.bedework.calfacade.ifs.EventsI; 
    8485import org.bedework.calfacade.ifs.Groups; 
    8586import org.bedework.icalendar.IcalTranslator; 
     
    164165  private BwUser user; 
    165166 
    166   private Events events; 
     167  private EventsI events; 
    167168 
    168169  private Calendars calendars; 
     
    11311132  } 
    11321133 
     1134  public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 
     1135    return events.getDeletedProxies(cal); 
     1136  } 
     1137 
    11331138  /* ==================================================================== 
    11341139   *                   Synchronization 
     
    13301335  } 
    13311336 
    1332   /** Get a logger for messages 
     1337  /* Get a logger for messages 
    13331338   */ 
    13341339  private Logger getLogger() { 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/DbStatistics.java

    r191 r415  
    7878 */ 
    7979public class DbStatistics { 
     80  /** Dump the statistics to the log 
     81   * 
     82   * @param dbStats 
     83   */ 
    8084  public static void dumpStats(Statistics dbStats) { 
    8185    if (dbStats == null) { 
     
    8892  } 
    8993 
     94  /** Get the current statistics 
     95   * 
     96   * @param dbStats 
     97   * @return Collection 
     98   */ 
    9099  public static Collection getStats(Statistics dbStats) { 
    91100    /* XXX this ought to be property driven to some extent. The cache stats in 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/EventProperties.java

    r301 r415  
    8888   * @param cal           Calintf object 
    8989   * @param access 
    90    * @param user 
     90   * @param currentMode 
    9191   * @param keyFieldName  Name of entity keyfield 
    9292   * @param className     Class of entity 
     
    9595   * @param debug 
    9696   */ 
    97   public EventProperties(Calintf cal, AccessUtil access,  
    98                          int currentMode,  
     97  public EventProperties(Calintf cal, AccessUtil access, 
     98                         int currentMode, 
    9999                         String keyFieldName, 
    100100                         String className, 
    101101                         String refQuery, 
    102                          int minId,  
     102                         int minId, 
    103103                         boolean debug) { 
    104104    super(cal, access, currentMode, debug); 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java

    r406 r415  
    104104   * @param cal 
    105105   * @param access 
    106    * @param user 
     106   * @param currentMode 
    107107   * @param debug 
    108108   */ 
     
    283283  } 
    284284 
    285   /** XXX temp I think 
    286    * Retrieve event proxies in the trash - they will be used to remove events 
    287    * from result sets. 
    288    * 
    289    * @return Collection of CoreEventInfo objects 
    290    */ 
    291   public Collection getDeletedProxies() throws CalFacadeException { 
    292     // Calintf supplies the calendar 
    293     return null; 
    294   } 
    295  
    296   /** XXX temp I think 
    297    * Retrieve event proxies in the trash - they will be used to remove events 
    298    * from result sets. 
    299    * 
    300    * @param cal         Deleted calendar object 
    301    * @return Collection of CoreEventInfo objects 
    302    */ 
    303285  public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 
    304286    HibSession sess = getSess(); 
     
    706688 
    707689    return ceis; 
    708   } 
    709  
    710   public boolean editable(BwEvent val) throws CalFacadeException { 
    711     if (currentMode == CalintfUtil.guestMode) { 
    712       return false; 
    713     } 
    714  
    715     if (val.getPublick() != (currentMode == CalintfUtil.publicAdminMode)) { 
    716       return false; 
    717     } 
    718  
    719     return getUser().equals(val.getCreator()); 
    720690  } 
    721691 
     
    11121082   * @param override    May be null if we retrieved the instance 
    11131083   * @param checked 
     1084   * @param recurRetrieval 
     1085   * @param freeBusy 
    11141086   * @return CoreEventInfo 
    11151087   * @throws CalFacadeException 
  • trunk/calendar3/calCore/src/org/bedework/calcore/ldap/LdapConfigProperties.java

    r394 r415  
    9999  private boolean debug; 
    100100 
     101  /** 
     102   * @param val 
     103   */ 
    101104  public void setInitialContextFactory(String val)  { 
    102105    initialContextFactory  = val; 
    103106  } 
    104107 
     108  /** 
     109   * @return String 
     110   */ 
    105111  public String getInitialContextFactory()  { 
    106112    return initialContextFactory; 
    107113  } 
    108114 
     115  /** 
     116   * @param val 
     117   */ 
    109118  public void setSecurityAuthentication(String val)  { 
    110119    securityAuthentication  = val; 
    111120  } 
    112121 
     122  /** 
     123   * @return String 
     124   */ 
    113125  public String getSecurityAuthentication()  { 
    114126    return securityAuthentication; 
  • trunk/calendar3/calEnv/src/org/bedework/calenv/CalOptions.java

    r394 r415  
    777777    public ArrayList children; 
    778778 
     779    /** 
     780     * @return Collection 
     781     */ 
    779782    public Collection getChildren() { 
    780783      if (children == null) { 
     
    784787    } 
    785788 
     789    /** Add a child 
     790     * 
     791     * @param val OptionElement 
     792     */ 
    786793    public void addChild(OptionElement val) { 
    787794      getChildren().add(val); 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwCalendar.java

    r336 r415  
    102102  /** The children of this calendar */ 
    103103  private Collection children; 
    104    
    105   /* This field must only be used for cloned copies of an entity as it is  
     104 
     105  /* This field must only be used for cloned copies of an entity as it is 
    106106   * specific to a current thread. 
    107107   */ 
     
    274274   * ==================================================================== */ 
    275275 
     276  /** Only call fro cloned object 
     277   * 
     278   * @param val CurrentAccess 
     279   */ 
    276280  public void setCurrentAccess(CurrentAccess val) { 
    277281    currentAccess = val; 
    278282  } 
    279283 
     284  /** 
     285   * @return CurrentAccess 
     286   */ 
    280287  public CurrentAccess getCurrentAccess() { 
    281288    return currentAccess; 
     
    402409 
    403410  public int hashCode() { 
    404        if (getPath() == null) { 
    405                return 1; 
    406        
     411    if (getPath() == null) { 
     412      return 1; 
     413   
    407414    return getPath().hashCode(); 
    408415  } 
     
    428435    Iterator it = iterateChildren(); 
    429436    boolean donech = false; 
    430      
     437 
    431438    while (it.hasNext()) { 
    432439      BwCalendar ch = (BwCalendar)it.next(); 
    433        
     440 
    434441      if (!donech) { 
    435442        donech = true; 
     
    437444        sb.append(", "); 
    438445      } 
    439        
     446 
    440447      sb.append(ch.getPath()); 
    441448    } 
    442449    sb.append(")"); 
    443      
     450 
    444451    if (getCurrentAccess() != null) { 
    445452      sb.append(", currentAccess="); 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDateTime.java

    r375 r415  
    206206  } 
    207207 
     208  /** Create a copy of this object 
     209   * 
     210   * @param timezones 
     211   * @return BwDateTime 
     212   * @throws CalFacadeException 
     213   */ 
    208214  public BwDateTime copy(CalTimezones timezones) throws CalFacadeException { 
    209215    return makeDateTime(makeDtEnd(), timezones); 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDuration.java

    r187 r415  
    244244    return new Duration(d); 
    245245  } 
    246    
     246 
     247  /** Return true if this represents a zero duration 
     248   * 
     249   * @return boolean 
     250   */ 
    247251  public boolean isZero() { 
    248252    if (getWeeks() != 0) { 
    249253      return false; 
    250254    } 
    251      
    252     return ((getDays() == 0) &&  
     255 
     256    return ((getDays() == 0) && 
    253257            (getHours() == 0) && 
    254258            (getMinutes() == 0) && 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwStats.java

    r191 r415  
    5656 
    5757import java.io.Serializable; 
     58import java.util.ArrayList; 
    5859import java.util.Collection; 
    5960import java.util.Iterator; 
    60 import java.util.Vector; 
    6161 
    6262/** Some statistics for the Bedework calendar. These are not necessarily 
     
    7171   */ 
    7272  public static class StatsEntry { 
     73    // ENUM 
     74    /** */ 
    7375    public final static int statKindHeader = 0; 
     76    /** */ 
    7477    public final static int statKindStat = 1; 
    7578 
     
    7881    private String statLabel; 
    7982 
     83    // ENUM 
     84    /** */ 
    8085    public final static int statTypeString = 0; 
     86    /** */ 
    8187    public final static int statTypeInt = 1; 
     88    /** */ 
    8289    public final static int statTypeLong = 2; 
     90    /** */ 
    8391    public final static int statTypeDouble = 3; 
    8492    private int statType; 
     
    8694    private String statVal; 
    8795 
     96    /** Constructor for an int val 
     97     * 
     98     * @param label 
     99     * @param val 
     100     */ 
    88101    public StatsEntry(String label, int val) { 
    89102      statKind = statKindStat; 
     
    93106    } 
    94107 
     108    /** Constructor for a long val 
     109     * 
     110     * @param label 
     111     * @param val 
     112     */ 
    95113    public StatsEntry(String label, long val) { 
    96114      statKind = statKindStat; 
     
    100118    } 
    101119 
     120    /** Constructor for a double val 
     121     * 
     122     * @param label 
     123     * @param val 
     124     */ 
    102125    public StatsEntry(String label, double val) { 
    103126      statKind = statKindStat; 
     
    107130    } 
    108131 
     132    /** Constructor for a String val 
     133     * 
     134     * @param label 
     135     * @param val 
     136     */ 
    109137    public StatsEntry(String label, String val) { 
    110138      statKind = statKindStat; 
     
    114142    } 
    115143 
     144    /** Constructor for a header 
     145     * 
     146     * @param header 
     147     */ 
    116148    public StatsEntry(String header) { 
    117149      statKind = statKindHeader; 
     
    119151    } 
    120152 
     153    /** 
     154     * @return int kind of stat 
     155     */ 
    121156    public int getStatKind() { 
    122157      return statKind; 
    123158    } 
    124159 
     160    /** 
     161     * @return String label 
     162     */ 
    125163    public String getStatLabel() { 
    126164      return statLabel; 
    127165    } 
    128166 
     167    /** 
     168     * @return int type 
     169     */ 
    129170    public int getStatType() { 
    130171      return statType; 
    131172    } 
    132173 
     174    /** 
     175     * @return String value 
     176     */ 
    133177    public String getStatVal() { 
    134178      return statVal; 
     
    207251  } 
    208252 
     253  /** 
     254   * @return Collection of StatsEntry 
     255   */ 
    209256  public Collection getStats() { 
    210     Vector v = new Vector(); 
    211  
    212     v.add(new StatsEntry("Bedework statistics.")); 
    213     v.add(new StatsEntry("tzFetches", getTzFetches())); 
    214     v.add(new StatsEntry("systemTzFetches", getSystemTzFetches())); 
    215     v.add(new StatsEntry("tzStores", getTzStores())); 
    216  
    217     v.add(new StatsEntry("event fetch time", getEventFetchTime())); 
    218     v.add(new StatsEntry("event fetches", getEventFetches())); 
    219  
    220     v.add(new StatsEntry("UTC dates cached", getDatesCached())); 
    221     v.add(new StatsEntry("UTC date cache hits", getDateCacheHits())); 
    222     v.add(new StatsEntry("UTC date cache misses", getDateCacheMisses())); 
    223  
    224     return v
     257    ArrayList al = new ArrayList(); 
     258 
     259    al.add(new StatsEntry("Bedework statistics.")); 
     260    al.add(new StatsEntry("tzFetches", getTzFetches())); 
     261    al.add(new StatsEntry("systemTzFetches", getSystemTzFetches())); 
     262    al.add(new StatsEntry("tzStores", getTzStores())); 
     263 
     264    al.add(new StatsEntry("event fetch time", getEventFetchTime())); 
     265    al.add(new StatsEntry("event fetches", getEventFetches())); 
     266 
     267    al.add(new StatsEntry("UTC dates cached", getDatesCached())); 
     268    al.add(new StatsEntry("UTC date cache hits", getDateCacheHits())); 
     269    al.add(new StatsEntry("UTC date cache misses", getDateCacheMisses())); 
     270 
     271    return al
    225272  } 
    226273 
    227274  /** Turn the Collection of StatsEntry into a String for dumps. 
     275   * 
     276   * @param c  Collection of StatsEntry 
     277   * @return String formatted result. 
    228278   */ 
    229279  public static String toString(Collection c) { 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java

    r375 r415  
    618618    /** Event Info objects to extract from */ 
    619619    public Collection events; 
    620     /* Start of period - updated at each call from endDt */ 
     620    /** Start of period - updated at each call from endDt */ 
    621621    public BwDateTime startDt; 
    622622    /** Duration of period */ 
     
    634634   * @param   pars      GetPeriodsPars object 
    635635   * @return  Collection of EventInfo being one days events or empty for no events. 
    636    * @throws Throwable 
     636   * @throws CalFacadeException 
    637637   */ 
    638638  public static Collection getPeriodsEvents(GetPeriodsPars pars) throws CalFacadeException { 
     
    691691  } 
    692692 
    693   /**Turn the int minutes into a 4 digit String hours and minutes value 
    694    * 
    695    * @param int minutes 
    696    * @return String time 
     693  /** Turn the int minutes into a 4 digit String hours and minutes value 
     694   * 
     695   * @param minutes  int 
     696   * @return String 4 digit hours + minutes 
    697697   */ 
    698698  public static String getTimeFromMinutes(int minutes) { 
     
    702702  /** Return String value of par padded to 2 digits. 
    703703   * @param val 
    704    * @return 
     704   * @return String 
    705705   */ 
    706706  public static String pad2(int val) { 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/CoreEventInfo.java

    r356 r415  
    8282  /** Constructor 
    8383   * 
     84   * @param event 
     85   * @param currentAccess 
    8486   */ 
    8587  public CoreEventInfo(BwEvent event, CurrentAccess currentAccess) { 
     
    102104  } 
    103105 
    104   /* Set the current users access rights. 
     106  /** Set the current users access rights. 
    105107   * 
    106108   * @param val  CurrentAccess 
     
    110112  } 
    111113 
    112   /* Get the current users access rights. 
     114  /** Get the current users access rights. 
    113115   * 
    114116   * @return  CurrentAccess 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java

    r406 r415  
    734734  } 
    735735 
    736   public boolean editable(BwEvent val) throws CalFacadeException { 
    737     checkOpen(); 
    738  
    739     if (currentMode == CalintfDefs.guestMode) { 
    740       return false; 
    741     } 
    742  
    743     if (val.getPublick() != (currentMode == CalintfDefs.publicAdminMode)) { 
    744       return false; 
    745     } 
    746  
    747     return user.equals(val.getCreator()); 
    748   } 
    749  
    750736  public Collection getDeletedProxies() throws CalFacadeException { 
     737    throw new CalFacadeUnimplementedException(); 
     738  } 
     739 
     740  public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 
    751741    throw new CalFacadeUnimplementedException(); 
    752742  } 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalTimezones.java

    r298 r415  
    7878public abstract class CalTimezones implements Serializable { 
    7979  private transient Logger log; 
    80    
     80 
    8181  protected boolean debug; 
    8282 
     
    8888 
    8989    boolean publick; 
    90      
     90 
    9191    /** 
    9292     * @param tz 
     
    9595      init(tz); 
    9696    } 
    97      
     97 
    9898    /** Constructor 
    99      *  
     99     * 
    100100     * @param tz 
    101101     * @param publick 
     
    105105      this.publick = publick; 
    106106    } 
    107      
     107 
    108108    /** (Re)init the object 
    109      *  
     109     * 
    110110     * @param tz 
    111      * @param vtz 
    112111     */ 
    113112    public void init(TimeZone tz) { 
    114113      this.tz = tz; 
    115114    } 
    116      
     115 
     116    /** Get the timezone 
     117     * 
     118     * @return TimeZone 
     119     */ 
    117120    public TimeZone getTz() { 
    118121      return tz; 
    119122    } 
    120      
     123 
    121124    /** 
    122125     * @return true for public timezone 
     
    129132  /* Map of user TimezoneInfo */ 
    130133  protected HashMap timezones = new HashMap(); 
    131    
     134 
    132135  /* Cache date only UTC values - we do a lot of those but the number of 
    133136   * different dates should be limited. 
    134    *  
     137   * 
    135138   * We have one cache per timezone 
    136139   */ 
     
    138141 
    139142  private HashMap defaultDateCache = new HashMap(); 
    140    
     143 
    141144  private long datesCached; 
    142145  private long dateCacheHits; 
     
    146149    this.debug = debug; 
    147150  } 
    148    
     151 
    149152  /** Save a timezone definition in the database. The timezone is in the 
    150153   * form of a complete calendar definition containing a single VTimeZone 
     
    171174      trace("register timezone with id " + id); 
    172175    } 
    173      
     176 
    174177    TimezoneInfo tzinfo = (TimezoneInfo)timezones.get(id); 
    175      
     178 
    176179    if (tzinfo == null) { 
    177180      tzinfo = new TimezoneInfo(timezone); 
     
    190193  */ 
    191194  public abstract TimeZone getTimeZone(final String id) throws CalFacadeException; 
    192    
     195 
    193196  /** Get the default timezone for this system. 
    194197   * 
     
    203206    return defaultTimeZone; 
    204207  } 
    205    
     208 
    206209  /** Set the default timezone id for this system. 
    207210   * 
     
    213216    defaultTimeZoneId = id; 
    214217  } 
    215    
     218 
    216219  /** Get the default timezone id for this system. 
    217220   * 
     
    222225    return defaultTimeZoneId; 
    223226  } 
    224    
     227 
    225228  /** Find a timezone object in the database given the id. 
    226229   * 
     
    231234   */ 
    232235  public abstract VTimeZone findTimeZone(final String id, BwUser owner) throws CalFacadeException; 
    233    
     236 
    234237  /** Clear all public timezone objects. Implementing classes should call this. 
    235238   * 
     
    243246    defaultDateCache.clear(); 
    244247  } 
    245    
     248 
    246249  /** Refresh the public timezone table - presumably after a call to clearPublicTimezones. 
    247250   * and many calls to saveTimeZone. 
     
    250253   */ 
    251254  public abstract void refreshTimezones() throws CalFacadeException; 
    252    
     255 
    253256  private static DateFormat formatTd  = new SimpleDateFormat("yyyyMMdd'T'HHmmss"); 
    254257  private static Calendar cal = Calendar.getInstance(); 
     
    264267    cal.setTimeZone(utctz); 
    265268  } 
    266    
     269 
    267270  /** Given a String time value and a possibly null tzid and/or timezone 
    268271   *  will return a UTC formatted value. The supplied time should be of the 
     
    270273   * 
    271274   *  <p>The last form will be returned untouched, it's already UTC. 
    272    *   
     275   * 
    273276   *  <p>the first will have T000000 appended to the parameter value then the 
    274277   *  first and second will be converted to the equivalent UTC time. 
     
    285288   * @throws CalFacadeException for bad parameters or timezone 
    286289   */ 
    287   public synchronized String getUtc(String time, String tzid, TimeZone tz)  
     290  public synchronized String getUtc(String time, String tzid, TimeZone tz) 
    288291          throws CalFacadeException { 
    289292    /* XXX We probably need the ownerid to determine exactly which timezone 
     
    299302    String dateKey = null; 
    300303    HashMap cache = null; 
    301      
     304 
    302305    if ((time.length() == 8) && CalFacadeUtil.isISODate(time)) { 
    303306      /* See if we have it cached */ 
    304        
     307 
    305308      if (tzid == null) { 
    306309        cache = defaultDateCache; 
     
    314317        } 
    315318      } 
    316        
     319 
    317320      String utc = (String)cache.get(time); 
    318        
     321 
    319322      if (utc != null) { 
    320323        dateCacheHits++; 
     
    323326 
    324327      /* Not in the cache - calculate it */ 
    325        
     328 
    326329      dateCacheMisses++; 
    327330      dateKey = time; 
     
    330333      throw new CalFacadeBadDateException(time); 
    331334    } 
    332      
     335 
    333336    try { 
    334337      boolean tzchanged = false; 
    335        
     338 
    336339      /* If we get a null timezone and id we are being asked for the default. 
    337340       * If we get a null tz and the tzid is the default id same again. 
    338        *  
     341       * 
    339342       * Otherwise we are asked for something other than the default. 
    340        *  
    341        * So lasttzid is either  
     343       * 
     344       * So lasttzid is either 
    342345       *    1. null - never been called 
    343346       *    2. the default tzid 
    344347       *    3. Some other tzid. 
    345348       */ 
    346        
     349 
    347350      if (tz == null) { 
    348351        if (tzid == null) { 
    349352          tzid = getDefaultTimeZoneId(); 
    350353        } 
    351          
     354 
    352355        if ((lasttzid == null) || (!lasttzid.equals(tzid))) { 
    353356          if (tzid.equals(getDefaultTimeZoneId())) { 
     
    356359            lasttz = getTimeZone(tzid); 
    357360          } 
    358            
     361 
    359362          if (lasttz == null) { 
    360363            lasttzid = null; 
     
    376379        } 
    377380      } 
    378        
    379        
     381 
     382 
    380383      if (tzchanged) { 
    381384        if (debug) { 
     
    385388        lasttzid = tzid; 
    386389      } 
    387        
     390 
    388391      cal.setTime(formatTd.parse(time)); 
    389        
     392 
    390393      StringBuffer sb = new StringBuffer(); 
    391394      digit4(sb, cal.get(Calendar.YEAR)); 
     
    397400      digit2(sb, cal.get(Calendar.SECOND)); 
    398401      sb.append('Z'); 
    399        
     402 
    400403      String utc = sb.toString(); 
    401        
     404 
    402405      if (dateKey != null) { 
    403406        cache.put(dateKey, utc); 
    404407        datesCached++; 
    405408      } 
    406        
     409 
    407410      return utc; 
    408411    } catch (CalFacadeException cfe) { 
     
    413416    } 
    414417  } 
    415    
     418 
    416419  /** 
    417420   * @return Number of utc values cached 
     
    420423    return datesCached; 
    421424  } 
    422    
     425 
    423426  /** 
    424427   * @return date cache hits 
     
    427430    return dateCacheHits; 
    428431  } 
    429    
     432 
    430433  /** 
    431434   * @return data cache misses. 
     
    434437    return dateCacheMisses; 
    435438  } 
    436      
     439 
    437440  /* ==================================================================== 
    438441   *                   protected methods 
    439442   * ==================================================================== */ 
    440    
     443 
    441444  protected void digit2(StringBuffer sb, int val) throws CalFacadeException { 
    442445    if (val > 99) { 
     
    448451    sb.append(val); 
    449452  } 
    450    
     453 
    451454  protected void digit4(StringBuffer sb, int val) throws CalFacadeException { 
    452455    if (val > 9999) { 
     
    462465    sb.append(val); 
    463466  } 
    464    
     467 
    465468 
    466469  /* Get a logger for messages 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java

    r356 r415  
    372372   * @param returnResult 
    373373   * @return CurrentAccess 
    374    * @throws CalFacadeAccessException if returnResult false and no access 
    375    * @throws CalFacadeException 
     374   * @throws CalFacadeException if returnResult false and no access 
    376375   */ 
    377376  public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 
     
    693692   */ 
    694693  public Collection getSponsorRefs(BwSponsor val) throws CalFacadeException; 
     694 
     695  /* ==================================================================== 
     696   *                   Synchronization 
     697   * ==================================================================== */ 
     698 
     699  /** XXX temp I think 
     700   * Retrieve event proxies in the given calendar - they will be used to remove events 
     701   * from result sets. 
     702   * 
     703   * @return Collection of CoreEventInfo objects 
     704   * @throws CalFacadeException 
     705   */ 
     706  public Collection getDeletedProxies() throws CalFacadeException; 
    695707 
    696708  /* ==================================================================== 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java

    r406 r415  
    139139 
    140140  /** XXX temp I think 
    141    * Retrieve event proxies in the trash - they will be used to remove events 
     141   * Retrieve event proxies in the given calendar - they will be used to remove events 
    142142   * from result sets. 
    143143   * 
     144   * @param cal     BwCalendar object restricting search or null. 
    144145   * @return Collection of CoreEventInfo objects 
     146   * @throws CalFacadeException 
    145147   */ 
    146   public Collection getDeletedProxies() throws CalFacadeException; 
     148  public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException; 
    147149 
    148150  /* * Return true if this event is editable by the current user 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/BwPreferences.java

    r408 r415  
    348348   * 
    349349   * @param val  String time value 
     350   * @throws CalFacadeException 
    350351   */ 
    351352  public void setWorkdayStart(String val) throws CalFacadeException{ 
     
    364365   * 
    365366   * @param val  String time value 
     367   * @throws CalFacadeException 
    366368   */ 
    367369  public void setWorkdayEnd(String val) throws CalFacadeException{ 
     
    453455   * 
    454456   * @param val  String time value 
     457   * @return int minutes 
     458   * @throws CalFacadeException 
    455459   */ 
    456460  private int makeMinutesFromTime(String val) throws CalFacadeException{ 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/EventInfo.java

    r356 r415  
    312312  } 
    313313 
    314   /* Set the current users access rights. 
     314  /** Set the current users access rights. 
    315315   * 
    316316   * @param val  CurrentAccess 
     
    320320  } 
    321321 
    322   /* Get the current users access rights. 
     322  /** Get the current users access rights. 
    323323   * 
    324324   * @return  CurrentAccess 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/UserAuth.java

    r336 r415  
    145145   * @param  cb        CallBack object 
    146146   * @param  val        Object 
     147   * @param debug 
    147148   * @exception CalFacadeException If there's a problem 
    148149   */ 
     
    170171   * @param  cb        CallBack object 
    171172   * @param  val       int sum  of allowable access. 
     173   * @param debug 
    172174   * @exception CalFacadeException If there's a problem 
    173175   */ 
  • trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/EmitAccess.java

    r320 r415  
    6363public class EmitAccess extends AccessAppUtil { 
    6464  private String namespacePrefix; 
    65    
     65 
    6666  /** Acls use tags in the webdav and caldav namespace. For use over caldav 
    6767   * we shoud supply the uris. Otherwise a null namespace will be used. 
    6868   * 
    69    * @param wdNamespace 
    70    * @param cdNamespace 
    71    * @param xml 
     69   * @param namespacePrefix String prefix 
     70   * @param xml   XmlEmit 
    7271   */ 
    7372  public EmitAccess(String namespacePrefix, XmlEmit xml) { 
    7473    super(xml); 
    75      
     74 
    7675    this.namespacePrefix = namespacePrefix; 
    7776  } 
  • trunk/calendar3/caldavClientApi/build.xml

    r2 r415  
    4545 
    4646      <!-- Include the location of the compiled calendar classes --> 
     47      <pathelement location="${org.bedework.access.jar}"/> 
    4748      <pathelement location="${org.bedework.http.jar}"/> 
    4849      <pathelement location="${org.bedework.ical.jar}"/> 
  • trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/CalintfCaldavImpl.java

    r321 r415  
    7474import org.bedework.calfacade.CalFacadeException; 
    7575import org.bedework.calfacade.CalintfDefs; 
     76import org.bedework.calfacade.base.BwShareableDbentity; 
    7677import org.bedework.calfacade.base.CalintfBase; 
    7778import org.bedework.calfacade.filter.BwFilter; 
     
    8081import org.bedework.calfacade.ifs.Groups; 
    8182import org.bedework.http.client.HttpManager; 
     83 
     84import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    8285 
    8386import java.util.Collection; 
     
    290293   * ==================================================================== */ 
    291294 
    292   public void changeAccess(Object o, Collection aces) throws CalFacadeException { 
    293     checkOpen(); 
    294     throw new CalFacadeUnimplementedException(); 
    295   } 
    296  
    297   public Collection getAces(Object o) throws CalFacadeException { 
     295  public void changeAccess(BwShareableDbentity ent, 
     296                           Collection aces) throws CalFacadeException { 
     297    checkOpen(); 
     298    throw new CalFacadeUnimplementedException(); 
     299  } 
     300 
     301  public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 
     302                                   boolean returnResult) throws CalFacadeException { 
    298303    checkOpen(); 
    299304    throw new CalFacadeUnimplementedException(); 
     
    373378  } 
    374379 
    375   public BwCalendar getCalendar(String path) throws CalFacadeException{ 
    376     checkOpen(); 
    377  
    378     throw new CalFacadeUnimplementedException(); 
    379   } 
    380  
    381   public BwCalendar getDefaultCalendar() throws CalFacadeException { 
    382     throw new CalFacadeUnimplementedException(); 
    383   } 
    384  
    385   public BwCalendar getTrashCalendar() throws CalFacadeException { 
     380  public BwCalendar getCalendar(String path, 
     381                                int desiredAccess) throws CalFacadeException{ 
     382    checkOpen(); 
     383 
     384    throw new CalFacadeUnimplementedException(); 
     385  } 
     386 
     387  public BwCalendar getDefaultCalendar(BwUser user) throws CalFacadeException { 
     388    throw new CalFacadeUnimplementedException(); 
     389  } 
     390 
     391  public BwCalendar getTrashCalendar(BwUser user) throws CalFacadeException { 
    386392    throw new CalFacadeUnimplementedException(); 
    387393  } 
     
    583589  } 
    584590 
    585   public Collection getEvent(String guid, String rid, 
    586                              Integer seqnum, 
     591  public Collection getEvent(BwCalendar calendar, String guid, String rid, 
    587592                             int recurRetrieval) throws CalFacadeException { 
    588593    checkOpen(); 
     
    592597  public Collection getEvents(BwCalendar calendar, BwFilter filter, 
    593598                              BwDateTime startDate, BwDateTime endDate, 
    594                               int recurRetrieval) 
    595           throws CalFacadeException { 
     599                              int recurRetrieval, 
     600                              boolean freeBusy) throws CalFacadeException { 
    596601    throw new CalFacadeUnimplementedException(); 
    597602  } 
     
    611616    checkOpen(); 
    612617    throw new CalFacadeUnimplementedException(); 
    613   } 
    614  
    615   public boolean editable(BwEvent val) throws CalFacadeException { 
    616     checkOpen(); 
    617  
    618     if (currentMode == CalintfDefs.guestMode) { 
    619       return false; 
    620     } 
    621  
    622     if (val.getPublick() != (currentMode == CalintfDefs.publicAdminMode)) { 
    623       return false; 
    624     } 
    625  
    626     return user.equals(val.getCreator()); 
    627618  } 
    628619 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexKey.java

    r369 r415  
    8484  private String itemType; 
    8585 
     86  /** Constructor 
     87   * 
     88   */ 
    8689  public BwIndexKey() { 
    8790  } 
    8891 
     92  /** Constructor 
     93   * 
     94   * @param svci 
     95   */ 
    8996  public BwIndexKey(CalSvcI svci) { 
    9097    this.svci = svci; 
    9198  } 
    9299 
     100  /** Constructor 
     101   * 
     102   * @param svci 
     103   * @param score 
     104   */ 
    93105  public BwIndexKey(CalSvcI svci, float score) { 
    94106    this.score = score; 
     
    96108  } 
    97109 
     110  /** Set the item type with a value defined in BwIndexLuceneDefs 
     111   * 
     112   * @param val 
     113   */ 
    98114  public void setItemType(String val) { 
    99115    itemType = val; 
    100116  } 
    101117 
     118  /** Set the score 
     119   * 
     120   * @param val 
     121   */ 
    102122  public void setScore(float val) { 
    103123    score = val; 
    104124  } 
    105125 
     126  /** Set the key for a calendar (the path) 
     127   * 
     128   * @param key1 
     129   */ 
    106130  public void setCalendarKey(String key1) { 
    107131    this.key1 = key1; 
    108132  } 
    109133 
     134  /** Set the key for an event (encode ca+guid+recurid) 
     135   * 
     136   * @param key 
     137   * @throws IndexException 
     138   */ 
    110139  public void setEventKey(String key) throws IndexException { 
    111140    encoded = key.toCharArray(); 
     
    117146  } 
    118147 
     148  /** Encode an event key 
     149   * 
     150   * @param key1 
     151   * @param key2 
     152   * @param key3 
     153   * @return Strign encoded key 
     154   * @throws IndexException 
     155   */ 
    119156  public String makeEventKey(String key1, String key2, 
    120157                             String key3) throws IndexException { 
     
    127164  } 
    128165 
     166  /* (non-Javadoc) 
     167   * @see edu.rpi.cct.misc.indexing.Index.Key#getRecord() 
     168   */ 
    129169  public Object getRecord() throws IndexException { 
    130170    try { 
     
    164204   * ==================================================================== */ 
    165205 
    166   /** Current position in the key */ 
     206  /* Current position in the key */ 
    167207  private int pos; 
    168208 
    169   /** When encoding a key we build it here. 
     209  /* When encoding a key we build it here. 
    170210   */ 
    171211  private CharArrayWriter caw; 
     
    188228  /** Back off one char 
    189229   * 
    190    * @throws AccessException 
     230   * @throws IndexException 
    191231   */ 
    192232  public void back() throws IndexException { 
     
    197237   * 
    198238   * @param n   int number of chars 
    199    * @throws AccessException 
     239   * @throws IndexException 
    200240   */ 
    201241  public void back(int n) throws IndexException { 
     
    260300   * 
    261301   * @return int length 
    262    * @throws AccessException 
     302   * @throws IndexException 
    263303   */ 
    264304  public int getLength() throws IndexException { 
     
    288328   * 
    289329   * @return String decoded String value 
    290    * @throws AccessException 
     330   * @throws IndexException 
    291331   */ 
    292332  public String getKeyString() throws IndexException { 
     
    309349  /** Skip a String from the encoded acl at the current position. 
    310350   * 
    311    * @throws AccessException 
     351   * @throws IndexException 
    312352   */ 
    313353  public void skipString() throws IndexException { 
     
    335375   * 
    336376   * @param len 
    337    * @throws AccessException 
     377   * @throws IndexException 
    338378   */ 
    339379  public void encodeLength(int len) throws IndexException { 
     
    355395   * 
    356396   * @param val 
    357    * @throws AccessException 
     397   * @throws IndexException 
    358398   */ 
    359399  public void encodeString(String val) throws IndexException { 
     
    375415   * 
    376416   * @param c char 
    377    * @throws AccessException 
     417   * @throws IndexException 
    378418   */ 
    379419  public void addChar(char c) throws IndexException { 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexLuceneImpl.java

    r369 r415  
    7777  private BwIndexKey keyConverter = new BwIndexKey(); 
    7878 
     79  /** Constructor 
     80   * 
     81   * @param svci 
     82   * @param sysfilePath 
     83   * @param admin 
     84   * @param debug 
     85   * @throws IndexException 
     86   */ 
    7987  public BwIndexLuceneImpl(CalSvcI svci, 
    8088                           String sysfilePath, 
     
    140148   * @param   rec      The record 
    141149   * @return  String   String which uniquely identifies the record 
     150   * @throws IndexException 
    142151   */ 
    143152  public String makeKeyVal(Object rec) throws IndexException { 
     
    167176   * @param   rec      The record 
    168177   * @return  String   Name for the field/term 
     178   * @throws IndexException 
    169179   */ 
    170180  public String makeKeyName(Object rec) throws IndexException { 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r406 r415  
    10161016  } 
    10171017 
    1018   public BwCalendar getSubCalendar(BwSubscription val, 
    1019                                    boolean freeBusy) throws CalFacadeException { 
    1020     int desiredAccess = PrivilegeDefs.privRead; 
    1021     if (freeBusy) { 
    1022       desiredAccess = PrivilegeDefs.privReadFreeBusy; 
    1023     } 
    1024  
    1025     if (!val.getInternalSubscription() || val.getCalendarDeleted()) { 
    1026       return null; 
    1027     } 
    1028  
    1029     BwCalendar calendar = val.getCalendar(); 
    1030  
    1031     if (calendar != null) { 
    1032       // recheck access 
    1033       if (getCal().checkAccess(calendar, desiredAccess, true) == null) { 
    1034         val.setCalendar(null); 
    1035         return null; 
    1036       } 
    1037       return calendar; 
    1038     } 
    1039  
    1040     String path; 
    1041     String uri = val.getUri(); 
    1042  
    1043     if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) { 
    1044       path = uri.substring(CalFacadeDefs.bwUriPrefix.length()); 
    1045     } else { 
    1046       // Shouldn't happen? 
    1047       path = uri; 
    1048     } 
    1049  
    1050     if (debug) { 
    1051       trace("Search for calendar \"" + path + "\""); 
    1052     } 
    1053  
    1054     try { 
    1055       calendar = getCal().getCalendar(path, desiredAccess); 
    1056     } catch (CalFacadeAccessException cfae) { 
    1057       calendar = null; 
    1058     } 
    1059  
    1060     if (calendar == null) { 
    1061       // Assume deleted 
    1062       val.setCalendarDeleted(true); 
    1063       updateSubscription(val); 
    1064     } else { 
    1065       val.setCalendar(calendar); 
    1066     } 
    1067  
    1068     return calendar; 
    1069   } 
    1070  
    10711018  /* ==================================================================== 
    10721019   *                   Free busy 
     
    16241571  } 
    16251572 
    1626   public Collection getEvents(BwSubscription sub, BwFilter filter, 
    1627                               BwDateTime startDate, BwDateTime endDate, 
    1628                               int recurRetrieval, 
    1629                               boolean freeBusy) throws CalFacadeException { 
     1573  public DelEventResult deleteEvent(BwEvent event, 
     1574                                    boolean delUnreffedLoc) throws CalFacadeException { 
     1575    DelEventResult der = new DelEventResult(false, false, 0); 
     1576 
     1577    if (event == null) { 
     1578      return der; 
     1579    } 
     1580 
     1581    BwLocation loc = event.getLocation(); 
     1582 
     1583    Calintf.DelEventResult cider = getCal().deleteEvent(event); 
     1584 
     1585    if (!cider.eventDeleted) { 
     1586      return der; 
     1587    } 
     1588 
     1589    der.eventDeleted = true; 
     1590    der.alarmsDeleted = cider.alarmsDeleted; 
     1591 
     1592    if (delUnreffedLoc) { 
     1593      if ((loc != null) && 
     1594          (getCal().getLocationRefs(loc).size() == 0) && 
     1595          (getCal().deleteLocation(loc))) { 
     1596        der.locationDeleted = true; 
     1597      } 
     1598    } 
     1599 
     1600    return der; 
     1601  } 
     1602 
     1603  public EventUpdateResult addEvent(BwCalendar cal, 
     1604                                    BwEvent event, 
     1605                                    Collection overrides) throws CalFacadeException { 
     1606    EventUpdateResult updResult = new EventUpdateResult(); 
     1607 
     1608    if (event instanceof BwEventProxy) { 
     1609      BwEventProxy proxy = (BwEventProxy)event; 
     1610      BwEvent override = proxy.getRef(); 
     1611      setupSharableEntity(override); 
     1612    } else { 
     1613      setupSharableEntity(event); 
     1614    } 
     1615 
     1616    BwLocation loc = event.getLocation(); 
     1617    BwSponsor sp = event.getSponsor(); 
     1618 
     1619    if ((sp != null) && (ensureSponsorExists(sp) == null)) { 
     1620      updResult.sponsorsAdded++; 
     1621    } 
     1622 
     1623    if ((loc != null) && (ensureLocationExists(loc) == null)) { 
     1624      updResult.locationsAdded++; 
     1625    } 
     1626 
     1627    /* If no calendar has been assigned for this event set it to the default 
     1628     * calendar for non-public events or reject it for public events. 
     1629     */ 
     1630 
     1631    if (cal == null) { 
     1632      if (event.getPublick()) { 
     1633        throw new CalFacadeException("No calendar assigned"); 
     1634      } 
     1635 
     1636      cal = getPreferences().getDefaultCalendar(); 
     1637    } 
     1638 
     1639    if (!cal.getCalendarCollection()) { 
     1640      throw new CalFacadeAccessException(); 
     1641    } 
     1642 
     1643    event.setCalendar(cal); 
     1644 
     1645    event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); 
     1646    event.setLastmod(new LastModified(new DateTime(true)).getValue()); 
     1647    event.setCreated(new Created(new DateTime(true)).getValue()); 
     1648 
     1649    if (event instanceof BwEventProxy) { 
     1650      BwEventProxy proxy = (BwEventProxy)event; 
     1651      BwEvent override = proxy.getRef(); 
     1652      getCal().addEvent(override, overrides); 
     1653    } else { 
     1654      getCal().addEvent(event, overrides); 
     1655    } 
     1656 
     1657    if (isPublicAdmin()) { 
     1658      /* Mail event to any subscribers */ 
     1659    } 
     1660 
     1661    return updResult; 
     1662  } 
     1663 
     1664  public void updateEvent(BwEvent event) throws CalFacadeException { 
     1665    event.setLastmod(new LastModified(new DateTime(true)).getValue()); 
     1666 
     1667    getCal().updateEvent(event); 
     1668 
     1669    if (isPublicAdmin()) { 
     1670      /* Mail event to any subscribers */ 
     1671    } 
     1672  } 
     1673 
     1674  /** For an event to which we have write access we simply mark it deleted. 
     1675   * 
     1676   * <p>Otherwise we add an annotation maarking the event as deleted. 
     1677   * 
     1678   * @param event 
     1679   * @throws CalFacadeException 
     1680   */ 
     1681  public void markDeleted(BwEvent event) throws CalFacadeException { 
     1682    CurrentAccess ca = getCal().checkAccess(event, PrivilegeDefs.privWrite, true); 
     1683 
     1684    if (ca.accessAllowed) { 
     1685      // Have write access - just set the flag and move it into the owners trash 
     1686      event.setDeleted(true); 
     1687      event.setCalendar(getCal().getTrashCalendar(event.getOwner())); 
     1688      updateEvent(event); 
     1689      return; 
     1690    } 
     1691 
     1692    // Need to annotate it as deleted 
     1693 
     1694    BwEventProxy proxy = BwEventProxy.makeAnnotation(event, event.getOwner()); 
     1695 
     1696    // Where does the ref go? Not in the same calendar - we have no access 
     1697    // Put it in the trash - but don't delete on empty trash 
     1698 
     1699    BwCalendar cal = getCal().getDeletedCalendar(getUser()); 
     1700    proxy.setOwner(getUser()); 
     1701    proxy.setDeleted(true); 
     1702    proxy.setCalendar(cal); 
     1703    addEvent(cal, proxy, null); 
     1704  } 
     1705 
     1706  /* ==================================================================== 
     1707   *                       Caldav support 
     1708   * Caldav as it stands at the moment requires that we save the arbitary 
     1709   * names clients might assign to events. 
     1710   * ==================================================================== */ 
     1711 
     1712  public Collection findEventsByName(BwCalendar cal, String val) 
     1713          throws CalFacadeException { 
     1714    return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); 
     1715  } 
     1716 
     1717  /* ==================================================================== 
     1718   *                   Synchronization 
     1719   * ==================================================================== */ 
     1720 
     1721  public BwSynchInfo getSynchInfo() throws CalFacadeException { 
     1722    return getCal().getSynchInfo(); 
     1723  } 
     1724 
     1725  public void addSynchInfo(BwSynchInfo val) throws CalFacadeException { 
     1726    getCal().addSynchInfo(val); 
     1727  } 
     1728 
     1729  public void updateSynchInfo(BwSynchInfo val) throws CalFacadeException { 
     1730    getCal().updateSynchInfo(val); 
     1731  } 
     1732 
     1733  public BwSynchState getSynchState(BwEvent ev) 
     1734      throws CalFacadeException { 
     1735    return getCal().getSynchState(ev); 
     1736  } 
     1737 
     1738  public Collection getDeletedSynchStates() throws CalFacadeException { 
     1739    return getCal().getDeletedSynchStates(); 
     1740  } 
     1741 
     1742  public void addSynchState(BwSynchState val) 
     1743      throws CalFacadeException { 
     1744    getCal().addSynchState(val); 
     1745  } 
     1746 
     1747  public void updateSynchState(BwSynchState val) 
     1748      throws CalFacadeException { 
     1749    getCal().updateSynchState(val); 
     1750  } 
     1751 
     1752  public void getSynchData(BwSynchState val) throws CalFacadeException { 
     1753    getCal().getSynchData(val); 
     1754  } 
     1755 
     1756  public void setSynchData(BwSynchState val) throws CalFacadeException { 
     1757    getCal().setSynchData(val); 
     1758  } 
     1759 
     1760  public void updateSynchStates() throws CalFacadeException { 
     1761    getCal().updateSynchStates(); 
     1762  } 
     1763 
     1764  /* ==================================================================== 
     1765   *                       Alarms 
     1766   * ==================================================================== */ 
     1767 
     1768  public Collection getAlarms(BwEvent event, BwUser user) throws CalFacadeException { 
     1769    return getCal().getAlarms(event, user); 
     1770  } 
     1771 
     1772  public void setAlarm(BwEvent event, 
     1773                       BwEventAlarm alarm) throws CalFacadeException { 
     1774    // Do some sort of validation here. 
     1775    alarm.setEvent(event); 
     1776    alarm.setOwner(getUser()); 
     1777    getCal().addAlarm(alarm); 
     1778  } 
     1779 
     1780  public void updateAlarm(BwAlarm val) throws CalFacadeException { 
     1781    getCal().updateAlarm(val); 
     1782  } 
     1783 
     1784  public Collection getUnexpiredAlarms(BwUser user) throws CalFacadeException { 
     1785    return getCal().getUnexpiredAlarms(user); 
     1786  } 
     1787 
     1788  public Collection getUnexpiredAlarms(BwUser user, long triggerTime) 
     1789          throws CalFacadeException { 
     1790    return getCal().getUnexpiredAlarms(user, triggerTime); 
     1791  } 
     1792 
     1793  /* ==================================================================== 
     1794   *                   Access control 
     1795   * ==================================================================== */ 
     1796 
     1797  /* This provides some limits to shareable entity updates for the 
     1798   * admin users. It is applied in addition to the normal access checks 
     1799   * applied at the lower levels. 
     1800   */ 
     1801  private void updateOK(Object o) throws CalFacadeException { 
     1802    if (isGuest()) { 
     1803      throw new CalFacadeAccessException(); 
     1804    } 
     1805 
     1806    if (isSuper()) { 
     1807      // Always ok 
     1808      return; 
     1809    } 
     1810 
     1811    if (!(o instanceof BwShareableDbentity)) { 
     1812      throw new CalFacadeAccessException(); 
     1813    } 
     1814 
     1815    if (!isPublicAdmin()) { 
     1816      // Normal access checks apply 
     1817      return; 
     1818    } 
     1819 
     1820    BwShareableDbentity ent = (BwShareableDbentity)o; 
     1821 
     1822    if (adminCanEditAllPublicSponsors || 
     1823        ent.getCreator().equals(currentUser())) { 
     1824      return; 
     1825    } 
     1826 
     1827    throw new CalFacadeAccessException(); 
     1828  } 
     1829 
     1830  /* This checks to see if the current user has owner access based on the 
     1831   * supplied object. This is used to limit access to objects not normally 
     1832   * shared such as preferences and related objects like veiws and subscriptions. 
     1833   */ 
     1834  private void checkOwnerOrSuper(Object o) throws CalFacadeException { 
     1835    if (isGuest()) { 
     1836      throw new CalFacadeAccessException(); 
     1837    } 
     1838 
     1839    if (isSuper()) { 
     1840      // Always ok? 
     1841      return; 
     1842    } 
     1843 
     1844    if (!(o instanceof BwOwnedDbentity)) { 
     1845      throw new CalFacadeAccessException(); 
     1846    } 
     1847 
     1848    BwOwnedDbentity ent = (BwOwnedDbentity)o; 
     1849 
     1850    BwUser u; 
     1851 
     1852    /*if (!isPublicAdmin()) { 
     1853      // Expect a different owner - always public-user???? 
     1854      return; 
     1855    }*/ 
     1856 
     1857    u = getUser(); 
     1858 
     1859    if (u.equals(ent.getOwner())) { 
     1860      return; 
     1861    } 
     1862 
     1863    throw new CalFacadeAccessException(); 
     1864  } 
     1865 
     1866  /* ==================================================================== 
     1867   *                   Package and protected methods 
     1868   * ==================================================================== */ 
     1869 
     1870  /** Get the current db session 
     1871   * 
     1872   * @return Object 
     1873   * @throws CalFacadeException 
     1874   */ 
     1875  Object getDbSession() throws CalFacadeException { 
     1876    return getCal().getDbSession(); 
     1877  } 
     1878 
     1879  /* ==================================================================== 
     1880   *                   Private methods 
     1881   * ==================================================================== */ 
     1882 
     1883  private Collection getEvents(BwSubscription sub, BwFilter filter, 
     1884                               BwDateTime startDate, BwDateTime endDate, 
     1885                               int recurRetrieval, 
     1886                               boolean freeBusy) throws CalFacadeException { 
    16301887    TreeSet ts = new TreeSet(); 
    16311888 
     
    17221979  } 
    17231980 
    1724   public DelEventResult deleteEvent(BwEvent event, 
    1725                                     boolean delUnreffedLoc) throws CalFacadeException { 
    1726     DelEventResult der = new DelEventResult(false, false, 0); 
    1727  
    1728     if (event == null) { 
    1729       return der; 
    1730     } 
    1731  
    1732     BwLocation loc = event.getLocation(); 
    1733  
    1734     Calintf.DelEventResult cider = getCal().deleteEvent(event); 
    1735  
    1736     if (!cider.eventDeleted) { 
    1737       return der; 
    1738     } 
    1739  
    1740     der.eventDeleted = true; 
    1741     der.alarmsDeleted = cider.alarmsDeleted; 
    1742  
    1743     if (delUnreffedLoc) { 
    1744       if ((loc != null) && 
    1745           (getCal().getLocationRefs(loc).size() == 0) && 
    1746           (getCal().deleteLocation(loc))) { 
    1747         der.locationDeleted = true; 
    1748       } 
    1749     } 
    1750  
    1751     return der; 
    1752   } 
    1753  
    1754   public EventUpdateResult addEvent(BwCalendar cal, 
    1755                                     BwEvent event, 
    1756                                     Collection overrides) throws CalFacadeException { 
    1757     EventUpdateResult updResult = new EventUpdateResult(); 
    1758  
    1759     if (event instanceof BwEventProxy) { 
    1760       BwEventProxy proxy = (BwEventProxy)event; 
    1761       BwEvent override = proxy.getRef(); 
    1762       setupSharableEntity(override); 
     1981  private BwCalendar getSubCalendar(BwSubscription val, 
     1982                                    boolean freeBusy) throws CalFacadeException { 
     1983    int desiredAccess = PrivilegeDefs.privRead; 
     1984    if (freeBusy) { 
     1985      desiredAccess = PrivilegeDefs.privReadFreeBusy; 
     1986    } 
     1987 
     1988    if (!val.getInternalSubscription() || val.getCalendarDeleted()) { 
     1989      return null; 
     1990    } 
     1991 
     1992    BwCalendar calendar = val.getCalendar(); 
     1993 
     1994    if (calendar != null) { 
     1995      // recheck access 
     1996      if (getCal().checkAccess(calendar, desiredAccess, true) == null) { 
     1997        val.setCalendar(null); 
     1998        return null; 
     1999      } 
     2000      return calendar; 
     2001    } 
     2002 
     2003    String path; 
     2004    String uri = val.getUri(); 
     2005 
     2006    if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) { 
     2007      path = uri.substring(CalFacadeDefs.bwUriPrefix.length()); 
    17632008    } else { 
    1764       setupSharableEntity(event); 
    1765     } 
    1766  
    1767     BwLocation loc = event.getLocation(); 
    1768     BwSponsor sp = event.getSponsor(); 
    1769  
    1770     if ((sp != null) && (ensureSponsorExists(sp) == null)) { 
    1771       updResult.sponsorsAdded++; 
    1772     } 
    1773  
    1774     if ((loc != null) && (ensureLocationExists(loc) == null)) { 
    1775       updResult.locationsAdded++; 
    1776     } 
    1777  
    1778     /* If no calendar has been assigned for this event set it to the default 
    1779      * calendar for non-public events or reject it for public events. 
    1780      */ 
    1781  
    1782     if (cal == null) { 
    1783       if (event.getPublick()) { 
    1784         throw new CalFacadeException("No calendar assigned"); 
    1785       } 
    1786  
    1787       cal = getPreferences().getDefaultCalendar(); 
    1788     } 
    1789  
    1790     if (!cal.getCalendarCollection()) { 
    1791       throw new CalFacadeAccessException(); 
    1792     } 
    1793  
    1794     event.setCalendar(cal); 
    1795  
    1796     event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); 
    1797     event.setLastmod(new LastModified(new DateTime(true)).getValue()); 
    1798     event.setCreated(new Created(new DateTime(true)).getValue()); 
    1799  
    1800     if (event instanceof BwEventProxy) { 
    1801       BwEventProxy proxy = (BwEventProxy)event; 
    1802       BwEvent override = proxy.getRef(); 
    1803       getCal().addEvent(override, overrides); 
     2009      // Shouldn't happen? 
     2010      path = uri; 
     2011    } 
     2012 
     2013    if (debug) { 
     2014      trace("Search for calendar \"" + path + "\""); 
     2015    } 
     2016 
     2017    try { 
     2018      calendar = getCal().getCalendar(path, desiredAccess); 
     2019    } catch (CalFacadeAccessException cfae) { 
     2020      calendar = null; 
     2021    } 
     2022 
     2023    if (calendar == null) { 
     2024      // Assume deleted 
     2025      val.setCalendarDeleted(true); 
     2026      updateSubscription(val); 
    18042027    } else { 
    1805       getCal().addEvent(event, overrides); 
    1806     } 
    1807  
    1808     if (isPublicAdmin()) { 
    1809       /* Mail event to any subscribers */ 
    1810     } 
    1811  
    1812     return updResult; 
    1813   } 
    1814  
    1815   public void updateEvent(BwEvent event) throws CalFacadeException { 
    1816     event.setLastmod(new LastModified(new DateTime(true)).getValue()); 
    1817  
    1818     getCal().updateEvent(event); 
    1819  
    1820     if (isPublicAdmin()) { 
    1821       /* Mail event to any subscribers */ 
    1822     } 
    1823   } 
    1824  
    1825   /** For an event to which we have write access we simply mark it deleted. 
    1826    * 
    1827    * <p>Otherwise we add an annotation maarking the event as deleted. 
    1828    * 
    1829    * @param event 
    1830    * @throws CalFacadeException 
    1831    */ 
    1832   public void markDeleted(BwEvent event) throws CalFacadeException { 
    1833     CurrentAccess ca = getCal().checkAccess(event, PrivilegeDefs.privWrite, true); 
    1834  
    1835     if (ca.accessAllowed) { 
    1836       // Have write access - just set the flag and move it into the owners trash 
    1837       event.setDeleted(true); 
    1838       event.setCalendar(getCal().getTrashCalendar(event.getOwner())); 
    1839       updateEvent(event); 
    1840       return; 
    1841     } 
    1842  
    1843     // Need to annotate it as deleted 
    1844  
    1845     BwEventProxy proxy = BwEventProxy.makeAnnotation(event, event.getOwner()); 
    1846  
    1847     // Where does the ref go? Not in the same calendar - we have no access 
    1848     // Put it in the trash - but don't delete on empty trash 
    1849  
    1850     BwCalendar cal = getCal().getDeletedCalendar(getUser()); 
    1851     proxy.setOwner(getUser()); 
    1852     proxy.setDeleted(true); 
    1853     proxy.setCalendar(cal); 
    1854     addEvent(cal, proxy, null); 
    1855   } 
    1856  
    1857   /* ==================================================================== 
    1858    *                       Caldav support 
    1859    * Caldav as it stands at the moment requires that we save the arbitary 
    1860    * names clients might assign to events. 
    1861    * ==================================================================== */ 
    1862  
    1863   public Collection findEventsByName(BwCalendar cal, String val) 
    1864           throws CalFacadeException { 
    1865     return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); 
    1866   } 
    1867  
    1868   /* ==================================================================== 
    1869    *                   Synchronization 
    1870    * ==================================================================== */ 
    1871  
    1872   public BwSynchInfo getSynchInfo() throws CalFacadeException { 
    1873     return getCal().getSynchInfo(); 
    1874   } 
    1875  
    1876   public void addSynchInfo(BwSynchInfo val) throws CalFacadeException { 
    1877     getCal().addSynchInfo(val); 
    1878   } 
    1879  
    1880   public void updateSynchInfo(BwSynchInfo val) throws CalFacadeException { 
    1881     getCal().updateSynchInfo(val); 
    1882   } 
    1883  
    1884   public BwSynchState getSynchState(BwEvent ev) 
    1885       throws CalFacadeException { 
    1886     return getCal().getSynchState(ev); 
    1887   } 
    1888  
    1889   public Collection getDeletedSynchStates() throws CalFacadeException { 
    1890     return getCal().getDeletedSynchStates(); 
    1891   } 
    1892  
    1893   public void addSynchState(BwSynchState val) 
    1894       throws CalFacadeException { 
    1895     getCal().addSynchState(val); 
    1896   } 
    1897  
    1898   public void updateSynchState(BwSynchState val) 
    1899       throws CalFacadeException { 
    1900     getCal().updateSynchState(val); 
    1901   } 
    1902  
    1903   public void getSynchData(BwSynchState val) throws CalFacadeException { 
    1904     getCal().getSynchData(val); 
    1905   } 
    1906  
    1907   public void setSynchData(BwSynchState val) throws CalFacadeException { 
    1908     getCal().setSynchData(val); 
    1909   } 
    1910  
    1911   public void updateSynchStates() throws CalFacadeException { 
    1912     getCal().updateSynchStates(); 
    1913   } 
    1914  
    1915   /* ==================================================================== 
    1916    *                       Alarms 
    1917    * ==================================================================== */ 
    1918  
    1919   public Collection getAlarms(BwEvent event, BwUser user) throws CalFacadeException { 
    1920     return getCal().getAlarms(event, user); 
    1921   } 
    1922  
    1923   public void setAlarm(BwEvent event, 
    1924                        BwEventAlarm alarm) throws CalFacadeException { 
    1925     // Do some sort of validation here. 
    1926     alarm.setEvent(event); 
    1927     alarm.setOwner(getUser()); 
    1928     getCal().addAlarm(alarm); 
    1929   } 
    1930  
    1931   public void updateAlarm(BwAlarm val) throws CalFacadeException { 
    1932     getCal().updateAlarm(val); 
    1933   } 
    1934  
    1935   public Collection getUnexpiredAlarms(BwUser user) throws CalFacadeException { 
    1936     return getCal().getUnexpiredAlarms(user); 
    1937   } 
    1938  
    1939   public Collection getUnexpiredAlarms(BwUser user, long triggerTime) 
    1940           throws CalFacadeException { 
    1941     return getCal().getUnexpiredAlarms(user, triggerTime); 
    1942   } 
    1943  
    1944   /* ==================================================================== 
    1945    *                   Access control 
    1946    * ==================================================================== */ 
    1947  
    1948   /* This provides some limits to shareable entity updates for the 
    1949    * admin users. It is applied in addition to the normal access checks 
    1950    * applied at the lower levels. 
    1951    */ 
    1952   private void updateOK(Object o) throws CalFacadeException { 
    1953     if (isGuest()) { 
    1954       throw new CalFacadeAccessException(); 
    1955     } 
    1956  
    1957     if (isSuper()) { 
    1958       // Always ok 
    1959       return; 
    1960     } 
    1961  
    1962     if (!(o instanceof BwShareableDbentity)) { 
    1963       throw new CalFacadeAccessException(); 
    1964     } 
    1965  
    1966     if (!isPublicAdmin()) { 
    1967       // Normal access checks apply 
    1968       return; 
    1969     } 
    1970  
    1971     BwShareableDbentity ent = (BwShareableDbentity)o; 
    1972  
    1973     if (adminCanEditAllPublicSponsors || 
    1974         ent.getCreator().equals(currentUser())) { 
    1975       return; 
    1976     } 
    1977  
    1978     throw new CalFacadeAccessException(); 
    1979   } 
    1980  
    1981   /* This checks to see if the current user has owner access based on the 
    1982    * supplied object. This is used to limit access to objects not normally 
    1983    * shared such as preferences and related objects like veiws and subscriptions. 
    1984    */ 
    1985   private void checkOwnerOrSuper(Object o) throws CalFacadeException { 
    1986     if (isGuest()) { 
    1987       throw new CalFacadeAccessException(); 
    1988     } 
    1989  
    1990     if (isSuper()) { 
    1991       // Always ok? 
    1992       return; 
    1993     } 
    1994  
    1995     if (!(o instanceof BwOwnedDbentity)) { 
    1996       throw new CalFacadeAccessException(); 
    1997     } 
    1998  
    1999     BwOwnedDbentity ent = (BwOwnedDbentity)o; 
    2000  
    2001     BwUser u; 
    2002  
    2003     /*if (!isPublicAdmin()) { 
    2004       // Expect a different owner - always public-user???? 
    2005       return; 
    2006     }*/ 
    2007  
    2008     u = getUser(); 
    2009  
    2010     if (u.equals(ent.getOwner())) { 
    2011       return; 
    2012     } 
    2013  
    2014     throw new CalFacadeAccessException(); 
    2015   } 
    2016  
    2017   /* ==================================================================== 
    2018    *                   Package and protected methods 
    2019    * ==================================================================== */ 
    2020  
    2021   /** Get the current db session 
    2022    * 
    2023    * @return Object 
    2024    */ 
    2025   Object getDbSession() throws CalFacadeException { 
    2026     return getCal().getDbSession(); 
    2027   } 
    2028  
    2029   /* ==================================================================== 
    2030    *                   Private methods 
    2031    * ==================================================================== */ 
     2028      val.setCalendar(calendar); 
     2029    } 
     2030 
     2031    return calendar; 
     2032  } 
    20322033 
    20332034  private void deleteOK(Object o) throws CalFacadeException { 
  • trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java

    r395 r415  
    319319   * <p>Note that the returned object may require a one time initialisation 
    320320   * call to set it up correctly. 
    321    * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, int
    322    * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, Object
     321   * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, int, boolean
     322   * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, Object, boolean
    323323   * 
    324324   * @param user         String account name 
  • trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcIPars.java

    r301 r415  
    6969   */ 
    7070  private String user; 
    71    
     71 
    7272  /** Environment properties prefix - e.g. "org.bedework.webpersonal." 
    7373   */ 
     
    9494   * @param authUser    String authenticated user of the application 
    9595   * @param user        String user to act as 
    96    * @param enzPrefix   String Environment properties prefix 
     96   * @param envPrefix   String Environment properties prefix 
    9797   * @param publicAdmin true for admin 
    9898   * @param caldav      true if via caldav 
  • trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/Index.java

    r369 r415  
    77 */ 
    88public interface Index extends Serializable { 
     9  /** 
     10   * @param val 
     11   */ 
    912  public void setDebug(boolean val); 
    1013 
    1114  /** This might need to be called to open the index in the appropriate manner 
    1215   *  probably determined by information passed to the constructor. 
     16   * 
     17   * @throws IndexException 
    1318   */ 
    1419  public void open() throws IndexException; 
     
    1621  /** This can be called to (re)create the index. It will destroy any 
    1722   * previously existing index. 
     23   * 
     24   * @throws IndexException 
    1825   */ 
    1926  public void create() throws IndexException; 
    2027 
    2128  /** See if we need to call open 
     29   * 
     30   * @return boolean 
    2231   */ 
    2332  public boolean getIsOpen(); 
     
    4049   * 
    4150   * @param   rec      The record to index 
     51   * @throws IndexException 
    4252   */ 
    4353  public void indexRec(Object rec) throws IndexException; 
     
    4656   * 
    4757   * @param   rec      The record to unindex 
     58   * @throws IndexException 
    4859   */ 
    4960  public void unindexRec(Object rec) throws IndexException; 
     
    5263   * 
    5364   * @param   recs     The records to index 
     65   * @throws IndexException 
    5466   */ 
    5567  public void indexRecs(Object[] recs) throws IndexException; 
     
    5971   * 
    6072   * @param   recs     The records to index 
     73   * @throws IndexException 
    6174   */ 
    6275  public void indexNewRecs(Object[] recs) throws IndexException; 
     
    6578   * 
    6679   * @param   recs      The records to unindex 
     80   * @throws IndexException 
    6781   */ 
    6882  public void unindexRecs(Object[] recs) throws IndexException; 
     
    7589   * @return  int      Number found. 0 means none found, 
    7690   *                                -1 means indeterminate 
     91   * @throws IndexException 
    7792   */ 
    7893  public int search(String query) throws IndexException; 
     
    8398   */ 
    8499  public abstract class Key { 
    85     public float score;       // Score this record 
     100    /** Score this record */ 
     101    public float score; 
    86102 
     103    /** 
     104     * @return  Object entity 
     105     * @throws IndexException 
     106     */ 
    87107    public abstract Object getRecord() throws IndexException; 
    88108  } 
     
    93113   * @param   keys     Array for the record keys 
    94114   * @return  int      Actual number of records 
     115   * @throws IndexException 
    95116   */ 
    96117  public int retrieve(int n, Key[] keys) throws IndexException; 
     
    98119  /** Called if we intend to run a batch of updates. endBatch MUST be 
    99120   * called or manual intervention may be required to remove locks. 
     121   * 
     122   * @throws IndexException 
    100123   */ 
    101124  public void startBatch() throws IndexException; 
    102125 
    103126  /** Called at the end of a batch of updates. 
     127   * 
     128   * @throws IndexException 
    104129   */ 
    105130  public void endBatch() throws IndexException; 
    106131 
    107132  /** Called to close at the end of a session. 
     133   * 
     134   * @throws IndexException 
    108135   */ 
    109136  public void close() throws IndexException; 
  • trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexDummyImpl.java

    r369 r415  
    66  private boolean isOpen; 
    77 
     8  /** 
     9   * @throws IndexException 
     10   */ 
    811  public IndexDummyImpl() throws IndexException { 
    912  } 
  • trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexException.java

    r369 r415  
    3333  private String reason1; 
    3434 
     35  /** 
     36   */ 
    3537  public IndexException() { 
    3638    super(); 
    3739  } 
    3840 
     41  /** 
     42   * @param cause 
     43   */ 
    3944  public IndexException(Throwable cause) { 
    4045    super(cause); 
    4146  } 
    4247 
     48  /** 
     49   * @param pr 
     50   */ 
    4351  public IndexException(String pr) { 
    4452    super(pr); 
    4553  } 
    4654 
     55  /** 
     56   * @param pr 
     57   * @param reason1 
     58   */ 
    4759  public IndexException(String pr, String reason1) { 
    4860    super(pr); 
     
    5062  } 
    5163 
     64  /** 
     65   * @return  String rason1 
     66   */ 
    5267  public String getReason1() { 
    5368    return reason1; 
  • trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexLuceneImpl.java

    r369 r415  
    5757   * @param writeable   true if the caller can update the index 
    5858   * @param debug       true if we want to see what's going on 
     59   * @throws IndexException 
    5960   */ 
    6061  public IndexLuceneImpl(String basePath, 
     
    7273   * @param stopWords   set of stop words, null for default. 
    7374   * @param debug       true if we want to see what's going on 
     75   * @throws IndexException 
    7476   */ 
    7577  public IndexLuceneImpl(String basePath, 
     
    8587  } 
    8688 
     89  /** 
     90   * @return boolean debugging flag 
     91   */ 
    8792  public boolean getDebug() { 
    8893    return debug; 
     
    95100   * @param score The rating for this entry 
    96101   * @return Index.Key  new or reused object 
     102   * @throws IndexException 
    97103   */ 
    98104  public abstract Index.Key makeKey(Index.Key key, 
     
    104110   * @param   rec      The record 
    105111   * @return  Term     Lucene term which uniquely identifies the record 
     112   * @throws IndexException 
    106113   */ 
    107114  public abstract Term makeKeyTerm(Object rec) throws IndexException; 
     
    111118   * @param   rec      The record 
    112119   * @return  String   Name for the field/term 
     120   * @throws IndexException 
    113121   */ 
    114122  public abstract String makeKeyName(Object rec) throws IndexException; 
     
    118126   * @param doc   The =Document 
    119127   * @param rec   The record 
     128   * @throws IndexException 
    120129   */ 
    121130  public abstract void addFields(Document doc, 
     
    402411 
    403412  /** Called if we need to close the writer 
     413   * 
     414   * @throws IndexException 
    404415   */ 
    405416  public synchronized void closeWtr() throws IndexException { 
     
    421432 
    422433  /** Called if we need to close the reader 
     434   * 
     435   * @throws IndexException 
    423436   */ 
    424437  public synchronized void closeRdr() throws IndexException { 
     
    457470 
    458471  /** Ensure we're open 
     472   * 
     473   * @throws IndexException 
    459474   */ 
    460475  private void checkOpen() throws IndexException { 
     
    466481  } 
    467482 
    468   /** Called to obtain the current or a new writer. 
     483  /* Called to obtain the current or a new writer. 
    469484   * 
    470485   * @return IndexWriter  writer to our index 
     
    488503  } 
    489504 
    490   /** Called to obtain the current or a new reader. 
     505  /* Called to obtain the current or a new reader. 
    491506   * 
    492507   * @return IndexReader  reader of our index 
     
    511526 
    512527 
    513   /** Called to unindex a record. The reader will be left 
     528  /* Called to unindex a record. The reader will be left 
    514529   * open. The writer must be closed and will stay closed. 
    515530   * 
     
    538553  } 
    539554 
    540   /** Called to index a record. The writer will be left open and the reader 
     555  /* Called to index a record. The writer will be left open and the reader 
    541556   * must be closed on entry and will stay closed. 
    542557   * 
     
    569584   * @param   name     String field name 
    570585   * @param   ss       String array of keywords 
     586   * @throws IndexException 
    571587   */ 
    572588  protected void addKeyArray(Document doc, String name, String[] ss) 
     
    588604   * @param   name     Field name 
    589605   * @param   dt       The timestamp 
     606   * @throws IndexException 
    590607   */ 
    591608  protected void addTimestamp(Document doc, String name, Timestamp dt) 
     
    603620   * @param   name     Field name 
    604621   * @param   val      The value 
     622   * @throws IndexException 
    605623   */ 
    606624  protected void addString(Document doc, String name, String val) 
     
    618636   * @param   name     Field name 
    619637   * @param   cost     The cost in cents 
     638   * @throws IndexException 
    620639   */ 
    621640  protected void addCost(Document doc, String name, Long cost) 
     
    654673   * @param   name     Field name 
    655674   * @param   val      The value 
     675   * @throws IndexException 
    656676   */ 
    657677  protected void addKey(Document doc, String name, String val) 
     
    669689   * @param   name     Field name 
    670690   * @param   val      The value 
     691   * @throws IndexException 
    671692   */ 
    672693  protected void addLongStoredString(Document doc, String name, String val) 
     
    684705   * @param   name     Field name 
    685706   * @param   val      The value 
     707   * @throws IndexException 
    686708   */ 
    687709  protected void addLongString(Document doc, String name, String val) 
  • trunk/calendar3/common/src/edu/rpi/sss/util/jsp/UtilAbstractAction.java

    r338 r415  
    635635  /** Get the session id for the loggers. 
    636636   * 
     637   * @param request 
    637638   * @return  String    session id 
    638639   */ 
     
    659660   * 
    660661   * @param request    HttpServletRequest 
     662   * @param form 
    661663   * @return boolean true for OK to log out. False - not allowed - ignore it. 
    662664   */ 
     
    669671   * 
    670672   * @param request    HttpServletRequest 
     673   * @param form 
    671674   * @return null for continue, forwardLoggedOut to end session. 
     675   * @throws Throwable 
    672676   */ 
    673677  protected String checkLogOut(HttpServletRequest request, 
     
    691695   * ==================================================================== */ 
    692696 
    693   /** We handle our own nocache headers instead of letting struts do it. 
     697  /* We handle our own nocache headers instead of letting struts do it. 
    694698   * Struts does it on every response but, if we are running with nocache, 
    695699   * we need to be able to disable it for the occassional response. 
     
    738742   * ==================================================================== */ 
    739743 
    740   /** Debugging routine to see if we can serialize the session. 
     744  /* Debugging routine to see if we can serialize the session. 
    741745   * We see session serialization errors in the web container if an 
    742746   * unserializable object class gets embedded in the session somewhere 
     
    843847   * @param form     Action form 
    844848   * @return String  forward to here. null if no error found. 
     849   * @throws Throwable 
    845850   */ 
    846851  private String checkVarReq(HttpServletRequest request, 
     
    917922   * @param request  Needed to locate session 
    918923   * @return String  forward to here. null if no forward found. 
     924   * @throws Throwable 
    919925   */ 
    920926  private String checkForwardto(HttpServletRequest request) throws Throwable { 
     
    936942   * 
    937943   * @param request  Needed to locate session 
     944   * @param form 
    938945   * @return String  forward to here on error. null for OK. 
     946   * @throws Throwable 
    939947   */ 
    940948  protected String checkConfirmationId(HttpServletRequest request, 
     
    963971   * 
    964972   * @param request  Needed to locate session 
     973   * @param form 
    965974   * @return String  forward to here on error. null for OK. 
     975   * @throws Throwable 
    966976   */ 
    967977  protected String requireConfirmationId(HttpServletRequest request, 
     
    11181128   * @param name    name of parameter 
    11191129   * @return  String   value 
     1130   * @throws Throwable 
    11201131   */ 
    11211132  protected String getReqPar(HttpServletRequest req, String name) throws Throwable { 
     
    11271138   * @param req 
    11281139   * @param name    name of parameter 
     1140   * @param defaultVal 
    11291141   * @return  int   value 
     1142   * @throws Throwable 
    11301143   */ 
    11311144  protected int getIntReqPar(HttpServletRequest req, String name, 
     
    11481161   * @param req 
    11491162   * @param name    name of parameter 
     1163   * @param defaultVal 
    11501164   * @return  long  value 
     1165   * @throws Throwable 
    11511166   */ 
    11521167  protected long getLongReqPar(HttpServletRequest req, String name, 
     
    11701185   * @param name    name of parameter 
    11711186   * @return  boolean   value 
     1187   * @throws Throwable 
    11721188   */ 
    11731189  protected Boolean getBooleanReqPar(HttpServletRequest req, String name) 
     
    11961212   * @param request  Needed to locate session 
    11971213   * @param messages Resources 
     1214   * @return ErrorEmitSvlt 
    11981215   */ 
    11991216  private ErrorEmitSvlt getErrorObj(HttpServletRequest request, 
     
    12141231   * @param request  Needed to locate session 
    12151232   * @param messages Resources 
     1233   * @return MessageEmitSvlt 
    12161234   */ 
    12171235  private MessageEmitSvlt getMessageObj(HttpServletRequest request, 
  • trunk/calendar3/common/src/edu/rpi/sss/util/servlets/ConfiguredXSLTFilter.java

    r2 r415  
    308308  /** Obtain the presentation state from the session. Override if you want 
    309309   * different behaviour. 
     310   * 
     311   * @param request 
     312   * @return PresentationState 
    310313   */ 
    311314  protected PresentationState getPresentationState(HttpServletRequest request) { 
  • trunk/calendar3/common/src/edu/rpi/sss/util/servlets/io/WrappedResponse.java

    r2 r415  
    167167 
    168168  /** Get a logger for messages 
     169   * 
     170   * @return Logger 
    169171   */ 
    170172  protected Logger getLogger() { 
  • trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlEmit.java

    r314 r415  
    6969  private Writer wtr; 
    7070  private boolean mustEmitNS; 
    71    
     71 
    7272  private boolean noHeaders = false; 
    7373 
     
    9595  /** construct an object which will be used to collect namespace names 
    9696   * during the first phase and emit xml afetr startEmit is called. 
    97    *  
     97   * 
    9898   * @param noHeaders    boolean true to suppress headers 
    9999   */ 
     
    120120  public void startEmit(Writer wtr) throws IOException { 
    121121    this.wtr = wtr; 
    122      
     122 
    123123    if (!noHeaders) { 
    124124      mustEmitNS = true; 
    125        
     125 
    126126      writeHeader(); 
    127127    } 
     
    293293  } 
    294294 
     295  /** Write a new line 
     296   * 
     297   * @throws IOException 
     298   */ 
    295299  public void newline() throws IOException { 
    296300    wtr.write("\n"); 
  • trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlUtil.java

    r394 r415  
    300300  } 
    301301 
    302   /** Strip out the characters causing comparison problems. 
     302  /* Strip out the characters causing comparison problems. 
     303   * 
     304   * @param strVal 
     305   * @return 
    303306   */ 
    304307  private static String strip(String strVal) { 
  • trunk/calendar3/config/configs/democal.properties

    r394 r415  
    163163 
    164164org.bedework.app.UserCal.war.name=ucal 
    165 org.bedework.app.UserCal.deploy.j2ee=false 
    166165org.bedework.app.UserCal.ear.name=ucal 
    167166org.bedework.app.UserCal.context.root=ucal 
  • trunk/calendar3/config/src/edu/rpi/cct/uwcal/config/optionsApp/AbstractOptionsPanel.java

    r2 r415  
    187187 
    188188  /** Add some help text and increment the row. 
     189   * 
     190   * @param resourceName 
    189191   */ 
    190192  protected void showHelpText(String resourceName) { 
     
    208210 
    209211  /** Add some text and increment the row. 
     212   * 
     213   * @param resourceName 
    210214   */ 
    211215  protected void showTitleText(String resourceName) { 
     
    229233 
    230234  /** Add a label and separator and increment the row. 
     235   * 
     236   * @param titleName 
    231237   */ 
    232238  protected void addSeparator(String titleName) { 
     
    273279   * 
    274280   * <p>Otherwise we just create a checkbox to hold the property value. 
     281   * 
     282   * @param resourceName 
     283   * @param advancedField 
     284   * @return OptionsCheckBox 
    275285   */ 
    276286  protected OptionsCheckBox checkBox(String resourceName, boolean advancedField) { 
     
    323333   * 
    324334   * <p>Otherwise we just create a checkbox to hold the property value. 
     335   * 
     336   * @param resourceName 
     337   * @param advancedField 
     338   * @return OptionsTextField 
    325339   */ 
    326340  protected OptionsTextField textField(String resourceName, boolean advancedField) { 
  • trunk/calendar3/config/src/org/bedework/webconfig/Defs.java

    r307 r415  
    6262  /** This prefix never changes */ 
    6363  public static final String envPrefix = "org.bedework.app.bwconfig."; 
    64    
     64 
     65  /* Types of application */ 
     66  /** */ 
    6567  public static final String webconfigType = "webconfig"; 
     68  /** */ 
    6669  public static final String webadminType = "webadmin"; 
     70  /** */ 
    6771  public static final String webpublicType = "webpublic"; 
     72  /** */ 
    6873  public static final String webuserType = "webuser"; 
     74  /** */ 
    6975  public static final String publiccaldavType = "publiccaldav"; 
     76  /** */ 
    7077  public static final String usercaldavType = "usercaldav"; 
    71    
     78 
    7279  /** Valid types of application */ 
    7380  public static final String[] appTypes = { 
     
    7986    usercaldavType 
    8087  }; 
    81    
     88 
    8289  /** */ 
    8390  public static final String modulesCollectionName = "modules"; 
    84    
     91 
    8592  /** Default properties file (built in to application) */ 
    86   //public final static String defaultProperties = "/properties/calendar/default-bedework.properties";  
    87    
     93  //public final static String defaultProperties = "/properties/calendar/default-bedework.properties"; 
     94 
    8895  /* Types for properties */ 
    89      
     96 
    9097  /** String property */ 
    9198  public final static int typeString = 0; 
    92    
     99 
    93100  /** Int property */ 
    94101  public final static int typeInt = 1; 
    95    
     102 
    96103  /** boolean property */ 
    97104  public final static int typeBoolean = 2; 
    98    
     105 
    99106  /** Choice property, i.e. One of n  (radio) */ 
    100   public final static int typeChoice = 3;   
    101    
     107  public final static int typeChoice = 3; 
     108 
    102109  /** Multi-value property - radio or select */ 
    103   public final static int typeMultiple = 4;  
    104    
     110  public final static int typeMultiple = 4; 
     111 
    105112  /** Comment */ 
    106   public final static int typeComment = 5;  
     113  public final static int typeComment = 5; 
    107114} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
    64    * @param onlyIf   BooleanProperty - display collection only if true 
     64   * @param name   String name of application 
    6565   * @throws Throwable 
    6666   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
    64    * @param onlyIf   BooleanProperty - display collection only if true 
     64   * @param name   String name of application 
    6565   * @throws Throwable 
    6666   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java

    r307 r415  
    165165    return properties; 
    166166  } 
    167    
     167 
    168168  /** Add a required boolean property to the collection 
    169169   * 
     
    176176    BooleanProperty prop = new BooleanProperty(name, suffix, true); 
    177177    addProperty(prop); 
    178      
    179     return prop; 
    180   } 
    181    
     178 
     179    return prop; 
     180  } 
     181 
    182182  /** Add a hidden boolean property to the collection 
    183183   * 
     
    191191    prop.setHidden(true); 
    192192    addProperty(prop); 
    193      
    194     return prop; 
    195   } 
    196    
     193 
     194    return prop; 
     195  } 
     196 
    197197  /** Add an optional boolean property to the collection 
    198198   * 
     
    205205    BooleanProperty prop = new BooleanProperty(name, suffix, false); 
    206206    addProperty(prop); 
    207      
    208     return prop; 
    209   } 
    210    
     207 
     208    return prop; 
     209  } 
     210 
    211211  /** Add a required int property to the collection 
    212212   * 
     
    219219    IntProperty prop = new IntProperty(name, suffix, true); 
    220220    addProperty(prop); 
    221      
    222     return prop; 
    223   } 
    224    
     221 
     222    return prop; 
     223  } 
     224 
    225225  /** Add a required text property to the collection 
    226226   * 
     
    233233    ConfigProperty prop = new ConfigProperty(name, suffix, true); 
    234234    addProperty(prop); 
    235      
    236     return prop; 
    237   } 
    238    
     235 
     236    return prop; 
     237  } 
     238 
    239239  /** Add a hidden text property to the collection 
    240240   * 
     
    248248    prop.setHidden(true); 
    249249    addProperty(prop); 
    250      
    251     return prop; 
    252   } 
    253    
     250 
     251    return prop; 
     252  } 
     253 
    254254  /** Add a required text property to the collection 
    255255   * 
     
    264264    ConfigProperty prop = new ConfigProperty(name, suffix, true, onlyIf); 
    265265    addProperty(prop); 
    266      
    267     return prop; 
    268   } 
    269    
     266 
     267    return prop; 
     268  } 
     269 
    270270  /** Add a required ordered list property to the collection 
    271271   * 
    272272   * @param name 
    273273   * @param suffix 
    274    * @return 
    275    * @throws Throwable 
    276    */ 
    277   public OrderedListProperty requiredOrderedList(String name,  
     274   * @return OrderedListProperty 
     275   * @throws Throwable 
     276   */ 
     277  public OrderedListProperty requiredOrderedList(String name, 
    278278                                                 String suffix) throws Throwable { 
    279279    OrderedListProperty prop = new OrderedListProperty(name, suffix, true); 
    280280    addProperty(prop); 
    281      
    282     return prop; 
    283   } 
    284    
     281 
     282    return prop; 
     283  } 
     284 
    285285  /** Add a required ordered multi list property to the collection 
    286286   * 
     
    288288   * @param suffix 
    289289   * @param possibleValues String[] array of allowable values 
    290    * @return 
    291    * @throws Throwable 
    292    */ 
    293   public OrderedMultiListProperty requiredOrderedMultiList(String name,  
     290   * @return OrderedMultiListProperty 
     291   * @throws Throwable 
     292   */ 
     293  public OrderedMultiListProperty requiredOrderedMultiList(String name, 
    294294                                                           String suffix, 
    295                                                            String[] possibleValues)  
     295                                                           String[] possibleValues) 
    296296               throws Throwable { 
    297     OrderedMultiListProperty prop = new OrderedMultiListProperty(name, suffix, true,  
     297    OrderedMultiListProperty prop = new OrderedMultiListProperty(name, suffix, true, 
    298298                                                                 possibleValues); 
    299299    addProperty(prop); 
    300      
    301     return prop; 
    302   } 
    303   
     300 
     301    return prop; 
     302  } 
     303 
    304304  /** Add a comment to the collection 
    305305   * 
     
    442442   * ==================================================================== */ 
    443443 
     444  /** 
     445   * @param o 
     446   * @return int 
     447   */ 
    444448  public int compareTo(Object o) { 
    445449    if (!(o instanceof ConfigCollection)) { 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
    64    * @param onlyIf   BooleanProperty - display collection only if true 
     64   * @param name   String name of application 
    6565   * @throws Throwable 
    6666   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
     64   * @param name   String name of application 
    6465   * @throws Throwable 
    6566   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
    64    * @param onlyIf   BooleanProperty - display collection only if true 
     64   * @param name   String name of application 
    6565   * @throws Throwable 
    6666   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java

    r307 r415  
    6262  /** Constructor 
    6363   * 
    64    * @param onlyIf   BooleanProperty - display collection only if true 
     64   * @param name   String name of application 
    6565   * @throws Throwable 
    6666   */ 
  • trunk/calendar3/config/src/org/bedework/webconfig/props/CommentProperty.java

    r302 r415  
    6464 * giving a property name of "org.bedework.webadmin.app.root" 
    6565 * 
    66  * <p>A comment propert is just that - text to be inserted as a comment in the  
     66 * <p>A comment propert is just that - text to be inserted as a comment in the 
    6767 * resulting properties file. 
    68  *  
     68 * 
    6969 * @author Mike Douglass 
    7070 */ 
     
    7474  /** Constructor 
    7575   * 
    76    * @param value    String 
     76   * @param val    String 
    7777   */ 
    7878  public CommentProperty(String val) { 
  • trunk/calendar3/deployment/src/org/bedework/deployment/ApplicationXmlTask.java

    r269 r415  
    8989 
    9090  private File warDir; 
    91    
     91 
    9292  private String displayName; 
    9393 
     
    9595  private Writer wtr; 
    9696 
     97  /** Add a fileset 
     98   * 
     99   * @param set 
     100   */ 
    97101  public void addFileset(FileSet set) { 
    98102    filesets.add(set); 
     
    128132    try { 
    129133      getModules(); 
    130        
     134 
    131135      FileUtils.newFileUtils().createNewFile(outFile, true); 
    132        
     136 
    133137      wtr = new FileWriter(outFile); 
    134138 
     
    173177      throw new BuildException(t); 
    174178    } 
    175   }  
     179  } 
    176180 
    177181  /* Scan the filesets and extract files that end with ".jar" and directories 
     
    189193      throw new BuildException("No wardir supplied"); 
    190194    } 
    191      
     195 
    192196    String[] warnames = warDir.list(fltr); 
    193197    for (int wi = 0; wi < warnames.length; wi++) { 
    194198      wars.add(warnames[wi]); 
    195199    } 
    196      
     200 
    197201    Iterator it = filesets.iterator(); 
    198202 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/Dumpling.java

    r50 r415  
    226226 
    227227  /** Anything for which toString() works OK 
     228   * 
     229   * @param name 
     230   * @param val 
     231   * @throws Throwable 
    228232   */ 
    229233  protected void taggedVal(String name, Object val) throws Throwable { 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java

    r260 r415  
    116116   *  =================================================================== */ 
    117117 
     118  /** 
     119   * @throws Throwable 
     120   */ 
    118121  void open() throws Throwable { 
    119122    if (globals.rintf == null) { 
     
    168171 
    169172  /** Called to finish off by writing out prefs. 
     173   * 
     174   * @throws Throwable 
    170175   */ 
    171176  private void makePrefs() throws Throwable { 
     
    247252   * @param user     BwUser object 
    248253   * @param cal      BwCalendar object 
     254   * @param display 
     255   * @param freeBusy 
    249256   * @param publicCalendar 
    250257   * @throws Throwable 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java

    r260 r415  
    106106  public boolean debug; 
    107107 
     108  /** Map user with id of zero on to this id - fixes oversight */ 
    108109  public static int mapUser0 = 1; 
    109    
     110 
    110111  /** */ 
    111112  public boolean debugEntity; 
     
    240241  public int alarms; 
    241242 
    242   /** If true we should discard all but users in onlyUsers  
     243  /** If true we should discard all but users in onlyUsers 
    243244   * This helps when building demo data 
    244245   */ 
     
    247248  /** Users we preserve */ 
    248249  public HashMap onlyUsersMap = new HashMap(); 
    249    
     250 
    250251  /** counter */ 
    251252  public static class SubscriptionsMap extends HashMap { 
     
    401402        val.setId(id); 
    402403      } 
    403        
     404 
    404405      Integer keyid = new Integer(id); 
    405406      if (get(keyid) != null) { 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/EntityFieldRule.java

    r247 r415  
    250250    field(name); 
    251251  } 
    252    
     252 
    253253  protected String fixedDateTimeFld() throws Exception { 
    254254    String dtVal = stringFld(); 
    255     if ((dtVal.length() == 8) ||  
     255    if ((dtVal.length() == 8) || 
    256256          ((dtVal.charAt(13) == '0') && (dtVal.charAt(14) == '0'))) { 
    257257      return dtVal; 
    258258    } 
    259      
     259 
    260260    String prefix = dtVal.substring(0, 13); 
    261      
    262     if (dtVal.length() == 16) {  
    263        return prefix + "00Z";  
     261 
     262    if (dtVal.length() == 16) { 
     263       return prefix + "00Z"; 
    264264     } 
    265      
    266     return prefix + "00";  
    267   } 
    268  
    269   /** prehib to hib */ 
     265 
     266    return prefix + "00"; 
     267  } 
     268 
     269  /** prehib to hib 
     270   * 
     271   * @return BwDateTime 
     272   * @throws Exception 
     273   */ 
    270274  protected BwDateTime dateFld() throws Exception { 
    271275    if (fldval == null) { 
     
    295299  } 
    296300 
    297   /** prehib to hib */ 
     301  /** prehib to hib 
     302   * 
     303   * @param val 
     304   * @throws Exception 
     305   */ 
    298306  protected void makeDateTimeFld(BwDateTime val) throws Exception { 
    299307    if (fldval == null) { 
     
    327335  } 
    328336 
    329   /** Make an iso date time -- prehib to hib */ 
     337  /** Make an iso date time -- prehib to hib 
     338   * 
     339   * @return String 
     340   * @throws Exception 
     341   */ 
    330342  protected String isoDateTimeFld() throws Exception { 
    331343    if (fldval == null) { 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/FilterRule.java

    r171 r415  
    188188  } 
    189189 
    190   /** There are restrictions on what is valid in calendar names. 
     190  /* There are restrictions on what is valid in calendar names. 
    191191   */ 
    192192  private String fixName(String val) { 
  • trunk/calendar3/icalendar/src/org/bedework/icalendar/BwEventUtil.java

    r298 r415  
    142142   */ 
    143143  public static EventInfo toEvent(IcalCallback cb, 
    144                                   BwCalendar cal,  
     144                                  BwCalendar cal, 
    145145                                  Collection evs, 
    146146                                  VEvent val, 
     
    236236         * expansions etc. 
    237237         */ 
    238         Collection eis = cb.getEvent(cal, guid, rid,  
     238        Collection eis = cb.getEvent(cal, guid, rid, 
    239239                                     CalFacadeDefs.retrieveRecurMaster); 
    240240        if ((eis == null) || (eis.size() == 0)) { 
     
    795795  }*/ 
    796796 
    797   /** Try to build a location from the supplied string. This only works if 
     797  /* Try to build a location from the supplied string. This only works if 
    798798   * the delimiters and keywords remain intact. 
    799799   * 
     
    808808  } 
    809809 
    810   /** Try to build a contact from the supplied string. This only works if 
     810  /* Try to build a contact from the supplied string. This only works if 
    811811   * the delimiters and keywords remain intact. 
    812812   */ 
  • trunk/calendar3/icalendar/src/org/bedework/icalendar/VEventUtil.java

    r310 r415  
    456456  } 
    457457 
    458   /** Return the highest possible start date from this recurrence or null 
     458  /* Return the highest possible start date from this recurrence or null 
    459459   * if no count or until date specified 
    460460   */ 
  • trunk/calendar3/test/src/org/bedework/httpunit/utils/TestUtils.java

    r2 r415  
    347347  } 
    348348 
    349   /** Get a logger for messages 
     349  /* Get a logger for messages 
    350350   */ 
    351351  private Logger getLogger() { 
  • trunk/calendar3/test/src/org/bedework/tests/calsvc/CalSvcTest.java

    r2 r415  
    143143   * 
    144144   * @param n     int number of locations 
     145   * @param user 
    145146   * @return int  key of first added (remainder should follow) 
     147   * @throws Throwable 
    146148   */ 
    147149  private int addLocations(int n, 
     
    175177   * 
    176178   * @param n     int number of sponsors 
     179   * @param user 
    177180   * @return int  key of first added (remainder should follow) 
     181   * @throws Throwable 
    178182   */ 
    179183  private int addSponsors(int n, 
     
    240244   * @param locn      int first location id 
    241245   * @param spn       int first sponsor id 
     246   * @param user 
    242247   * @param desc      some identifying text 
    243248   * @return int      key of first added (remainder should follow) 
     249   * @throws Throwable 
    244250   */ 
    245251  private int addEvents(int n, int locn, int spn, 
  • trunk/calendar3/timers/src/org/bedework/timers/AlarmTask.java

    r2 r415  
    230230  } 
    231231 
    232   /** Get a logger for messages 
     232  /* Get a logger for messages 
    233233   */ 
    234234  private Logger getLogger() { 
  • trunk/calendar3/timers/src/org/bedework/timers/Timers.java

    r2 r415  
    233233  } 
    234234 
    235   /** Get a logger for messages 
     235  /* Get a logger for messages 
    236236   */ 
    237237  private Logger getLogger() { 
  • trunk/calendar3/timers/src/org/bedework/timers/service/DbPollerTimerService.java

    r301 r415  
    138138  private void init() throws Throwable { 
    139139    svci = new CalSvc(); 
    140     CalSvcIPars pars = new CalSvcIPars(account,  
     140    CalSvcIPars pars = new CalSvcIPars(account, 
    141141                                       account, 
    142142                                       null,   // XXX needs envPrefix 
     
    166166  } 
    167167 
    168   /** Get a logger for messages 
     168  /* Get a logger for messages 
    169169   */ 
    170170  private Logger getLogger() { 
  • trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEUpdateEventAction.java

    r365 r415  
    219219   * the form. 
    220220   * 
     221   * @param form 
     222   * @param svci 
     223   * @param event 
     224   * @param err 
    221225   * @return boolean  true OK, false not OK and message(s) emitted. 
     226   * @throws Throwable 
    222227   */ 
    223228  private boolean validateEventCalendar(PEActionForm form, CalSvcI svci, 
     
    258263  /** 
    259264   * 
     265   * @param form 
     266   * @param svci 
     267   * @param event 
     268   * @param err 
    260269   * @return boolean  false means something wrong, message emitted 
    261270   * @throws Throwable 
     
    307316   * the form. 
    308317   * 
     318   * @param form 
     319   * @param svci 
     320   * @param event 
     321   * @param err 
    309322   * @return boolean  true OK, false not OK and message(s) emitted. 
    310323   * @throws Throwable 
     
    359372   * the form. 
    360373   * 
     374   * @param form 
     375   * @param svci 
     376   * @param event 
     377   * @param err 
    361378   * @return boolean  true OK, false not OK and message(s) emitted. 
    362379   * @throws Throwable 
  • trunk/calendar3/webclient/src/org/bedework/webclient/BwMailEventAction.java

    r55 r415  
    124124   * @param name     name for attachment 
    125125   * @param type     mimetype for attachment 
     126   * @param form 
     127   * @throws Throwable 
    126128   */ 
    127129  private void mailMessage(Message val, 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r409 r415  
    5252    to the maximum extent the law permits. 
    5353*/ 
    54  
    5554package org.bedework.webcommon; 
    5655 
     
    314313   * @param emitError   Emit error messages for missing request par. 
    315314   * @return boolean    true there was a subname parameter 
     315   * @param cloneIt     true if we should clone the result 
    316316   * @throws Throwable 
    317317   */ 
     
    605605   *                  otherwise this is an explicit request to change group. 
    606606   * @return String   forward name 
     607   * @throws Throwable 
    607608   */ 
    608609  protected String checkGroup(HttpServletRequest request, 
     
    12571258   * @param loc      LocationVO object 
    12581259   * @param cal 
    1259    * @throws CalFacadeException 
     1260   * @throws Throwable 
    12601261   */ 
    12611262  protected void updateAuthPrefs(BwActionFormBase form, 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/TimeDateComponents.java

    r257 r415  
    278278  } 
    279279 
    280   /** Sets this object's current date to now.  
     280  /** Sets this object's current date to now. 
    281281   */ 
    282282  public void setNow() { 
     
    584584  } 
    585585 
    586   /** Get a logger for messages 
     586  /* Get a logger for messages 
    587587   */ 
    588588  private Logger getLogger() { 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/calendars/UpdateCalendarAction.java

    r408 r415  
    162162  } 
    163163 
    164   /** Validate a calendar - we do not create these as a side effect. 
     164  /* Validate a calendar - we do not create these as a side effect. 
    165165   * 
    166166   * @return boolean  false means something wrong, message emitted 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/BaseTag.java

    r336 r415  
    7474   *                  found. 
    7575   * @return Object   null if none found. 
     76   * @throws JspTagException 
    7677   */ 
    7778  protected Object getObject(String name, String scope, 
     
    107108   *                  found. 
    108109   * @return int      0 if none found. 
     110   * @throws JspTagException 
    109111   */ 
    110112  protected int getInt(String name, String scope, 
     
    127129   * @param scopeName   String - same as struts values 
    128130   * @return int        value defined in PageContext 
     131   * @throws JspTagException 
    129132   */ 
    130133  protected int getScope(String scopeName) throws JspTagException { 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitCurrentPrivsTag.java

    r320 r415  
    7676  /** Optional attribute: name of outer tag */ 
    7777  private String tagName; 
    78    
     78 
    7979  /** 
    8080   * Constructor 
     
    8282  public EmitCurrentPrivsTag() { 
    8383  } 
    84    
     84 
    8585  /** Called at end of Tag 
    8686   * 
     
    9797        tagName = property; 
    9898      } 
    99        
     99 
    100100      // Assume we're indented for the first tag 
    101101      out.print('<'); 
     
    116116    return EVAL_PAGE; 
    117117  } 
    118    
     118 
    119119  private String getXmlAccess(CurrentAccess ca) throws Throwable { 
    120120    if (ca == null) { 
    121121      return null; 
    122122    } 
    123      
     123 
    124124    return AccessAppUtil.getCurrentPrivSetString(ca.privileges); 
    125125  } 
    126126 
     127  /** 
     128   * @param val String name 
     129   */ 
    127130  public void setTagName(String val) { 
    128131    tagName = val; 
    129132  } 
    130133 
     134  /** 
     135   * @return String name 
     136   */ 
    131137  public String getTagName() { 
    132138    return tagName; 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitTextTag.java

    r320 r415  
    7575  private String tagName; 
    7676 
    77   /** Optional attribute: for those who like tidy xml  
     77  /** Optional attribute: for those who like tidy xml 
    7878   * If specified we add teh value after a new line. */ 
    7979  private String indent = null; 
    8080 
    8181  private boolean filter = true; 
    82    
     82 
    8383  /** 
    8484   * Constructor 
     
    8686  public EmitTextTag() { 
    8787  } 
    88    
     88 
    8989  /** Called at end of Tag 
    9090   * 
     
    101101        tagName = property; 
    102102      } 
    103        
     103 
    104104      // Assume we're indented for the first tag 
    105105      out.print('<'); 
    106106      out.print(tagName); 
    107        
     107 
    108108      if (indent != null) { 
    109109        out.println('>'); 
     
    135135  } 
    136136 
     137  /** 
     138   * @param val String name 
     139   */ 
    137140  public void setTagName(String val) { 
    138141    tagName = val; 
    139142  } 
    140143 
     144  /** 
     145   * @return String name 
     146   */ 
    141147  public String getTagName() { 
    142148    return tagName; 
    143149  } 
    144150 
     151  /** 
     152   * @param val String indent 
     153   */ 
    145154  public void setIndent(String val) { 
    146155    indent = val; 
    147156  } 
    148157 
     158  /** 
     159   * @return  String indent 
     160   */ 
    149161  public String getIndent() { 
    150162    return indent; 
    151163  } 
    152    
     164 
     165  /** Should we filter output for html? 
     166   * 
     167   * @param val boolean 
     168   */ 
    153169  public void setFilter(boolean val) { 
    154170    filter = val; 
    155171  } 
    156    
     172 
     173  /** Should we filter output for html? 
     174   * 
     175   * @return boolean 
     176   */ 
    157177  public boolean getFilter() { 
    158178    return filter; 
    159179  } 
    160    
     180 
    161181  private String formatted(String val) { 
    162182    if (filter) { 
    163183      return TagUtils.getInstance().filter(val); 
    164184    } 
    165      
     185 
    166186    return val; 
    167187  } 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopePropertyTag.java

    r312 r415  
    6666  String property; 
    6767 
     68  /** 
     69   * @param val 
     70   */ 
    6871  public void setProperty(String val) { 
    6972    property = val; 
    7073  } 
    7174 
     75  /** 
     76   * @return String 
     77   */ 
    7278  public String getProperty() { 
    7379    return property; 
     
    7985   *                  found. 
    8086   * @return Object   null if none found. 
     87   * @throws JspTagException 
    8188   */ 
    8289  protected Object getObject(boolean required) throws JspTagException { 
     
    8996   *                  found. 
    9097   * @return String   null if none found. 
     98   * @throws JspTagException 
    9199   */ 
    92100  protected String getString(boolean required) throws JspTagException { 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopeTag.java

    r312 r415  
    6464  String scope; 
    6565 
     66  /** 
     67   * @param val 
     68   */ 
    6669  public void setScope(String val) { 
    6770    scope = val; 
    6871  } 
    6972 
     73  /** 
     74   * @return String 
     75   */ 
    7076  public String getScope() { 
    7177    return scope; 
     
    7884   *                  found. 
    7985   * @return Object   null if none found. 
     86   * @throws JspTagException 
    8087   */ 
    8188  protected Object getObject(String property, boolean required) 
     
    9097   *                  found. 
    9198   * @return int      0 if none found. 
     99   * @throws JspTagException 
    92100   */ 
    93101  protected int getInt(String property, boolean required) 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameTag.java

    r312 r415  
    5555 
    5656/** Tag with a name attribute 
    57  *  
     57 * 
    5858 * @author Mike Douglass 
    5959 * 
     
    6363  String name; 
    6464 
     65  /** 
     66   * @param val 
     67   */ 
    6568  public void setName(String val) { 
    6669    name = val; 
    6770  } 
    6871 
     72  /** 
     73   * @return String name 
     74   */ 
    6975  public String getName() { 
    7076    return name;