use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class FormDecorator method appendFlexiFormDirty.
public String appendFlexiFormDirty(String id) {
StringOutput sb = new StringOutput(256);
FormJSHelper.appendFlexiFormDirty(sb, container.getRootForm(), id);
return sb.toString();
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class FormJSHelper method getXHRFnCallFor.
/**
* Build the javascript method to send a flexi form event with all possible settings.
*
* @param form The form object
* @param id The id of the element
* @param actionIndex The type of event (click...)
* @param dirtyCheck If false, the dirty check is by passed
* @param pushState If true, the state (visible url in browser) will be pushed to the browser
* @param submit If true, the form will be submitted but it only works for none multi part forms.
* @param pairs Additional name value pairs send by the link
* @return
*/
public static String getXHRFnCallFor(Form form, String id, int actionIndex, boolean dirtyCheck, boolean pushState, boolean submit, NameValuePair... pairs) {
try (StringOutput sb = new StringOutput(128)) {
sb.append("o_ffXHREvent('").append(form.getFormName()).append("','").append(form.getDispatchFieldId()).append("','").append(id).append("','").append(form.getEventFieldId()).append("','").append(FormEvent.ON_DOTDOTDOT[actionIndex]).append("',").append(dirtyCheck).append(",").append(pushState).append(",").append(submit);
if (pairs != null && pairs.length > 0) {
for (NameValuePair pair : pairs) {
sb.append(",'").append(pair.getName()).append("','").append(pair.getValue()).append("'");
}
}
sb.append(")");
return sb.toString();
} catch (IOException e) {
log.error("", e);
return "";
}
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class WizardInfoController method renderWizardSteps.
/**
* [used by velocity!!]
* @param strStep
* @param strMaxStep
* @return
*/
public StringOutput renderWizardSteps(String strStep, String strMaxStep) throws IOException {
int step = Integer.parseInt(strStep);
int maxStep = Integer.parseInt(strMaxStep);
StringOutput sb = new StringOutput(100);
renderWizardSteps(sb, maxStep, step);
return sb;
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class RESTDispatcher method getRedirectToURL.
private String getRedirectToURL(UserSession usess) {
ChiefController cc = Windows.getWindows(usess).getChiefController();
Window w = cc.getWindow();
URLBuilder ubu = new URLBuilder(WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED, w.getInstanceId(), String.valueOf(w.getTimestamp()));
StringOutput sout = new StringOutput(30);
ubu.buildURI(sout, null, null);
return sout.toString();
}
use of org.olat.core.gui.render.StringOutput in project openolat by klemens.
the class RemoteLoginformDispatcher method getRedirectToURL.
private String getRedirectToURL(UserSession usess) {
Window w = Windows.getWindows(usess).getChiefController().getWindow();
URLBuilder ubu = new URLBuilder("", w.getInstanceId(), String.valueOf(w.getTimestamp()));
StringOutput sout = new StringOutput(30);
ubu.buildURI(sout, null, null);
return WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED + sout.toString();
}
Aggregations