public class FieldNameFinder<AU extends AppUser,F extends FieldNameFinder> extends AppUserNameFinder<AU,F> implements HistoryFieldContributor
AppUserNameFinder
that stores the name in a database field.
This composite can be used directly with the realm-name set from the construction tag of the composite. However only one
composite of this exact type can exist in a factory so trivial sub-classes are needed to install more than one FieldNameFinder
,
Because WebNameFinder
is already a sub-class you can install a FieldNameFinder
and a WebNameFinder
without problems.
Configuration parameters:
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
PROPERTY_PREFIX |
Constructor and Description |
---|
FieldNameFinder(AppUserFactory factory,
java.lang.String realm) |
Modifier and Type | Method and Description |
---|---|
boolean |
active()
Checks if sufficient database fields exist to use this
AppUserNameFinder
An inactive finder still modifies the table specification but won't be retreivable as a realm. |
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.
|
void |
addToHistorySpecification(TableSpecification spec)
add fields to the history table default specification.
|
java.util.Map<java.lang.String,java.lang.String> |
addTranslations(java.util.Map<java.lang.String,java.lang.String> translations)
return a default set of translation between field names and text labels.
|
void |
customiseForm(Form f)
Extension hook to allow additional Form customisation generic to all
types of Form (create and update) For example adding a FormValidator .
|
void |
customiseUpdateForm(Form f,
AU target,
SessionService operator)
Extension hook to allow additional Form customisation specific to the update
of an existing object.
|
protected int |
defaultFieldLength()
default filed length when creating table.
|
java.lang.String |
getCanonicalName(AU object)
Get a canonical name of an object in a format that can be parsed by the
ParseFactory.findFromString(String) method. |
java.lang.String |
getNameLabel()
Get a user presented label asking for the login name of the supported type.
|
SQLFilter |
getStringFinderFilter(java.lang.Class target,
java.lang.String name)
get a filter than locates the target object from a String.
|
TableSpecification |
modifyDefaultTableSpecification(TableSpecification spec,
java.lang.String table)
Modify the
TableSpecification of the target factory. |
protected java.lang.String |
normalizeName(java.lang.String name)
If there are varient forms of the names this normalises the name to the form stored in the database
|
void |
setName(AU user,
java.lang.String name)
Set the name of an object for this realm (If supported)
|
protected boolean |
userSet() |
boolean |
userVisible()
Is this a name we might expect the user to know or an internal generated id.
|
findFromString, getAllNames, getDataCache, getRealm, getType, toString, validateName, verified
addDefaults, addFieldHelp, addOptional, addSelectors, getContext, getFactory, getLogger, getRecord, getRepository, postUpdate, preRegister, release
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFieldConstraints, addFormFields
protected static final java.lang.String PROPERTY_PREFIX
public FieldNameFinder(AppUserFactory factory, java.lang.String realm)
factory
- realm
- public java.lang.String getCanonicalName(AU object)
ParseFactory
ParseFactory.findFromString(String)
method.getCanonicalName
in interface ParseFactory<AU extends AppUser>
protected java.lang.String normalizeName(java.lang.String name)
name
- public java.lang.String getNameLabel()
AppUserNameFinder
getNameLabel
in class AppUserNameFinder<AU extends AppUser,F extends FieldNameFinder>
public SQLFilter getStringFinderFilter(java.lang.Class target, java.lang.String name)
AppUserNameFinder
AppUserNameFinder.findFromString(String)
getStringFinderFilter
in class AppUserNameFinder<AU extends AppUser,F extends FieldNameFinder>
public boolean userVisible()
AppUserNameFinder
userVisible
in class AppUserNameFinder<AU extends AppUser,F extends FieldNameFinder>
public TableSpecification modifyDefaultTableSpecification(TableSpecification spec, java.lang.String table)
TableStructureContributer
TableSpecification
of the target factory.modifyDefaultTableSpecification
in interface TableStructureContributer<AU extends AppUser>
modifyDefaultTableSpecification
in class Composite<AU extends AppUser,F extends FieldNameFinder>
protected int defaultFieldLength()
public void addToHistorySpecification(TableSpecification spec)
HistoryFieldContributor
addToHistorySpecification
in interface HistoryFieldContributor
public java.util.Map<java.lang.String,java.lang.String> addTranslations(java.util.Map<java.lang.String,java.lang.String> translations)
TableStructureContributer
addTranslations
in interface TableStructureContributer<AU extends AppUser>
addTranslations
in class Composite<AU extends AppUser,F extends FieldNameFinder>
Map
public java.util.Set<java.lang.String> addSuppress(java.util.Set<java.lang.String> suppress)
TableStructureContributer
addSuppress
in interface TableStructureContributer<AU extends AppUser>
addSuppress
in class Composite<AU extends AppUser,F extends FieldNameFinder>
Set
of fields to suppress in forms.protected boolean userSet()
public void customiseUpdateForm(Form f, AU target, SessionService operator)
TableStructureContributer
TableStructureContributer.customiseForm(Form)
customiseUpdateForm
in interface TableStructureContributer<AU extends AppUser>
customiseUpdateForm
in class Composite<AU extends AppUser,F extends FieldNameFinder>
public void customiseForm(Form f)
TableStructureContributer
TableStructureContributer.customiseUpdateForm(Form, DataObject, SessionService)
customiseForm
in interface TableStructureContributer<AU extends AppUser>
customiseForm
in class Composite<AU extends AppUser,F extends FieldNameFinder>
f
- Form to modifypublic void setName(AU user, java.lang.String name)
AppUserNameFinder
setName
in class AppUserNameFinder<AU extends AppUser,F extends FieldNameFinder>
public boolean active()
AppUserNameFinder
AppUserNameFinder
An inactive finder still modifies the table specification but won't be retreivable as a realm.active
in class AppUserNameFinder<AU extends AppUser,F extends FieldNameFinder>