[[#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
- Define the identification mechanism. After all you must 'know' who
the recipient is, if you want to deliver personalized content.
- Define the roles you want to support
- Define the access mechanism for getting the personalized information
Steps to do:
- Derive subclasses of role and implement the Init method.
- 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("");"
" ..."
"}"
}
}]]
- 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
- [[#wd Lookup Recipe8 ]]: [[#wd Lookup TitleRecipe8 ]]
- [[#wd Lookup Recipe9 ]]: [[#wd Lookup TitleRecipe9 ]]