Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2794

Re: How to retrieve complete scheduling information for all recurring schedules using Enterprise SDK or RESTful API

$
0
0

I have a Java program that I've written that pulls all sorts of data out of the CMS.  For schedules, I have created a class called ScheduleInfo.  In the code below, the top section is part of the code in the constructor and schedType, intervalType, and interval are properties of the class.

 

 

 

ISchedulingInfo si = o.getSchedulingInfo();

loadSchedType(si.getType());

if (!intervalType.isEmpty()){

  loadInterval(si);

}

 

 

private void loadSchedType(int iType) {

  switch (iType){

  case 0:

  schedType = "Once";

  case 1:

  schedType = "Hourly";

  intervalType = "Hours";

  break;

  case 2:

  schedType = "Daily";

  intervalType = "Days";

  break;

  case 3:

  schedType = "Weekly";

  break;

  case 4:

  schedType = "Monthly";

  intervalType = "Months";

  break;

  case 5:

  schedType = "Nth Day of Month";

  intervalType = "Nth Day";

  break;

  case 6:

  schedType = "First Monday of Month";

  break;

  case 7:

  schedType = "Last Day of Month";

  break;

  case 8:

  schedType = "Calendar";

  break;

  case 9:

  schedType = "Calendar Template";

  break;

  default:

  schedType = "Unknown";

  break;

  }

}

 

 

private void loadInterval(ISchedulingInfo si){

  if (intervalType.equals("Hours")){

  interval = si.getIntervalHours();

  } else if (intervalType.equals("Days")){

  interval = si.getIntervalDays();

  } else if (intervalType.equals("Months")){

  interval = si.getIntervalMonths();

  } else if (intervalType.equals("Nth Day")){

  interval = si.getIntervalNthDay();

  }

}

 

-Dell


Viewing all articles
Browse latest Browse all 2794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>