use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.
the class Asqatasun method getAuditPageParameterSet.
/**
* The default parameter set embeds a depth value that corresponds to the
* site audit. We need here to replace this parameter by a parameter value
* equals to 0.
*
* @return
*/
private Set<Parameter> getAuditPageParameterSet(Set<Parameter> defaultParameterSet) {
ParameterElement parameterElement = parameterElementDataService.getParameterElement("DEPTH");
Parameter depthParameter = parameterDataService.getParameter(parameterElement, "0");
Set<Parameter> auditPageParamSet = parameterDataService.updateParameter(defaultParameterSet, depthParameter);
return auditPageParamSet;
}
use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.
the class Asqatasun method getParameterSetFromAuditLevel.
/**
*
* @param auditLevel
* @return
*/
private Set<Parameter> getParameterSetFromAuditLevel(String ref, String level) {
if (ref.equalsIgnoreCase(RGAA30_REF) || ref.equalsIgnoreCase(RGAA32016_REF)) {
if (level.equalsIgnoreCase(BRONZE_LEVEL)) {
level = A_LEVEL;
} else if (level.equalsIgnoreCase(SILVER_LEVEL)) {
level = AA_LEVEL;
} else if (level.equalsIgnoreCase(GOLD_LEVEL)) {
level = AAA_LEVEL;
}
}
if (level.equalsIgnoreCase(BRONZE_LEVEL) || level.equalsIgnoreCase(A_LEVEL)) {
level = LEVEL_1;
} else if (level.equalsIgnoreCase(SILVER_LEVEL) || level.equalsIgnoreCase(AA_LEVEL)) {
level = LEVEL_2;
} else if (level.equalsIgnoreCase(GOLD_LEVEL) || level.equalsIgnoreCase(AAA_LEVEL)) {
level = LEVEL_3;
}
ParameterElement levelParameterElement = parameterElementDataService.getParameterElement(LEVEL_PARAMETER_ELEMENT_CODE);
Parameter levelParameter = parameterDataService.getParameter(levelParameterElement, ref + ";" + level);
Set<Parameter> paramSet = parameterDataService.getDefaultParameterSet();
return parameterDataService.updateParameter(paramSet, levelParameter);
}
use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.
the class ParameterElementFactoryImpl method createParameter.
@Override
public ParameterElement createParameter(ParameterFamily parameterFamily) {
ParameterElement parameterElement = new ParameterElementImpl();
parameterElement.setParameterFamily(parameterFamily);
return parameterElement;
}
use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.
the class ParameterElementDAOImpl method findParameterElementFromCode.
@Override
public ParameterElement findParameterElementFromCode(String parameterElementCode) {
Query query = entityManager.createQuery("SELECT pe FROM " + getEntityClass().getName() + " pe" + " WHERE pe.parameterElementCode = :parameterElementCode");
query.setParameter("parameterElementCode", parameterElementCode);
try {
return (ParameterElement) query.getSingleResult();
} catch (NoResultException nre) {
return null;
} catch (NonUniqueResultException nure) {
return null;
}
}
use of org.asqatasun.entity.parameterization.ParameterElement in project Asqatasun by Asqatasun.
the class AuditLauncherController method getAuditPageParameterSet.
/**
* The default parameter set embeds a depth value that corresponds to the
* site audit. We need here to replace this parameter by a parameter value
* equals to 0.
*
* @return
*/
private Set<Parameter> getAuditPageParameterSet(int nbOfPages) {
Set<Parameter> paramSet = new HashSet<>();
ParameterElement depthParameterElement = parameterElementDataService.getParameterElement(TgolKeyStore.DEPTH_PARAM_KEY);
ParameterElement maxDocParameterElement = parameterElementDataService.getParameterElement(TgolKeyStore.MAX_DOCUMENT_PARAM_KEY);
Parameter depthParameter = parameterDataService.getParameter(depthParameterElement, TgolKeyStore.DEPTH_PAGE_PARAM_VALUE);
Parameter maxDocParameter = parameterDataService.getParameter(maxDocParameterElement, String.valueOf(nbOfPages));
paramSet.add(depthParameter);
paramSet.add(maxDocParameter);
return parameterDataService.updateParameterSet(getDefaultParamSet(), paramSet);
}
Aggregations