T
- Type of log EntryO
- Type of owning objectpublic abstract class LogFactory<T extends LogFactory.Entry,O extends Indexed> extends DataObjectFactory<T>
Modifier and Type | Class and Description |
---|---|
class |
LogFactory.DateFilter
Filter LogItems by date
|
class |
LogFactory.EditItemTransition |
static class |
LogFactory.Entry<L extends Indexed,F extends LogFactory,O extends DataObject>
Base class for a log entry
|
static class |
LogFactory.EntryKey |
static class |
LogFactory.ItemAction<T extends LogFactory.Entry> |
class |
LogFactory.ItemDateFilter
Filter items by owner, type and date range
|
static class |
LogFactory.ItemType<E extends LogFactory.Entry>
superclass for the type objects in sub-classes
|
class |
LogFactory.TransitionProvider |
class |
LogFactory.TypeFilter<L extends Indexed>
Filter item by type, date range and link reference
|
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 |
DATE |
static LogFactory.EntryKey |
EDIT_ITEM |
protected static java.lang.String |
LINK_ID |
protected static java.lang.String |
OPERATOR_ID |
protected LogOwner<O> |
owner_factory |
protected static java.lang.String |
OWNER_ID |
protected LogFactory.ItemType<T> |
use_type |
protected AppUserFactory<?> |
user_factory |
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
Constructor and Description |
---|
LogFactory(LogOwner<O> fac,
java.lang.String table,
AppUserFactory<?> uf) |
Modifier and Type | Method and Description |
---|---|
T |
find(LogFactory.ItemType.ItemValue v,
int link,
boolean allow_null)
Find and item only by what it points to.
|
T |
find(O owner,
LogFactory.ItemType.ItemValue v,
int link,
boolean allow_null)
find an item by owner and value
|
protected TableSpecification |
getDefaultTableSpecification(AppContext c,
LogOwner<O> fac,
AppUserFactory<?> uf,
java.lang.String homeTable) |
SQLFilter<T> |
getItemFilter(LogFactory.ItemType.ItemValue<T> v) |
protected SQLAndFilter<T> |
getItemFilter(LogFactory.ItemType.ItemValue v,
int link)
get a SQL filter to items that point to a particular target.
|
protected SQLAndFilter<T> |
getItemFilter(O q,
LogFactory.ItemType.ItemValue v,
int link) |
protected LogFactory.ItemType<T> |
getItemType()
Get the final
LogFactory.ItemType to use for this class. |
CloseableIterator<T> |
getLog(O q) |
protected java.util.List<OrderClause> |
getOrder() |
protected LogOwner<O> |
getOwnerFactory() |
ReferenceFilter<T,O> |
getOwnerFilter(O q) |
java.util.Set<O> |
getOwners(LogFactory.ItemType.ItemValue v,
int link)
get all owners that reference a particular owner from their log.
|
protected java.util.Map<java.lang.String,TableSpecification> |
getPrereqTables() |
protected abstract LogFactory.ItemType<T> |
getStaticItemType()
Get the most specific non-dynamic
LogFactory.ItemType
sub-classes override this to generate a statically configured type. |
java.lang.Class<T> |
getTarget()
Get a bound on the type of object produced by this factory for run-time checking.
|
LogTransitionProvider |
getTransitionProvider() |
protected T |
makeBDO(Repository.Record res)
Construct a new Blank DataObject of the correct Class
This method takes a Record as an argument.
|
protected void |
observeComposite(Composite c)
Observer
Composite s as they are registered. |
void |
purge(O q)
purge all entries for an owner.
|
void |
purgeOrphan()
purge all orphan entries.
|
protected void |
setupItems(AppContext c,
java.lang.String table)
create LogItem tables that don't have factories.
|
all, allowPreSelect, canCreate, canUpdate, checkComposite, convertToDestinationFilter, customiseForm, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getComposites, getConfigTag, getContext, getCount, getDefaultRelationshipFilter, getDefaults, getDefaultTableSpecification, getDestFilter, getExcludeFilter, getFieldConstraints, getFieldHelp, getFilter, getFilter, getFilter, getFinalSelectFilter, getFinalTableSpecification, getFindFilter, getFormCreator, getFormUpdate, getID, getIndex, getInput, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getOptional, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getSelectors, getSupress, getTableSpecification, getTableStructureContributers, getTag, getTranslations, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeObject, makeRecord, makeReference, makeReference, matches, narrowSelector, narrowSelector, OrderBy, postCreateTableSetup, postSetContext, release, restrictDefaultInput, setComposites, setContext, setContext, setContextWithMake, setProperty, toString, updateTable
public static final LogFactory.EntryKey EDIT_ITEM
protected static final java.lang.String OWNER_ID
protected static final java.lang.String LINK_ID
protected static final java.lang.String OPERATOR_ID
protected static final java.lang.String DATE
protected final AppUserFactory<?> user_factory
protected final LogFactory.ItemType<T extends LogFactory.Entry> use_type
public LogFactory(LogOwner<O> fac, java.lang.String table, AppUserFactory<?> uf)
protected void setupItems(AppContext c, java.lang.String table)
c
- table
- protected void observeComposite(Composite c)
DataObjectFactory
Composite
s as they are registered.
Note that as this can be called during factory construction no assumptions can be made about
factory attribute state. The Composite.preRegister()
method needs to be used to set attribute state that is going to be used by this method.observeComposite
in class DataObjectFactory<T extends LogFactory.Entry>
protected java.util.Map<java.lang.String,TableSpecification> getPrereqTables()
protected TableSpecification getDefaultTableSpecification(AppContext c, LogOwner<O> fac, AppUserFactory<?> uf, java.lang.String homeTable)
public ReferenceFilter<T,O> getOwnerFilter(O q)
public T find(LogFactory.ItemType.ItemValue v, int link, boolean allow_null) throws DataException
v
- link
- allow_null
- DataException
public T find(O owner, LogFactory.ItemType.ItemValue v, int link, boolean allow_null) throws DataException
q
- v
- link
- allow_null
- DataException
protected SQLAndFilter<T> getItemFilter(LogFactory.ItemType.ItemValue v, int link)
v
- link
- protected SQLAndFilter<T> getItemFilter(O q, LogFactory.ItemType.ItemValue v, int link)
public java.util.Set<O> getOwners(LogFactory.ItemType.ItemValue v, int link) throws DataException
v
- link
- DataException
protected final LogFactory.ItemType<T> getItemType()
LogFactory.ItemType
to use for this class.
This can include dynamic additions.protected abstract LogFactory.ItemType<T> getStaticItemType()
LogFactory.ItemType
sub-classes override this to generate a statically configured type.
which is then used to create a per-instance version including dynamic additions.protected final T makeBDO(Repository.Record res) throws DataFault
DataObjectFactory
makeBDO
in class DataObjectFactory<T extends LogFactory.Entry>
res
- Record to create object fromDataFault
public final void purge(O q) throws DataFault
q
- DataFault
public final void purgeOrphan() throws DataFault
LogOwner
is a DataObjectFactory
.DataFault
public CloseableIterator<T> getLog(O q) throws DataFault
DataFault
protected java.util.List<OrderClause> getOrder()
getOrder
in class DataObjectFactory<T extends LogFactory.Entry>
public LogTransitionProvider getTransitionProvider()
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 LogFactory.Entry>
getTarget
in interface Targetted<T extends LogFactory.Entry>
getTarget
in class DataObjectFactory<T extends LogFactory.Entry>
public SQLFilter<T> getItemFilter(LogFactory.ItemType.ItemValue<T> v)
v
-