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;
parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
parent.setLayout(CmsUtils.noSpaceGridLayout());
- // createAdminArea(parent);
+ uxContext = new SimpleUxContext();
+ if (!getUxContext().isMasterData())
+ createAdminArea(parent);
headerArea = new Composite(parent, SWT.NONE);
headerArea.setLayout(new FillLayout());
GridData headerData = new GridData(SWT.FILL, SWT.FILL, false, false);
bodyArea.setData(RWT.CUSTOM_VARIANT, CmsStyles.CMS_BODY);
bodyArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
- uxContext = new SimpleUxContext();
uiInitialized = true;
refresh();
}
// 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);
}