Electronic ID Configuration
In order to generate Electronic ID, an appropriate JSON file should be uploaded into the template as an Electronic ID file type.
IDcard.json (file)
{
"style":"event ticket",
"expirationDate":"3105",
"logo_text":"TEST",
"colors":{
"background_color":"#FFFFFF",
"foreground_color":"#000000",
"label_color":"#000000"
},
"images":{
"logo_path":"#{cometPictureService.getActiveFilePath(idCardTemplate,conf.getLong('app.IDCardTemplate.electronicID.logoFileType',tenant),tenant)}",
"thumbnail_path":"#{cometPictureService.getFilePathOfPhotoBasedOnRegistration(be,tenant)}",
"icon_path":"#{cometPictureService.getActiveFilePath(idCardTemplate,conf.getLong('app.IDCardTemplate.electronicID.iconFileType',tenant),tenant)}",
"footer_path":"#{cometPictureService.getActiveFilePath(idCardTemplate,conf.getLong('app.IDCardTemplate.electronicID.footerFileType',tenant),tenant)}"
},
"content":{
"headerFields":[
{
"key":"ID",
"label":"#{msg.getString('label.id')}",
"value":"#{be.person.id}"
}
],
"primaryFields":[
{
"key":"Name",
"label":"#{msg.getString('label.name')}",
"value":"#{be.person.nameFull}"
}
],
"secondaryFields":[
{
"key":"Organization",
"label":"#{msg.getString((be.organization.type.parent!=null and be.organization.type.parent.id==conf.getLong('app.organizationType.club.id'))?'label.club':'label.organization')}",
"value":"#{be.organization.mainName}"
}
],
"auxiliaryFields":[
{
"key":"Role",
"label":"#{msg.getString('label.role')}",
"value":"#{msg.getString(idCardTemplate.subRegistrationType!=null?idCardTemplate.subRegistrationType.nameKey:(be.type.parent!=null?be.type.parent.nameKey:be.type.nameKey))}"
},
{
"key":"Age category",
"label":"#{msg.getString('label.category')}",
"value":"#{be.person.getPersonAge() > 15 ? 'Adult' : 'Junior'}"
},
{
"key":"Date of registration",
"label":"#{msg.getString('label.registration.dateFrom2')}",
"value":"#{util.formatDate(be.dateFrom, conf.getString('app.dateFormat', tenant))}"
}
],
"backFields":[
{
"key":"Id",
"label":"#{msg.getString('label.id')}",
"value":"#{be.person.id}"
},
{
"key":"Name",
"label":"#{msg.getString('label.name')}",
"value":"#{be.person.getNameFull()}"
},
{
"key":"Date of birth",
"label":"#{msg.getString('label.dateOfBirth')}",
"value":"#{util.formatDate(be.person.dateOfBirth, conf.getString('app.dateFormat', tenant))}"
},
{
"key":"Organization",
"label":"#{msg.getString((be.organization.type.parent!=null and be.organization.type.parent.id==conf.getLong('app.organizationType.club.id'))?'label.club':'label.organization')}",
"value":"#{be.organization.mainName}"
},
{
"key":"Date of registration",
"label":"#{msg.getString('label.registration.dateFrom2')}",
"value":"#{util.formatDate(be.dateFrom, conf.getString('app.dateFormat', tenant))}"
}
]
}
}
2. IDcard2.json (file)
If you want to print the logo of registration's organization (dynamic - depends on the organization) rather than uploaded the logo to the template (static - always the same for template), use this for "logo_path" under "images" in JSON:
"logo_path":"#{cometPictureService.getLogoPath(be.organization)}"
2. If you want to add information about the last active title/license of the registration, add this snippet to "auxiliary fields" or "backFields":
{
"key":"Title/license",
"label":"#{msg.getString('label.title.Referee')}",
"value":"#{cometTitleLicenseService.findPersonLastActiveTitle(idCardTemplate.registrationType.id,be.person,tenant)!=null?msg.getString(cometTitleLicenseService.findPersonLastActiveTitle(idCardTemplate.registrationType.id,be.person,tenant).configuration.titleLicenseType.nameKey):}"
}
3. If you want to print age category which is set on registration rather than using hard-coded text, use:
{
"key":"Age category",
"label":"#{msg.getString('label.category')}",
"value":"#{msg.getString(be.category.name)}"
}
For more info please contact your KAM or Analyticom Support team