info.magnolia.module
Class InstallContextImpl

java.lang.Object
  extended by info.magnolia.module.InstallContextImpl
All Implemented Interfaces:
InstallContext

public class InstallContextImpl
extends java.lang.Object
implements InstallContext

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.module.InstallContext
InstallContext.Message, InstallContext.MessagePriority
 
Constructor Summary
InstallContextImpl()
           
 
Method Summary
 void error(java.lang.String message, java.lang.Throwable th)
           
 HierarchyManager getConfigHierarchyManager()
           
 ModuleDefinition getCurrentModuleDefinition()
          Allows generic tasks to know what's being installed/updated.
 int getExecutedTaskCount()
           
 HierarchyManager getHierarchyManager(java.lang.String workspace)
           
 java.util.Map<java.lang.String,java.util.List<InstallContext.Message>> getMessages()
          A Map of messages where the key is the module name.
protected  java.lang.String getModuleKey()
          The key used in the map of messages.
 Content getModulesNode()
           
 Content getOrCreateCurrentModuleConfigNode()
           
 Content getOrCreateCurrentModuleNode()
           
 InstallStatus getStatus()
           
 int getTotalTaskCount()
           
 boolean hasModulesNode()
           
 void info(java.lang.String message)
           
 boolean isModuleRegistered(java.lang.String moduleName)
           
protected  void log(InstallContext.Message message)
           
 void restartNeeded(java.lang.String message)
           
 void setCurrentModule(ModuleDefinition module)
           
 void warn(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstallContextImpl

public InstallContextImpl()
Method Detail

setCurrentModule

public void setCurrentModule(ModuleDefinition module)

info

public void info(java.lang.String message)
Specified by:
info in interface InstallContext

warn

public void warn(java.lang.String message)
Specified by:
warn in interface InstallContext

error

public void error(java.lang.String message,
                  java.lang.Throwable th)
Specified by:
error in interface InstallContext

restartNeeded

public void restartNeeded(java.lang.String message)
Specified by:
restartNeeded in interface InstallContext

getExecutedTaskCount

public int getExecutedTaskCount()
Specified by:
getExecutedTaskCount in interface InstallContext

getTotalTaskCount

public int getTotalTaskCount()
Specified by:
getTotalTaskCount in interface InstallContext

getStatus

public InstallStatus getStatus()
Specified by:
getStatus in interface InstallContext

getMessages

public java.util.Map<java.lang.String,java.util.List<InstallContext.Message>> getMessages()
Description copied from interface: InstallContext
A Map of messages where the key is the module name.

Specified by:
getMessages in interface InstallContext

getCurrentModuleDefinition

public ModuleDefinition getCurrentModuleDefinition()
Description copied from interface: InstallContext
Allows generic tasks to know what's being installed/updated.

Specified by:
getCurrentModuleDefinition in interface InstallContext

isModuleRegistered

public boolean isModuleRegistered(java.lang.String moduleName)
Specified by:
isModuleRegistered in interface InstallContext

getHierarchyManager

public HierarchyManager getHierarchyManager(java.lang.String workspace)
Specified by:
getHierarchyManager in interface InstallContext

getConfigHierarchyManager

public HierarchyManager getConfigHierarchyManager()
Specified by:
getConfigHierarchyManager in interface InstallContext

hasModulesNode

public boolean hasModulesNode()
Specified by:
hasModulesNode in interface InstallContext

getModulesNode

public Content getModulesNode()
                       throws javax.jcr.RepositoryException
Specified by:
getModulesNode in interface InstallContext
Returns:
the root node for all modules in the config workspace.
Throws:
javax.jcr.RepositoryException

getOrCreateCurrentModuleNode

public Content getOrCreateCurrentModuleNode()
                                     throws javax.jcr.RepositoryException
Specified by:
getOrCreateCurrentModuleNode in interface InstallContext
Throws:
javax.jcr.RepositoryException

getOrCreateCurrentModuleConfigNode

public Content getOrCreateCurrentModuleConfigNode()
                                           throws javax.jcr.RepositoryException
Specified by:
getOrCreateCurrentModuleConfigNode in interface InstallContext
Throws:
javax.jcr.RepositoryException

log

protected void log(InstallContext.Message message)

getModuleKey

protected java.lang.String getModuleKey()
The key used in the map of messages. This is mostly because Maps keys in freemarker can only be Strings... We just need to make sure this is consistent accross templates...



Copyright © 2003-2010 Magnolia International Ltd.. All Rights Reserved.