Package org.dspace.app.webui.cris.dto

Examples of org.dspace.app.webui.cris.dto.OUAnagraficaObjectDTO


                                .<BoxOrganizationUnit, it.cilea.osd.jdyna.web.Tab<BoxOrganizationUnit>> findContainableInPropertyHolder(
                                        getClazzBox(), iph.getId()));
            }
        }
        OUAdditionalFieldStorage dynamicObject = grant.getDynamicField();
        OUAnagraficaObjectDTO anagraficaObjectDTO = new OUAnagraficaObjectDTO(
                grant);
        anagraficaObjectDTO.setTabId(areaId);
        anagraficaObjectDTO.setObjectId(grant.getId());
        anagraficaObjectDTO.setParentId(grant.getId());
   

        List<OUPropertiesDefinition> realTPS = new LinkedList<OUPropertiesDefinition>();
        List<IContainable> structuralField = new LinkedList<IContainable>();
        for (IContainable c : tipProprietaInArea)
View Full Code Here


    @Override
    protected ModelAndView onSubmit(HttpServletRequest request,
            HttpServletResponse response, Object object, BindException errors)
            throws Exception
    {
        OUAnagraficaObjectDTO anagraficaObjectDTO = (OUAnagraficaObjectDTO) object;

        String exitPage = "redirect:/cris/tools/ou/editDynamicData.htm?id="
                + anagraficaObjectDTO.getParentId();

       
        EditTabOrganizationUnit editT = getApplicationService().get(
                EditTabOrganizationUnit.class, anagraficaObjectDTO.getTabId());
        if (anagraficaObjectDTO.getNewTabId() != null)
        {
            exitPage += "&tabId=" + anagraficaObjectDTO.getNewTabId();
        }
        else
        {
            exitPage = "redirect:/cris/ou/"
                    + ResearcherPageUtils.getPersistentIdentifier(anagraficaObjectDTO
                                    .getParentId(), OrganizationUnit.class) + "/"
                    + editT.getShortName().substring(4) + ".html";
        }
        if (request.getParameter("cancel") != null)
        {
            return new ModelAndView(exitPage);
        }
       
       
        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(),
                anagraficaObjectDTO.getTabId());
        final String areaTitle = area.getTitle();
        saveMessage(
                request,
                getText("action.anagrafica.edited", new Object[] { areaTitle },
                        request.getLocale()));
View Full Code Here

TOP

Related Classes of org.dspace.app.webui.cris.dto.OUAnagraficaObjectDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.