import java.util.Map;
+import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
/** Simple header/body ergonomics. */
public class SimpleErgonomics extends AbstractCmsEntryPoint {
+ private static final long serialVersionUID = 8743413921359548523L;
+
private final static Log log = LogFactory.getLog(SimpleErgonomics.class);
private boolean uiInitialized = false;
private CmsImageManager imageManager = new ImageManagerImpl();
private UxContext uxContext = null;
- public SimpleErgonomics(Repository repository, String workspace,
- String defaultPath, CmsUiProvider uiProvider,
+ public SimpleErgonomics(Repository repository, String workspace, String defaultPath, CmsUiProvider uiProvider,
Map<String, String> factoryProperties) {
super(repository, workspace, defaultPath, factoryProperties);
this.uiProvider = uiProvider;
// Exception
Throwable exception = getException();
if (exception != null) {
- SystemNotifications systemNotifications = new SystemNotifications(
- bodyArea);
+ SystemNotifications systemNotifications = new SystemNotifications(bodyArea);
systemNotifications.notifyException(exception);
resetException();
return;
bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
try {
- uiProvider.createUi(bodyArea, getNode());
+ Node node = getNode();
+ if (node == null)
+ log.error("Context cannot be null");
+ else
+ uiProvider.createUi(bodyArea, node);
} catch (RepositoryException e) {
throw new CmsException("Cannot refresh body", e);
}