@Override public VToDo createComponent(PropertyList properties, ComponentList subComponents) { return new VToDo(properties, subComponents); } }
/** * {@inheritDoc} */ public final String toString() { return BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + getAlarms() + END + ':' + getName() + Strings.LINE_SEPARATOR; }
/** * @return the optional last-modified property */ public final LastModified getLastModified() { return getProperty(Property.LAST_MODIFIED); }
public void validate(final VToDo target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(ATTENDEE, target.getProperties()); Arrays.asList(DTSTAMP, ORGANIZER, UID).forEach( property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); Arrays.asList(CATEGORIES, CLASS, CREATED, DESCRIPTION, DTSTART, DUE, DURATION, GEO, LAST_MODIFIED, LOCATION, PERCENT_COMPLETE, PRIORITY, RESOURCES, RECURRENCE_ID, SEQUENCE, STATUS, SUMMARY, URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties())); ComponentValidator.assertNone(VALARM, target.getAlarms()); } }
for (VAlarm component : getAlarms()) { component.validate(recurse); getProperties()); getProperties()); Property.DTSTAMP, Property.DTSTART, Property.GEO, Property.LAST_MODIFIED, Property.LOCATION, Property.ORGANIZER, Property.PERCENT_COMPLETE, Property.PRIORITY, Property.RECURRENCE_ID, Property.SEQUENCE, Property.STATUS, Property.SUMMARY, Property.UID, Property.URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); final Status status = getProperty(Property.STATUS); if (status != null && !Status.VTODO_NEEDS_ACTION.getValue().equals(status.getValue()) && !Status.VTODO_COMPLETED.getValue().equals(status.getValue()) getProperties()); getProperties()); validateProperties();
public VToDo(boolean initialise) { super(VTODO); if (initialise) { getProperties().add(new DtStamp()); } }
/** * {@inheritDoc} */ public boolean equals(final Object arg0) { if (arg0 instanceof VToDo) { return super.equals(arg0) && Objects.equals(alarms, ((VToDo) arg0).getAlarms()); } return super.equals(arg0); }
/** * @return */ public static TestSuite suite() throws URISyntaxException { TestSuite suite = new TestSuite(); VToDo td = new VToDo(); suite.addTest(new VToDoTest("testIsCalendarComponent", td)); // iCalendar validation suite.addTest(new VToDoTest("testValidationException", td)); VToDo validTd = new VToDo(); validTd.getProperties().add(new Uid("12")); suite.addTest(new VToDoTest("testValidation", validTd)); // iTIP REPLY validation suite.addTest(new VToDoTest("testReplyValidationException", new VToDo())); VToDo replyTd = new VToDo(); replyTd.getProperties().add(new Attendee("mailto:jane@example.com")); replyTd.getProperties().add(new Organizer("mailto:joe@example.com")); replyTd.getProperties().add(new Uid("12")); suite.addTest(new VToDoTest("testReplyValidation", replyTd)); return suite; }
if(task.getUid()!=null) { note.setIcalUid(task.getUid().getValue()); if (task.getSummary() != null) { note.setDisplayName(StringUtils.substring(task.getSummary() .getValue(), 0, 1024)); if (task.getDescription() != null) { note.setBody(task.getDescription().getValue()); if (task.getDateStamp() != null) { note.setClientModifiedDate(task.getDateStamp().getDate()); Completed completed = task.getDateCompleted(); Status status = task.getStatus(); TriageStatus ts = note.getTriageStatus();
private void parseToDo(VToDo toDo) throws RDFParseException, RDFHandlerException, UnsupportedEncodingException { log.debug("parsing todo: {}", toDo.getUid()); Resource r_event; if(toDo.getUid() != null) { r_event = resolveURI(toDo.getUid().getValue()); } else { r_event = resolveURI(UUID.randomUUID().toString()); } Resource t_vevent = createURI(NS_ICAL + "Vtodo"); URI p_type = createURI(NS_RDF + "type"); rdfHandler.handleStatement(createStatement(r_event,p_type,t_vevent)); parseCalendarComponent(toDo,r_event); }
public void validate(final VToDo target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(ATTENDEE, target.getProperties()); Arrays.asList(DTSTAMP, ORGANIZER, SEQUENCE, UID).forEach( property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); Arrays.asList(CATEGORIES, CLASS, CREATED, DESCRIPTION, DTSTART, DUE, DURATION, GEO, LAST_MODIFIED, LOCATION, LOCATION, PERCENT_COMPLETE, PRIORITY, RECURRENCE_ID, RESOURCES, STATUS, URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties())); ComponentValidator.assertNone(VALARM, target.getAlarms()); } }
for (VAlarm component : getAlarms()) { component.validate(recurse); getProperties()); getProperties()); Property.DTSTAMP, Property.DTSTART, Property.GEO, Property.LAST_MODIFIED, Property.LOCATION, Property.ORGANIZER, Property.PERCENT_COMPLETE, Property.PRIORITY, Property.RECURRENCE_ID, Property.SEQUENCE, Property.STATUS, Property.SUMMARY, Property.UID, Property.URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, getProperties())); final Status status = getProperty(Property.STATUS); if (status != null && !Status.VTODO_NEEDS_ACTION.getValue().equals(status.getValue()) && !Status.VTODO_COMPLETED.getValue().equals(status.getValue()) getProperties()); getProperties()); validateProperties();
@Override public void execute(String input) { PropertyValidator.getInstance().assertOneOrLess(input, target.getProperties()); } });
/** * {@inheritDoc} */ public boolean equals(final Object arg0) { if (arg0 instanceof VToDo) { return super.equals(arg0) && Objects.equals(alarms, ((VToDo) arg0).getAlarms()); } return super.equals(arg0); }
if(task.getUid()!=null) { note.setIcalUid(task.getUid().getValue()); if (task.getSummary() != null) { note.setDisplayName(StringUtils.substring(task.getSummary() .getValue(), 0, 1024)); if (task.getDescription() != null) { note.setBody(task.getDescription().getValue()); if (task.getDateStamp() != null) { note.setClientModifiedDate(task.getDateStamp().getDate()); Completed completed = task.getDateCompleted(); Status status = task.getStatus(); TriageStatus ts = note.getTriageStatus();
/** * {@inheritDoc} */ public final String toString() { return BEGIN + ':' + getName() + Strings.LINE_SEPARATOR + getProperties() + getAlarms() + END + ':' + getName() + Strings.LINE_SEPARATOR; }
public void validate(final VToDo target) throws ValidationException { PropertyValidator.getInstance().assertOneOrMore(ATTENDEE, target.getProperties()); Arrays.asList(DTSTAMP, ORGANIZER, UID).forEach( property -> PropertyValidator.getInstance().assertOne(property, target.getProperties())); Arrays.asList(CATEGORIES, CLASS, CREATED, DESCRIPTION, DTSTART, DUE, DURATION, GEO, LAST_MODIFIED, LOCATION, PERCENT_COMPLETE, PRIORITY, RESOURCES, RECURRENCE_ID, SEQUENCE, STATUS, SUMMARY, URL).forEach(property -> PropertyValidator.getInstance().assertOneOrLess(property, target.getProperties())); ComponentValidator.assertNone(VALARM, target.getAlarms()); } }
for (VAlarm component : getAlarms()) { component.validate(recurse); getProperties()); getProperties()); final Status status = (Status) getProperty(Property.STATUS); if (status != null && !Status.VTODO_NEEDS_ACTION.getValue().equals(status.getValue()) && !Status.VTODO_COMPLETED.getValue().equals(status.getValue()) getProperties()); getProperties()); validateProperties();
@Override public VToDo createComponent(PropertyList properties, ComponentList subComponents) { return new VToDo(properties, subComponents); } }