[[#wd Lookup TitleRecipe11 ]]

Overview

This recipe describes how you deliver personalized information on webpages with COAST. It is assumed that you are familiar with the basic elements of the COAST environment (e.g. roles, pages, renderers etc.)

Preconditions

Steps to do:

  1. Derive subclasses of role and implement the Init method.

  2. Load the personalized information in MyRole::Init and make it available in the role store. Use the same tags for the entry in the roleStore as later in Lookup.
    Sample:
    [[#wd DisplayAnythingRenderer {
    	/AnythingInfo {
    		"bool MyRole::Init(Context &c)"
    		"{"
    		"	Anything fields = c.GetQuery()["fields"];"
    		"	Anything roleStore= GetStore();"
    		"	"
    		"	// store the personel Information in the role store"
    		"	roleStore["UserName"] = fields["resultLoginName"].AsString("");"
    		"	..."
    		"}"
    	}
    }]]
    
  3. Define your page templates containing renderers that use information comming from the roleStore Anything.
    Sample:
    [[#wd DisplayAnythingRenderer {
    	/AnythingInfo {
    		"..."
    		"Hello Dear [[#wd Lookup UserName ]]"
    		"..."
    	}
    }]]
    

Remarks

Stores used: RoleStore.
Renderers used: ContextLookupRenderer

Glossary

Related Topics