com.alogient.cameleon.sdk.form.service.FormService Maven / Gradle / Ivy
The newest version!
package com.alogient.cameleon.sdk.form.service;
import java.util.Map;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.alogient.cameleon.sdk.common.util.exception.SaveObjectException;
import com.alogient.cameleon.sdk.content.vo.CultureVo;
import com.alogient.cameleon.sdk.form.util.exception.FormNotFoundException;
import com.alogient.cameleon.sdk.form.vo.FormVo;
import com.alogient.cameleon.sdk.form.vo.submission.BasicCameleonFormSubmission;
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
public interface FormService {
public static final String EMAIL_HTML = "html";
/**
* Get the form from form id
*
* @param formId the id of the form
* @param cultureVo the culture vo
* @param isLiveMode true if the user is viewing the site in live mode
* @return a form
* @throws FormNotFoundException If the form could not be found or converted
*/
FormVo getForm(Integer formId, CultureVo cultureVo, Boolean isLiveMode) throws FormNotFoundException;
/**
* Get the form from form id
*
* @param formId the id of the form
* @param cultureId the culture id
* @param isLiveMode true if the user is viewing the site in live mode
* @return a form
* @throws FormNotFoundException If the form could not be found or converted
*/
FormVo getForm(Integer formId, Integer cultureId, Boolean isLiveMode) throws FormNotFoundException;
/**
* Used for polls. Get the count of for each element choice for a form element
*
* @param formElement The form element we want the count for
* @return A map of [element choice value, count]
*/
Map getAnswerCount(Integer formElement);
void submitForm(BasicCameleonFormSubmission submission, Boolean isLiveMode, String generator) throws SaveObjectException;
T getSubmittedForm(Long submissionId, Class submissionFormClass);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy