public class EmailTransitionProvider extends java.lang.Object implements ViewPathTransitionProvider<EditAction,MailTarget>
getTransition(MailTarget, EditAction)
and a generic Action
is used for most operations.
The edit_part view needs to use a CustomFormContent
transition to insert the form
into its correct place in the message view.Constructor and Description |
---|
EmailTransitionProvider(MessageHandlerFactory fac) |
Modifier and Type | Method and Description |
---|---|
<R> R |
accept(TransitionFactoryVisitor<R,MailTarget,EditAction> vis)
Accept a
TransitionFactoryVisitor . |
boolean |
allowTransition(AppContext c,
MailTarget target,
EditAction key)
Access control check.
|
boolean |
canView(MailTarget target,
SessionService<?> sess)
Can the current person view this target
|
<X extends ContentBuilder> |
getBottomContent(X cb,
MailTarget target,
SessionService<?> sess)
Get the content to be displayed at the bottom of the target page.
|
AppContext |
getContext() |
java.lang.String |
getHelp(EditAction key)
Get tooltip help string for an operation
|
java.util.LinkedList<java.lang.String> |
getID(MailTarget target)
Get the id string for form posts from a target
|
<X extends ContentBuilder> |
getLogContent(X cb,
MailTarget target,
SessionService<?> sess)
Get the content to be displayed on the view target page as part of the target pane.
|
Logger |
getLogger() |
<X extends ContentBuilder> |
getSummaryContent(AppContext c,
X cb,
MailTarget target)
Get target summary to be shown on transition page.
|
MailTarget |
getTarget(java.util.LinkedList<java.lang.String> path)
Find target type by id string
|
java.lang.String |
getTargetName()
What is the name for this type of transition.
|
java.lang.String |
getText(EditAction key)
get custom button content.
|
<X extends ContentBuilder> |
getTopContent(X cb,
MailTarget target,
SessionService<?> sess)
Get the content to be displayed at the top of the target page.
|
Transition<MailTarget> |
getTransition(MailTarget target,
EditAction key)
Find a transition operator for this type by key.
|
java.util.Set<EditAction> |
getTransitions(MailTarget 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.
|
EditAction |
lookupTransition(MailTarget 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
showTransition
public static Feature SEND_NOW
public EmailTransitionProvider(MessageHandlerFactory fac)
public boolean canView(MailTarget target, SessionService<?> sess)
ViewTransitionFactory
canView
in interface ViewTransitionFactory<EditAction,MailTarget>
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<EditAction,MailTarget>
public <X extends ContentBuilder> X getSummaryContent(AppContext c, X cb, MailTarget target)
TransitionFactory
getSummaryContent
in interface TransitionFactory<EditAction,MailTarget>
c
- AppContextcb
- ContentBuilderpublic MailTarget getTarget(java.util.LinkedList<java.lang.String> path)
PathTransitionProvider
getTarget
in interface PathTransitionProvider<EditAction,MailTarget>
public java.util.LinkedList<java.lang.String> getID(MailTarget target)
PathTransitionProvider
getID
in interface PathTransitionProvider<EditAction,MailTarget>
public boolean allowTransition(AppContext c, MailTarget target, EditAction key)
TransitionFactory
allowTransition
in interface TransitionFactory<EditAction,MailTarget>
c
- AppContexttarget
- target objectkey
- identifying key object for transitionpublic <X extends ContentBuilder> X getTopContent(X cb, MailTarget target, SessionService<?> sess)
ViewTransitionFactory
getTopContent
in interface ViewTransitionFactory<EditAction,MailTarget>
public <X extends ContentBuilder> X getLogContent(X cb, MailTarget target, SessionService<?> sess)
ViewTransitionFactory
getLogContent
in interface ViewTransitionFactory<EditAction,MailTarget>
public java.lang.String getHelp(EditAction key)
ViewTransitionFactory
getHelp
in interface ViewTransitionFactory<EditAction,MailTarget>
public java.lang.String getText(EditAction key)
ViewTransitionFactory
getText
in interface ViewTransitionFactory<EditAction,MailTarget>
public java.util.Set<EditAction> getTransitions(MailTarget 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<EditAction,MailTarget>
public Transition<MailTarget> getTransition(MailTarget target, EditAction key)
TransitionFactory
getTransition
in interface TransitionFactory<EditAction,MailTarget>
target
- target (may be null)key
- keypublic EditAction lookupTransition(MailTarget target, java.lang.String name)
TransitionFactory
lookupTransition
in interface TransitionFactory<EditAction,MailTarget>
target
- (may be null)public AppContext getContext()
getContext
in interface Contexed
public <R> R accept(TransitionFactoryVisitor<R,MailTarget,EditAction> 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 PathTransitionProvider<EditAction,MailTarget>
accept
in interface TransitionFactory<EditAction,MailTarget>
public Logger getLogger()
public <X extends ContentBuilder> X getBottomContent(X cb, MailTarget target, SessionService<?> sess)
ViewTransitionFactory
getBottomContent
in interface ViewTransitionFactory<EditAction,MailTarget>