T
- public class TextFileOverlay<T extends TextFileOverlay.TextFile> extends DataObjectFactory<T>
For the file-system representation of a resource the parent directory is located by using the group name as a configuration parameter. (Non absolute directory paths are relative to the application root. Multiple search directories can be specified as a comma seperated list
When a resource is requested it is first looked up in the database. If it does not exist (or the contents are null) then the file-system resource is retrieved. otherwise the DB contents are retrieved.
All lookups cause a DB entry with null contents will be created to register that resource for form updates. The update form always populates with the value a lookup would return but it only stores a value if this differs from the file-system value.
The create method is used to create database only entries. For example to add entries to a location within the application war-file.
Modifier and Type | Class and Description |
---|---|
class |
TextFileOverlay.ExistsValidator
Check we are only creating a new entry and one where no
matching file already exists.
|
static class |
TextFileOverlay.TextFile |
class |
TextFileOverlay.TextFileCreator
Create a database only TextFile object
|
class |
TextFileOverlay.TextFileDiffAction |
static class |
TextFileOverlay.TextFileRevertAction |
static class |
TextFileOverlay.TextFileUpdateAction |
class |
TextFileOverlay.TextFileUpdator |
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 |
---|---|
protected static java.lang.String |
GROUP |
protected static java.lang.String |
NAME |
protected static java.lang.String |
TEXT |
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
Constructor and Description |
---|
TextFileOverlay(AppContext c) |
TextFileOverlay(AppContext c,
java.lang.String table) |
Modifier and Type | Method and Description |
---|---|
FilterResult<T> |
allbyGroup(java.lang.String groupName) |
TextFileOverlay.TextFile |
find(java.lang.String group,
java.lang.String name) |
java.net.URL |
getBaseURL() |
protected TableSpecification |
getDefaultTableSpecification(AppContext c,
java.lang.String table)
Get the default table specification if the table is to be created.
|
FormCreator |
getFormCreator(AppContext c)
Create a default FormCreator for the target object
The form may be customised according to the requesting AppUser
|
FormUpdate<T> |
getFormUpdate(AppContext c)
produce a FormUpdate for the target type appropriate for
the requesting user
|
protected java.lang.String |
getInitialCreateText()
Generates initial text to use when creating.
|
protected java.util.List<OrderClause> |
getOrder() |
protected static java.io.InputStream |
getResourceStream(AppContext conn,
java.lang.String group,
java.lang.String name) |
protected java.util.Map<java.lang.String,Selector> |
getSelectors()
Get a Map of selectors to use for forms of this type.
|
protected static java.lang.String |
getStringFromStream(AppContext conn,
java.io.InputStream stream) |
java.lang.Class<T> |
getTarget()
Get a bound on the type of object produced by this factory for run-time checking.
|
protected T |
makeBDO(Repository.Record res)
Construct a new Blank DataObject of the correct Class
This method takes a Record as an argument.
|
void |
setBaseURL(java.net.URL base) |
protected java.lang.String[] |
splitNormalised(java.lang.String input)
Normalise and split input.
|
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, getID, getIndex, getInput, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getOptional, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getSupress, 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
protected static final java.lang.String GROUP
protected static final java.lang.String NAME
protected static final java.lang.String TEXT
public TextFileOverlay(AppContext c, java.lang.String table)
public TextFileOverlay(AppContext c)
protected static java.lang.String getStringFromStream(AppContext conn, java.io.InputStream stream) throws java.io.IOException
java.io.IOException
protected static java.io.InputStream getResourceStream(AppContext conn, java.lang.String group, java.lang.String name)
public TextFileOverlay.TextFile find(java.lang.String group, java.lang.String name) throws DataFault
DataFault
protected T makeBDO(Repository.Record res) throws DataFault
DataObjectFactory
makeBDO
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
res
- Record to create object fromDataFault
public void setBaseURL(java.net.URL base)
public java.net.URL getBaseURL()
protected java.lang.String[] splitNormalised(java.lang.String input)
input
- public FormUpdate<T> getFormUpdate(AppContext c)
FormUpdateProducer
getFormUpdate
in interface FormUpdateProducer<T extends TextFileOverlay.TextFile>
getFormUpdate
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
c
- AppContextprotected TableSpecification getDefaultTableSpecification(AppContext c, java.lang.String table)
DataObjectFactory
getDefaultTableSpecification
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
c
- AppContexttable
- String table name.public FilterResult<T> allbyGroup(java.lang.String groupName) throws DataFault
DataFault
protected java.lang.String getInitialCreateText()
public FormCreator getFormCreator(AppContext c)
FormCreatorProducer
getFormCreator
in interface FormCreatorProducer
getFormCreator
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
c
- AppContextprotected java.util.Map<java.lang.String,Selector> getSelectors()
DataObjectFactory
getSelectors
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
DataObjectFormFactory
public java.lang.Class<T> 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<T extends TextFileOverlay.TextFile>
getTarget
in interface Targetted<T extends TextFileOverlay.TextFile>
getTarget
in class DataObjectFactory<T extends TextFileOverlay.TextFile>
protected java.util.List<OrderClause> getOrder()
getOrder
in class DataObjectFactory<T extends TextFileOverlay.TextFile>