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