All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wiris.plugin.dispatchers.EditorDispatcher Maven / Gradle / Ivy

The newest version!
package com.wiris.plugin.dispatchers;

import java.io.IOException;
import java.io.PrintWriter;

import java.util.Iterator;
import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wiris.plugin.LibWIRIS;

public abstract class EditorDispatcher {
    public static void dispatch(Properties config, HttpServletRequest request, 
                                HttpServletResponse response) throws IOException {
        response.setContentType("text/html; charset=utf-8");
        PrintWriter out = response.getWriter();

        out.println("");
        out.print("<span class="hljs-string">WIRIS Formula Editor</span>
"); String language = request.getParameter("lang"); if (language != null) { config.setProperty("wirisformulaeditorlang", language); } Properties params = new Properties(); params.setProperty("lang", "wirisformulaeditorlang"); params.setProperty("identMathvariant", "wirisimageidentmathvariant"); params.setProperty("numberMathvariant", "wirisimagenumbermathvariant"); params.setProperty("fontIdent", "wirisimagefontident"); params.setProperty("fontNumber", "wirisimagefontnumber"); params.setProperty("version", "wirisimageserviceversion"); Iterator keys = params.keySet().iterator(); while (keys.hasNext()) { String key = (String)keys.next(); String value = params.getProperty(key); String param = config.getProperty(value); if (param != null) { out.print(""); } } String fontRangesParam = config.getProperty("wirisimagefontranges"); if (fontRangesParam != null) { String[] fontRanges = fontRangesParam.split(","); for (int i = 0; i < fontRanges.length; ++i) { String fontRangeName = fontRanges[i].trim(); String fontRange = config.getProperty(fontRangeName); if (fontRange != null) { out.print(""); } } } out.print("

You need JAVA® to use WIRIS tools.
FREE download from www.java.com

"); out.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy