ui = cmsWebApp.getCmsApp().initUi(parent);
ui.setData(CmsApp.UI_NAME_PROPERTY, uiName);
ui.setLayoutData(CmsUiUtils.fillAll());
+ // we need ui to be set before refresh so that CmsView can store UI context data
+ // in it.
+ cmsWebApp.getCmsApp().refreshUi(ui, null);
} catch (Exception e) {
throw new IllegalStateException("Cannot create entrypoint contents", e);
}
return cmsSession;
}
+ @Override
+ public Object getData(String key) {
+ if (ui != null) {
+ return ui.getData(key);
+ } else {
+ throw new IllegalStateException("UI is not initialized");
+ }
+ }
+
+ @Override
+ public void setData(String key, Object value) {
+ if (ui != null) {
+ ui.setData(key, value);
+ } else {
+ throw new IllegalStateException("UI is not initialized");
+ }
+ }
+
/*
* EntryPoint IMPLEMENTATION
*/
boolean isAnonymous();
/**
- * Send an event to this topic. Does noothing by default., but if implemented it
+ * Send an event to this topic. Does nothing by default., but if implemented it
* MUST set the {@link #CMS_VIEW_UID_PROPERTY} in the properties.
*/
default void sendEvent(String topic, Map<String, Object> properties) {
throw new UnsupportedOperationException();
}
+ default Object getData(String key) {
+ throw new UnsupportedOperationException();
+ }
+
+ default void setData(String key, Object value) {
+ throw new UnsupportedOperationException();
+ }
+
static CmsView getCmsView(Control parent) {
// find parent shell
Shell topShell = parent.getShell();