class TemplateHelper {

	public String replace(String text, String values) {
		if (params == null) {
			return text;
		}
		JsonObject obj = parseValues(values);

		for (TemplateParam p : params) {
			String value = "-missing value-";
			if (obj != null && obj.has(p.getKey())) {
				value = obj.get(p.getKey()).getAsString();
				if ("file".equalsIgnoreCase(p.getType())) {
					value = "/s/api/fileservice/files/" + value + "/content";
				}
			} else if ("file".equalsIgnoreCase(p.getType())) {
				value = "/ui/img/image_preview.png";
			}
			text = StringUtils.replace(text, "{{" + p.getKey() + "}}", value);
		}

		return text;
	}

	public  TemplateHelper(String params);

}