public abstract class NodePickerController extends Object implements org.apache.wicket.model.IDetachable
Constructor and Description |
---|
NodePickerController(IPluginContext context,
NodePickerControllerSettings settings) |
Modifier and Type | Method and Description |
---|---|
org.apache.wicket.Component |
create(String id) |
void |
detach() |
protected org.apache.wicket.model.IModel<javax.jcr.Node> |
getBaseModel()
A hook that allows subclasses to specify a default location.
|
org.apache.wicket.model.IModel<javax.jcr.Node> |
getFolderModel()
Helper method to retrieve the current folder model
|
protected abstract org.apache.wicket.model.IModel<javax.jcr.Node> |
getInitialModel()
Return the initially selected model
|
protected org.apache.wicket.model.IModel<javax.jcr.Node> |
getLastVisitedFromPreferences()
Check the IPreferencesStore for a last visited location (a node path) and if found, return it in a new
JcrNodeModel, otherwise return null.
|
IRenderService |
getRenderer() |
String[] |
getRootPaths() |
org.apache.wicket.model.IModel<javax.jcr.Node> |
getSelectedModel() |
void |
initSelection()
Try to determine which model should be used as initial selection.
|
protected boolean |
isLinkable(javax.jcr.Node node)
Determine if the provided node is of nodeType["mix:referenceable"] and if it's not a hippo:document below a
hippo:handle.
|
protected boolean |
isValidNodeType(javax.jcr.Node node)
Determine if the node type of the provided node is valid.
|
protected boolean |
isValidSelection(org.apache.wicket.model.IModel<javax.jcr.Node> targetModel)
This method determines the validity of the selected node in context of this dialog.
|
void |
onClose() |
protected void |
onFolderSelected(org.apache.wicket.model.IModel<javax.jcr.Node> model) |
protected void |
onSelect(boolean isValid)
This method is called when a new model is selected.
|
void |
setSelectedFolder(org.apache.wicket.model.IModel<javax.jcr.Node> model) |
public NodePickerController(IPluginContext context, NodePickerControllerSettings settings)
public org.apache.wicket.Component create(String id)
public void setSelectedFolder(org.apache.wicket.model.IModel<javax.jcr.Node> model)
protected void onFolderSelected(org.apache.wicket.model.IModel<javax.jcr.Node> model)
public void initSelection()
protected org.apache.wicket.model.IModel<javax.jcr.Node> getBaseModel()
public org.apache.wicket.model.IModel<javax.jcr.Node> getSelectedModel()
protected abstract org.apache.wicket.model.IModel<javax.jcr.Node> getInitialModel()
protected void onSelect(boolean isValid)
isValid
- If the model is considered a valid selection model, value will be true, otherwise false.protected boolean isValidSelection(org.apache.wicket.model.IModel<javax.jcr.Node> targetModel)
targetModel
- The model providing the node to be validated.protected boolean isLinkable(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- Node to test for linkabilityjavax.jcr.RepositoryException
- Something went wrong in the repositoryprotected boolean isValidNodeType(javax.jcr.Node node) throws javax.jcr.RepositoryException
Determine if the node type of the provided node is valid. In case a handle is passed, it will use the nested hippo-document node, or, if none found (in case of a delete), return false.
By default, only documents are considered valid. To use more fine-grained validation, like for example, only allow document types "foo" & "bar", or allow folders as well, a list of allowedNodeTypes can be set during construction of the dialog.
node
- The node to be validated. If it is of nodeType["hippo:handle"], the first childNode with the same name
will be used instead.javax.jcr.RepositoryException
- Something went wrong in the repositorypublic IRenderService getRenderer()
public final void onClose()
public void detach()
detach
in interface org.apache.wicket.model.IDetachable
protected org.apache.wicket.model.IModel<javax.jcr.Node> getLastVisitedFromPreferences()
public org.apache.wicket.model.IModel<javax.jcr.Node> getFolderModel()
public String[] getRootPaths()
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.