Package java.util

Examples of java.util.GregorianCalendar


     * <CODE>Object[]{cert,error}</CODE> where <CODE>cert</CODE> is the
     * failed certificate and <CODE>error</CODE> is the error message
     */   
    public static Object[] verifyCertificates(Certificate certs[], KeyStore keystore, Collection crls, Calendar calendar) {
        if (calendar == null)
            calendar = new GregorianCalendar();
        for (int k = 0; k < certs.length; ++k) {
            X509Certificate cert = (X509Certificate)certs[k];
            String err = verifyCertificate(cert, crls, calendar);
            if (err != null)
                return new Object[]{cert, err};
View Full Code Here


        String estimatedcloseyear = opportunityForm.getEstimatedcloseyear();
        try {
          int estimatedclosemonth1 = Integer.parseInt(estimatedclosemonth);
          int estimatedcloseday1 = Integer.parseInt(estimatedcloseday);
          int estimatedcloseyear1 = Integer.parseInt(estimatedcloseyear);
          Calendar estimatedClose = new GregorianCalendar();
          estimatedClose.set(estimatedcloseyear1, estimatedclosemonth1 - 1, estimatedcloseday1);
          opportunityVO.setEstimatedClose(new Timestamp(estimatedClose.getTimeInMillis()));
        } catch (NumberFormatException nfe) {
          logger.info("[execute]: blank date fields");
        } catch (Exception e) {
          logger.error("[execute]: Exception");
        }
      }

      if (typeofoperation.equals(SaleConstantKeys.ADD)) {
        remote.addOpportunity(ownerId, opportunityVO);
      } else if (typeofoperation.equals(SaleConstantKeys.EDIT)) {
        String opportunityid = request.getParameter("opportunityid");

        if ((opportunityForm.getActualclosemonth() != null) && (opportunityForm.getActualcloseday() != null)
            && (opportunityForm.getActualcloseyear() != null)) {
          String actualclosemonth = opportunityForm.getActualclosemonth();
          String actualcloseday = opportunityForm.getActualcloseday();
          String actualcloseyear = opportunityForm.getActualcloseyear();

          try {
            int actualclosemonth1 = Integer.parseInt(actualclosemonth);
            int actualcloseday1 = Integer.parseInt(actualcloseday);
            int actualcloseyear1 = Integer.parseInt(actualcloseyear);
            Calendar actualClose = new GregorianCalendar(actualcloseyear1, actualclosemonth1 - 1, actualcloseday1);
            opportunityVO.setActualclose(new Timestamp(actualClose.getTimeInMillis()));
          } catch (NumberFormatException nfe) {
            logger.info("[execute]: blank date fields");
          } catch (Exception e) {
            logger.error("[execute]: Exception", e);
          }
View Full Code Here

    String forward = ".view.calendar.datetime";
    // "dateTimeSelectForm" in mappings/calendar.xml
    DynaActionForm dateForm = (DynaActionForm) form;
    try {
      // get the the current system date and time and set it to the form
      GregorianCalendar currentDate = new GregorianCalendar(tz, locale);
      dateForm.set("currentDate", currentDate);
      request.setAttribute("currentDate", currentDate);
      // dateTimeType
      // Type 1 You can set the date.
      // Type 2 You can set the Date and Time both
      // Type 3 You can set the Start Date and end Date
      // Type 4 You can set the date, Start Time and End Time.
      // Type 5 You can set the Start DAte, Start time , End Date & End Time..
      Integer dateTimeType = (Integer) dateForm.get("dateTimeType");
      if (dateTimeType == null) {
        dateTimeType = new Integer(Constants.BothDateTime);
      }
      dateForm.set("dateTimeType", dateTimeType);

      Boolean showWeeklyColumn = (Boolean) dateForm.get("showWeeklyColumn");
      if (showWeeklyColumn == null) {
        request.setAttribute("showWeeklyColumn", new Boolean(false));
      } else {
        request.setAttribute("showWeeklyColumn", new Boolean(true));
      }

      dateForm.set("dateTimeType", dateTimeType);
      // get the month and year parameters from the request.
      // These will be used to set the selectedDate value.
      Integer month = (Integer) dateForm.get("month");
      if (month == null) {
        month = new Integer(currentDate.get(GregorianCalendar.MONTH) + 1);
      }

      Integer year = (Integer) dateForm.get("year");
      if (year == null) {
        year = new Integer(currentDate.get(GregorianCalendar.YEAR));
      }

      // This value will display the selected month in the mini calendar.
      GregorianCalendar selectedDate = new GregorianCalendar(year.intValue(), month.intValue() - 1, 1);
      dateForm.set("selectedDate", selectedDate);
      request.setAttribute("selectedDate", selectedDate);

      DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
      // simple mode basicall is non-calendar/activities mode, because
      // the following behaviour is unexpected in sales.
      boolean simpleMode = ((Boolean)dateForm.get("simpleMode")).booleanValue();
      String startDate = (String) dateForm.get("startDate");
      String endDate = (String) dateForm.get("endDate");
      if (!simpleMode) {
        if ((startDate == null || startDate.length() < 1) && (endDate == null || endDate.length() < 1)) {
          // if startDate *AND* endDate are not already set, then
          // set them both to the current date in the format MM/dd/yyyy
          startDate = df.format(currentDate.getTime());
          endDate = startDate;
        }
      }
      dateForm.set("startDate", startDate);
      dateForm.set("endDate", endDate);

      // if startTime is given, but endTime is NOT, then set the
      // endTime = startTime + 1 hour
      String startTime = (String) dateForm.get("startTime");
      String endTime = (String) dateForm.get("endTime");
      if ((startTime != null && startTime.length() > 0) && (endTime == null || endTime.length() <= 0)) {
        DateFormat tf = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
        GregorianCalendar endTimeCal = new GregorianCalendar();
        // get a Calendar object generated from the given startTime String
        endTimeCal.setTime(tf.parse(startTime));
        // add one hour to the Calendar object
        endTimeCal.set(GregorianCalendar.HOUR_OF_DAY, endTimeCal.get(GregorianCalendar.HOUR_OF_DAY) + 1);
        // get the String representation of the Calendar object, using the
        // SimpleDateFormat
        String defaultEndTime = tf.format(endTimeCal.getTime());
        // set the new endTime String to the form
        dateForm.set("endTime", defaultEndTime);
      }
    } catch (Exception e) {
      logger.error("[execute]: Exception", e);
View Full Code Here

    private String digestEncryptionAlgorithm;
    private HashMap exclusionLocations;
       
    PdfSignatureAppearance(PdfStamperImp writer) {
        this.writer = writer;
        signDate = new GregorianCalendar();
        fieldName = getNewSigName();
    }
View Full Code Here

      throw new RuntimeException();
  }

  public XMLGregorianCalendar test45EmptyInDateTimeOut() {
    try {
      return DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(1, 4, 2011));
    } catch (DatatypeConfigurationException e) {
      e.printStackTrace();
    }
    return null;
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Object convert(Class destClass, Object srcObj) {
    Class sourceClass = srcObj.getClass();
    Calendar result = new GregorianCalendar();

    if (java.util.Date.class.isAssignableFrom(sourceClass)) {
      // Date --> XMLGregorianCalendar
      result.setTime((java.util.Date) srcObj);
    } else if (Calendar.class.isAssignableFrom(sourceClass)) {
      // Calendar --> XMLGregorianCalendar
      Calendar c = (Calendar) srcObj;
      result.setTime(c.getTime());
      result.setTimeZone(c.getTimeZone());
    } else if (XMLGregorianCalendar.class.isAssignableFrom(sourceClass)) {
      result = ((XMLGregorianCalendar) srcObj).toGregorianCalendar();
    } else if (dateFormat != null && String.class.isAssignableFrom(sourceClass)) {
      if ("".equals(srcObj)) {
        return null;
      }
      try {
        long time = dateFormat.parse((String) srcObj).getTime();
        result.setTime(new Date(time));
      } catch (ParseException e) {
        throw new ConversionException("Unable to parse source object using specified date format", e);
      }
    } else {
      try {
        long time = Long.parseLong(srcObj.toString());
        result.setTime(new Date(time));
      } catch (NumberFormatException e) {
        throw new ConversionException("Unable to determine time in millis of source object", e);
      }
    }

View Full Code Here

  public CalendarConverter(DateFormat dateFormat) {
    this.dateFormat = dateFormat;
  }

  public Object convert(Class destClass, Object srcObj) {
    Calendar result = new GregorianCalendar();
    Class srcFieldClass = srcObj.getClass();
    // Convert from Date to Calendar
    if (java.util.Date.class.isAssignableFrom(srcFieldClass)) {
      result.setTime((java.util.Date) srcObj);
    }
    //  Convert from Calendar to Calendar
    else if (Calendar.class.isAssignableFrom(srcFieldClass)) {
      Calendar c = (Calendar) srcObj;
      result.setTime(c.getTime());
      result.setTimeZone(c.getTimeZone());
    } else if (XMLGregorianCalendar.class.isAssignableFrom(srcFieldClass)) {
      Calendar c = ((XMLGregorianCalendar) srcObj).toGregorianCalendar();
      result.setTime(c.getTime());
      result.setTimeZone(c.getTimeZone());
    }
    // String to Calendar
    else if (dateFormat != null && String.class.isAssignableFrom(srcFieldClass)) {
      try {
        result.setTime(new Date(dateFormat.parse((String) srcObj).getTime()));
      } catch (ParseException e) {
        throw new ConversionException("Unable to parse source object using specified date format", e);
      }
      // Default conversion
    } else {
      try {
        result.setTime(new Date(Long.parseLong(srcObj.toString())));
      } catch (NumberFormatException e) {
        throw new ConversionException("Unable to determine time in millis of source object", e);
      }
    }
    return result;
View Full Code Here

           continue;
         }
       }

       // If we made it this far then we can get the activity detail and populate the object.
       GregorianCalendar activityRecordStart = new GregorianCalendar(TimeZone.getTimeZone("EST"));
       if (activityRecord.get("Start") != null)
       {
         Timestamp activityStartDate = (Timestamp)activityRecord.get("Start");
         activityRecordStart.setTimeInMillis(activityStartDate.getTime());
       }

       GregorianCalendar activityRecordEnd = new GregorianCalendar(TimeZone.getTimeZone("EST"));
       if (activityRecord.get("End") != null)
       {
         Timestamp activityEndDate = (Timestamp)activityRecord.get("End");
         activityRecordEnd.setTimeInMillis(activityEndDate.getTime());
       }
       
        int activityType = ((Number)activityRecord.get("Type")).intValue();
        // its a Special Case for the Forcast Sales. We will not have the end date for it..
        // we have to display as the whole day event, for that reason if we set the start as end date.
        if(activityType == 3){
          activityRecordEnd.set(GregorianCalendar.DAY_OF_MONTH,activityRecordStart.get(GregorianCalendar.DAY_OF_MONTH));
          activityRecordEnd.set(GregorianCalendar.MONTH,activityRecordStart.get(GregorianCalendar.MONTH));
          activityRecordEnd.set(GregorianCalendar.YEAR,activityRecordStart.get(GregorianCalendar.YEAR));
          activityRecordEnd.set(GregorianCalendar.HOUR_OF_DAY,23);
        }
       
       // 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();
          
           try{
             RecurranceRuleRfc rfcRecurranceRule = new RecurranceRuleRfc(rfcRuleString, recurrStartDate, recurrEndDate);
             List matchingDates = rfcRecurranceRule.getAllMatchingDates();
             // Iterate the list and add new activity objects onto the list.
             start = System.currentTimeMillis();
             for (int i = 0; i < matchingDates.size(); i++)
             {
               java.util.Date matchingDate = (java.util.Date)matchingDates.get(i);
               GregorianCalendar recurringInstanceStartDate = new GregorianCalendar(passedStartDate.getTimeZone());
               // This is the start Calendar for this instance of the recurrance
               recurringInstanceStartDate.setTime(matchingDate); // This will set the MONTH/DATE/YEAR
               // Get the Time of Day from the activity Record
               recurringInstanceStartDate.set(Calendar.HOUR, activityRecordStart.get(Calendar.HOUR));
               recurringInstanceStartDate.set(Calendar.MINUTE, activityRecordStart.get(Calendar.MINUTE));
               recurringInstanceStartDate.set(Calendar.AM_PM, activityRecordStart.get(Calendar.AM_PM));
               // This is the End Calendar for this instance of the recurrance
               GregorianCalendar recurringInstanceEndDate = new GregorianCalendar(passedEndDate.getTimeZone());
               // The only real way to set the instance end time
               // is to find out the duration of the activityRecord and set the
               // end time of this instance to be offset from the start time of
               // the same instance by the calculated duration.
               long activityDuration = activityRecordEnd.getTimeInMillis() - activityRecordStart.getTimeInMillis();
               recurringInstanceEndDate.setTimeInMillis(recurringInstanceStartDate.getTimeInMillis() + activityDuration);
               CalendarActivityObject recurringInstanceObject = new CalendarActivityObject(recurringInstanceStartDate, recurringInstanceEndDate, activityId, (String)activityRecord.get("Title"), (String)activityRecord.get("ActivityName"), userId, individualId, "",false,null,null);
               recurringInstanceObject.setActivityDetail((String)activityRecord.get("Details"));
               // set visibility
               recurringInstanceObject.setActivityVisibility((String)activityRecord.get("visibility"));
               // set owner
               recurringInstanceObject.setActivityOwnerId(((Number)activityRecord.get("Owner")).intValue());
               ArrayList activityAttendeeInfo = remote.getActivityAttendee(activityId.intValue());
               recurringInstanceObject.setActivityAttendee(activityAttendeeInfo);
               //Find the Entity
               HashMap activityLinkInfo = remote.getActivityLink(activityId.intValue());
               String entityName = (String)activityLinkInfo.get("EntityName");
               int entityID = -1;
               try
               {
                 Integer.parseInt((String)activityLinkInfo.get("EntityID"));
               }catch(NumberFormatException nfe){
                 // "Don't stand so, don't stand so, close to me..."
               }
               //Set the Entity
               recurringInstanceObject.setEntityName(entityName);
               recurringInstanceObject.setEntityID(entityID);
               retVec.add(recurringInstanceObject);
             } // end for (int ctr = 0; ctr < results.size(); ctr++)
           }catch (Exception e){
             logger.debug("[Exception][CvCalendarEJB.fillReturnVector] Exception Thrown: " , e);
           }            
         } // end if (mapRecurrence != null)
       }else if (activityRecordStart.before(passedEndDate) && activityRecordEnd.after(passedStartDate)){
         // else it is not a recurring type of activity.

         // We will collect the number of days in the StartDate and EndDate ArrayList
         // in between the Starting Time Activity and Ending Time of Activity.
         GregorianCalendar tempStartTime = new GregorianCalendar(TimeZone.getTimeZone("EST"));
         tempStartTime.setTimeInMillis(activityRecordStart.getTimeInMillis());

         GregorianCalendar tempEndTime = new GregorianCalendar(TimeZone.getTimeZone("EST"));

         ArrayList StartDate = new ArrayList();
         ArrayList EndDate = new ArrayList();

         StartDate.add(new Long(tempStartTime.getTimeInMillis()));
         while (tempStartTime.before(activityRecordEnd))
         {
           tempEndTime.setTimeInMillis(tempStartTime.getTimeInMillis());
           tempEndTime.set(GregorianCalendar.HOUR,11);
           tempEndTime.set(GregorianCalendar.MINUTE,59);
           tempEndTime.set(GregorianCalendar.SECOND,59);
           tempEndTime.set(GregorianCalendar.AM_PM,GregorianCalendar.PM);

           tempStartTime.add(GregorianCalendar.DAY_OF_MONTH,1);
           tempStartTime.set(GregorianCalendar.HOUR,0);
           tempStartTime.set(GregorianCalendar.MINUTE,0);
           tempStartTime.set(GregorianCalendar.SECOND,0);
           tempStartTime.set(GregorianCalendar.AM_PM,GregorianCalendar.AM);

           if (! tempStartTime.before(activityRecordEnd))
           {
             break;
             }else{
             EndDate.add(new Long(tempEndTime.getTimeInMillis()));
             StartDate.add(new Long(tempStartTime.getTimeInMillis()));
           }   // end of if(!tempStartTime.before(activityRecordEnd))

         }   // end of while (tempStartTime.before(activityRecordEnd))

         tempEndTime.setTimeInMillis(activityRecordEnd.getTimeInMillis());
         EndDate.add(new Long(tempEndTime.getTimeInMillis()));

         for(int i = 0; i<StartDate.size();i++)
         {
           long startTimeInMills = ((Long) StartDate.get(i)).longValue();
           long endTimeInMills = ((Long) EndDate.get(i)).longValue();

           GregorianCalendar ActivityStart = new GregorianCalendar(TimeZone.getTimeZone("EST"));
           ActivityStart.setTimeInMillis(startTimeInMills);

           GregorianCalendar ActivityEnd = new GregorianCalendar(TimeZone.getTimeZone("EST"));
           ActivityEnd.setTimeInMillis(endTimeInMills);

           CalendarActivityObject cvo = null;

           // Activity for only one day
           if (StartDate.size() == 1)
View Full Code Here

      Argument object = params.get(OBJECT);
      String objectName = (String) object.getArgumentValue().getValue();
     
      Argument start = params.get(STARTDATE);
      Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
      GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(startTime);
      XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      Argument end = params.get(ENDDATE);
      Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
      tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
      tempCalendar.setTime(endTime);
      XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
     
      deletedResult = parent.getConnection().getDeleted(objectName, startCalendar, endCalendar);
    } catch (ResourceException e) {
      throw new TranslatorException(e);
View Full Code Here

        activityForm.setActivityDetail(activity.getActivityDetails());
      }

      if (activity.getActivityStartDate() != null) {
        Timestamp startTimeStamp = activity.getActivityStartDate();
        Calendar start = new GregorianCalendar();
        start.setTime(startTimeStamp);
        activityForm.setActivityStartDate(df.format(start.getTime()));
        activityForm.setActivityStartTime(tf.format(start.getTime()));
      }

      if (activity.getActivityEndDate() != null) {
        Timestamp endTimeStamp = activity.getActivityEndDate();
        Calendar end = new GregorianCalendar();
        end.setTime(endTimeStamp);
        activityForm.setActivityEndDate(df.format(end.getTime()));
        activityForm.setActivityEndTime(tf.format(end.getTime()));
      }

      RecurrenceVO recurrenceVO = null;
      if (activity.getRecurrence() != null) {
        recurrenceVO = activity.getRecurrence();
        activityForm.setActivityRecurringFrequency(recurrenceVO.getTimePeriod());

        // if date is not null convert from timestamp to String
        if (recurrenceVO.getStartDate() != null) {
          Date recurStartDate = recurrenceVO.getStartDate();
          Calendar recurStart = new GregorianCalendar();
          recurStart.setTime(recurStartDate);
          activityForm.setActivityRecurStartDate(df.format(recurStart.getTime()));
          activityForm.setActivityRecurringStartTime(tf.format(recurStart.getTime()));
        }

        if (recurrenceVO.getUntil() != null) {
          Date recurEndDate = recurrenceVO.getUntil();
          Calendar recurEnd = new GregorianCalendar();
          recurEnd.setTime(recurEndDate);
          activityForm.setActivityRecurEndDate(df.format(recurEnd.getTime()));
        }

        HashMap mapRecurrence = recurrenceVO.getRecurrenceHM();
        if (mapRecurrence != null) {
          if (mapRecurrence.size() > 0) {
            String frequency = (String)mapRecurrence.get("FREQUENCY");
            String every = (String)mapRecurrence.get("EVERY");
            String on = (String)mapRecurrence.get("ON");
            activityForm.setActivityRecurringFrequency(frequency);

            if (frequency.equals("DAY")) {
              activityForm.setActivityRecurringDailyEvery("1");
              activityForm.setActivityRecurringDailyDays(every);
              if (Integer.parseInt(on) > 0) {
                activityForm.setActivityRecurringDailyWeekdays("1");
              }
            } else if (frequency.equals("WEEK")) {
              activityForm.setActivityRecurringWeeklyEvery(every);
              StringTokenizer st = new StringTokenizer(on, ",");
              String strweeklyon[] = new String[st.countTokens()];
              int i = 0;

              while (st.hasMoreTokens()) {
                String strToken = st.nextToken();
                if (strToken.equals("6")) {
                  strToken = "Su";
                } else if (strToken.equals("0")) {
                  strToken = "Mo";
                } else if (strToken.equals("1")) {
                  strToken = "Tu";
                } else if (strToken.equals("2")) {
                  strToken = "We";
                } else if (strToken.equals("3")) {
                  strToken = "Th";
                } else if (strToken.equals("4")) {
                  strToken = "Fr";
                } else if (strToken.equals("5")) {
                  strToken = "Sa";
                }
                strweeklyon[i] = strToken.trim();
                i++;
              }
              String selectedweek[] = { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };
              activityForm.setActivityRecurringWeeklyOn(strweeklyon);
              activityForm.setActivitySelectedWeek(selectedweek);
              activityForm.setActivityFindWeek(strweeklyon);
            } else if (frequency.equals("MONTH")) {
              String onstring = on;
              int inton = Integer.parseInt(onstring.substring(0, 1));
              activityForm.setActivityRecurringMonthlyEvery("" + inton);
              if (inton == 0) {
                String monthday = onstring.substring(2, onstring.length());
                activityForm.setActivityRecurringMonthlyEveryDay(monthday);
                activityForm.setActivityRecurringMonthlyOnWeek("-1");
                activityForm.setActivityRecurringMonthlyOnDay("-1");
              }

              if (inton == 1) {
                activityForm.setActivityRecurringMonthlyOnDay(onstring.substring(2, 3));
                activityForm.setActivityRecurringMonthlyOnWeek(onstring.substring(4, 5));
              }
            } else if (frequency.equals("YEAR")) {
              String onstring = on;
              int inton = Integer.parseInt(onstring.substring(0, 1));
              activityForm.setActivityRecurringYearlyEvery("" + inton);
              if (inton == 0) {
                activityForm.setActivityRecurringYearlyEveryMonth(every);
                String yearday = onstring.substring(2, onstring.length());
                activityForm.setActivityRecurringYearlyEveryDay(yearday);
                activityForm.setActivityRecurringYearlyOnWeek("-1");
                activityForm.setActivityRecurringYearlyOnDay("-1");
              }

              if (inton == 1) {
                activityForm.setActivityRecurringYearlyOnMonth(every);
                activityForm.setActivityRecurringYearlyOnWeek(onstring.substring(2, 3));
                activityForm.setActivityRecurringYearlyOnDay(onstring.substring(4, 5));
              }
            }// end of else if (frequency.equals("YEAR"))
          }// end of if (mapRecurrence.size()>0)
        }// end of if (mapRecurrence != null)
      }// end of if (actVo.getRecurrence() != null)

      Collection activityAction = null;
      if (activity.getActivityAction() != null) {
        activityAction = activity.getActivityAction();
        Iterator it = activityAction.iterator();
        while (it.hasNext()) {
          ActivityActionVO acVO = (ActivityActionVO)it.next();
          String strActionType = acVO.getActionType();
          if (strActionType.equals(ActivityActionVO.AA_ALERT)) {
            activityForm.setActivityReminder("on");
            if (acVO.getActionTime() != null) {
              Timestamp remindTimeStamp = acVO.getActionTime();
              Calendar remind = new GregorianCalendar();
              remind.setTime(remindTimeStamp);
              activityForm.setActivityRemindDate(df.format(remind.getTime()));
              activityForm.setActivityReminderTime(tf.format(remind.getTime()));
            }// end of if (acVO.getActionTime() != null)
          }// end of if (strActionType.equals(ActivityActionVO.AA_ALERT))
          else if (strActionType.equals(ActivityActionVO.AA_EMAIL)) {
            activityForm.setActivityEmailInvitation("on");
          }// end of else if (strActionType.equals(ActivityActionVO.AA_EMAIL))
View Full Code Here

TOP

Related Classes of java.util.GregorianCalendar

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.