info.magnolia.module.delta
Class PartialBootstrapTask
java.lang.Object
info.magnolia.module.delta.AbstractTask
info.magnolia.module.delta.PartialBootstrapTask
- All Implemented Interfaces:
- Task
public class PartialBootstrapTask
- extends AbstractTask
This task is used to bootstrap a part of a file.
- Author:
- tmiyar
Constructor Summary |
PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath)
Bootstraps fragment of file. |
PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
int importUUIDBehavior)
|
PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
java.lang.String targetResource)
Bootstraps newly created file. |
PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
java.lang.String targetResource,
int importUUIDBehavior)
|
Method Summary |
protected void |
bootstrap(java.lang.String resourceName,
java.lang.String itemName,
int importUUIDBehavior,
java.io.InputStream stream)
|
void |
execute(InstallContext ctx)
A good-citizen task should execute itself responsibly: it should know
what to do in case of problems: for instance, fixable or irrelevant
issues should usually just be logged used the InstallContext methods,
when the user can fix them later on. |
protected java.io.InputStream |
getNodeStream(java.lang.String fileName,
java.lang.String nodePath)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PartialBootstrapTask
public PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath)
- Bootstraps fragment of file.
- Parameters:
resource
- - resource file i.e. /mgnl-bootstrap/standard-templating-kit/dialogs/pages/config.modules.standard-templating-kit.dialogs.pages.article.stkArticleProperties.xmlitemPath
- - path in the file of the node you want to bootstrap i.e. /stkArticleProperties/tabCategorization
PartialBootstrapTask
public PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
java.lang.String targetResource)
- Bootstraps newly created file.
- Parameters:
resource
- - resource file i.e. /mgnl-bootstrap/standard-templating-kit/dialogs/pages/config.modules.standard-templating-kit.dialogs.pages.article.stkArticleProperties.xmlitemPath
- - path in the file of the node you want to bootstrap i.e. /stkArticleProperties/tabCategorizationtargetResource
- - A target bootstrap file name in case you want to bootstrap the file in a different node /mgnl-bootstrap/standard-templating-kit/dialogs/pages/config.modules.standard-templating-kit.dialogs.pages.target.xml
PartialBootstrapTask
public PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
java.lang.String targetResource,
int importUUIDBehavior)
PartialBootstrapTask
public PartialBootstrapTask(java.lang.String name,
java.lang.String description,
java.lang.String resource,
java.lang.String itemPath,
int importUUIDBehavior)
execute
public void execute(InstallContext ctx)
throws TaskExecutionException
- Description copied from interface:
Task
- A good-citizen task should execute itself responsibly: it should know
what to do in case of problems: for instance, fixable or irrelevant
issues should usually just be logged used the InstallContext methods,
when the user can fix them later on. The task could also potentially
do backups of nodes it needs to modify extensively, so the user could
refer to the backups in case of problem. In the event of an unrecoverable
issue, the Task could also throw a TaskExecutionException, knowing that
will cancel the whole module's installation, update and startup. If
a TaskExecutionException must be thrown, keep in mind that the exception
message will still be shown to the end user, so try to keep them human
readable.
- Throws:
TaskExecutionException
getNodeStream
protected java.io.InputStream getNodeStream(java.lang.String fileName,
java.lang.String nodePath)
bootstrap
protected void bootstrap(java.lang.String resourceName,
java.lang.String itemName,
int importUUIDBehavior,
java.io.InputStream stream)
throws java.io.IOException,
javax.jcr.RepositoryException
- Throws:
java.io.IOException
javax.jcr.RepositoryException
Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.