public class TableTransitionProvider extends AbstractContexed implements ViewTransitionProvider<TableTransitionKey,DataObjectFactory>, IndexTransitionProvider<TableTransitionKey,DataObjectFactory>
Modifier and Type | Class and Description |
---|---|
class |
TableTransitionProvider.IndexTransition |
class |
TableTransitionProvider.UploadTransition
A transition to upload an XML dump into the table.
|
Modifier and Type | Field and Description |
---|---|
static TableTransitionKey |
INDEX |
static java.lang.String |
TABLE_INDEX_ROLE |
static java.lang.String |
TABLE_TRANSITION_TAG |
static TableTransitionKey |
UPLOAD |
static Feature |
UPLOAD_XML_FEATURE |
conn
Constructor and Description |
---|
TableTransitionProvider(AppContext conn) |
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(TransitionFactoryVisitor<R,DataObjectFactory,TableTransitionKey> vis)
Accept a
TransitionFactoryVisitor . |
boolean |
allowTransition(AppContext c,
DataObjectFactory target,
TableTransitionKey name)
Access control check.
|
boolean |
canView(DataObjectFactory target,
SessionService<?> sess)
Can the current person view this target
|
<X extends ContentBuilder> |
getBottomContent(X hb,
DataObjectFactory target,
SessionService<?> sess)
Get the content to be displayed at the bottom of the target page.
|
java.util.Set<java.lang.String> |
getConfigProperties(DataObjectFactory<?> target)
get a set of configuration parameters that configure this object.
|
java.lang.String |
getHelp(TableTransitionKey key)
Get tooltip help string for an operation
|
java.lang.String |
getID(DataObjectFactory target)
Get the id string for form posts from a target
|
TableTransitionKey |
getIndexTransition()
Get the key for the default index transition.
|
<X extends ContentBuilder> |
getLogContent(X hb,
DataObjectFactory target,
SessionService<?> sess)
Get the content to be displayed on the view target page as part of the target pane.
|
<X extends ContentBuilder> |
getSummaryContent(AppContext c,
X cb,
DataObjectFactory target)
Get target summary to be shown on transition page.
|
DataObjectFactory |
getTarget(java.lang.String id)
Find target type by id string
|
java.lang.String |
getTargetName()
What is the name for this type of transition.
|
java.lang.String |
getText(TableTransitionKey key)
get custom button content.
|
<X extends ContentBuilder> |
getTopContent(X hb,
DataObjectFactory target,
SessionService<?> sess)
Get the content to be displayed at the top of the target page.
|
Transition<DataObjectFactory> |
getTransition(DataObjectFactory target,
TableTransitionKey key)
Find a transition operator for this type by key.
|
java.util.Set<TableTransitionKey> |
getTransitions(DataObjectFactory target)
Get a list of all the transition keys supported by the target type to be presented to the user
as a set of possible options in a view transition.
|
TableTransitionKey |
lookupTransition(DataObjectFactory target,
java.lang.String name)
Lookup a transition key by String
This has to be the same as the result of the toString method
on the key as this is what is passed from transitions.jsp for a form transition.
|
getContext, getLogger, resetLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
showTransition
getContext
public static final Feature UPLOAD_XML_FEATURE
public static final java.lang.String TABLE_INDEX_ROLE
public static final java.lang.String TABLE_TRANSITION_TAG
public static final TableTransitionKey INDEX
public static final TableTransitionKey UPLOAD
public TableTransitionProvider(AppContext conn)
public java.util.Set<java.lang.String> getConfigProperties(DataObjectFactory<?> target)
public boolean allowTransition(AppContext c, DataObjectFactory target, TableTransitionKey name)
TransitionFactory
allowTransition
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
c
- AppContexttarget
- target objectname
- identifying key object for transitionpublic java.lang.String getID(DataObjectFactory target)
TransitionProvider
getID
in interface TransitionProvider<TableTransitionKey,DataObjectFactory>
public <X extends ContentBuilder> X getSummaryContent(AppContext c, X cb, DataObjectFactory target)
TransitionFactory
getSummaryContent
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
c
- AppContextcb
- ContentBuilderpublic DataObjectFactory getTarget(java.lang.String id)
TransitionProvider
getTarget
in interface TransitionProvider<TableTransitionKey,DataObjectFactory>
public java.lang.String getTargetName()
TransitionFactory
TransitionServlet
The value can also be used as the user presented text for the type of object
in the title of the transition form page though this can be overridden by setting
target-name.transition_titlegetTargetName
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
public boolean canView(DataObjectFactory target, SessionService<?> sess)
ViewTransitionFactory
canView
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public <X extends ContentBuilder> X getLogContent(X hb, DataObjectFactory target, SessionService<?> sess)
ViewTransitionFactory
getLogContent
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public <X extends ContentBuilder> X getTopContent(X hb, DataObjectFactory target, SessionService<?> sess)
ViewTransitionFactory
getTopContent
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public <X extends ContentBuilder> X getBottomContent(X hb, DataObjectFactory target, SessionService<?> sess)
ViewTransitionFactory
getBottomContent
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public java.lang.String getHelp(TableTransitionKey key)
ViewTransitionFactory
getHelp
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public java.lang.String getText(TableTransitionKey key)
ViewTransitionFactory
getText
in interface ViewTransitionFactory<TableTransitionKey,DataObjectFactory>
public TableTransitionKey getIndexTransition()
IndexTransitionFactory
getIndexTransition
in interface IndexTransitionFactory<TableTransitionKey,DataObjectFactory>
public <R> R accept(TransitionFactoryVisitor<R,DataObjectFactory,TableTransitionKey> vis)
TransitionFactory
TransitionFactoryVisitor
.
Any code that depends on
the particular sub-interface of TransitionFactory
should implement TransitionFactoryVisitor
this ensures it will always
handle all possible sub-classes.accept
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
accept
in interface TransitionProvider<TableTransitionKey,DataObjectFactory>
public java.util.Set<TableTransitionKey> getTransitions(DataObjectFactory target)
TransitionFactory
TransitionFactory.allowTransition(AppContext, Object, Object)
will not be presented.
Additional hidden operations may also be supported but these will never be presented to the user
as options and can only generated as a ChainedTransitionResult
.
In most cases the transition set will be the same for all null/non-null targets
though in principal dynamic transitions could be generated based on the state of the target e.g. a parameterised
transition with the parameter encoded in the key.getTransitions
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
public Transition<DataObjectFactory> getTransition(DataObjectFactory target, TableTransitionKey key)
TransitionFactory
getTransition
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
target
- target (may be null)key
- keypublic TableTransitionKey lookupTransition(DataObjectFactory target, java.lang.String name)
TransitionFactory
lookupTransition
in interface TransitionFactory<TableTransitionKey,DataObjectFactory>
target
- (may be null)