return new ModelAndView(exitPage);
}
ResearcherPage researcher = getApplicationService().get(
ResearcherPage.class, anagraficaObjectDTO.getParentId());
RPAdditionalFieldStorage myObject = researcher.getDynamicField();
List<BoxResearcherPage> propertyHolders = new LinkedList<BoxResearcherPage>();
if (editT.getDisplayTab() != null)
{
for (BoxResearcherPage box : editT.getDisplayTab()
.getMask())
{
propertyHolders.add(box);
}
}
else
{
propertyHolders = getApplicationService().findPropertyHolderInTab(
getClazzTab(), anagraficaObjectDTO.getTabId());
}
List<IContainable> tipProprietaInArea = new LinkedList<IContainable>();
for (BoxResearcherPage iph : propertyHolders)
{
tipProprietaInArea
.addAll(getApplicationService()
.<BoxResearcherPage, it.cilea.osd.jdyna.web.Tab<BoxResearcherPage>> findContainableInPropertyHolder(
getClazzBox(), iph.getId()));
}
List<RPPropertiesDefinition> realTPS = new LinkedList<RPPropertiesDefinition>();
List<IContainable> structuralField = new LinkedList<IContainable>();
for (IContainable c : tipProprietaInArea)
{
RPPropertiesDefinition rpPd = getApplicationService()
.findPropertiesDefinitionByShortName(
RPPropertiesDefinition.class, c.getShortName());
if (rpPd != null)
{
realTPS.add(rpPd);
}
else
{
structuralField.add(c);
}
}
AnagraficaUtils.reverseDTO(anagraficaObjectDTO, myObject, realTPS);
myObject.pulisciAnagrafica();
researcher.setSourceID(anagraficaObjectDTO.getSourceID());
researcher.setStatus(anagraficaObjectDTO.getStatus());
researcher.setEpersonID(anagraficaObjectDTO.getEpersonID());
getApplicationService().saveOrUpdate(ResearcherPage.class, researcher);