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
| Property | Returns | Description |
|---|---|---|
| instanceId | 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. |
| roles | List<Role> | Roles this application registers: the voucher redeemer and voucher supervisor roles. |
| voucherTypes | List<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.
| Parameter | Description |
|---|---|
pb | the 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.
| Parameter | Description |
|---|---|
ur | the 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.
| Parameter | Description |
|---|---|
profile | the 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.
| Parameter | Description |
|---|---|
rf | the root folder used to render the voucher page |
website | the website the voucher belongs to |
v | the 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.