}
OrganizationUnit grant = getApplicationService().get(OrganizationUnit.class,
anagraficaObjectDTO.getParentId());
OUAdditionalFieldStorage myObject = grant.getDynamicField();
List<BoxOrganizationUnit> propertyHolders = new LinkedList<BoxOrganizationUnit>();
if (editT.getDisplayTab() != null)
{
for (BoxOrganizationUnit box : editT.getDisplayTab().getMask())
{
propertyHolders.add(box);
}
}
else
{
propertyHolders = getApplicationService().findPropertyHolderInTab(
getClazzTab(), anagraficaObjectDTO.getTabId());
}
List<IContainable> tipProprietaInArea = new LinkedList<IContainable>();
for (BoxOrganizationUnit iph : propertyHolders)
{
tipProprietaInArea
.addAll(getApplicationService()
.<BoxOrganizationUnit, it.cilea.osd.jdyna.web.Tab<BoxOrganizationUnit>> findContainableInPropertyHolder(
getClazzBox(), iph.getId()));
}
List<OUPropertiesDefinition> realTPS = new LinkedList<OUPropertiesDefinition>();
List<IContainable> structuralField = new LinkedList<IContainable>();
for (IContainable c : tipProprietaInArea)
{
OUPropertiesDefinition rpPd = getApplicationService()
.findPropertiesDefinitionByShortName(
OUPropertiesDefinition.class, c.getShortName());
if (rpPd != null)
{
realTPS.add(rpPd);
}
else
{
structuralField.add(c);
}
}
AnagraficaUtils.reverseDTO(anagraficaObjectDTO, myObject, realTPS);
myObject.pulisciAnagrafica();
grant.setSourceID(anagraficaObjectDTO.getSourceID());
grant.setStatus(anagraficaObjectDTO.getStatus());
getApplicationService().saveOrUpdate(OrganizationUnit.class, grant);
EditTabOrganizationUnit area = getApplicationService().get(getClazzTab(),