AU - type of AppUserpublic class PreferredViewComposite<AU extends AppUser> extends AppUserComposite<AU,PreferredViewComposite> implements NewSignupAction<AU>, EmailParamContributor<AU>
AppUserComposite that returns an optional preferred view for
AppUsers. This is when there are multiple flavours of an applications
sharing a database but we want to tie certain users to a certain view.
This is used to customise template email messages to the user.
If set the parameter prefered_view.default defines the view URL
(equivalent to service.saf.url that should be set for users created/signing-up).
This should normally only be set within the view in question.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PREFERRED_VIEW |
| Constructor and Description |
|---|
PreferredViewComposite(AppUserFactory<AU> fac) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
addDefaults(java.util.Map<java.lang.String,java.lang.Object> defaults)
Generate a set of default property values.
|
java.util.Set<java.lang.String> |
addOptional(java.util.Set<java.lang.String> optional)
generate the set of optional fields to be used to provide class specific defaults
in form creation/update.
|
void |
addParams(java.util.Map<java.lang.String,java.lang.String> params,
AU user) |
java.util.Map<java.lang.String,Selector> |
addSelectors(java.util.Map<java.lang.String,Selector> selectors)
Get a Map of selectors to use for forms of this type.
|
java.util.Set<java.lang.String> |
addSuppress(java.util.Set<java.lang.String> suppress)
generate the class specific set of suppressed fields to be used in form creation/update
The individual forms can override these so you usually use this method to define fields that should
be suppressed in all forms.
|
java.util.Map<java.lang.String,java.lang.String> |
addTranslations(java.util.Map<java.lang.String,java.lang.String> labels)
return a default set of translation between field names and text labels.
|
PreferedView |
getDefaultView() |
PreferedView |
getPreferredView(AU person) |
protected java.lang.Class<? super PreferredViewComposite> |
getType()
Returns the type the composite should be registered under.
|
PreferedViewFactory |
getViewFactory() |
TableSpecification |
modifyDefaultTableSpecification(TableSpecification spec,
java.lang.String table)
Modify the
TableSpecification of the target factory. |
void |
newSignup(AU user) |
void |
setPreferredView(AU person,
PreferedView c) |
void |
setRegions(TemplateFile template,
AU user) |
addFieldHelp, customiseForm, customiseUpdateForm, getContext, getFactory, getLogger, getRecord, getRepository, postUpdate, preRegister, release, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddFieldConstraints, addFormFieldspublic static final java.lang.String PREFERRED_VIEW
public PreferredViewComposite(AppUserFactory<AU> fac)
public PreferedViewFactory getViewFactory()
protected java.lang.Class<? super PreferredViewComposite> getType()
CompositegetType in class Composite<AU extends AppUser,PreferredViewComposite>public TableSpecification modifyDefaultTableSpecification(TableSpecification spec, java.lang.String table)
TableStructureContributerTableSpecification of the target factory.modifyDefaultTableSpecification in interface TableStructureContributer<AU extends AppUser>modifyDefaultTableSpecification in class Composite<AU extends AppUser,PreferredViewComposite>public java.util.Map<java.lang.String,java.lang.String> addTranslations(java.util.Map<java.lang.String,java.lang.String> labels)
TableStructureContributeraddTranslations in interface TableStructureContributer<AU extends AppUser>addTranslations in class Composite<AU extends AppUser,PreferredViewComposite>Mappublic java.util.Set<java.lang.String> addOptional(java.util.Set<java.lang.String> optional)
TableStructureContributeraddOptional in interface TableStructureContributer<AU extends AppUser>addOptional in class Composite<AU extends AppUser,PreferredViewComposite>Setpublic java.util.Set<java.lang.String> addSuppress(java.util.Set<java.lang.String> suppress)
TableStructureContributeraddSuppress in interface TableStructureContributer<AU extends AppUser>addSuppress in class Composite<AU extends AppUser,PreferredViewComposite>Set of fields to suppress in forms.public java.util.Map<java.lang.String,Selector> addSelectors(java.util.Map<java.lang.String,Selector> selectors)
TableStructureContributeraddSelectors in interface TableStructureContributer<AU extends AppUser>addSelectors in class Composite<AU extends AppUser,PreferredViewComposite>Map of modified selectors/inputspublic PreferedView getPreferredView(AU person)
public void setPreferredView(AU person, PreferedView c)
public java.util.Map<java.lang.String,java.lang.Object> addDefaults(java.util.Map<java.lang.String,java.lang.Object> defaults)
TableStructureContributeraddDefaults in interface TableStructureContributer<AU extends AppUser>addDefaults in class Composite<AU extends AppUser,PreferredViewComposite>Map of default valuespublic PreferedView getDefaultView()
public void newSignup(AU user) throws java.lang.Exception
newSignup in interface NewSignupAction<AU extends AppUser>java.lang.Exceptionpublic void addParams(java.util.Map<java.lang.String,java.lang.String> params,
AU user)
addParams in interface EmailParamContributor<AU extends AppUser>public void setRegions(TemplateFile template, AU user)
setRegions in interface EmailParamContributor<AU extends AppUser>