Package org.dspace.app.cris.model.jdyna

Examples of org.dspace.app.cris.model.jdyna.EditTabProject


        // visibility)
        List<EditTabProject> tabs = getApplicationService()
                .getTabsByVisibility(EditTabProject.class, isAdmin);

        // check if request tab from view is active (check on collection before)
        EditTabProject editT = getApplicationService().get(
                EditTabProject.class, anagraficaObjectDTO.getTabId());
        if (!tabs.contains(editT))
        {
            throw new AuthorizeException(
                    "You not have needed authorization level to display this tab");
        }

        // collection of boxs
        List<BoxProject> propertyHolders = new LinkedList<BoxProject>();

        // if edit tab got a display tab (edit tab is hookup to display tab)
        // then edit box will be created from display box otherwise get all boxs
        // in edit tab
        if (editT.getDisplayTab() != null)
        {
            for (BoxProject box : editT.getDisplayTab().getMask())
            {
                propertyHolders.add(box);
            }
        }
        else
View Full Code Here


                }
                areaId = tabs.get(0).getId();
            }
            else
            {
                EditTabProject fuzzyEditTab = (EditTabProject) ((ApplicationService) getApplicationService())
                        .<BoxProject, TabProject, EditTabProject>getEditTabByDisplayTab(
                                Integer.parseInt(paramFuzzyTabId),
                                EditTabProject.class);
                areaId = fuzzyEditTab.getId();
            }
        }
        else
        {
            areaId = Integer.parseInt(paramTabId);
        }

        EditTabProject editT = getApplicationService().get(
                EditTabProject.class, areaId);
        List<BoxProject> propertyHolders = new LinkedList<BoxProject>();
        if (editT.getDisplayTab() != null)
        {
            for (BoxProject box : editT.getDisplayTab().getMask())
            {
                propertyHolders.add(box);
            }
        }
        else
        {
            propertyHolders = getApplicationService().findPropertyHolderInTab(
                    getClazzTab(), areaId);
        }

        List<IContainable> tipProprietaInArea = new LinkedList<IContainable>();

        for (BoxProject iph : propertyHolders)
        {
            if (editT.getDisplayTab() != null)
            {
                tipProprietaInArea
                        .addAll(getApplicationService()
                                .<BoxProject, it.cilea.osd.jdyna.web.Tab<BoxProject>> findContainableInPropertyHolder(
                                        BoxProject.class, iph.getId()));
View Full Code Here

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

       
        EditTabProject editT = getApplicationService().get(
                EditTabProject.class, anagraficaObjectDTO.getTabId());
        if (anagraficaObjectDTO.getNewTabId() != null)
        {
            exitPage += "&tabId=" + anagraficaObjectDTO.getNewTabId();
        }
        else
        {
            exitPage = "redirect:/cris/project/"
                    + ResearcherPageUtils.getPersistentIdentifier(anagraficaObjectDTO
                                    .getParentId(), Project.class) + "/"
                    + editT.getShortName().substring(4) + ".html";
        }
        if (request.getParameter("cancel") != null)
        {
            return new ModelAndView(exitPage);
        }
       
       
        Project grant = getApplicationService().get(Project.class,
                anagraficaObjectDTO.getParentId());
        ProjectAdditionalFieldStorage myObject = grant.getDynamicField();
       
        List<BoxProject> propertyHolders = new LinkedList<BoxProject>();
        if (editT.getDisplayTab() != null)
        {
            for (BoxProject box : editT.getDisplayTab().getMask())
            {
                propertyHolders.add(box);
            }
        }
        else
        {
            propertyHolders = getApplicationService().findPropertyHolderInTab(
                    getClazzTab(), anagraficaObjectDTO.getTabId());
        }

        List<IContainable> tipProprietaInArea = new LinkedList<IContainable>();

        for (BoxProject iph : propertyHolders)
        {

            tipProprietaInArea
                    .addAll(getApplicationService()
                            .<BoxProject, it.cilea.osd.jdyna.web.Tab<BoxProject>> findContainableInPropertyHolder(
                                    getClazzBox(), iph.getId()));

        }

        List<ProjectPropertiesDefinition> realTPS = new LinkedList<ProjectPropertiesDefinition>();
        List<IContainable> structuralField = new LinkedList<IContainable>();
        for (IContainable c : tipProprietaInArea)
        {
            ProjectPropertiesDefinition rpPd = getApplicationService()
                    .findPropertiesDefinitionByShortName(
                            ProjectPropertiesDefinition.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(Project.class, grant);
        EditTabProject 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

        AnagraficaObjectAreaDTO dto = (AnagraficaObjectAreaDTO) command;
        Project researcher = getApplicationService().get(Project.class,
                dto.getParentId());
        ProjectAdditionalFieldStorage myObject = researcher.getDynamicField();

        EditTabProject editT = getApplicationService().get(
                EditTabProject.class, dto.getTabId());
        List<BoxProject> propertyHolders = new LinkedList<BoxProject>();
        if (editT.getDisplayTab() != null)
        {
            for (BoxProject box : editT.getDisplayTab().getMask())
            {
                propertyHolders.add(box);
            }
        }
        else
View Full Code Here

TOP

Related Classes of org.dspace.app.cris.model.jdyna.EditTabProject

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.