Package com.centraview.activity.helper

Examples of com.centraview.activity.helper.RecurrenceVO


       // And what if they were null ... it means we have fubar data, and thats just the way it is.

       // if this is a recurring record, do some stuff.
       if ((activityRecord.get("startdate") != null))
       {
         RecurrenceVO recurrenceVO = new RecurrenceVO();
         recurrenceVO.setRecurrenceId(((Long)activityRecord.get("RecurrenceID")).intValue());
         recurrenceVO.setStartDate((Date)activityRecord.get("startdate"));
         recurrenceVO.setUntil((Date)activityRecord.get("Until"));
         recurrenceVO.setTimePeriod((String)activityRecord.get("TimePeriod"));
         recurrenceVO.setOn(((Number)activityRecord.get("RecurrOn")).intValue());
         recurrenceVO.setEvery(((Integer)activityRecord.get("Every")).intValue());
         recurrenceVO.fillRecurrenceHashMap();

         HashMap recurrenceRuleMap = recurrenceVO.getRecurrenceHM();
         if (recurrenceRuleMap != null && recurrenceRuleMap.size() > 0)
         {
           Date recurrStartDate = (Date)activityRecord.get("startdate");
           // For very long recurrences we only need to calculate out 18 months before of the
           // passedStartDate otherwise we spend all our time calculating recurring tasks.
           Calendar compareCalendar = (Calendar)passedStartDate.clone();
           compareCalendar.add(Calendar.MONTH, -18);
           Date compareDate = new Date(compareCalendar.getTimeInMillis());
           if (recurrStartDate.before(compareDate))
           {
             recurrStartDate = compareDate;
           }

           GregorianCalendar recurringStartDate = new GregorianCalendar(TimeZone.getTimeZone("EST"));
           if (recurrStartDate != null)
           {
             recurringStartDate.setTime(recurrStartDate);
             recurringStartDate.set(Calendar.HOUR, activityRecordStart.get(Calendar.HOUR));
             recurringStartDate.set(Calendar.MINUTE, activityRecordStart.get(Calendar.MINUTE));
             recurringStartDate.set(Calendar.AM_PM, activityRecordStart.get(Calendar.AM_PM));
           }

           Date recurrEndDate = (Date)activityRecord.get("Until");
           // if there is no end date (the recurrence is open ended)
           // then coerce it to the passed in end date, for calculation purposes
           // Also for very long recurrences we only need to calculate out 2 months ahead of the
           // passedEndDate otherwise we spend all our time calculating recurring tasks.
           compareCalendar = (Calendar)passedEndDate.clone();
           compareCalendar.add(Calendar.MONTH, 2);
           compareDate = new Date(compareCalendar.getTimeInMillis());
           if (recurrEndDate == null || recurrEndDate.after(compareDate))
           {
             recurrEndDate = compareDate;
           }

           // get an RFC 2445 compliant recurrance rule string.
           String rfcRuleString = recurrenceVO.getRecurrenceRule(recurrenceRuleMap);

           // This object can take a rule string, a start and end date
           // and supply a list of dates where the activity occurs.
           long start = System.currentTimeMillis();
          
View Full Code Here

TOP

Related Classes of com.centraview.activity.helper.RecurrenceVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.