use of com.haulmont.cuba.web.sys.LinkHandler in project cuba by cuba-platform.
the class ScreenHistoryBrowse method openUrl.
protected void openUrl(Entity entity) {
ScreenHistoryEntity screenHistoryEntity = (ScreenHistoryEntity) entity;
Map<String, String> paramsScreen = new HashMap<>();
String url = screenHistoryEntity.getUrl();
url = url.substring(url.indexOf("\u003f") + 1);
paramsScreen.put("local", "true");
String[] params = url.split("&");
for (String param : params) {
String name = param.split("=")[0];
String value = param.split("=")[1];
paramsScreen.put(name, value);
}
List<String> actions = configuration.getConfig(WebConfig.class).getLinkHandlerActions();
LinkHandler linkHandler = AppBeans.getPrototype(LinkHandler.NAME, App.getInstance(), actions.isEmpty() ? "open" : actions.get(0), paramsScreen);
if (linkHandler.canHandleLink()) {
linkHandler.handle();
}
}
use of com.haulmont.cuba.web.sys.LinkHandler in project cuba by cuba-platform.
the class AppUI method processExternalLink.
public void processExternalLink(VaadinRequest request) {
WrappedSession wrappedSession = request.getWrappedSession();
String action = (String) wrappedSession.getAttribute(LAST_REQUEST_ACTION_ATTR);
if (webConfig.getLinkHandlerActions().contains(action)) {
// noinspection unchecked
Map<String, String> params = (Map<String, String>) wrappedSession.getAttribute(LAST_REQUEST_PARAMS_ATTR);
params = params != null ? params : Collections.emptyMap();
try {
LinkHandler linkHandler = AppBeans.getPrototype(LinkHandler.NAME, app, action, params);
if (app.connection.isConnected() && linkHandler.canHandleLink()) {
linkHandler.handle();
} else {
app.linkHandler = linkHandler;
}
} catch (Exception e) {
error(new com.vaadin.server.ErrorEvent(e));
}
}
}
Aggregations