use of org.asqatasun.webapp.entity.scenario.Scenario in project Asqatasun by Asqatasun.
the class AuditScenarioController method displayScenarioSetUp.
@RequestMapping(value = TgolKeyStore.AUDIT_SCENARIO_SET_UP_CONTRACT_URL, method = RequestMethod.GET)
@Secured({ TgolKeyStore.ROLE_USER_KEY, TgolKeyStore.ROLE_ADMIN_KEY })
public String displayScenarioSetUp(@RequestParam(TgolKeyStore.CONTRACT_ID_KEY) String contractId, @RequestParam(TgolKeyStore.SCENARIO_ID_KEY) String scenarioId, HttpServletRequest request, HttpServletResponse response, Model model) {
Scenario scenario = scenarioDataService.read(Long.valueOf(scenarioId));
model.addAttribute(TgolKeyStore.SCENARIO_KEY, scenario);
return displayAuditSetUpView(TgolKeyStore.AUDIT_SCENARIO_SET_UP_VIEW_NAME, contractId, scenarioId, getScenarioOptionFormFieldBuilderMap(), ScopeEnum.SCENARIO, model);
}
use of org.asqatasun.webapp.entity.scenario.Scenario in project Asqatasun by Asqatasun.
the class AsqatasunOrchestratorImpl method auditScenario.
@Override
public void auditScenario(Contract contract, Long idScenario, String clientIp, Set<Parameter> parameterSet, Locale locale) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Scenarion audit on scenario with id" + idScenario);
for (Parameter param : parameterSet) {
LOGGER.debug("param " + param.getValue() + " " + param.getParameterElement().getParameterElementCode());
}
}
Act act = createAct(contract, ScopeEnum.SCENARIO, clientIp);
Scenario scenario = scenarioDataService.read(idScenario);
AuditThread auditScenarioThread = new AuditScenarioThread(scenario.getLabel(), scenario.getContent(), auditService, act, parameterSet, locale);
threadPoolTaskExecutor.submit(auditScenarioThread);
}
use of org.asqatasun.webapp.entity.scenario.Scenario in project Asqatasun by Asqatasun.
the class ContractDAOImplTest method testSaveOrUpdate.
/**
* Test of saveOrUpdate method, of class ContractDAOImpl.
*/
public void testSaveOrUpdate() {
System.out.println("saveOrUpdate");
Date beginDate = new Date();
Date endDate = new Date();
Date renewalDate = new Date();
int nbOfContract = contractDAO.findAll().size();
Set<Functionality> functionalitySet = new HashSet<Functionality>();
Set<OptionElement> optionElementSet = new HashSet<OptionElement>();
Set<Referential> referenceSet = new HashSet<Referential>();
Set<Scenario> scenarioSet = new HashSet<Scenario>();
Contract contract = contractFactory.createContract("Contract-test", beginDate, endDate, renewalDate, Float.valueOf(200), functionalitySet, optionElementSet, referenceSet, scenarioSet, null);
contractDAO.saveOrUpdate(contract);
assertEquals(nbOfContract + 1, contractDAO.findAll().size());
}
Aggregations