Examples of DynamicAnagraficaObjectDTO


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

        if (AuthorizeManager.isAdmin(context))
        {
            isAdmin = true;
        }
       
        DynamicAnagraficaObjectDTO object = (DynamicAnagraficaObjectDTO)command;       
        // collection of edit tabs (all edit tabs created on system associate to
        // visibility)
        DynamicObjectType typo = getApplicationService().get(DynamicObjectType.class, object.getTipologiaId());
        List<EditTabDynamicObject> tabs = getApplicationService()
                .<BoxDynamicObject, DynamicObjectType, DynamicPropertiesDefinition, TabDynamicObject, EditTabDynamicObject>getEditTabsByVisibilityAndType(EditTabDynamicObject.class, isAdmin, typo);

        // check if request tab from view is active (check on collection before)
        EditTabDynamicObject editT = getApplicationService().get(
View Full Code Here

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

                                .<BoxDynamicObject, it.cilea.osd.jdyna.web.Tab<BoxDynamicObject>> findContainableInPropertyHolder(
                                        getClazzBox(), iph.getId()));
            }
        }
        DynamicAdditionalFieldStorage dynamicObject = entity.getDynamicField();
        DynamicAnagraficaObjectDTO anagraficaObjectDTO = new DynamicAnagraficaObjectDTO(
                entity);
        anagraficaObjectDTO.setTabId(areaId);
        anagraficaObjectDTO.setObjectId(entity.getId());
        anagraficaObjectDTO.setParentId(entity.getId());
        anagraficaObjectDTO.setTipologiaId(entity.getTypo().getId());
       
        List<DynamicPropertiesDefinition> realTPS = new LinkedList<DynamicPropertiesDefinition>();
        List<IContainable> structuralField = new LinkedList<IContainable>();
        for (IContainable c : tipProprietaInArea)
        {
View Full Code Here

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

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

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

        EditTabDynamicObject editT = getApplicationService().get(
                EditTabDynamicObject.class, anagraficaObjectDTO.getTabId());
        if (anagraficaObjectDTO.getNewTabId() != null)
        {
            exitPage += "&tabId=" + anagraficaObjectDTO.getNewTabId();
        }
        else
        {
            exitPage = "redirect:/cris/"+ getSpecificPartPath() +"/"
                    + ResearcherPageUtils.getPersistentIdentifier(
                            anagraficaObjectDTO.getParentId(),
                            ResearchObject.class) + "/"
                    + editT.getShortName().substring(4) + ".html";
        }
        if (request.getParameter("cancel") != null)
        {
            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);
        EditTabDynamicObject 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
Copyright © 2018 www.massapi.com. 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.