Model Examples
No edit summary
No edit summary
Line 77: Line 77:
=== Outgoing Email Queue ===
=== Outgoing Email Queue ===
Model pattern that adds a outgoing email queue to the standard base model.
Model pattern that adds a outgoing email queue to the standard base model.
A seeker view enables you to search for queued or sent emails and an emial detail view for changing the queued emails.
A seeker view enables you to search for queued or sent emails and an email detail view for changing the queued emails.


Includes two serverside viewmodels, one that sends the emails and one that cleans up sent emails.
Includes two serverside viewmodels, one that sends the emails and one that cleans up sent emails.

Revision as of 21:13, 25 July 2020

Introduction to Examples and merge

This page describe merge in models - if you rather would use model+data="a complete system" to apply to a existing turnkey site look here Example_Gist.

Examples that you can merge into your empty or not complete model in order to get some functionality

2020-05-30 19h00 48.png

or/and :

2020-05-30 19h02 13.png
What happens when you merge another modlr file?
  1. If the merged file use some class name that you already use - the content of the classes is copied from the merged file to the class you already had - the incoming class is discarded to avoid doublet
  2. If the merged file use the same package name as you already have in your model - the content from the merged file is moved into your package
  3. If you the merged file use some viewmodel-names you already have - they are skipped - if new viewmodels are found they are added
  4. If you have the same diagram name - the diagrams are merged to avoid doublets.
  5. If the merged had some AssetsTK - it is merged to your AssetsTK increasing it or updating it

SysUserAuthentication - important architectural pattern

This example adds the SysSingleton and SysUser classes needed to enable login and authentication in Turnkey systems

2020-05-30 19h31 20.png

Download SysUserAuthentication - once downloaded do "open merge add" from the model you want to extend.

Password reset sample - important architectural pattern

There's no build in password reset functionality in Turnkey. This is because if we had one, it would probably not fit you anyway.

Instead, you add this functionality to your model and are then free to integrate and adapt it as you feel needed.

If you use the default package for login, the ASPNETIdentity package, this package will just extend you model with the following;

  1. A reset password page that you can create an action to go to. This page should be without any access groups.
  2. A server side viewmodel that runs every 20 seconds and sends emails with reset instructions to your users. Remember to set the Turnkey/MDrivenServer's email server settings.
  3. A page for the user to set the password. This page also has information to the user about expired reset tickets and sending a new ticket in those circumstances.

You import this template and then you;

  1. Set the PasswordReset package's "Default superclass" if you want that.
  2. Make sure you have email server set up.
  3. Create an action that opens the "RestetPasswordPage" viewmodel.

Download the model file here: PasswordResetTemplate.modlr

Password reset model sample.png

Consume and Purchase GetPaid#1

This model extends your system with an ability to charge the end-user for services you provide. The user will be treated as a SysConsumer in portal - and you can charge the SysConsumer with a Credit card and you can let the SysConsumer consume your services with a simple call in your local model.Download ChargeEndUserViaMDrivenPortalService.modlr :

2020-05-31 12h01 07.png

PayPal-Checkout GetPaid#2

As an alternative method to get paid from a user you can integrate PayPal. You will need a PayPal account and register as a developer. Once there you register your app and get a ClientID - you paste this ClientID into this viewmodel and you are all set. PayPalCheckout.modlr

2020-07-20 12h48 44.png
2020-07-20 12h50 01.png

SVG - Move boxes around

In this example we create objects represented by SVG graphic - that reacts to mouse events so that they be moved around and saved.

2020-05-31 17h14 29.png

Download it here: SvgInteractionMoveBoxesAround.modlr

Google map to show and update positions

The example shows how to place a marker on a google map, how to track the setting of the map, how to move the marker. For production you will need your own api key from google.

2020-05-31 19h31 33.png

Download the file here: GoogleMapWithMarkers.modlr

A Trello like board with cards you move between lists

Kanban boards can be used to many things. Move cards between list - klick up a card - add new cards etc.

2020-05-31 22h59 58.png

Download the file here: TrelloLikeBoard.modlr

Localization and Translation - important architectural pattern

MDriven systems can adhere to a model pattern and use that to store translations to all texts in actions and ViewModels. There is also ocl operators (Translate) that work on data according to this pattern.

2020-06-17 15h43 02.png

Translations.modlr

Theme builder - build theme in runtime

You can easily set CSS variables to influence colors and sizes of the UI. To try different settings out in runtime you can merge this model section:

2020-06-22 18h49 08.png
2020-06-22 18h49 22.png

ThemeBuilder.modlr , also see Theme as data

SysAsyncTicket - important architectural pattern

SysAsyncTicket is a model pattern described here AsyncTicket, it is recognized by the MDrivenServer and helps you easily do stuff in the background

2020-06-30 20h04 31.png

SysAsyncTicketMergeModel.modlr

Outgoing Email Queue

Model pattern that adds a outgoing email queue to the standard base model. A seeker view enables you to search for queued or sent emails and an email detail view for changing the queued emails.

Includes two serverside viewmodels, one that sends the emails and one that cleans up sent emails.

OutgoingEmailQueue.modlr

Notes to admin

The files uploaded here are maintained here SVN\source\Ideas\WikiPublishedModelExamples , read NOTESTOADMIN.txt in that location

In order to create a direct download link use syntax like this:Special:Redirect/file/Företag.modlr

This is how the link should be formed: https://www.mediawiki.org/wiki/Help:Linking_to_files

This page was edited 140 days ago on 11/09/2023. What links here