personal information manager stuff, ie. VCard and VCalendar
VCard
builder class
$vCard = PIM.VCard.new()
// set properties
$vCard.firstName := "Eric"
$vCard.middleName := ""
$vCard.lastName := "Marchand"
$vCard.organization := "4D"
$vCard.photo.attachFromUrl("https://avatars.githubusercontent.com/u/59135882?v=4"; "JPEG")
$vCard.workPhone := "312-555-1212"
$vCard.title := "Software Developer"
$vCard.url := "https://github.com/mesopelagique"
$vCard.note := "Notes on Eric"
$vCard.saveToFile(Folder(...).file("eric-marchand.vcf"))
$text:=$vCard.getText()
$vCard.webSend("eric-marchand.vcf")
Instead of using url you could embedded images
$vCard.photo.embedFromFile(File("/path/to/file.png"))
$vCard.logo.embedFromFile(File("/path/to/file.png"))
$vCard.photo.embedFromString("iVBORw0KGgoAAAANSUhEUgAAA2..."; "image/png"')
$vCard.logo.embedFromString("iVBORw0KGgoAAAANSUhEUgAAA2..."; "image/png")
// multiple email entry
$vCard.email := New collection(\
"e.marchand@emailhost.tld";\
"e.marchand@emailhost2.tld";\
"e.marchand@emailhost3.tld"\
)
// multiple cellphone
$vCard.cellPhone := New collection(\
"312-555-1414";\
"312-555-1415";\
"312-555-1416"\
)
VCalendar builder class
$calendar = PIM.VCalendar.new()
TODO
$text:=$calendar.getText()
$calendar.webSend("eric-marchand.ics")
To do unit test, this component use expect BDD/TDD component as git submodule in Components
When opening this database, the test component expect will be compiled by onStartUp
method with the new v19 Compile project command.
💡 If you have issue with previous version of 4D, just remove "expect" component, and test files like test_pim
🌏 To test web, you could also launch the web server and do any request on it, a vcard will be downloaded, vcard produced by test_web
- Fix format VCard bugs, seems to not import well with macOS calendar app
- Implement calendar event formatting
- Parse VCard (partially implemented in
_parse
or_parseFile
but not enough file tested) - Parse VCalendar
If you run a business and you’re using one of my projects in a revenue-generating product, it makes business sense to sponsor this open source development
Thank you for your support!
- vcard: very inspired from js library https://github.com/enesser/vCards-js