use of org.bedework.util.calendar.WsXMLTranslator in project bw-calendar-engine by Bedework.
the class IcalTranslator method fromIcal.
/**
* Convert the Icalendar object to a Collection of Calendar objects
*
* @param col collection the entities will live in - possibly null
* @param ical
* @param diff True if we should assume we are updating existing events.
* @return Icalendar
* @throws CalFacadeException
*/
public Icalendar fromIcal(final BwCalendar col, final IcalendarType ical, final boolean diff) throws CalFacadeException {
Icalendar ic = new Icalendar();
setSystemProperties();
WsXMLTranslator bldr = new WsXMLTranslator(ic);
try {
Calendar cal = bldr.fromXcal(ical);
return makeIc(col, ic, cal, diff, false);
} catch (CalFacadeException cfe) {
throw cfe;
} catch (Throwable t) {
throw new CalFacadeException(t);
}
}
use of org.bedework.util.calendar.WsXMLTranslator in project bw-calendar-engine by Bedework.
the class IcalTranslator method addOverride.
/**
* Add an override as part of an update
* @param ei
* @param comp
* @throws CalFacadeException
*/
public void addOverride(final EventInfo ei, final JAXBElement<? extends BaseComponentType> comp) throws CalFacadeException {
try {
Calendar cal = new WsXMLTranslator(new Icalendar()).fromXcomp(comp);
if (cal == null) {
return;
}
Icalendar ic = new Icalendar();
ic.addComponent(ei);
makeIc(null, ic, cal, true, false);
} catch (CalFacadeException cfe) {
throw cfe;
} catch (Throwable t) {
throw new CalFacadeException(t);
}
}
Aggregations