diff -NcrB standard/calendar/calendar-api/api/src/java/org/sakaiproject/calendar/api/RecurrenceRule.java calendar/calendar-api/api/src/java/org/sakaiproject/calendar/api/RecurrenceRule.java *** standard/calendar/calendar-api/api/src/java/org/sakaiproject/calendar/api/RecurrenceRule.java 2008-08-25 16:28:55.000000000 -0500 --- calendar/calendar-api/api/src/java/org/sakaiproject/calendar/api/RecurrenceRule.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 60,66 **** */ List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone); ! /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. * @param ranges The list (RecurrenceInstance) of ranges. */ --- 60,76 ---- */ List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone); ! /** ! * @author mustansar@rice.edu Mustansar Mehmood ! * Added by Mustansar Mehmood to incorporate MWF and TTH recurrence Rule ! * Return a List of all RecurrenceInstance objects generated by this rule within the given time range, based on the ! * prototype first range, in time order. ! * @param prototype The prototype first TimeRange. ! * @param range A time range to limit the generated ranges. ! * @return a List of RecurrenceInstance generated by this rule in this range. ! */ ! List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone, String freq); ! /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. * @param ranges The list (RecurrenceInstance) of ranges. */ diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/BaseCalendarService.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/BaseCalendarService.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/BaseCalendarService.java 2008-08-25 16:28:58.000000000 -0500 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/BaseCalendarService.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 983,988 **** --- 982,995 ---- { return new WeeklyRecurrenceRule(); } + /*Code to call Tuesday Thursday RecurrenceRule*/ + else if (frequency.equals(TThRecurrenceRule.FREQ)){ + return new TThRecurrenceRule(); + } + /*Code to call MWF RecurrenceRule*/ + else if (frequency.equals(MWFRecurrenceRule.FREQ)){ + return new MWFRecurrenceRule(); + } else if (frequency.equals(MonthlyRecurrenceRule.FREQ)) { return new MonthlyRecurrenceRule(); *************** *** 1000,1006 **** */ public RecurrenceRule newRecurrence(String frequency, int interval) { ! if (frequency.equals(DailyRecurrenceRule.FREQ)) { return new DailyRecurrenceRule(interval); } --- 1007,1013 ---- */ public RecurrenceRule newRecurrence(String frequency, int interval) { ! if (frequency.equals(DailyRecurrenceRule.FREQ)) { return new DailyRecurrenceRule(interval); } *************** *** 1008,1013 **** --- 1015,1028 ---- { return new WeeklyRecurrenceRule(interval); } + /*Code to call Tuesday Thursday RecurrenceRule*/ + else if (frequency.equals(TThRecurrenceRule.FREQ)){ + return new TThRecurrenceRule(interval); + } + /*Code to call MWF RecurrenceRule*/ + else if (frequency.equals(MWFRecurrenceRule.FREQ)){ + return new MWFRecurrenceRule(interval); + } else if (frequency.equals(MonthlyRecurrenceRule.FREQ)) { return new MonthlyRecurrenceRule(interval); *************** *** 1016,1022 **** { return new YearlyRecurrenceRule(interval); } ! return null; } --- 1031,1037 ---- { return new YearlyRecurrenceRule(interval); } ! return null; } *************** *** 1024,1030 **** * {@inheritDoc} */ public RecurrenceRule newRecurrence(String frequency, int interval, int count) ! { if (frequency.equals(DailyRecurrenceRule.FREQ)) { return new DailyRecurrenceRule(interval, count); --- 1039,1046 ---- * {@inheritDoc} */ public RecurrenceRule newRecurrence(String frequency, int interval, int count) ! { ! M_log.debug("\n"+ frequency +"\nand Internval is \n "+ interval +"count is\n " + count); if (frequency.equals(DailyRecurrenceRule.FREQ)) { return new DailyRecurrenceRule(interval, count); *************** *** 1033,1038 **** --- 1049,1062 ---- { return new WeeklyRecurrenceRule(interval, count); } + /*Code to call Tuesday Thursday RecurrenceRule*/ + else if (frequency.equals(TThRecurrenceRule.FREQ)){ + return new TThRecurrenceRule(interval,count); + } + /*Code to call MWF RecurrenceRule*/ + else if (frequency.equals(MWFRecurrenceRule.FREQ)){ + return new MWFRecurrenceRule(interval,count); + } else if (frequency.equals(MonthlyRecurrenceRule.FREQ)) { return new MonthlyRecurrenceRule(interval, count); *************** *** 1041,1050 **** { return new YearlyRecurrenceRule(interval, count); } ! return null; } - /** * {@inheritDoc} */ --- 1065,1073 ---- { return new YearlyRecurrenceRule(interval, count); } ! return null; } /** * {@inheritDoc} */ *************** *** 1058,1063 **** --- 1081,1094 ---- { return new WeeklyRecurrenceRule(interval, until); } + /*Code to call Tuesday Thursday RecurrenceRule*/ + else if (frequency.equals(TThRecurrenceRule.FREQ)){ + return new TThRecurrenceRule(interval,until); + } + /*Code to call MWF RecurrenceRule*/ + else if (frequency.equals(MWFRecurrenceRule.FREQ)){ + return new MWFRecurrenceRule(interval,until); + } else if (frequency.equals(MonthlyRecurrenceRule.FREQ)) { return new MonthlyRecurrenceRule(interval, until); *************** *** 1066,1072 **** { return new YearlyRecurrenceRule(interval, until); } ! return null; } --- 1097,1103 ---- { return new YearlyRecurrenceRule(interval, until); } ! return null; } *************** *** 4051,4059 **** // for rules... else ! { ! List instances = m_singleRule.generateInstances(this.getRange(), range, TimeService.getLocalTimeZone()); ! // remove any excluded getExclusionRule().excludeInstances(instances); --- 4081,4096 ---- // for rules... else ! { ! List instances=null; ! //call the implementation of generate instancs that takes MWF/TTh into account ! if((m_singleRule.getFrequencyDescription()).equals("MWF")||((m_singleRule.getFrequencyDescription()).equals("TTh"))){ ! instances = m_singleRule.generateInstances(this.getRange(), range, TimeService.getLocalTimeZone(),(m_singleRule.getFrequencyDescription()) ); ! } ! else{ ! ! instances = m_singleRule.generateInstances(this.getRange(), range, TimeService.getLocalTimeZone()); ! } // remove any excluded getExclusionRule().excludeInstances(instances); diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionRecurrenceRule.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionRecurrenceRule.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionRecurrenceRule.java 2008-08-25 16:28:58.000000000 -0500 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionRecurrenceRule.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 152,158 **** { return new Vector(); ! } // generateInstances /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. --- 152,171 ---- { return new Vector(); ! } // generateInstances ! ! /**@author mustansar@rice.edu ! *Implelmented by Mustansar Mehmood to incorporate MWF/TTH ! * Return a List of all RecurrenceInstance objects generated by this rule within the given time range, based on the ! *prototype first range, in time order. ! *@param prototype The prototype first TimeRange. ! *@param range A time range to limit the generated ranges. ! *@return a List of RecurrenceInstance generated by this rule in this range. ! */ ! public List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone , String freq) ! { ! return new Vector(); ! } // generateInstances /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionSeqRecurrenceRule.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionSeqRecurrenceRule.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionSeqRecurrenceRule.java 2008-08-25 16:28:58.000000000 -0500 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/ExclusionSeqRecurrenceRule.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 153,159 **** return new Vector(); } // generateInstances ! /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. * @param ranges The list (RecurrenceInstance) of ranges. --- 153,171 ---- return new Vector(); } // generateInstances ! /** ! * @author mustansar@rice.edu ! * Implelmented by Mustansar Mehmood to incorporate MWF/TTH ! * Return a List of all RecurrenceInstance objects generated by this rule within the given time range, based on the ! * prototype first range, in time order. ! * @param prototype The prototype first TimeRange. ! * @param range A time range to limit the generated ranges. ! * @return a List of RecurrenceInstance generated by this rule in this range. ! */ ! public List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone , String freq) ! { ! return new Vector(); ! } // generateInstances /** * Remove from the ranges list any RecurrenceInstance excluded by this rule. * @param ranges The list (RecurrenceInstance) of ranges. diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/MWFRecurrenceRule.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/MWFRecurrenceRule.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/MWFRecurrenceRule.java 1969-12-31 18:00:00.000000000 -0600 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/MWFRecurrenceRule.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 0 **** --- 1,106 ---- + /*********************************************************************************** + * + * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation. + * @author Mustansar@rice.edu + * + * Licensed under the Educational Community License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.opensource.org/licenses/ecl1.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + **********************************************************************************/ + package org.sakaiproject.calendar.impl; + import java.util.GregorianCalendar; + import java.util.Stack; + import org.sakaiproject.time.api.Time; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + /** + *

MWFRecurrenceRule is a time range generating rule that is based on a weekly recurrence.

+ *

repaeting Mondays Wendnesday and Fridays

+ *

The recurrences happen on the same day-of-week, at the same time as the prototype.

+ *

TODO: support changing the day-of-week of recurrences -Mustansar

+ */ + public class MWFRecurrenceRule extends RecurrenceRuleBase + { + /** The unique type / short frequency description. */ + protected final static String FREQ = "MWF"; + /** + * Construct. + */ + public MWFRecurrenceRule() + { + super(); + } // MWFRecurrenceRule + /** + * Construct with no limits. + * @param interval Every this many number of weeks: 1 would be weekly. + */ + public MWFRecurrenceRule(int interval) + { + super(interval); + } //MWFRecurrenceRule + + /** + * Construct with count limit. + * @param interval Every this many number of weeks: 1 would be weekly. + * @param count For this many occurrences - if 0, does not limit. + */ + public MWFRecurrenceRule(int interval, int count) + { + super(interval, count); + } // MWFRecurrenceRule + /** + * Construct with time limit. + * @param interval Every this many number of weeks: 1 would be weekly. + * @param until No time ranges past this time are generated - if null, does not limit. + */ + public MWFRecurrenceRule(int interval, Time until) + { + super(interval, until); + } // MWFRecurrenceRule + /** + * Serialize the resource into XML, adding an element to the doc under the top of the stack element. + * @param doc The DOM doc to contain the XML (or null for a string return). + * @param stack The DOM elements, the top of which is the containing element of the new "resource" element. + * @return The newly added element. + */ + public Element toXml(Document doc, Stack stack) + { + // add the "rule" element to the stack'ed element + Element rule = doc.createElement("rule"); + ((Element)stack.peek()).appendChild(rule); + // set the class name - old style for CHEF 1.2.10 compatibility + rule.setAttribute("class", "org.chefproject.osid.calendar.MWFRecurrenceRule"); + // set the rule class name w/o package, for modern usage + rule.setAttribute("name", "MWFRecurrenceRule"); + // Do the base class part. + setBaseClassXML(rule); + return rule; + } // toXml + + /* (non-Javadoc) + * @see org.chefproject.service.calendar.RecurrenceRuleBase#getRecurrenceType() + */ + protected int getRecurrenceType() + { + return GregorianCalendar.WEEK_OF_MONTH; + } + /** + * {@inheritDoc} + */ + public String getFrequencyDescription() + { + return FREQ; + } + } // MWFRecurrenceRule + + + diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/RecurrenceRuleBase.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/RecurrenceRuleBase.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/RecurrenceRuleBase.java 2008-08-25 16:28:58.000000000 -0500 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/RecurrenceRuleBase.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 22,27 **** --- 22,28 ---- package org.sakaiproject.calendar.impl; import java.util.GregorianCalendar; + import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TimeZone; *************** *** 175,181 **** --- 176,328 ---- return rv; } + /** + * Return a List of all RecurrenceInstance objects generated by this rule within the given time range, based on the + * prototype first range, in time order. + * @param prototype The prototype first TimeRange. + * @param range A time range to limit the generated ranges. + * @param timeZone The time zone to use for displaying times. + * %%% Note: this is currently not implemented, and always uses the "local" zone. + * @return a List of RecurrenceInstance generated by this rule in this range. + */ + + public List generateInstances(TimeRange prototype, TimeRange range, TimeZone timeZone, String freq) + + { + TimeBreakdown startBreakdown = prototype.firstTime().breakdownLocal(); + List rv = new Vector(); + GregorianCalendar startCalendarDate = TimeService.getCalendar(TimeService.getLocalTimeZone(),0,0,0,0,0,0,0); + startCalendarDate.set( + startBreakdown.getYear(), + startBreakdown.getMonth() - 1, + startBreakdown.getDay(), + startBreakdown.getHour(), + startBreakdown.getMin(), + startBreakdown.getSec()); //may have to move this line ahead + + GregorianCalendar nextCalendarDate = (GregorianCalendar) startCalendarDate.clone(); + if(freq.equals("MWF") && startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)%2!=0 ){ + if(startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==7){ + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 2); + } + else if (startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==6) { + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 3); + } + else { + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 1); + } + + // nextCalendarDate = (GregorianCalendar) startCalendarDate.clone(); + } + if(freq.equals("TTh")&&((startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)!=3)&& + ((startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK))!=5 ))){ + if (startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==1){ + + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 2); + } + else if (startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==2){ + + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 1); + } + else if (startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==4){ + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 1); + + } + else if (startCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==6){ + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 4); + } + else { + startCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 3); + } + + // nextCalendarDate = (GregorianCalendar) startCalendarDate.clone(); + }// end of else shifting startdate for TTh + nextCalendarDate = (GregorianCalendar) startCalendarDate.clone();//line has been moved here to avoid duplication + int currentCount = 1; + int hitCount=1; //counts tth/mwf occurences when getCount()>0 + do + { + Time nextTime = TimeService.newTime(nextCalendarDate); + // is this past count? + if ((getCount() > 0) && (hitCount > getCount())) + break; + // is this past until? + if ((getUntil() != null) && isAfter(nextTime, getUntil()) ) + break; + + TimeRange nextTimeRange = TimeService.newTimeRange(nextTime.getTime(), prototype.duration()); + + // Is this out of the range? + + if (isOverlap(range, nextTimeRange)) + { + TimeRange eventTimeRange = null; + + // Single time cases require special handling. + if ( prototype.isSingleTime() ) + { + eventTimeRange = TimeService.newTimeRange(nextTimeRange.firstTime()); + } + else + { + eventTimeRange = TimeService.newTimeRange(nextTimeRange.firstTime(), nextTimeRange.lastTime(), true, false); + } + + // use this one + String eventHR=eventTimeRange.toStringHR(); + rv.add(new RecurrenceInstance(eventTimeRange, currentCount)); + + //currentCount++; + } + + // if next starts after the range, stop generating I have added an extra condition here to test TTH/MWF Number of times repetition + else if (isAfter(nextTime, range.lastTime()) ){ + break; + } + if(freq.equals("MWF") ){ + do{ + nextCalendarDate = (GregorianCalendar) startCalendarDate.clone(); + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, currentCount);//"1" is the recurrence type but here thing are confusing + if((getInterval()>1&&(nextCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)==7))){ + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, ((getInterval()-1)*7)+currentCount);//"1"is the supposed recuurence Type + currentCount+=((getInterval()-1)*7)+1; + } + else { + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 1); + currentCount++; + } + } + while((nextCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)%2!=0)); + } + //Deal with finding respective Tuesdays and Thursdays + else { + + do{//Tuesday Thursday Loop + + nextCalendarDate = (GregorianCalendar) startCalendarDate.clone();//this line seems pointless + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, currentCount); //"1" is the supposed recurrence Type + int weekDay=nextCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK); + if((getInterval()>1&&(weekDay==6))) + { + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, ((getInterval()-1)*7)+currentCount+2);//"1" is the supposed recurrence Type + currentCount+=((getInterval()-1)*7)+2; + } + else { + nextCalendarDate.add(java.util.Calendar.DAY_OF_MONTH, 1); //"1" is the supposed recurrence Type + currentCount++; + } + } + while(((nextCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK)!=3)&&((nextCalendarDate.get(java.util.GregorianCalendar.DAY_OF_WEEK))!=5 ))); + + } + hitCount++; + //currentCount++; + } + while (true); + + return rv; + } protected abstract int getRecurrenceType(); /** Binary files standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/.swp and calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/.swp differ diff -NcrB standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/TThRecurrenceRule.java calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/TThRecurrenceRule.java *** standard/calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/TThRecurrenceRule.java 1969-12-31 18:00:00.000000000 -0600 --- calendar/calendar-impl/impl/src/java/org/sakaiproject/calendar/impl/TThRecurrenceRule.java 2008-11-06 13:31:46.000000000 -0600 *************** *** 0 **** --- 1,102 ---- + /************************************************************************************ + * + * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation. + * @author mustansar@rice.edu + * Licensed under the Educational Community License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.opensource.org/licenses/ecl1.php + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + **********************************************************************************/ + package org.sakaiproject.calendar.impl; + import java.util.GregorianCalendar; + import java.util.Stack; + import org.sakaiproject.time.api.Time; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + /** + *

TTh RecurrenceRule is a time range generating rule that is based on a weekly recurrence. repeating Tuesdays and Thursdays

+ *

The recurrences happen on the same day-of-week, at the same time as the prototype.

+ *

TODO: support changing the day-of-week of recurrences Mustansar

+ */ + public class TThRecurrenceRule extends RecurrenceRuleBase + { + /** The unique type / short frequency description. */ + protected final static String FREQ = "TTh"; + /** + * Construct. + */ + public TThRecurrenceRule() + { + super(); + } // TThRecurrenceRule + /** + * Construct with no limits. + * @param interval Every this many number of weeks: 1 would be weekly. + */ + public TThRecurrenceRule(int interval) + { + super(interval); + } // TThRecurrenceRule + /** + * Construct with count limit. + * @param interval Every this many number of weeks: 1 would be weekly. + * @param count For this many occurrences - if 0, does not limit. + */ + public TThRecurrenceRule(int interval, int count) + { + super(interval, count); + } // TThRecurrenceRule + /** + * Construct with time limit. + * @param interval Every this many number of weeks: 1 would be weekly. + * @param until No time ranges past this time are generated - if null, does not limit. + */ + public TThRecurrenceRule(int interval, Time until) + { + super(interval, until); + } // TThRecurrenceRule + /** + * Serialize the resource into XML, adding an element to the doc under the top of the stack element. + * @param doc The DOM doc to contain the XML (or null for a string return). + * @param stack The DOM elements, the top of which is the containing element of the new "resource" element. + * @return The newly added element. + */ + public Element toXml(Document doc, Stack stack) + { + // add the "rule" element to the stack'ed element + Element rule = doc.createElement("rule"); + ((Element)stack.peek()).appendChild(rule); + // set the class name - old style for CHEF 1.2.10 compatibility + rule.setAttribute("class", "org.chefproject.osid.calendar.TThRecurrenceRule"); + // set the rule class name w/o package, for modern usage + rule.setAttribute("name", "TThRecurrenceRule"); + // Do the base class part. + setBaseClassXML(rule); + return rule; + } // toXml + /* (non-Javadoc) + * @see org.chefproject.service.calendar.RecurrenceRuleBase#getRecurrenceType() + */ + protected int getRecurrenceType() + { + return GregorianCalendar.WEEK_OF_MONTH; + } + /** + * {@inheritDoc} + */ + public String getFrequencyDescription() + { + return FREQ; + } + } // TThRecurrenceRule + + + diff -NcrB standard/calendar/calendar-tool/tool/src/bundle/calendar.properties calendar/calendar-tool/tool/src/bundle/calendar.properties *** standard/calendar/calendar-tool/tool/src/bundle/calendar.properties 2008-08-25 16:28:57.000000000 -0500 --- calendar/calendar-tool/tool/src/bundle/calendar.properties 2008-11-06 13:31:45.000000000 -0600 *************** *** 248,254 **** set.on= On set.after = After set.times = time(s) ! #ViewDay Vm view.goto = Go to Next Day view.gotopd = Go to Previous Day --- 248,255 ---- set.on= On set.after = After set.times = time(s) ! set.MWF= MWF ! set.TTh=TTh #ViewDay Vm view.goto = Go to Next Day view.gotopd = Go to Previous Day diff -NcrB standard/calendar/calendar-tool/tool/src/webapp/vm/calendar/chef_calendar_setFrequency.vm calendar/calendar-tool/tool/src/webapp/vm/calendar/chef_calendar_setFrequency.vm *** standard/calendar/calendar-tool/tool/src/webapp/vm/calendar/chef_calendar_setFrequency.vm 2008-08-25 16:28:58.000000000 -0500 --- calendar/calendar-tool/tool/src/webapp/vm/calendar/chef_calendar_setFrequency.vm 2008-11-06 13:45:19.000000000 -0600 *************** *** 15,22 ****

--- 15,26 ----

*************** *** 61,66 **** --- 65,72 ---- #if ($freq == "week")$tlang.getString("set.weeks")#end #if ($freq == "month")$tlang.getString("set.months")#end #if ($freq == "year")$tlang.getString("set.years")#end + #if ($freq == "TTh")$tlang.getString("set.weeks")#end ##we want to display weeks here --mustansar + #if ($freq == "MWF")$tlang.getString("set.weeks")#end ##but text can be chnaged later as required --mustansar

$tlang.getString("set.ends")