Kademi application that adds gift voucher issuing and redemption to the account. Registered in apps.xml under the instance id "vouchersApp" and reached from templates and other app code via the current application registry. Contributes voucher-related menu items and dashboard portlets, issues vouchers automatically when a linked product is purchased, supplies merge fields for voucher details in content, backs up and restores voucher type configuration, contributes voucher journey builder nodes, and registers the voucher redeemer and voucher supervisor roles.

Implements: Application, MenuApplication, BrowsableApplication, ChildPageApplication, PortletApplication, ReportingApplication, RelatedProductApplication, DependentApplication, JourneyBuilderApplication, BackupableApplication, FieldProviderApplication, ManageProfileApplication, TableUploadApplication, SearchableApplication


Properties

PropertyReturnsDescription
instanceIdStringUnique identifier this application is registered under, always "vouchersApp". Used to look up this application's instance and its stored backup and restore configuration.
rolesList<Role>Roles this application registers: the voucher redeemer and voucher supervisor roles.
voucherTypesList<VoucherType>Looks up all voucher types configured for the current organisation. Performs a database query against the current root folder's organisation.

Methods

getInstanceId()

Returns: String

Unique identifier this application is registered under, always "vouchersApp". Used to look up this application's instance and its stored backup and restore configuration.

getRoles()

Returns: List<Role>

Roles this application registers: the voucher redeemer and voucher supervisor roles.

getVouchersForUser(ProfileBean pb)

Returns: List<VoucherBean>

Looks up the vouchers allocated to the given profile within the current organisation.

ParameterDescription
pbthe profile bean wrapping the profile to look up vouchers for

getVouchersForUser(UserResource ur)

Returns: List<VoucherBean>

Looks up the vouchers allocated to the profile behind the given user resource, within the current organisation.

ParameterDescription
urthe user resource whose profile the vouchers are looked up for

getVouchersForUser(Profile profile)

Returns: List<VoucherBean>

Looks up the vouchers allocated to the given profile within the current organisation. Performs a database query against the current root folder's organisation.

ParameterDescription
profilethe profile to look up vouchers for

generateVoucherPdf(RootFolder rf, Website website, Voucher v)

Returns: String

Renders the given voucher as a PDF and uploads it to the virtual file store, returning the content hash of the stored file. Used to attach a printable voucher to the order that generated it.

ParameterDescription
rfthe root folder used to render the voucher page
websitethe website the voucher belongs to
vthe voucher to render as a PDF

getVoucherTypes()

Returns: List<VoucherType>

Looks up all voucher types configured for the current organisation. Performs a database query against the current root folder's organisation.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.