public final class CommandHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT_NODE_KEY
Current node key
|
static String |
OUTPUT_KEY
output key
|
static String |
REPO_ADDRESS_KEY
address key
|
static String |
REPOSITORY_KEY
repository key
|
static String |
SESSION_KEY
session key
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceBundle |
getBundle() |
static javax.jcr.Node |
getCurrentNode(org.apache.commons.chain.Context ctx)
Gets the current working
Node |
static javax.jcr.Item |
getItem(org.apache.commons.chain.Context ctx,
String path)
Gets the
Item at the given path. |
static Iterator |
getItems(org.apache.commons.chain.Context ctx,
javax.jcr.Node node,
String pattern)
Gets the
Item s under the given Node that
match the pattern |
static javax.jcr.Node |
getNode(org.apache.commons.chain.Context ctx,
String path)
Gets the
Node at the given path. |
static javax.jcr.NodeIterator |
getNodes(org.apache.commons.chain.Context ctx,
javax.jcr.Node node,
String pattern)
Gets the
Node s under the given Node that
match the given pattern. |
static PrintWriter |
getOutput(org.apache.commons.chain.Context ctx)
Gets the current
PrintWriter |
static javax.jcr.PropertyIterator |
getProperties(org.apache.commons.chain.Context ctx,
javax.jcr.Node node,
String pattern)
Gets the
Property s under the current working node for the
given pattern |
static javax.jcr.Repository |
getRepository(org.apache.commons.chain.Context ctx)
Gets the current working
Repository |
static String |
getRepositoryAddress(org.apache.commons.chain.Context ctx) |
static javax.jcr.Session |
getSession(org.apache.commons.chain.Context ctx)
Gets the current working
Session |
static boolean |
hasNode(org.apache.commons.chain.Context ctx,
String path)
Checks
Node existence. |
static void |
setCurrentNode(org.apache.commons.chain.Context ctx,
javax.jcr.Node node)
Sets the current working
Node. |
static void |
setOutput(org.apache.commons.chain.Context ctx,
PrintWriter out)
Sets the current
PrintWriter. |
static void |
setRepository(org.apache.commons.chain.Context ctx,
javax.jcr.Repository repository,
String address)
Sets the current working
Repository |
static void |
setSession(org.apache.commons.chain.Context ctx,
javax.jcr.Session session)
Sets the current working
Session |
public static final String CURRENT_NODE_KEY
public static final String REPOSITORY_KEY
public static final String SESSION_KEY
public static final String OUTPUT_KEY
public static final String REPO_ADDRESS_KEY
public static void setOutput(org.apache.commons.chain.Context ctx,
PrintWriter out)
PrintWriter.ctx - the Contextout - the PrintWriterpublic static void setCurrentNode(org.apache.commons.chain.Context ctx,
javax.jcr.Node node)
Node.ctx - the Contextnode - the current working Node.public static void setRepository(org.apache.commons.chain.Context ctx,
javax.jcr.Repository repository,
String address)
Repositoryctx - the Contextrepository - the current working Repositorypublic static void setSession(org.apache.commons.chain.Context ctx,
javax.jcr.Session session)
throws CommandException
Sessionctx - the Contextsession - the current working SessionCommandException - if there's an open working Sessionpublic static PrintWriter getOutput(org.apache.commons.chain.Context ctx)
PrintWriterctx - the ContextPrintWriterpublic static javax.jcr.Node getCurrentNode(org.apache.commons.chain.Context ctx)
throws CommandException
Nodectx - the ContextNodeCommandException - if the current working Node can't be found.public static javax.jcr.Repository getRepository(org.apache.commons.chain.Context ctx)
throws CommandException
Repositoryctx - the ContextRepositoryCommandException - if the current working Repository is unset.public static String getRepositoryAddress(org.apache.commons.chain.Context ctx) throws CommandException
CommandExceptionpublic static javax.jcr.Session getSession(org.apache.commons.chain.Context ctx)
throws CommandException
Sessionctx - the ContextSessionCommandException - if the current working Session is unset.public static javax.jcr.Node getNode(org.apache.commons.chain.Context ctx,
String path)
throws CommandException,
javax.jcr.RepositoryException
Node at the given path.ctx - the Contextpath - the path to the NodeNode at the given pathCommandException - if the Node isn't found.javax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static javax.jcr.Item getItem(org.apache.commons.chain.Context ctx,
String path)
throws CommandException,
javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
Item at the given path. Node.ctx - the Contextpath - the path to the ItemItem at the given pathCommandException - if a Command internal error occurs.javax.jcr.PathNotFoundException - if there's no Node at the given path.javax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static boolean hasNode(org.apache.commons.chain.Context ctx,
String path)
throws CommandException,
javax.jcr.RepositoryException
Node existence.ctx - the Contextpath - the path to the NodeNode exists at the given pathCommandException - if the current working Session is unset.javax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static javax.jcr.NodeIterator getNodes(org.apache.commons.chain.Context ctx,
javax.jcr.Node node,
String pattern)
throws javax.jcr.RepositoryException
Node s under the given Node that
match the given pattern.ctx - the Contextnode - the parent Nodepattern - the patternIterator that contains the matching nodesjavax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static javax.jcr.PropertyIterator getProperties(org.apache.commons.chain.Context ctx,
javax.jcr.Node node,
String pattern)
throws javax.jcr.RepositoryException
Property s under the current working node for the
given patternctx - the Contextnode - the parent Nodepattern - the patternPropertyIteratorjavax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionpublic static ResourceBundle getBundle()
ResourceBundlepublic static Iterator getItems(org.apache.commons.chain.Context ctx, javax.jcr.Node node, String pattern) throws javax.jcr.RepositoryException
Item s under the given Node that
match the patternctx - the Contextnode - the parent Nodepattern - the patternIterator with the Item s that
match the given pattern.javax.jcr.RepositoryException - if the underlying repository throws a
RepositoryExceptionCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.