Difference between revisions of "Codeunit/ContentPublic/PagePublicTokenBuilder"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
m (28 revisions imported)
 
(20 intermediate revisions by one other user not shown)
Line 1: Line 1:
ARTICLE IS INCOMPLETE
== What it does ==
Usage example: Lets external users resend tokens for data they should have access to.


== What it does ==
Builds a token for accessing records using configuration options and dynamic parameters. It requires a record that has a reference to an email, to whom the token will be sent.
Builds a token for accessing records using configuration options and dynamic parameters.


Multimode operation based on supplied parameters
Multimode operation based on supplied parameters
Line 10: Line 10:
#* Execute normally
#* Execute normally


Afterwards an email is sent to the user with a token for the record in question
The DataID of the record is collected by making a lookup on the email supplied (see: LookupSolution, LookupFieldName).
 
An email is then sent to the user with a token for the record in question


== How to invoke ==
== How to invoke ==
Make a http request:
Make a http request:
   main?command='''dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder'''
   main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder
 
  main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&AltToken=0
 
  main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&EmailMatch=foo@bar.com
 
  main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&AltToken=0&EmailMatch=foo@bar.com


The name of the following parameters are optional and configurable
* AltToken
* EmailMatch


== Configuration ==
== Configuration ==
If no interface ('''TokenInterface''') is specified the codeunit will allways exit without doing anything.
The codeunit has the following options
The codeunit has the following options


=== Options for the email input form ===
=== Options for the email input form ===
 
These options are required
* FormHeader: HTML before the form and resulting message
* FormHeader: HTML before the form and resulting message
* FormFooter: HTML after the form and resulting message  
* FormFooter: HTML after the form and resulting message  
Line 29: Line 42:
* FormReponseFailure: Message to user if email failed
* FormReponseFailure: Message to user if email failed


=== Options for building the token ===
These options are required
* EmailMatch: Name of http parameter for setting the email
* TokenInterface: Interface to build the token for
* LookupSolution: System name of the solution which the token is built for
* LookupFieldName: Field in solution where email of the user can be found


* LookupSolution:
These options are optional
* LookupFieldName:
* AltToken: Name of http parameter for selecting the alternative interface
* TokenInterface:  
* TokenInterfaceAlt: Interface used if the parameter '''AltToken''' is set to '''1'''
* TokenInterfaceAlt:  
 
 
* EmailHeader:
* EmailContent:


   
=== Options for the email message ===
* EmailMatch:  
These options are required
* AltToken:
* EmailHeader: Subject content
* EmailContent: Body of email


== Developer info ==
== Developer info ==
* Type: CodeunitPagecontentPublic
* Type: CodeunitPagecontentPublic
* Security: Public accces
* Security: Public accces (with some model restrictions)

Latest revision as of 11:51, 10 December 2021

What it does

Usage example: Lets external users resend tokens for data they should have access to.

Builds a token for accessing records using configuration options and dynamic parameters. It requires a record that has a reference to an email, to whom the token will be sent.

Multimode operation based on supplied parameters

  1. Email as parameter: Execute silently
  2. No email supplied:
    • Display form with email
    • Execute normally

The DataID of the record is collected by making a lookup on the email supplied (see: LookupSolution, LookupFieldName).

An email is then sent to the user with a token for the record in question

How to invoke

Make a http request:

 main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder
 main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&AltToken=0
 main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&EmailMatch=foo@bar.com
 main?command=dk.p2e.blanket.codeunit.common.PagePublicTokenBuilder&AltToken=0&EmailMatch=foo@bar.com

The name of the following parameters are optional and configurable

  • AltToken
  • EmailMatch

Configuration

If no interface (TokenInterface) is specified the codeunit will allways exit without doing anything.

The codeunit has the following options

Options for the email input form

These options are required

  • FormHeader: HTML before the form and resulting message
  • FormFooter: HTML after the form and resulting message
  • FormIntroduction: Help text displayed above the form
  • FormSubmitButton: Text on submit button
  • FormReponseSuccess: Message to user if email is sent succesfully
  • FormReponseFailure: Message to user if email failed

Options for building the token

These options are required

  • EmailMatch: Name of http parameter for setting the email
  • TokenInterface: Interface to build the token for
  • LookupSolution: System name of the solution which the token is built for
  • LookupFieldName: Field in solution where email of the user can be found

These options are optional

  • AltToken: Name of http parameter for selecting the alternative interface
  • TokenInterfaceAlt: Interface used if the parameter AltToken is set to 1

Options for the email message

These options are required

  • EmailHeader: Subject content
  • EmailContent: Body of email

Developer info

  • Type: CodeunitPagecontentPublic
  • Security: Public accces (with some model restrictions)