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

org.molgenis.questionnaires.ThankYouTextService Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.questionnaires;

import org.molgenis.ui.controller.StaticContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ThankYouTextService
{
	private final StaticContentService staticContentService;
	private static final String DEFAULT_THANK_YOU_TEXT = "

Thank you for submitting the questionnaire.

"; @Autowired public ThankYouTextService(StaticContentService staticContentService) { this.staticContentService = staticContentService; } public String getThankYouText(String questionnaireName) { String key = getStaticContentKey(questionnaireName); String text = staticContentService.getContent(key); if (text == null) { text = DEFAULT_THANK_YOU_TEXT; staticContentService.submitContent(key, text); } return text; } public void saveThankYouText(String questionnaireName, String text) { String key = getStaticContentKey(questionnaireName); staticContentService.submitContent(key, text); } private String getStaticContentKey(String questionnaireName) { return String.format("%s_thankYouText", questionnaireName); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy