Changeset 200

Show
Ignore:
Timestamp:
02/24/06 15:29:51
Author:
douglm
Message:

Subscription disappeared from event info after making changes to improve efficiency of lookup.

emitEvent.jsp was looking in the wrong place for the subscription.

guids are unique within a calendar collection only.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/calCore/resources/hbms/Event.hbm.xml

    r176 r200  
    9090                 column="calendarid" 
    9191                 not-null="false" 
    92                  index="idx_event_calendar" /> 
     92                 index="idx_event_calendar" unique-key="event-key" /> 
    9393    <!-- not-null should be true above - but the restore code needs 
    9494         changing to write events with the calendar filled in. --> 
     
    120120    <property name="name" column="eventname" type="text"/> 
    121121 
    122     <!-- ownerid + guid + sequence + recurrence-id is a unique key. --> 
     122    <!-- (ownerid +) calendarid + guid + sequence + recurrence-id is a unique key. --> 
    123123    <property name="guid" type="text" unique-key="event-key" /> 
    124124 
  • trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java

    r172 r200  
    355355    assignGuid(val); 
    356356 
    357     /* The guid must not exist in the system. The above call assigns a guid if 
     357    /* The guid must not exist in the same calendar. The above call assigns a guid if 
    358358     * one wasn't assigned already. However, the event may have come with a guid 
    359      * (caldav, import, etc) so we need to cehck here. 
     359     * (caldav, import, etc) so we need to check here. 
    360360     * 
    361361     * It also ensures our guid allocation is working OK 
  • trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventProxy.java

    r2 r200  
    172172  /** Set the owner 
    173173   * 
    174    * @param val     UserVO owner of the entity 
     174   * @param val     BwUser owner of the entity 
    175175   */ 
    176176  public void setOwner(BwUser val) { 
  • trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java

    r192 r200  
    15521552        if (calendar != null) { 
    15531553          internal.addChild(calendar); 
    1554           sublookup.put(new Integer(calendar.getId()), sub); 
     1554          putSublookup(sublookup, sub, calendar); 
    15551555        } 
    15561556      } 
     
    15641564    return ts; 
    15651565  } 
     1566   
     1567  private void putSublookup(HashMap sublookup, BwSubscription sub, BwCalendar cal) { 
     1568    if (cal.getCalendarCollection()) { 
     1569      // Leaf node 
     1570      sublookup.put(new Integer(cal.getId()), sub); 
     1571      return; 
     1572    } 
     1573     
     1574    Iterator it = cal.iterateChildren(); 
     1575    while (it.hasNext()) { 
     1576      putSublookup(sublookup, sub, (BwCalendar)it.next()); 
     1577    } 
     1578  } 
    15661579 
    15671580  public DelEventResult deleteEvent(BwEvent event, 
     
    15991612    EventUpdateResult updResult = new EventUpdateResult(); 
    16001613 
    1601     setupSharableEntity(event); 
     1614    if (event instanceof BwEventProxy) { 
     1615      BwEventProxy proxy = (BwEventProxy)event; 
     1616      BwEvent override = proxy.getTarget(); 
     1617      setupSharableEntity(override); 
     1618    } else { 
     1619      setupSharableEntity(event); 
     1620    } 
    16021621 
    16031622    BwLocation loc = event.getLocation(); 
  • trunk/calendar3/webclient/war/docs/emitEvent.jsp

    r147 r200  
    77<%-- Output a single event --%> 
    88  <event> 
    9     <logic:present  name="event" property="subscription"> 
     9    <logic:present  name="eventInfo" property="subscription"> 
    1010      <subscription> 
    1111        <id><bean:write name="eventInfo" property="subscription.id"/></id> 
     
    1414      </subscription> 
    1515    </logic:present> 
    16     <logic:notPresent  name="event" property="subscription"> 
     16    <logic:notPresent  name="eventInfo" property="subscription"> 
    1717      <subscription> 
    1818        <id>-1</id>