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(String name,
String description,
String resource,
String itemPath)
Bootstraps fragment of file. |
PartialBootstrapTask(String name,
String description,
String resource,
String itemPath,
int importUUIDBehavior)
|
PartialBootstrapTask(String name,
String description,
String resource,
String itemPath,
String targetResource)
Bootstraps newly created file. |
PartialBootstrapTask(String name,
String description,
String resource,
String itemPath,
String targetResource,
int importUUIDBehavior)
|
PartialBootstrapTask
public PartialBootstrapTask(String name,
String description,
String resource,
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(String name,
String description,
String resource,
String itemPath,
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(String name,
String description,
String resource,
String itemPath,
String targetResource,
int importUUIDBehavior)
PartialBootstrapTask
public PartialBootstrapTask(String name,
String description,
String resource,
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 InputStream getNodeStream(String fileName,
String nodePath)
bootstrap
protected void bootstrap(String resourceName,
String itemName,
int importUUIDBehavior,
InputStream stream)
throws IOException,
javax.jcr.RepositoryException
- Throws:
IOException
javax.jcr.RepositoryException
getOutputResourceName
protected String getOutputResourceName(String resource,
String itemPath)
getResource
protected String getResource()
getItemName
protected String getItemName()
getItemPath
protected String getItemPath()
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.