/** * {@inheritDoc} */ public String toString() { return BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + END + ':' + getName() + Strings.LINE_SEPARATOR; }
/** * gets master component. * @param components The component list. * @return The component. */ private Component getMasterComponent(ComponentList<? extends Component> components) { Iterator<? extends Component> it = components.iterator(); while(it.hasNext()) { Component c = it.next(); if(c.getProperty(Property.RECURRENCE_ID)==null) { return c; } } throw new IllegalArgumentException("no master found"); }
public static Component copyComponent(Component comp) { try { return comp.copy(); } catch (Exception e) { throw new CosmoException("error copying component: " + comp, e); } }
/** * Convenience method for retrieving a named property. * * @param name name of the property to retrieve * @return the first matching property in the property list with the specified name */ public final <T extends Property> T getProperty(final String name) { return (T) getProperties().getProperty(name); }
final PropertyList pl = val.getProperties(); boolean vpoll = false; } else { throw new CalFacadeException("org.bedework.invalid.component.type", val.getName()); } else if (evinfo.getEvent().getEntityType() != entityType) { throw new CalFacadeException("org.bedework.mismatched.entity.type", val.toString()); Component valCopy = val.copy(); prop = valCopy.getProperty(Property.DESCRIPTION); if (prop != null) { prop.setValue(null); prop = valCopy.getProperty(Property.ATTACH); new BwXproperty(BwXproperty.bedeworkIcal, null, valCopy.toString()));
while (i.hasNext()) { result = i.next(); Property xProperty = result.getProperty(workEffortIdXPropName); if (xProperty != null && workEffortId.equals(xProperty.getValue())) { newComponent = false; break; Property uid = result.getProperty(Uid.UID); if (uid != null && uid.getValue().equals(workEffortUid)) { newComponent = false; components.add(result); PropertyList componentProps = result.getProperties(); loadWorkEffort(componentProps, workEffort); if (isTask) { result.validate(true); Debug.logVerbose("iCalendar component passes validation", module); } catch (ValidationException e) {
final Uid uid = (Uid) c.getProperty(Property.UID); for (final Iterator j = c.getProperties().iterator(); j.hasNext();) { final Property p = (Property) j.next(); final TzId tzid = (TzId) p.getParameter(Parameter.TZID);
Component masterCopy = null; try { masterCopy = master.copy(); } catch (Exception e) { throw new CosmoException("Error copying master component", e); masterCopy.getProperties().iterator(); while (i.hasNext()) { Property prop = i.next(); try { copy = instance.getComp() == master ? masterCopy.copy() : instance.getComp().copy(); componentToUTC(copy); } catch (URISyntaxException | ParseException | IOException e) { RecurrenceId rid = (RecurrenceId) copy.getProperties() .getProperty(Property.RECURRENCE_ID); if (rid != null) { copy.getProperties().remove(rid); copy.getProperties().add(rid); copy.getProperties().getProperty(Property.DTSTART); if (olddtstart != null) { copy.getProperties().remove(olddtstart); copy.getProperties().add(newdtstart);
/** * Perform validation on a component and its properties. * * @throws ValidationException where the component is not in a valid state */ public final void validate() throws ValidationException { validate(true); }
String summary = vevent.getProperty(SUMMARY).getValue(); if(summary.equals(eventSummary)) { PeriodList list = vevent.calculateRecurrenceSet(period); for(Object p : list) { DateTime date = ((Period) p).getStart();
// Reading the file and creating the calendar CalendarBuilder builder = new CalendarBuilder(); Calendar cal = null; try { cal = builder.build(new FileInputStream("my.ics")); } catch (IOException e) { e.printStackTrace(); } catch (ParserException e) { e.printStackTrace(); } // Create the date range which is desired. DateTime from = new DateTime("20100101T070000Z"); DateTime to = new DateTime("20100201T070000Z");; Period period = new Period(from, to); // For each VEVENT in the ICS for (Object o : cal.getComponents("VEVENT")) { Component c = (Component)o; PeriodList list = c.calculateRecurrenceSet(period); for (Object po : list) { System.out.println((Period)po); } }
/** * Test component. * @param comp The component. * @return The result of this test. */ public boolean testComponent(Component comp) { return componentName.equalsIgnoreCase(comp.getName()); }
final Component comp = (Component)it.next(); final String pollItem = comp.toString(); event.addPollItem(pollItem); final Property p = comp.getProperty(Property.POLL_ITEM_ID);
/** * {@inheritDoc} */ public final String toString() { final StringBuilder buffer = new StringBuilder(); for (final T c : this) { buffer.append(c.toString()); } return buffer.toString(); }
/** * Convenience method for retrieving a list of named properties. * * @param name name of properties to retrieve * @return a property list containing only properties with the specified name */ public final <C extends Property> PropertyList<C> getProperties(final String name) { return getProperties().getProperties(name); }
Component masterCopy = null; try { masterCopy = master.copy(); } catch (Exception e) { throw new CosmoException("Error copying master component", e); masterCopy.getProperties().iterator(); while (i.hasNext()) { Property prop = i.next(); try { copy = instance.getComp() == master ? masterCopy.copy() : instance.getComp().copy(); componentToUTC(copy); } catch (URISyntaxException | ParseException | IOException e) { RecurrenceId rid = (RecurrenceId) copy.getProperties() .getProperty(Property.RECURRENCE_ID); if (rid != null) { copy.getProperties().remove(rid); copy.getProperties().add(rid); copy.getProperties().getProperty(Property.DTSTART); if (olddtstart != null) { copy.getProperties().remove(olddtstart); copy.getProperties().add(newdtstart);
/** * Perform validation on a component. * @param recurse indicates whether to validate the component's properties * @throws ValidationException where the component is not in a valid state */ public abstract void validate(final boolean recurse) throws ValidationException;
String summary = vevent.getProperty(SUMMARY).getValue(); if(summary.equals(eventSummary)) { PeriodList list = vevent.calculateRecurrenceSet(period); for(Object p : list) { DateTime date = ((Period) p).getStart();
final PeriodList recurrenceSet = component.calculateRecurrenceSet(period); return (!recurrenceSet.isEmpty());
/** * Test component. * @param comp The component. * @return The result of this test. */ public boolean testComponent(Component comp) { return componentName.equalsIgnoreCase(comp.getName()); }