use of org.asqatasun.entity.option.OptionElement in project Asqatasun by Asqatasun.
the class AuditLauncherController method setUserParameters.
/**
* Some user options have to be converted as parameters and added to the
* general audit parameters.
*
* @param paramSet
* @param referentialKey
* @return
*/
private Set<Parameter> setUserParameters(Set<Parameter> paramSet, String referentialKey) {
User user = getCurrentUser();
Collection<OptionElement> optionElementSet = new HashSet<>();
for (String optionFamily : USER_OPTION_DEPENDING_ON_REFERENTIAL) {
optionElementSet.addAll(optionElementDataService.getOptionElementFromUserAndFamilyCode(user, referentialKey + "_" + optionFamily));
}
for (String optionFamily : userOption) {
optionElementSet.addAll(optionElementDataService.getOptionElementFromUserAndFamilyCode(user, optionFamily));
}
paramSet.addAll(parameterDataService.getParameterSetFromOptionElementSet(optionElementSet));
return paramSet;
}
use of org.asqatasun.entity.option.OptionElement in project Asqatasun by Asqatasun.
the class ParameterDataServiceImpl method getParameterSetFromOptionElementSet.
public Collection<Parameter> getParameterSetFromOptionElementSet(Collection<OptionElement> optionElementSet) {
Set<Parameter> paramSet = new HashSet<>();
for (OptionElement optionElement : optionElementSet) {
ParameterElement pe = parameterElementDataService.getParameterElement(optionElement.getOption().getCode());
if (pe != null) {
Parameter p = getParameter(pe, optionElement.getValue());
p = saveOrUpdate(p);
paramSet.add(p);
}
}
return paramSet;
}
Aggregations