T
- public abstract class FormFactoryProviderRegistry<T extends FormFactoryProvider> extends AbstractContexed implements UIGenerator, TransitionFactoryCreator<TransitionProvider>, NodeMaker
UIGenerator
to emit a set of edit/update buttons
and NodeMaker
to expose the same operations as a navigation menu.Modifier and Type | Field and Description |
---|---|
static char |
TAG_SEPERATOR |
conn
TYPE_SEPERATOR
Constructor and Description |
---|
FormFactoryProviderRegistry(AppContext conn) |
Modifier and Type | Method and Description |
---|---|
void |
addChildren(Node parent,
java.lang.String name,
FilteredProperties props)
Add additional child nodes specific to the
NodeMaker . |
ContentBuilder |
addContent(ContentBuilder builder) |
static java.lang.String |
cleanType(java.lang.String type)
map a tag string to something that won't break the TransitionServlet
|
T |
find(java.lang.String name) |
java.util.Iterator<T> |
getCreators(SessionService p)
Get all FormTypes that a person can create
|
abstract java.lang.String |
getGroup()
get the tag used to produce this class via AppContext.getFactory
|
static java.lang.String |
getGroup(java.lang.String tag) |
protected abstract java.util.Map<java.lang.String,T> |
getMap()
get a map from the cleaned
cleanType(String) tag
to the FormFactoryProvider . |
java.lang.String |
getTag(FormFactoryProvider e) |
abstract java.lang.String |
getTitle()
Subject are to use in form title
|
TransitionProvider<FormOperations,T> |
getTransitionProvider(FormFactoryProvider<T> provider) |
TransitionProvider |
getTransitionProvider(java.lang.String name) |
static java.lang.String |
getType(java.lang.String tag) |
java.util.Iterator<T> |
getTypes()
Return all FormTypes.
|
java.util.Iterator<T> |
getUpdaters(SessionService p)
Get all FormTypes that a person can update
|
Node |
makeNode(java.lang.String name,
FilteredProperties props)
Create a
Node for a named menu item. |
static java.lang.String |
makeTag(java.lang.String group,
java.lang.String type) |
getContext, getLogger, resetLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext
public static final char TAG_SEPERATOR
public FormFactoryProviderRegistry(AppContext conn)
public TransitionProvider getTransitionProvider(java.lang.String name)
getTransitionProvider
in interface TransitionFactoryCreator<TransitionProvider>
name
- TargetName used for the TransitionProviderpublic TransitionProvider<FormOperations,T> getTransitionProvider(FormFactoryProvider<T> provider)
protected abstract java.util.Map<java.lang.String,T> getMap()
cleanType(String)
tag
to the FormFactoryProvider
.
This is abstract to allow the map to be declared static.public abstract java.lang.String getGroup()
public abstract java.lang.String getTitle()
public java.util.Iterator<T> getTypes()
public java.util.Iterator<T> getUpdaters(SessionService p)
p
- Personpublic java.util.Iterator<T> getCreators(SessionService p)
p
- Personpublic T find(java.lang.String name)
public java.lang.String getTag(FormFactoryProvider e)
public static java.lang.String cleanType(java.lang.String type)
type
- public static java.lang.String makeTag(java.lang.String group, java.lang.String type)
public static java.lang.String getGroup(java.lang.String tag)
public static java.lang.String getType(java.lang.String tag)
public ContentBuilder addContent(ContentBuilder builder)
addContent
in interface UIGenerator
public Node makeNode(java.lang.String name, FilteredProperties props)
NodeMaker
Node
for a named menu item.
This is allowed to return null to indicate that nodes of this type are disabled/empty and should be
suppressed. The NavigationMenuService
can be configured to substitute a different node
in this case (for example to host child nodes added by the configuration).
Automatic child nodes can be added in this method and will appear first. Followed by nodes from the configuration
then nodes from NodeMaker.addChildren(Node, String, FilteredProperties)
makeNode
in interface NodeMaker
name
- name of the nodeprops
- FilteredProperties
containing the navigation menu configurationNode
public void addChildren(Node parent, java.lang.String name, FilteredProperties props)
NodeMaker
NodeMaker
.
This is intended for Node
s based on the current user or their roles.
It is a separate method so the dynamically generated nodes are added after any
specified in the configuration. Dynamic nodes that should appear first can be
added directly in NodeMaker.makeNode(String, FilteredProperties)
addChildren
in interface NodeMaker