BrightSide Workbench Full Report + Source Code
org.turro.ical.Calendar Class Reference

Public Member Functions

 Calendar (String name)
 
void addEvent (Date start, Date end, String name, String description)
 
void setOrganizer (String name, String email)
 
void setCompleted ()
 
void setCancelled ()
 
void addAttendee (String name, String email)
 
void addLocation (String address)
 
void output (OutputStream out)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 53 of file Calendar.java.

Constructor & Destructor Documentation

◆ Calendar()

org.turro.ical.Calendar.Calendar ( String  name)

Definition at line 59 of file Calendar.java.

59  {
60  icsCalendar = new net.fortuna.ical4j.model.Calendar();
61  icsCalendar.getProperties().add(new ProdId(name));
62  icsCalendar.getProperties().add(Version.VERSION_2_0);
63  icsCalendar.getProperties().add(CalScale.GREGORIAN);
64  }
Calendar(String name)
Definition: Calendar.java:59
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addAttendee()

void org.turro.ical.Calendar.addAttendee ( String  name,
String  email 
)

Definition at line 103 of file Calendar.java.

103  {
104  URI umail;
105  try {
106  umail = URI.create("mailto:" + email);
107  } catch(Exception ex) {
108  umail = URI.create("mailto:" + Contacts.getNoEmail());
109  }
110  Attendee attendee = new Attendee(umail);
111  attendee.getParameters().add(Role.REQ_PARTICIPANT);
112  attendee.getParameters().add(new Cn(name));
113  currentEvent.getProperties().add(attendee);
114  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addEvent()

void org.turro.ical.Calendar.addEvent ( Date  start,
Date  end,
String  name,
String  description 
)

Definition at line 66 of file Calendar.java.

66  {
67  try {
68  currentEvent = new VEvent(new DateTime(start), new DateTime(end == null ? start : end), name);
69  currentEvent.getProperties().add(new Description(description));
70 
71  endDate = end;
72 
73  UidGenerator ug = new FixedUidGenerator("uidGen");
74  Uid uid = ug.generateUid();
75  currentEvent.getProperties().add(uid);
76 
77  icsCalendar.getComponents().add(currentEvent);
78  } catch (SocketException ex) {
79  Logger.getLogger(Calendar.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
80  }
81  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addLocation()

void org.turro.ical.Calendar.addLocation ( String  address)

Definition at line 116 of file Calendar.java.

116  {
117  if(!Strings.isBlank(address)) {
118  Location location = new Location(address);
119  currentEvent.getProperties().add(location);
120  }
121  }
Here is the caller graph for this function:

◆ output()

void org.turro.ical.Calendar.output ( OutputStream  out)

Definition at line 123 of file Calendar.java.

123  {
124  try {
125  CalendarOutputter outputter = new CalendarOutputter();
126  outputter.output(icsCalendar, out);
127  } catch (IOException ex) {
128  Logger.getLogger(Calendar.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
129  }
130  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCancelled()

void org.turro.ical.Calendar.setCancelled ( )

Definition at line 99 of file Calendar.java.

99  {
100  currentEvent.getProperties().add(new Status("CANCELLED"));
101  }
Here is the caller graph for this function:

◆ setCompleted()

void org.turro.ical.Calendar.setCompleted ( )

Definition at line 95 of file Calendar.java.

95  {
96  currentEvent.getProperties().add(new Completed(new DateTime(endDate)));
97  }
Here is the caller graph for this function:

◆ setOrganizer()

void org.turro.ical.Calendar.setOrganizer ( String  name,
String  email 
)

Definition at line 83 of file Calendar.java.

83  {
84  URI umail;
85  try {
86  umail = URI.create("mailto:" + email);
87  } catch(Exception ex) {
88  umail = URI.create("mailto:" + Contacts.getNoEmail());
89  }
90  Organizer organizer = new Organizer(umail);
91  organizer.getParameters().add(new Cn(name));
92  currentEvent.getProperties().add(organizer);
93  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: