F
- type of DynamicFormManager.DynamicForm
public class DynamicFormManager<F extends DynamicFormManager.DynamicForm> extends PartOwnerFactory<F> implements ParseFactory<F>, TransitionFactoryCreator<TransitionFactory>, ServeDataProducer
DynamicFormManager.DynamicForm
instance represents a single version of
a muti-section questionnaire that will be presented to a user.
DynamicFormManager.DynamicForm
s are edited and dynamically but need to be frozen to generate a fixed
structure before being presented to users. New versions can still be constructed by copying
a frozen form.
All support classes and TransitionFactory
s used to handle the forms produced by this factory
are generated from here wither via getChildManager()
or getTransitionProvider(String)
table names are derived from the table used by this class. Therefore by sub-classing with a new table-name
an entirely distinct set of support tables will be generated.
Modifier and Type | Class and Description |
---|---|
static class |
DynamicFormManager.DynamicForm |
static class |
DynamicFormManager.Status |
DataObjectFactory.AbstractDataObjectInput, DataObjectFactory.AbstractFinder<X>, DataObjectFactory.DataObjectAcceptFilter, DataObjectFactory.DataObjectInput, DataObjectFactory.DataObjectIntegerInput, DataObjectFactory.DestAcceptFilter<T extends DataObject>, DataObjectFactory.FilterAdapter, DataObjectFactory.FilterCounter, DataObjectFactory.FilterExists, DataObjectFactory.FilterIterator, DataObjectFactory.FilterSelector, DataObjectFactory.FilterSet, DataObjectFactory.Finder, DataObjectFactory.MakeRemoteFilterVisitor<R extends DataObject>, DataObjectFactory.MatchFilter, DataObjectFactory.ReferencedAdapter<I extends Indexed>, DataObjectFactory.ReferenceIterator<I extends Indexed>, DataObjectFactory.SortingDataObjectInput, DataObjectFactory.TimeAcceptFilter<T extends DataObject>, DataObjectFactory.TimeFilter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FORM_TAG |
static java.lang.String |
NAME_FIELD |
static java.lang.String |
PART_TAG |
static java.lang.String |
VALIDATING_VISITOR_FIELD |
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
TYPE_SEPERATOR
DEFAULT_SERVE_DATA_TAG
Constructor and Description |
---|
DynamicFormManager(AppContext conn,
java.lang.String homeTable) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEdit(SessionService<?> sess)
Is the specified person allowed to perform targetless operations.
|
F |
duplicate(F original,
java.lang.String name) |
F |
findFromString(java.lang.String name)
Find an existing entry by name.
|
FilterResult<F> |
getActive() |
BaseFilter<F> |
getActiveFilter() |
java.lang.String |
getCanonicalName(F object)
Get a canonical name of an object in a format that can be parsed by the
ParseFactory.findFromString(String) method. |
PageManager |
getChildManager()
Get the
PartManager for the next level of
the hierarchy. |
java.lang.String |
getChildTypeName()
get the type-name for the child type.
|
MimeStreamData |
getData(SessionService user,
java.util.List<java.lang.String> path)
Get a MimeStreamData corresponding to the data to be served
This method also implements access control and returns null if access is denied.
|
protected TableSpecification |
getDefaultTableSpecification(AppContext c,
java.lang.String table)
Get the default table specification if the table is to be created.
|
java.lang.String |
getDownloadName(SessionService user,
java.util.List<java.lang.String> path)
get a download file-name to be added to a download link.
|
DynamicFormTransitionProvider<F> |
getDynamicFormProvider() |
SQLValueFilter<F> |
getNameFilter(java.lang.String name) |
FilterResult<F> |
getNew() |
SQLFilter<F> |
getNewFilter() |
protected java.util.Set<java.lang.String> |
getOptional()
generate the set of optional fields to be used to provide class specific defaults
in form creation/update.
|
PartPathTransitionProvider |
getPartPathProvider() |
FilterResult<F> |
getRetired() |
SQLFilter<F> |
getRetiredFilter() |
protected java.util.Map<java.lang.String,Selector> |
getSelectors()
Get a Map of selectors to use for forms of this type.
|
protected java.util.Set<java.lang.String> |
getSupress()
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.lang.Class |
getTarget()
Get a bound on the type of object produced by this factory for run-time checking.
|
TransitionFactory |
getTransitionProvider(java.lang.String tag) |
boolean |
hasActive() |
protected F |
makeBDO(Repository.Record res)
Construct a new Blank DataObject of the correct Class
This method takes a Record as an argument.
|
all, allowPreSelect, canCreate, canUpdate, checkComposite, convertToDestinationFilter, customiseForm, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getComposites, getConfigTag, getContext, getCount, getDefaultRelationshipFilter, getDefaults, getDestFilter, getExcludeFilter, getFieldConstraints, getFieldHelp, getFilter, getFilter, getFilter, getFinalSelectFilter, getFinalTableSpecification, getFindFilter, getFormCreator, getFormUpdate, getID, getIndex, getInput, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getOrder, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getTableSpecification, getTableStructureContributers, getTag, getTranslations, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeObject, makeRecord, makeReference, makeReference, matches, narrowSelector, narrowSelector, observeComposite, OrderBy, postCreateTableSetup, postSetContext, release, restrictDefaultInput, setComposites, setContext, setContext, setContextWithMake, setProperty, toString, updateTable
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getContext
public static final java.lang.String NAME_FIELD
public static final java.lang.String VALIDATING_VISITOR_FIELD
public static final java.lang.String PART_TAG
public static final java.lang.String FORM_TAG
public DynamicFormManager(AppContext conn, java.lang.String homeTable)
protected F makeBDO(Repository.Record res) throws DataFault
DataObjectFactory
makeBDO
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
res
- Record to create object fromDataFault
public java.lang.Class getTarget()
DataObjectFactory
IndexedProducer.getTarget()
. Normally this method should be overridden
each time we make a sub-class that narrows the produced type. However
checks should still pass if the super-type method is retained.getTarget
in interface IndexedProducer<F extends DynamicFormManager.DynamicForm>
getTarget
in interface Targetted<F extends DynamicFormManager.DynamicForm>
getTarget
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
public PageManager getChildManager()
PartOwnerFactory
PartManager
for the next level of
the hierarchy. This always returns null for
the bottom layer.getChildManager
in class PartOwnerFactory<F extends DynamicFormManager.DynamicForm>
PartManager
or nullpublic TransitionFactory getTransitionProvider(java.lang.String tag)
getTransitionProvider
in interface TransitionFactoryCreator<TransitionFactory>
tag
- TargetName used for the TransitionProviderprotected TableSpecification getDefaultTableSpecification(AppContext c, java.lang.String table)
DataObjectFactory
getDefaultTableSpecification
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
c
- AppContexttable
- String table name.public F findFromString(java.lang.String name)
ParseFactory
findFromString
in interface ParseFactory<F extends DynamicFormManager.DynamicForm>
public SQLValueFilter<F> getNameFilter(java.lang.String name)
name
- public FilterResult<F> getNew() throws DataFault
DataFault
public FilterResult<F> getActive() throws DataFault
DataFault
public BaseFilter<F> getActiveFilter()
public FilterResult<F> getRetired() throws DataFault
DataFault
public boolean canEdit(SessionService<?> sess)
sess
- protected java.util.Set<java.lang.String> getSupress()
DataObjectFactory
getSupress
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
DataObjectFormFactory
protected java.util.Map<java.lang.String,Selector> getSelectors()
DataObjectFactory
getSelectors
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
DataObjectFormFactory
protected java.util.Set<java.lang.String> getOptional()
DataObjectFactory
DataObjectFactory.getNullable()
and remove any fields that should be forced to be mandatory.
Alternatively you can start with an empty set (defaulting to all fields mandatory) and add exceptions
Note that for legacy reasons a non-nullable String field CAN be made optional (the Repository
will map null values to the empty string)getOptional
in class DataObjectFactory<F extends DynamicFormManager.DynamicForm>
DataObjectFactory.getNullable()
public PartPathTransitionProvider getPartPathProvider()
public DynamicFormTransitionProvider<F> getDynamicFormProvider()
public java.lang.String getCanonicalName(F object)
ParseFactory
ParseFactory.findFromString(String)
method.getCanonicalName
in interface ParseFactory<F extends DynamicFormManager.DynamicForm>
public MimeStreamData getData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
SessionService
may not have a current person set so you have to check for
null SessionService
and null AppUser
as well as the users permissions.getData
in interface ServeDataProducer
java.lang.Exception
public java.lang.String getDownloadName(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
MimeStreamData.getName()
if ServeDataProducer.getData(SessionService, List)
returns a non-null value.
However this method may be called by display content generation code so if the result is generated on the fly it might be possible to generate the download name in
a more lightweight fashion. It should also work to always return null thought he browser will use the last part of the selection path as the downloadgetDownloadName
in interface ServeDataProducer
java.lang.Exception
public java.lang.String getChildTypeName()
PartOwnerFactory
getChildTypeName
in class PartOwnerFactory<F extends DynamicFormManager.DynamicForm>
public F duplicate(F original, java.lang.String name) throws DataException
DataException
public boolean hasActive()