Search in sources :

Example 61 with StringOutput

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();
}
Also used : StringOutput(org.olat.core.gui.render.StringOutput)

Example 62 with StringOutput

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 "";
    }
}
Also used : StringOutput(org.olat.core.gui.render.StringOutput) IOException(java.io.IOException)

Example 63 with StringOutput

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;
}
Also used : StringOutput(org.olat.core.gui.render.StringOutput)

Example 64 with StringOutput

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();
}
Also used : Window(org.olat.core.gui.components.Window) StringOutput(org.olat.core.gui.render.StringOutput) ChiefController(org.olat.core.gui.control.ChiefController) URLBuilder(org.olat.core.gui.render.URLBuilder)

Example 65 with StringOutput

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();
}
Also used : Window(org.olat.core.gui.components.Window) StringOutput(org.olat.core.gui.render.StringOutput) URLBuilder(org.olat.core.gui.render.URLBuilder)

Aggregations

StringOutput (org.olat.core.gui.render.StringOutput)188 IOException (java.io.IOException)48 URLBuilder (org.olat.core.gui.render.URLBuilder)30 Renderer (org.olat.core.gui.render.Renderer)26 Block (uk.ac.ed.ph.jqtiplus.node.content.basic.Block)24 RenderResult (org.olat.core.gui.render.RenderResult)22 Component (org.olat.core.gui.components.Component)10 Translator (org.olat.core.gui.translator.Translator)10 Locale (java.util.Locale)8 Window (org.olat.core.gui.components.Window)8 Form (org.olat.core.gui.components.form.flexible.impl.Form)8 VelocityRenderDecorator (org.olat.core.gui.render.velocity.VelocityRenderDecorator)8 ArrayList (java.util.ArrayList)6 StreamResult (javax.xml.transform.stream.StreamResult)6 Test (org.junit.Test)6 GlobalSettings (org.olat.core.gui.GlobalSettings)6 ComponentRenderer (org.olat.core.gui.components.ComponentRenderer)6 DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)6 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)6 Matcher (java.util.regex.Matcher)5