Changeset 356

Show
Ignore:
Timestamp:
04/10/06 00:26:24
Author:
douglm
Message:

Deletions mostly working.

New svci method markDeleted which marks events as deleted and moves them into the owners trash

For events to which the user has no access, e.g. public events, an annotation is added which is
marked as deleted and is also stored in the trash

Further work:
Need to handle recurrence instances.
Need a way to really delete events
Need to ensure empty trash doesn't remove the annotations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java

    r331 r356  
    5555 
    5656import edu.rpi.cct.uwcal.access.PrivilegeDefs; 
     57import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    5758 
    5859import org.bedework.calenv.CalEnv; 
     
    300301    calendars = new Calendars(this, access, currentMode, debug); 
    301302 
    302     categories = new EventProperties(this, access, currentMode,  
     303    categories = new EventProperties(this, access, currentMode, 
    303304                                     "word", BwCategory.class.getName(), 
    304305                                     "getCategoryRefs", 
    305306                                     -1, debug); 
    306     locations = new EventProperties(this, access, currentMode,  
     307    locations = new EventProperties(this, access, currentMode, 
    307308                                    "address", BwLocation.class.getName(), 
    308309                                    "getLocationRefs", 
    309310                                     CalFacadeDefs.maxReservedLocationId, debug); 
    310     sponsors = new EventProperties(this, access, currentMode,  
     311    sponsors = new EventProperties(this, access, currentMode, 
    311312                                   "name", BwSponsor.class.getName(), 
    312313                                   "getSponsorRefs", 
     
    325326    access.setSuperUser(val); 
    326327  } 
    327    
     328 
    328329  public boolean getSuperUser() { 
    329330    return access.getSuperUser(); 
     
    334335      return null; 
    335336    } 
    336      
     337 
    337338    BwRWStats rwstats = (BwRWStats)stats; 
    338      
     339 
    339340    if (timezones != null) { 
    340341      rwstats.setDateCacheHits(timezones.getDateCacheHits()); 
     
    342343      rwstats.setDatesCached(timezones.getDatesCached()); 
    343344    } 
    344      
     345 
    345346    return stats; 
    346347  } 
     
    350351      return; 
    351352    } 
    352      
     353 
    353354    if (dbStats == null) { 
    354355      dbStats = sessFactory.getStatistics(); 
    355356    } 
    356      
     357 
    357358    dbStats.setStatisticsEnabled(enable); 
    358359  } 
     
    362363      return false; 
    363364    } 
    364      
     365 
    365366    return dbStats.isStatisticsEnabled(); 
    366367  } 
    367    
     368 
    368369  public void dumpDbStats() throws CalFacadeException { 
    369370    DbStatistics.dumpStats(dbStats); 
    370371  } 
    371    
     372 
    372373  public Collection getDbStats() throws CalFacadeException { 
    373374    return DbStatistics.getStats(dbStats); 
     
    689690   * ==================================================================== */ 
    690691 
    691   public void changeAccess(BwShareableDbentity ent,  
     692  public void changeAccess(BwShareableDbentity ent, 
    692693                           Collection aces) throws CalFacadeException { 
    693694    checkOpen(); 
    694695    access.changeAccess(ent, aces); 
    695696    sess.saveOrUpdate(ent); 
     697  } 
     698 
     699  public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 
     700                                   boolean returnResult) throws CalFacadeException { 
     701    return access.checkAccess(ent, desiredAccess, returnResult); 
    696702  } 
    697703 
     
    10991105  } 
    11001106 
     1107  public Collection getDeletedProxies() throws CalFacadeException { 
     1108    return events.getDeletedProxies(this.getTrashCalendar(user)); 
     1109  } 
     1110 
    11011111  /* ==================================================================== 
    11021112   *                   Synchronization 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java

    r321 r356  
    107107   * @param debug 
    108108   */ 
    109   public Events(Calintf cal, AccessUtil access,  
     109  public Events(Calintf cal, AccessUtil access, 
    110110                int currentMode, boolean debug) { 
    111111    super(cal, access, currentMode, debug); 
     
    118118    TreeSet ts = new TreeSet(); 
    119119    HibSession sess = getSess(); 
    120      
     120 
    121121    /* This (seems) to work as follows: 
    122      *  
     122     * 
    123123     * First try to retrieve the event from the events table. 
    124      *  
     124     * 
    125125     * If not there try the annotations table. If it's there, it's a reference 
    126126     * to an event owned by somebody else. Otherwise we drew a blank. 
    127      *  
     127     * 
    128128     * If we want the recurrences and the event is recurring we go on to try to 
    129129     * retrieve the rest. 
     
    138138      cei = postGetEvent((BwEvent)sess.getUnique(), privRead, noAccessReturnsNull); 
    139139 
     140      // XXX Don't want annotations in the trash 
    140141      if (cei == null) { 
    141142        /* Look for an annotation to that event by the current user. 
     
    149150        } 
    150151      } 
    151        
     152 
    152153      if (cei == null) { 
    153154        return ts; 
    154155      } 
    155        
     156 
    156157      master = cei.getEvent(); 
    157158 
     
    279280  } 
    280281 
     282  /** XXX temp I think 
     283   * Retrieve event proxies in the trash - they will be used to remove events 
     284   * from result sets. 
     285   * 
     286   * @return Collection of CoreEventInfo objects 
     287   */ 
     288  public Collection getDeletedProxies() throws CalFacadeException { 
     289    // Calintf supplies the calendar 
     290    return null; 
     291  } 
     292 
     293  /** XXX temp I think 
     294   * Retrieve event proxies in the trash - they will be used to remove events 
     295   * from result sets. 
     296   * 
     297   * @param cal         Trash calendar object 
     298   * @return Collection of CoreEventInfo objects 
     299   */ 
     300  public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 
     301    HibSession sess = getSess(); 
     302    StringBuffer sb = new StringBuffer(); 
     303 
     304    sb.append("from "); 
     305    sb.append(BwEventAnnotation.class.getName()); 
     306    sb.append(" ev"); 
     307    sb.append(" where ev.calendar=:calendar"); 
     308    sb.append(" and ev.deleted=true"); 
     309 
     310    sess.createQuery(sb.toString()); 
     311    sess.setEntity("calendar", cal); 
     312 
     313    Collection evs = sess.getList(); 
     314 
     315    return postGetEvents(evs, privRead, noAccessReturnsNull); 
     316  } 
     317 
    281318  public CoreEventInfo getEvent(int id) throws CalFacadeException { 
    282319    HibSession sess = getSess(); 
     
    290327  } 
    291328 
    292   public void addEvent(BwEvent val,  
     329  public void addEvent(BwEvent val, 
    293330                       Collection overrides) throws CalFacadeException { 
    294331    RecuridTable recurids = null; 
     
    321358      throw new CalFacadeException(CalFacadeException.duplicateGuid); 
    322359    } 
    323      
     360 
    324361    if (val.getOrganizer() != null) { 
    325362      sess.saveOrUpdate(val.getOrganizer()); 
     
    568605 
    569606    Filters flt = new Filters(filter, sb, qevName, debug); 
     607 
     608    // XXX we should do the following for both events and annotations 
    570609 
    571610    /* SEG:   from Events ev where */ 
     
    808847  } 
    809848 
    810   private void eventQuery(Class cl, BwCalendar calendar, String guid, String rid,  
     849  private void eventQuery(Class cl, BwCalendar calendar, String guid, String rid, 
    811850                          boolean masterOnly) throws CalFacadeException { 
    812851    HibSession sess = getSess(); 
     
    10911130        checked.setChecked(mstr, ca); 
    10921131      } 
    1093        
     1132 
    10941133      if (!ca.accessAllowed) { 
    10951134        return null; 
     
    12101249     * (DTSTART >= start AND DTSTART < end) OR 
    12111250     * (DTEND   > start AND DTEND <= end) 
    1212      *  
     1251     * 
    12131252     * XXX This is wrong??? Last should be 
    12141253     * XXX (DTEND   > start AND DTEND < end) 
     
    12821321 
    12831322    while (it.hasNext()) { 
    1284       CoreEventInfo cei = postGetEvent((BwEvent)it.next(),  
     1323      CoreEventInfo cei = postGetEvent((BwEvent)it.next(), 
    12851324                                       desiredAccess, nullForNoAccess); 
    1286        
     1325 
    12871326      if (cei != null) { 
    12881327        outevs.add(cei); 
     
    13021341 
    13031342    CurrentAccess ca = access.checkAccess(ev, desiredAccess, nullForNoAccess); 
    1304      
     1343 
    13051344    if (!ca.accessAllowed) { 
    13061345      return null; 
     
    13131352    */ 
    13141353 
     1354    if (ev instanceof BwEventAnnotation) { 
     1355      ev = new BwEventProxy((BwEventAnnotation)ev); 
     1356    } 
    13151357    CoreEventInfo cei = new CoreEventInfo(ev, ca); 
    1316      
     1358 
    13171359    return cei; 
    13181360  } 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEvent.java

    r181 r356  
    11291129    /* If the guids are the same it's the same event for non recurring. 
    11301130       For recurring events the recurrence id must also be equal. 
    1131      *
     1131     *
    11321132    int res = e1.getGuid().compareTo(e2.getGuid()); 
    11331133    if (res == 0) { 
     
    11361136      } 
    11371137 
    1138       /* Recurring - only the same if the recurrence id is equal *
     1138      /* Recurring - only the same if the recurrence id is equal *
    11391139      return CalFacadeUtil.cmpObjval(e1.getRecurrence().getRecurrenceId(), 
    11401140                                     e2.getRecurrence().getRecurrenceId()); 
     
    11511151    } 
    11521152 
    1153     /* Dates are the same - try summary. *
     1153    /* Dates are the same - try summary. *
    11541154 
    11551155    res = e1.getSummary().compareTo(e2.getSummary()); 
     
    11601160    // Just use guid 
    11611161    return e1.getGuid().compareTo(e2.getGuid()); 
     1162    */ 
     1163    /* If the guids are the same it's the same event for non recurring. 
     1164       For recurring events the recurrence id must also be equal. 
     1165     */ 
     1166    int res = e1.getGuid().compareTo(e2.getGuid()); 
     1167    if ((res == 0) && (!e1.getRecurring())) { 
     1168      return 0; 
     1169    } 
     1170 
     1171    if (!e2.getRecurring()) { 
     1172      return 1; 
     1173    } 
     1174 
     1175    /* Both recurring - only the same if the recurrence id is equal */ 
     1176    return CalFacadeUtil.cmpObjval(e1.getRecurrence().getRecurrenceId(), 
     1177                                   e2.getRecurrence().getRecurrenceId()); 
    11621178  } 
    11631179 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventProxy.java

    r212 r356  
    243243  } 
    244244 
     245  /** Set the event's calendar 
     246   * 
     247   * @param val    BwCalendar event's calendar 
     248   */ 
     249  public void setCalendar(BwCalendar val) { 
     250    ref.setCalendar(val); 
     251  } 
     252 
     253  /** Get the event's calendar 
     254   * 
     255   * @return CalendarVO   the event's calendar 
     256   */ 
     257  public BwCalendar getCalendar() { 
     258    BwCalendar val = ref.getCalendar(); 
     259    if (val != null) { 
     260      return val; 
     261    } 
     262 
     263    return getTarget().getCalendar(); 
     264  } 
     265 
    245266  /* (non-Javadoc) 
    246267   * @see org.bedework.calfacade.BwEvent#setName(java.lang.String) 
     
    401422  } 
    402423 
     424  /** Set the event deleted flag 
     425   * 
     426   *  @param val    boolean true if the event is deleted 
     427   */ 
     428  public void setDeleted(boolean val) { 
     429    ref.setDeleted(val); 
     430  } 
     431 
     432  /** Get the event deleted flag 
     433   * 
     434   *  @return boolean    true if the event is deleted 
     435   */ 
     436  public boolean getDeleted() { 
     437    if (getTarget().getDeleted()) { 
     438      return true; 
     439    } 
     440    return ref.getDeleted(); 
     441  } 
     442 
    403443  /* (non-Javadoc) 
    404444   * @see org.bedework.calfacade.BwEvent#setStatus(char) 
     
    471511  } 
    472512 
    473   /** Set the event's calendar 
    474    * 
    475    * @param val    CalendarVO event's calendar 
    476    */ 
    477   public void setCalendar(BwCalendar val) { 
    478     ref.setCalendar(val); 
    479   } 
    480  
    481   /** Get the event's calendar 
    482    * 
    483    * @return CalendarVO   the event's calendar 
    484    */ 
    485   public BwCalendar getCalendar() { 
    486     BwCalendar val = ref.getCalendar(); 
    487     if (val != null) { 
    488       return val; 
    489     } 
    490  
    491     return getTarget().getCalendar(); 
    492   } 
    493  
    494513  public void setDtstamp(String val) { 
    495514    ref.setDtstamp(val); 
     
    786805    } 
    787806    return getTarget().getAttendeeEmailList(); 
     807  } 
     808 
     809  /* (non-Javadoc) 
     810   * @see org.bedework.calfacade.ifs.AttendeesI#copyAttendees() 
     811   */ 
     812  public Collection copyAttendees() { 
     813    if (ref.getAttendeesChanged()) { 
     814      return ref.copyAttendees(); 
     815    } 
     816 
     817    return getTarget().copyAttendees(); 
    788818  } 
    789819 
     
    861891    override.setEndType(ev.getEndType()); 
    862892    override.setCreator(ev.getCreator()); 
     893    override.setGuid(ev.getGuid()); 
    863894 
    864895    if (owner != null) { 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeDefs.java

    r2 r356  
    7979  public static final int unsavedItemKey = -1; 
    8080 
    81   /** Values which define how to retrieve recurring events. We have the 
     81  /** ENUM 
     82   * Values which define how to retrieve recurring events. We have the 
    8283   * following choices (derived from caldav) 
    8384   * 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/CoreEventInfo.java

    r321 r356  
    6868public class CoreEventInfo implements Comparable, Comparator, Serializable { 
    6969  protected BwEvent event; 
    70    
     70 
    7171  /* This object contains information giving the current users access rights to 
    7272   * the entity. 
     
    7575 
    7676  /** Constructor 
    77    *  
     77   * 
    7878   */ 
    7979  public CoreEventInfo() { 
     
    8181 
    8282  /** Constructor 
    83    *  
     83   * 
    8484   */ 
    8585  public CoreEventInfo(BwEvent event, CurrentAccess currentAccess) { 
     
    8787    this.currentAccess = currentAccess; 
    8888  } 
    89    
     89 
    9090  /** 
    9191   * @param val 
     
    101101    return event; 
    102102  } 
    103    
     103 
    104104  /* Set the current users access rights. 
    105    *  
     105   * 
    106106   * @param val  CurrentAccess 
    107107   */ 
     
    109109    currentAccess = val; 
    110110  } 
    111    
     111 
    112112  /* Get the current users access rights. 
    113    *  
     113   * 
    114114   * @return  CurrentAccess 
    115115   */ 
     
    131131    } 
    132132 
    133     if (01 == 02) { 
     133    if (o1 == o2) { 
    134134      return 0; 
    135135    } 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java

    r331 r356  
    7878import org.bedework.calfacade.ifs.Groups; 
    7979 
     80import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
     81 
    8082import java.sql.Timestamp; 
    8183import java.util.Collection; 
     
    153155  public void setSuperUser(boolean val) { 
    154156  } 
    155    
     157 
    156158  public boolean getSuperUser() { 
    157159    return false; 
     
    176178  public void dumpDbStats() throws CalFacadeException { 
    177179  } 
    178    
     180 
    179181  public Collection getDbStats() throws CalFacadeException { 
    180182    return null; 
     
    370372   * ==================================================================== */ 
    371373 
    372   public void changeAccess(BwShareableDbentity ent,  
     374  public void changeAccess(BwShareableDbentity ent, 
    373375                           Collection aces) throws CalFacadeException { 
    374376    checkOpen(); 
     377    throw new CalFacadeUnimplementedException(); 
     378  } 
     379 
     380  public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 
     381                                   boolean returnResult) throws CalFacadeException { 
    375382    throw new CalFacadeUnimplementedException(); 
    376383  } 
     
    731738  } 
    732739 
     740  public Collection getDeletedProxies() throws CalFacadeException { 
     741    throw new CalFacadeUnimplementedException(); 
     742  } 
     743 
    733744  /* ==================================================================== 
    734745   *                       Caldav support 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java

    r331 r356  
    6868import org.bedework.calfacade.filter.BwFilter; 
    6969import org.bedework.calfacade.ifs.Groups; 
     70 
     71import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    7072 
    7173import java.util.Collection; 
     
    111113                      boolean debug) throws CalFacadeException; 
    112114 
    113   /** Called after init to flag this user as a super user.  
     115  /** Called after init to flag this user as a super user. 
    114116   * 
    115117   * @param val       true for a super user 
     
    117119  public void setSuperUser(boolean val); 
    118120 
    119   /** Called after init to flag this user as a super user.  
     121  /** Called after init to flag this user as a super user. 
    120122   * 
    121123   * @return boolean true if super user 
     
    130132  public BwStats getStats() throws CalFacadeException; 
    131133 
    132   /** Enable/disable db statistics  
     134  /** Enable/disable db statistics 
    133135   * 
    134136   * @param enable       boolean true to turn on db statistics collection 
     
    137139  public void setDbStatsEnabled(boolean enable) throws CalFacadeException; 
    138140 
    139   /**   
     141  /** 
    140142   * 
    141143   * @return boolean true if statistics collection enabled 
     
    144146  public boolean getDbStatsEnabled() throws CalFacadeException; 
    145147 
    146   /** Dump db statistics  
     148  /** Dump db statistics 
    147149   * 
    148150   * @throws CalFacadeException if not admin 
     
    150152  public void dumpDbStats() throws CalFacadeException; 
    151153 
    152   /** Get db statistics  
     154  /** Get db statistics 
    153155   * 
    154156   * @return Collection of BwStats.StatsEntry objects 
     
    356358  /** Change the access to the given calendar entity. 
    357359   * 
    358    * @param ent      BwShareableDbentity  
     360   * @param ent      BwShareableDbentity 
    359361   * @param aces     Collection of ace 
    360362   * @throws CalFacadeException 
    361363   */ 
    362   public void changeAccess(BwShareableDbentity ent,  
     364  public void changeAccess(BwShareableDbentity ent, 
    363365                           Collection aces) throws CalFacadeException; 
     366 
     367  /** Check the access for the given entity. Returns the current access 
     368   * or null or optionally throws a no access exception. 
     369   * 
     370   * @param ent 
     371   * @param desiredAccess 
     372   * @param returnResult 
     373   * @return CurrentAccess 
     374   * @throws CalFacadeAccessException if returnResult false and no access 
     375   * @throws CalFacadeException 
     376   */ 
     377  public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 
     378                                   boolean returnResult) throws CalFacadeException; 
    364379 
    365380  /* ==================================================================== 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java

    r331 r356  
    2222   * ==================================================================== */ 
    2323 
    24   /** Return one or more events using the calendar, guid and optionally a  
     24  /** Return one or more events using the calendar, guid and optionally a 
    2525   * recurrence-id as a key. 
    2626   * 
     
    5353   * @return  CoreEventInfo object representing event. 
    5454   * @throws CalFacadeException 
    55    *  
     55   * 
    5656   * @deprecated - other calendar systems won't support this. Doesn't make sense 
    5757   *               for recurring events. 
     
    125125   * @param calendar     BwCalendar object restricting search or null. 
    126126   * @param filter       BwFilter object restricting search or null. 
    127    * @param startDate    DateTimeVO start - may be null 
    128    * @param endDate      DateTimeVO end - may be null. 
     127   * @param startDate    BwDateTime start - may be null 
     128   * @param endDate      BwDateTime end - may be null. 
    129129   * @param recurRetrieval Takes value defined in CalFacadeDefs 
    130130   * @return Collection  of CoreEventInfo objects 
     
    135135                              int recurRetrieval) 
    136136          throws CalFacadeException; 
     137 
     138  /** XXX temp I think 
     139   * Retrieve event proxies in the trash - they will be used to remove events 
     140   * from result sets. 
     141   * 
     142   * @return Collection of CoreEventInfo objects 
     143   */ 
     144  public Collection getDeletedProxies() throws CalFacadeException; 
    137145 
    138146  /* * Return true if this event is editable by the current user 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/EventInfo.java

    r321 r356  
    129129   */ 
    130130  private String recurrenceId; 
    131    
     131 
    132132  /* This object contains information giving the current users access rights to 
    133133   * the entity. 
     
    311311    return recurrenceId; 
    312312  } 
    313    
     313 
    314314  /* Set the current users access rights. 
    315    *  
     315   * 
    316316   * @param val  CurrentAccess 
    317317   */ 
     
    319319    currentAccess = val; 
    320320  } 
    321    
     321 
    322322  /* Get the current users access rights. 
    323    *  
     323   * 
    324324   * @return  CurrentAccess 
    325325   */ 
     
    341341    } 
    342342 
    343     if (01 == 02) { 
     343    if (o1 == o2) { 
    344344      return 0; 
    345345    } 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r336 r356  
    9898//import org.bedework.mail.MailerIntf; 
    9999 
     100import edu.rpi.cct.uwcal.access.PrivilegeDefs; 
     101import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 
    100102import edu.rpi.cct.uwcal.resources.Resources; 
    101103 
     
    127129 
    128130  private boolean open; 
    129    
     131 
    130132  private boolean superUser; 
    131133 
     
    310312    superUser = val; 
    311313  } 
    312    
     314 
    313315  public boolean getSuperUser() { 
    314316    return superUser; 
     
    334336    return getCal().getDbStatsEnabled(); 
    335337  } 
    336    
     338 
    337339  public void dumpDbStats() throws CalFacadeException { 
    338340    //if (!pars.getPublicAdmin()) { 
    339341    //  throw new CalFacadeAccessException(); 
    340342    //} 
    341      
     343 
    342344    trace(getStats().toString()); 
    343345    getCal().dumpDbStats(); 
    344346  } 
    345    
     347 
    346348  public Collection getDbStats() throws CalFacadeException { 
    347349    //if (!pars.getPublicAdmin()) { 
    348350    //  throw new CalFacadeAccessException(); 
    349351    //} 
    350      
     352 
    351353    return getCal().getDbStats(); 
    352354  } 
     
    568570   * ==================================================================== */ 
    569571 
    570   public void changeAccess(BwShareableDbentity ent,  
     572  public void changeAccess(BwShareableDbentity ent, 
    571573                           Collection aces) throws CalFacadeException { 
    572574    getCal().changeAccess(ent, aces); 
     
    583585      throw new CalFacadeAccessException(); 
    584586    } 
    585      
     587 
    586588    timezones.saveTimeZone(tzid, vtz); 
    587589  } 
     
    604606      throw new CalFacadeAccessException(); 
    605607    } 
    606      
     608 
    607609    timezones.clearPublicTimezones(); 
    608610  } 
     
    698700      } 
    699701    } 
    700      
     702 
    701703    getCal().updateCalendar(val); 
    702704  } 
     
    14591461  } 
    14601462 
    1461   public Collection getEvent(BwSubscription sub, BwCalendar cal,  
     1463  public Collection getEvent(BwSubscription sub, BwCalendar cal, 
    14621464                             String guid, String recurrenceId, 
    14631465                             int recurRetrieval) throws CalFacadeException { 
     
    15241526      } 
    15251527    } 
    1526      
     1528 
    15271529    /* Iterate over the subscriptions and merge the results. 
    1528      *  
     1530     * 
    15291531     * First we iterate over the subscriptions looking for internal calendars. 
    15301532     * These we accumulate as children of a single calendar allowing a single 
    15311533     * query for all calendars. 
    1532      *  
     1534     * 
    15331535     * We will then iterate again to handle external calendars. (Not implemented) 
    15341536     */ 
     
    15361538    BwCalendar internal = new BwCalendar(); 
    15371539    setupSharableEntity(internal); 
    1538      
     1540 
    15391541    // For locating subscriptions from calendar 
    15401542    HashMap sublookup = new HashMap(); 
     
    15441546 
    15451547      BwCalendar calendar = getSubCalendar(sub); 
    1546        
     1548 
    15471549      if (calendar != null) { 
    15481550        internal.addChild(calendar); 
     
    15501552      } 
    15511553    } 
    1552      
     1554 
    15531555    if (internal.getChildren().size() == 0) { 
    15541556      if (debug) { 
    15551557        trace("No children for internal calendar"); 
    15561558      } 
    1557        
     1559 
    15581560      return ts; 
    15591561    } 
    1560      
     1562 
    15611563    ts.addAll(postProcess(getCal().getEvents(internal, filter, 
    15621564                          startDate, endDate, 
     
    15651567 
    15661568    return ts; 
    1567   } 
    1568    
    1569   private BwCalendar getSubCalendar(BwSubscription sub) throws CalFacadeException { 
    1570     if (!sub.getInternalSubscription() || sub.getCalendarDeleted()) { 
    1571       return null; 
    1572     } 
    1573      
    1574     BwCalendar calendar = sub.getCalendar(); 
    1575      
    1576     if (calendar != null) { 
    1577       return calendar; 
    1578     } 
    1579      
    1580     String path; 
    1581     String uri = sub.getUri(); 
    1582      
    1583     if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) { 
    1584       path = uri.substring(CalFacadeDefs.bwUriPrefix.length()); 
    1585     } else { 
    1586       // Shouldn't happen? 
    1587       path = uri; 
    1588     } 
    1589      
    1590     if (debug) { 
    1591       trace("Search for calendar \"" + path + "\""); 
    1592     } 
    1593      
    1594     calendar = getCal().getCalendar(path); 
    1595     if (calendar == null) { 
    1596       // Assume deleted 
    1597       sub.setCalendarDeleted(true); 
    1598       updateSubscription(sub); 
    1599     } else { 
    1600       sub.setCalendar(calendar); 
    1601     } 
    1602      
    1603     return calendar; 
    1604   } 
    1605    
    1606   private void putSublookup(HashMap sublookup, BwSubscription sub, BwCalendar cal) { 
    1607     if (cal.getCalendarCollection()) { 
    1608       // Leaf node 
    1609       sublookup.put(new Integer(cal.getId()), sub); 
    1610       return; 
    1611     } 
    1612      
    1613     Iterator it = cal.iterateChildren(); 
    1614     while (it.hasNext()) { 
    1615       putSublookup(sublookup, sub, (BwCalendar)it.next()); 
    1616     } 
    16171569  } 
    16181570 
     
    16861638      throw new CalFacadeAccessException(); 
    16871639    } 
    1688      
     1640 
    16891641    event.setCalendar(cal); 
    16901642 
     
    17181670  } 
    17191671 
    1720   public boolean deleteSubscribedEvent(BwEvent event) throws CalFacadeException { 
    1721     /* 
    1722     if (!getCal().fromSubscription(event)) { 
    1723       throw new CalFacadeException( 
    1724             "Attempt to hide a non-subscribed event: " + event); 
    1725     } 
    1726     */ 
    1727     throw new CalFacadeException("Unimplemented: "); 
     1672  /** For an event to which we have write access we simply mark it deleted. 
     1673   * 
     1674   * <p>Otherwise we add an annotation maarking the event as deleted. 
     1675   * 
     1676   * @param event 
     1677   * @throws CalFacadeException 
     1678   */ 
     1679  public void markDeleted(BwEvent event) throws CalFacadeException { 
     1680    CurrentAccess ca = getCal().checkAccess(event, PrivilegeDefs.privWrite, true); 
     1681 
     1682    if (ca.accessAllowed) { 
     1683      // Have write access - just set the flag and move it into the owners trash 
     1684      event.setDeleted(true); 
     1685      event.setCalendar(getCal().getTrashCalendar(event.getOwner())); 
     1686      updateEvent(event); 
     1687      return; 
     1688    } 
     1689 
     1690    // Need to annotate it as deleted 
     1691 
     1692    BwEventProxy proxy = BwEventProxy.makeAnnotation(event, event.getOwner()); 
     1693 
     1694    // Where does the ref go? Not in the same calendar - we have no access 
     1695    // Put it in the trash - but don't delete on empty trash 
     1696 
     1697    BwCalendar cal = getCal().getTrashCalendar(getUser()); 
     1698    proxy.setOwner(getUser()); 
     1699    proxy.setDeleted(true); 
     1700    proxy.setCalendar(cal); 
     1701    addEvent(cal, proxy, null); 
    17281702  } 
    17291703 
     
    19291903  }*/ 
    19301904 
    1931   private EventInfo postProcess(CoreEventInfo cei, BwSubscription sub,  
     1905  private BwCalendar getSubCalendar(BwSubscription sub) throws CalFacadeException { 
     1906    if (!sub.getInternalSubscription() || sub.getCalendarDeleted()) { 
     1907      return null; 
     1908    } 
     1909 
     1910    BwCalendar calendar = sub.getCalendar(); 
     1911 
     1912    if (calendar != null) { 
     1913      return calendar; 
     1914    } 
     1915 
     1916    String path; 
     1917    String uri = sub.getUri(); 
     1918 
     1919    if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) { 
     1920      path = uri.substring(CalFacadeDefs.bwUriPrefix.length()); 
     1921    } else { 
     1922      // Shouldn't happen? 
     1923      path = uri; 
     1924    } 
     1925 
     1926    if (debug) { 
     1927      trace("Search for calendar \"" + path + "\""); 
     1928    } 
     1929 
     1930    calendar = getCal().getCalendar(path); 
     1931    if (calendar == null) { 
     1932      // Assume deleted 
     1933      sub.setCalendarDeleted(true); 
     1934      updateSubscription(sub); 
     1935    } else { 
     1936      sub.setCalendar(calendar); 
     1937    } 
     1938 
     1939    return calendar; 
     1940  } 
     1941 
     1942  private void putSublookup(HashMap sublookup, BwSubscription sub, BwCalendar cal) { 
     1943    if (cal.getCalendarCollection()) { 
     1944      // Leaf node 
     1945      sublookup.put(new Integer(cal.getId()), sub); 
     1946      return; 
     1947    } 
     1948 
     1949    Iterator it = cal.iterateChildren(); 
     1950    while (it.hasNext()) { 
     1951      putSublookup(sublookup, sub, (BwCalendar)it.next()); 
     1952    } 
     1953  } 
     1954 
     1955  private EventInfo postProcess(CoreEventInfo cei, BwSubscription sub, 
    19321956                                HashMap sublookup) 
    19331957          throws CalFacadeException { 
     
    19421966     */ 
    19431967    BwEvent ev = cei.getEvent(); 
    1944      
     1968 
    19451969    if (ev instanceof BwEventAnnotation) { 
    19461970      ev = new BwEventProxy((BwEventAnnotation)ev); 
     
    19481972 
    19491973    EventInfo ei = new EventInfo(ev); 
    1950      
     1974 
    19511975    if (sub != null) { 
    19521976      ei.setSubscription(sub); 
     
    19651989    ArrayList al = new ArrayList(); 
    19661990 
     1991    /* XXX possibly not a great idea. We should probably retrieve the 
     1992     * deleted events at the same time as we retrieve the desired set. 
     1993     * 
     1994     * This way we get too many. 
     1995     */ 
     1996    Collection deleted = getCal().getDeletedProxies(); 
     1997 
    19671998    Iterator it = ceis.iterator(); 
    19681999 
    19692000    while (it.hasNext()) { 
    1970       EventInfo ei = postProcess((CoreEventInfo)it.next(), sub, null); 
    1971       al.add(ei); 
     2001      CoreEventInfo cei = (CoreEventInfo)it.next(); 
     2002 
     2003      if (!deleted.contains(cei)) { 
     2004        EventInfo ei = postProcess(cei, sub, null); 
     2005        al.add(ei); 
     2006      } 
    19722007    } 
    19732008 
     
    19792014    ArrayList al = new ArrayList(); 
    19802015 
     2016    /* XXX possibly not a great idea. We should probably retrieve the 
     2017     * deleted events at the same time as we retrieve the desired set. 
     2018     * 
     2019     * This way we get too many. 
     2020     */ 
     2021    Collection deleted = getCal().getDeletedProxies(); 
     2022 
     2023    //traceDeleted(deleted); 
     2024 
    19812025    Iterator it = ceis.iterator(); 
    19822026 
    19832027    while (it.hasNext()) { 
    1984       EventInfo ei = postProcess((CoreEventInfo)it.next(), null, sublookup); 
    1985       al.add(ei); 
     2028      CoreEventInfo cei = (CoreEventInfo)it.next(); 
     2029 
     2030 //     if (!deleted.contains(cei)) { 
     2031      if (!isDeleted(deleted, cei)) { 
     2032        EventInfo ei = postProcess(cei, null, sublookup); 
     2033        al.add(ei); 
     2034      } 
    19862035    } 
    19872036 
    19882037    return al; 
     2038  } 
     2039 
     2040  /* XXX This is here because contains doesn't appear to be working with 
     2041   * CoreEventInfo objects (or their events) 
     2042   * 
     2043   * This is either the TreeSet impleemntation (unlikely) or something to 
     2044   * do with comparisons but under debug the compare method doesn't even get 
     2045   * called for some of he objects in deleted 
     2046   */ 
     2047  private boolean isDeleted(Collection deleted, CoreEventInfo tryCei) { 
     2048    if ((deleted == null) || (deleted.size() == 0)) { 
     2049      return false; 
     2050    } 
     2051    boolean try1 = false; 
     2052 
     2053    Iterator it = deleted.iterator(); 
     2054    while (it.hasNext()) { 
     2055      CoreEventInfo cei = (CoreEventInfo)it.next(); 
     2056      BwEventProxy pr = (BwEventProxy)cei.getEvent(); 
     2057      if (debug) { 
     2058        trace("Deleted: " + pr.getTarget().getId()); 
     2059      } 
     2060 
     2061      if (cei.equals(tryCei)) { 
     2062        if (!debug) { 
     2063          return true; 
     2064        } 
     2065 
     2066        trace("Matched: " + tryCei.getEvent().getId()); 
     2067        try1 = true; 
     2068        break; 
     2069      } 
     2070    } 
     2071 
     2072    // only here for debug mode 
     2073    boolean try2 = deleted.contains(tryCei); 
     2074    trace("  try2 for : " + tryCei.getEvent().getId() + " gives " + try2); 
     2075 
     2076    return try1 || try2; 
     2077  } 
     2078 
     2079  private void traceDeleted(Collection c) { 
     2080    Iterator it = c.iterator(); 
     2081    while (it.hasNext()) { 
     2082      CoreEventInfo cei = (CoreEventInfo)it.next(); 
     2083      BwEventProxy pr = (BwEventProxy)cei.getEvent(); 
     2084      trace("Deleted: " + pr.getTarget().getId()); 
     2085    } 
    19892086  } 
    19902087 
     
    20382135 
    20392136      if (userCreated) { 
    2040       initUser(auth, cali); 
     2137        initUser(auth, cali); 
    20412138      } 
    20422139 
     
    20622159    } 
    20632160  } 
    2064    
     2161 
    20652162  private void initUser(BwUser user, Calintf cali) throws CalFacadeException { 
    20662163    // Add preferences 
     
    21942291    public Collection getEvent(BwCalendar cal, String guid, String rid, 
    21952292                               int recurRetrieval) throws CalFacadeException { 
    2196       return CalSvc.this.getEvent(BwSubscription.makeSubscription(cal), cal, guid,  
     2293      return CalSvc.this.getEvent(BwSubscription.makeSubscription(cal), cal, guid, 
    21972294                                  rid, recurRetrieval); 
    21982295    } 
  • trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java

    r336 r356  
    108108  public abstract void init(CalSvcIPars pars) throws CalFacadeException; 
    109109 
    110   /** Called after init to flag this user as a super user.  
     110  /** Called after init to flag this user as a super user. 
    111111   * 
    112112   * @param val       true for a super user 
     
    114114  public abstract void setSuperUser(boolean val); 
    115115 
    116   /** Called after init to flag this user as a super user.  
     116  /** Called after init to flag this user as a super user. 
    117117   * 
    118118   * @return boolean true if super user 
     
    127127  public abstract BwStats getStats() throws CalFacadeException; 
    128128 
    129   /** Enable/disable db statistics  
     129  /** Enable/disable db statistics 
    130130   * 
    131131   * @param enable       boolean true to turn on db statistics collection 
     
    134134  public abstract void setDbStatsEnabled(boolean enable) throws CalFacadeException; 
    135135 
    136   /**   
     136  /** 
    137137   * 
    138138   * @return boolean true if statistics collection enabled 
     
    141141  public abstract boolean getDbStatsEnabled() throws CalFacadeException; 
    142142 
    143   /** Dump db statistics  
     143  /** Dump db statistics 
    144144   * 
    145145   * @throws CalFacadeException if not admin 
     
    147147  public abstract void dumpDbStats() throws CalFacadeException; 
    148148 
    149   /** Get db statistics  
     149  /** Get db statistics 
    150150   * 
    151151   * @return Collection of BwStats.StatsEntry objects 
     
    407407  /** Change the access to the given calendar entity. 
    408408  * 
    409   * @param ent      BwShareableDbentity  
     409  * @param ent      BwShareableDbentity 
    410410  * @param aces     Collection of ace 
    411411  * @throws CalFacadeException 
    412412  */ 
    413  public abstract void changeAccess(BwShareableDbentity ent,  
     413 public abstract void changeAccess(BwShareableDbentity ent, 
    414414                                   Collection aces) throws CalFacadeException; 
    415415 
     
    10831083   * @return  EventInfo   value object representing event. 
    10841084   * @throws CalFacadeException 
    1085    *  
     1085   * 
    10861086   * @deprecated - other calendar systems won't support this. Doesn't make sense 
    10871087   *               for recurring events. 
     
    11041104   * @throws CalFacadeException 
    11051105   */ 
    1106   public abstract Collection getEvent(BwSubscription sub, BwCalendar cal,  
    1107                                       String guid,  
     1106  public abstract Collection getEvent(BwSubscription sub, BwCalendar cal, 
     1107                                      String guid, 
    11081108                                      String recurrenceId, 
    11091109                                      int recurRetrieval) 
     
    12311231  public abstract void updateEvent(BwEvent event) throws CalFacadeException; 
    12321232 
    1233   /** Delete a subscribed event for the current user. 
    1234    * 
    1235    * <p>This is a partially implemented feature which currently only changes 
    1236    * the synch state. What we need is in effect a reverse event ref - I guess 
    1237    * a new purpose, which indicates the event is hidden for this user. 
    1238    * 
    1239    * @param  event          BwEvent object 
    1240    * @return  boolean       false for no such item. 
    1241    * @throws CalFacadeException 
    1242    */ 
    1243   public abstract boolean deleteSubscribedEvent(BwEvent event) 
    1244       throws CalFacadeException; 
     1233  /** For an event to which we have write access we simply mark it deleted. 
     1234   * 
     1235   * <p>Otherwise we add an annotation maarking the event as deleted. 
     1236   * 
     1237   * @param event 
     1238   * @throws CalFacadeException 
     1239   */ 
     1240  public abstract void markDeleted(BwEvent event) throws CalFacadeException; 
    12451241 
    12461242  /* ==================================================================== 
  • trunk/calendar3/synchml/src/edu/rpi/cct/uwcal/synchml/common/Synchml.java

    r336 r356  
    5757import org.bedework.calfacade.BwEvent; 
    5858import org.bedework.calfacade.BwEventObj; 
     59import org.bedework.calfacade.BwRecurrence; 
    5960import org.bedework.calfacade.BwSynchData; 
    6061import org.bedework.calfacade.BwSynchInfo; 
     
    122123    this.deviceId = deviceId; 
    123124    this.debug = debug; 
    124     CalSvcIPars pars = new CalSvcIPars(account,  
     125    CalSvcIPars pars = new CalSvcIPars(account, 
    125126                                       account, 
    126127                                       null,     // XXX Requires an env prefix 
     
    271272  public boolean deleteEvent(VEvent val) throws CalFacadeException { 
    272273    // FIXME - We need a subscription to the calendar we are synching - second par 
    273     return deleteEvent(BwEventUtil.toEvent(svci.getIcalCallback(),  
    274                                            null,  // BwCalendar  
    275                                            null,  // overrides  
     274    return deleteEvent(BwEventUtil.toEvent(svci.getIcalCallback(), 
     275                                           null,  // BwCalendar 
     276                                           null,  // overrides 
    276277                                           val, debug).getEvent()); 
    277278  } 
     
    458459   */ 
    459460  public boolean deleteEvent(BwEvent val) throws CalFacadeException { 
    460     EventInfo ei = svci.getEvent(val.getId()); 
    461  
    462     if (ei == null) { 
     461    String recurId = null; 
     462 
     463    BwRecurrence recur = val.getRecurrence(); 
     464 
     465    if (recur != null) { 
     466      recurId = recur.getRecurrenceId(); 
     467    } 
     468 
     469    int recurRetrieval = CalFacadeDefs.retrieveRecurMaster; 
     470    if (recurId != null) { 
     471      // Get the instance 
     472      recurRetrieval = CalFacadeDefs.retrieveRecurExpanded; 
     473    } 
     474    Collection evs = svci.getEvent(null, val.getCalendar(), val.getGuid(), 
     475                                   recurId, recurRetrieval); 
     476 
     477    if ((evs == null) || (evs.size() == 0)) { 
    463478      return false; 
    464479    } 
    465480 
    466     if (ei.getKind() == EventInfo.kindEntry) { 
    467       CalSvcI.DelEventResult der = svci.deleteEvent(ei.getEvent(), true); 
    468       return der.eventDeleted; 
    469     } 
    470  
    471     if (ei.getKind() == EventInfo.kindAdded) { 
    472       svci.deleteEvent(ei.getEvent(), true); 
    473     } else if (ei.getKind() == EventInfo.kindUndeletable) { 
    474       svci.deleteSubscribedEvent(ei.getEvent()); 
    475     } 
     481    /* We should have one only 
     482     */ 
     483 
     484    if (evs.size() != 1) { 
     485      throw new CalFacadeException("org.dedwork.synchml.unexpected.result"); 
     486    } 
     487 
     488    EventInfo ei = (EventInfo)evs.iterator().next(); 
     489 
     490    svci.markDeleted(ei.getEvent()); 
    476491 
    477492    return true; 
  • trunk/calendar3/webclient/src/org/bedework/webclient/BwDelEventAction.java

    r55 r356  
    8787    } 
    8888 
    89     int id = form.getEventId(); 
     89    CalSvcI svci = form.fetchSvci(); 
    9090 
    91     if (id < 0) { 
     91    EventInfo ei = findEvent(request, form); 
     92 
     93    if (ei == null) { 
    9294      // Do nothing 
    93       form.getErr().emit("org.bedework.client.error.nosuchevent", id); 
     95      form.getErr().emit("org.bedework.client.error.nosuchevent"); 
    9496      return "doNothing"; 
    9597    } 
    9698 
    97     CalSvcI svci = form.fetchSvci(); 
    98  
    99     EventInfo ei = svci.getEvent(id); 
    100  
    101     if (ei == null) { 
    102       // Do nothing 
    103       form.getErr().emit("org.bedework.client.error.nosuchevent", id); 
    104       return "doNothing"; 
    105     } 
    106  
     99    // XXX temp - just mark as deleted 
     100    /* 
    107101    CalSvcI.DelEventResult delResult = form.fetchSvci().deleteEvent(ei.getEvent(), true); 
    108102 
     
    115109      form.getMsg().emit("org.bedework.client.message.deleted.locations", 1); 
    116110    } 
     111    */ 
     112    svci.markDeleted(ei.getEvent()); 
    117113 
    118114    form.getMsg().emit("org.bedework.client.message.deleted.events", 1); 
  • trunk/calendar3/webclient/war/WEB-INF/struts-config.xml

    r355 r356  
    414414    </action> 
    415415 
    416     <!-- ..................... subscriptionss .......................... --> 
     416    <!-- ..................... subscriptions .......................... --> 
    417417 
    418418     <action    path="/subs/showSubs" 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r338 r356  
    103103  /** Name of the init parameter holding our name */ 
    104104  private static final String appNameInitParameter = "rpiappname"; 
    105    
     105 
    106106  public String getId() { 
    107107    return getClass().getName(); 
     
    130130      } 
    131131    } 
    132      
     132 
    133133    if (getPublicAdmin(form)) { 
    134134      /** We may want to masquerade as a different user 
     
    170170      // Embed in request for pages that cannot access the form (loggedOut) 
    171171      request.setAttribute("org.bedework.action.appbase", appBase); 
     172    } 
     173 
     174    if (!form.getNewSession()) { 
     175      // First time through here for this session 
     176 
     177      // Set to default view 
     178      setView(null, form); 
    172179    } 
    173180 
     
    293300  } 
    294301 
    295   /** Method to retrieve an event. An event is identified by the calendar +  
     302  /** Method to retrieve an event. An event is identified by the calendar + 
    296303   * guid + recurrence id. We also take the subscription id as a parameter so 
    297304   * we can pass it along in the result for display purposes. 
    298    *  
     305   * 
    299306   * <p>We cannot just take the calendar from the subscription, because the 
    300    * calendar has to be the actual collection containing the event. A  
     307   * calendar has to be the actual collection containing the event. A 
    301308   * subscription may be to higher up the tree (i.e. a folder). 
    302    *  
     309   * 
    303310   * <p>We need to also allow the calendar path instead of the id. External 
    304    * calendars don't have an id. This means changing the api (again) and  
     311   * calendars don't have an id. This means changing the api (again) and 
    305312   * changing the urls (again). 
    306    *  
     313   * 
    307314   * <p>It may be more appropriate to simply encode a url to the event. 
    308    *  
     315   * 
    309316   * <p>Request parameters<ul> 
    310317   *      <li>"subid"    subscription id for event. < 0 if there is none 
     
    337344      } 
    338345    } 
    339      
     346 
    340347    int calId = getIntReqPar(request, "calid", -1); 
    341348    BwCalendar cal = null; 
     
    345352      return null; 
    346353    } 
    347      
     354 
    348355    cal = svci.getCalendar(calId); 
    349      
     356 
    350357    if (cal == null) { 
    351358      // Assume no access 
     
    600607    HttpSession session = request.getSession(); 
    601608    ServletContext sc = session.getServletContext(); 
    602      
     609 
    603610    String appName = sc.getInitParameter("bwappname"); 
    604      
     611 
    605612    if ((appName == null) || (appName.length() == 0)) { 
    606613      appName = "unknown-app-name"; 
    607614    } 
    608      
     615 
    609616    String envPrefix = "org.bedework.app." + appName + "."; 
    610617 
    611618    env = new CalEnv(envPrefix, debug); 
    612619    frm.assignEnv(env); 
    613      
     620 
    614621    return env; 
    615622  } 
     
    670677    HttpSession sess = request.getSession(false); 
    671678    String appName = getAppName(sess); 
    672      
     679 
    673680    if (s != null) { 
    674681      if (debug) { 
     
    777784    return s; 
    778785  } 
    779    
     786 
    780787  private String getAppName(HttpSession sess) { 
    781788    ServletContext sc = sess.getServletContext(); 
     
    785792      appname = "?"; 
    786793    } 
    787      
     794 
    788795    return appname; 
    789796  } 
     
    797804    HttpSession hsess = request.getSession(); 
    798805    BwCallback cb = (BwCallback)hsess.getAttribute(BwCallback.cbAttrName); 
    799      
     806 
    800807    if (cb == null) { 
    801808      if (form.getDebug()) { 
     
    809816        cb.out(); 
    810817      } catch (Throwable t) {} 
    811        
     818 
    812819      try { 
    813820        cb.close(); 
    814821      } catch (Throwable t) {} 
    815822    } 
    816      
     823 
    817824    return true; 
    818825  } 
     
    876883                          svci.getUser()); 
    877884      } 
    878        
     885 
    879886      // XXX access - disable use of roles 
    880887      access = svci.getUserAuth().getUsertype(); 
     
    897904          runAsUser = form.getEnv().getAppProperty("run.as.user"); 
    898905        } 
    899          
    900         CalSvcIPars pars = new CalSvcIPars(user, //access,  
    901                                            runAsUser,  
     906 
     907        CalSvcIPars pars = new CalSvcIPars(user, //access, 
     908                                           runAsUser, 
    902909                                           form.getEnv().getAppPrefix(), 
    903910                                           publicAdmin, 
     
    917924        par.svlt = servlet; 
    918925        par.req = request; 
    919          
     926 
    920927        if (publicAdmin) { 
    921928          try { 
    922929            ua = svci.getUserAuth(user, par); 
    923              
     930 
    924931            form.assignAuthorisedUser(ua.getUsertype() != UserAuth.noPrivileges); 
    925932            svci.setSuperUser((ua.getUsertype() & UserAuth.superUser) != 0); 
    926              
     933 
    927934            // XXX access - disable use of roles 
    928935            access = ua.getUsertype(); 
    929              
     936 
    930937            if (debug) { 
    931938              debugMsg("UserAuth says that current user has the type: " + 
     
    944951      } 
    945952    } 
    946      
     953 
    947954    form.assignUserVO((BwUser)svci.getUser().clone()); 
    948955