public MInstance(NSDictionary aDict, MSiteConfig aConfig) { shutdownFormatter.setDefaultFormatTimeZone(NSTimeZone.timeZoneWithName("UTC", true)); values = new NSMutableDictionary(aDict); _host = aConfig.hostWithName(hostName()); _application = aConfig.applicationWithName(applicationName()); _siteConfig = aConfig; calculateNextScheduledShutdown(); }
/** ******** Constructors ********* */ // This constructor is for adding new instances through the UI public MInstance(MHost aHost, MApplication anApplication, Integer anID, MSiteConfig aConfig) { shutdownFormatter.setDefaultFormatTimeZone(NSTimeZone.timeZoneWithName("UTC", true)); values = new NSMutableDictionary(); _host = aHost; _application = anApplication; _siteConfig = aConfig; setApplicationName(_application.name()); setHostName(_host.name()); setId(anID); takeValuesFromApplication(); setSchedulingEnabled(Boolean.FALSE); setSchedulingType("DAILY"); setSchedulingHourlyStartTime(Integer.valueOf(3)); setSchedulingDailyStartTime(Integer.valueOf(3)); setSchedulingWeeklyStartTime(Integer.valueOf(3)); setSchedulingStartDay(Integer.valueOf(1)); // Sunday setSchedulingInterval(Integer.valueOf(12)); setGracefulScheduling(Boolean.TRUE); }
/** * Standard constructor for WOComponent subclasses. * * @param context context of a transaction * @see WOComponent#pageWithName(String) * @see WOApplication#pageWithName(String, WOContext) */ public ERPublishCalendarPage(WOContext context) { super(context); events = new NSMutableArray(); calendarTimeZone = new NSTimestampFormatter ("%Z").format (new NSTimestamp()); dateTimeFormatter = new NSTimestampFormatter ("%Y%m%dT%H%M%S"); dateTimeFormatter.setDefaultFormatTimeZone (NSTimeZone.localTimeZone()); dateFormatter = new NSTimestampFormatter ("%Y%m%d"); dateFormatter.setDefaultFormatTimeZone (NSTimeZone.localTimeZone()); utcDateTimeFormatter = new NSTimestampFormatter ("%Y%m%dT%H%M%SZ"); utcDateTimeFormatter.setDefaultFormatTimeZone (NSTimeZone.timeZoneWithName ("UTC", false)); timeZoneFormatter = new NSTimestampFormatter ("%Z"); timeZoneFormatter.setDefaultFormatTimeZone (NSTimeZone.localTimeZone()); }