X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api%2Fsrc%2Forg%2Fargeo%2Fapi%2Fcms%2FCmsView.java;fp=org.argeo.api%2Fsrc%2Forg%2Fargeo%2Fapi%2Fcms%2FCmsView.java;h=0000000000000000000000000000000000000000;hb=7d2a002f5dcfe8a8c7b29803b70d4b1aff265ed1;hp=c7ca1e90cbc11848dab04137d9fc5b145a5fd817;hpb=865fc51900459b888938cc0d6943673ee6f20d09;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.api/src/org/argeo/api/cms/CmsView.java b/org.argeo.api/src/org/argeo/api/cms/CmsView.java deleted file mode 100644 index c7ca1e90c..000000000 --- a/org.argeo.api/src/org/argeo/api/cms/CmsView.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.argeo.api.cms; - -import java.security.PrivilegedAction; -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.LoginContext; - -/** Provides interaction with the CMS system. */ -public interface CmsView { - final static String CMS_VIEW_UID_PROPERTY = "argeo.cms.view.uid"; - // String KEY = "org.argeo.cms.ui.view"; - - String getUid(); - - UxContext getUxContext(); - - // NAVIGATION - void navigateTo(String state); - - // SECURITY - void authChange(LoginContext loginContext); - - void logout(); - - // void registerCallbackHandler(CallbackHandler callbackHandler); - - // SERVICES - void exception(Throwable e); - - CmsImageManager getImageManager(); - - boolean isAnonymous(); - - /** - * 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 properties) { - - } - - /** - * Convenience methods for when {@link #sendEvent(String, Map)} only requires - * one single parameter. - */ - default void sendEvent(String topic, String param, Object value) { - Map properties = new HashMap<>(); - properties.put(param, value); - sendEvent(topic, properties); - } - - default void applyStyles(Object widget) { - - } - - default T doAs(PrivilegedAction action) { - throw new UnsupportedOperationException(); - } - - default Void runAs(Runnable runnable) { - return doAs(new PrivilegedAction() { - - @Override - public Void run() { - if (runnable != null) - runnable.run(); - return null; - } - }); - } - - default void stateChanged(String state, String title) { - } - - default CmsSession getCmsSession() { - throw new UnsupportedOperationException(); - } - - default Object getData(String key) { - throw new UnsupportedOperationException(); - } - - @SuppressWarnings("unchecked") - default T getUiContext(Class clss) { - return (T) getData(clss.getName()); - } - - default void setUiContext(Class clss, T instance) { - setData(clss.getName(), instance); - } - - default void setData(String key, Object value) { - throw new UnsupportedOperationException(); - } - -}