The following code requires a steep learning curve around Java, Apache projects, iCal4j (a great calendaring toolkit for iCalendar) Spring, Spring DAO and Maven; and probably many more things. Look how straightforward the expression is though:
from(calendarEventEmailInboundEndpoint).to(
"bean:calendarAttachmentTranslator").to(
"bean:calendarEventTranslator").to(
"bean:calendarEventDAO?method=save");
The above Java code shows a Camel route that reads emails from a pop3 or imap inbox (depending on how calendarEventEmailInboundEndpoint is configured), extracts iCalendar attachments from one or more emails, translates the iCal4j representation into a model form for persistence, and finally persists the calendar event(s) in a database.
Pretty sophisticated stuff for 4 lines of code. :-)
No comments:
Post a Comment