QR and barcode
(Created page with "To get the functionality to generate QR codes in Turnkey follow this pattern: none|thumb|577x577px Add a class ZXing (this is the open source...")
 
No edit summary
Line 4: Line 4:


In the application (a returns and reclamation system) where this was used first we added a derived attribute like so:
In the application (a returns and reclamation system) where this was used first we added a derived attribute like so:
  QRCode: Blob , DerivationOcl = ZXing.QRImage(300,300,’<nowiki>https://reklamation.azurewebsites.net/MDriven/DisplayWithVariables?view=TestQRCodeFromVariable&id=$null$&vLopnummer=’+self.Lopnummer.asstring</nowiki>)
  QRCode: Blob , DerivationOcl = ZXing.QRImage(300,300,’https://reklamation.azurewebsites.net/MDriven/DisplayWithVariables?view=TestQRCodeFromVariable&id=$null$&vLopnummer=’+self.Lopnummer.asstring)
 
The Method must be marked with Tagged Value : Eco.ExternalLateBound = AnyValue
Let me explain the Ocl a bit:
Let me explain the Ocl a bit:


ZXing.QRImage(300,300, theUrl)  – this calls the static method QRImage on class ZXing, stating that the QRCode should be 300×300 pixels – in order for this to be legal in Ocl we must have the QRImage method marked as IsQuery.
ZXing.QRImage(300,300, theUrl)  – this calls the static method QRImage on class ZXing, stating that the QRCode should be 300×300 pixels – in order for this to be legal in Ocl we must have the QRImage method marked as IsQuery.

Revision as of 08:58, 2 August 2018

To get the functionality to generate QR codes in Turnkey follow this pattern:

2018-07-29 12h32 21.png

Add a class ZXing (this is the open source QR-code library we use, credits go to everyone involved in that). Add a static method with this signature QRImage(width:Integer; height:Integer; value:String):Image – and then you have access.

In the application (a returns and reclamation system) where this was used first we added a derived attribute like so:

QRCode: Blob , DerivationOcl = ZXing.QRImage(300,300,’https://reklamation.azurewebsites.net/MDriven/DisplayWithVariables?view=TestQRCodeFromVariable&id=$null$&vLopnummer=’+self.Lopnummer.asstring)
The Method must be marked with Tagged Value : Eco.ExternalLateBound = AnyValue

Let me explain the Ocl a bit:

ZXing.QRImage(300,300, theUrl)  – this calls the static method QRImage on class ZXing, stating that the QRCode should be 300×300 pixels – in order for this to be legal in Ocl we must have the QRImage method marked as IsQuery.

This page was edited 96 days ago on 02/10/2024. What links here