addWarning("Error calling TML action: " + e.getMessage());
}
}
// Conditionally execute special action changeLanguage
WGPRequestPath path = (WGPRequestPath) request.getAttribute(WGACore.ATTRIB_REQUESTPATH);
if (path.getPreferredLanguageChange() != null) {
actionLink = new TMLActionLink(request.getSession());
actionLink.setDefaultAction(TMLAction.DEFAULTACTION_CHANGELANGUAGE);
try {
if (path.getPreferredLanguageChange().equals(WGPRequestPath.PREFERREDLANGUAGECHANGE_USECONTENT)) {
actionLink.setParam1((String) getTMLContext().meta("language"));
}
else {
actionLink.setParam1(path.getPreferredLanguageChange());
}
actionLink.setContextPath(getTMLContext().getpath());
TMLAction calledAction = callAction(actionLink, ajax);
// In case of a called master action we rebuild the session of the current db
// To let the following WebTML request reflect eventually done changes in the action
if (calledAction != null && calledAction.isMaster()) {
getTMLContext().db().reopenSession();
}
}
catch (TMLActionException e) {
addWarning("Error changing preferred language to '" + path.getPreferredLanguageChange() + "' bc of exception: " + e.getClass().getName() + " message: " + e.getMessage());
log.error("Error changing preferred language to '" + path.getPreferredLanguageChange() + "'", e);
}
catch (WGAPIException e) {
addWarning("Error changing preferred language to '" + path.getPreferredLanguageChange() + "' bc of exception: " + e.getClass().getName() + " message: " + e.getMessage());
log.error("Error changing preferred language to '" + path.getPreferredLanguageChange() + "'", e);
}
actioncalled = true;
}