Package org.dspace.app.cris.model

Examples of org.dspace.app.cris.model.Project


        ProjectDisplayTagData dto = (ProjectDisplayTagData) command;
        boolean check_change = false;
        for (ProjectDTO researcher : dto.getList())
        {
            Project realResearcher = applicationService
                    .get(Project.class, researcher.getId());
            if (realResearcher.getStatus() != null
                    && realResearcher.getStatus() != researcher.getStatus())
            {
                realResearcher.setStatus(researcher.getStatus());
                applicationService.saveOrUpdate(Project.class,
                        realResearcher);
                check_change = true;
            }
        }
View Full Code Here


    public int countBoxPublicMetadata(Integer objectID,
            BoxProject box, boolean b)
    {       
        int result = 0;
       
        Project p = getApplicationService().get(Project.class, objectID);
        for (IContainable cont : box.getMask())
        {

            if (cont instanceof DecoratorProjectTypeNested)
            {
                DecoratorProjectTypeNested decorator = (DecoratorProjectTypeNested) cont;
                ProjectTypeNestedObject real = (ProjectTypeNestedObject)decorator.getReal();
                List<ProjectNestedObject> results = getApplicationService()
                        .getNestedObjectsByParentIDAndTypoID(Integer
                                .parseInt(p.getIdentifyingValue()),
                                (real.getId()), ProjectNestedObject.class);
               
                external: for (ProjectNestedObject object : results)
                {
                    for (ProjectNestedPropertiesDefinition rpp : real
                            .getMask())
                    {                  
                       
                       
                            for (ProjectNestedProperty pp : object.getAnagrafica4view().get(rpp.getShortName()))
                            {
                                if (pp.getVisibility() == 1)
                                {
                                    result++;
                                    break external;
                                }
                            }

                       
                       
                    }
                }

            }

            
            if (cont instanceof DecoratorProjectPropertiesDefinition)
            {
                DecoratorProjectPropertiesDefinition decorator = (DecoratorProjectPropertiesDefinition) cont;
                result += ResearcherTagLibraryFunctions.countDynamicPublicMetadata(
                        p.getDynamicField(), decorator.getShortName(),
                        decorator.getRendering(), decorator.getReal(),
                        false);

            }
            
View Full Code Here

    {
        Map<String, Object> reference = new HashMap<String, Object>();
       
        String id_s = request.getParameter("id");
        Integer id = Integer.parseInt(id_s);
        Project grant = getApplicationService().get(
                    Project.class, id);
        Context context = UIUtil.obtainContext(request);       
        if (AuthorizeManager.isAdmin(context))       
        {
            reference.put("grant_page_menu", new Boolean(true));
View Full Code Here

        Boolean isAdmin = false;
        if (paramId != null)
        {
            id = Integer.parseInt(paramId);
        }
        Project grant = getApplicationService().get(Project.class, id);
        Context context = UIUtil.obtainContext(request);
        if (!AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException("Only system admin can edit");
        }
        else
        {
            isAdmin = true;
        }

        Integer areaId;
        if (paramTabId == null)
        {
            if (paramFuzzyTabId == null)
            {
                List<EditTabProject> tabs = getApplicationService()
                        .getTabsByVisibility(EditTabProject.class, isAdmin);
                if (tabs.isEmpty())
                {
                    throw new AuthorizeException("No tabs defined!!");
                }
                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()));
            }
            else
            {
                tipProprietaInArea
                        .addAll(getApplicationService()
                                .<BoxProject, it.cilea.osd.jdyna.web.Tab<BoxProject>> findContainableInPropertyHolder(
                                        getClazzBox(), iph.getId()));
            }
        }
        ProjectAdditionalFieldStorage dynamicObject = grant.getDynamicField();
        ProjectAnagraficaObjectDTO anagraficaObjectDTO = new ProjectAnagraficaObjectDTO(
                grant);
        anagraficaObjectDTO.setTabId(areaId);
        anagraficaObjectDTO.setObjectId(grant.getId());
        anagraficaObjectDTO.setParentId(grant.getId());
   
        List<ProjectPropertiesDefinition> realTPS = new LinkedList<ProjectPropertiesDefinition>();
        List<IContainable> structuralField = new LinkedList<IContainable>();
        for (IContainable c : tipProprietaInArea)
        {
View Full Code Here

        {
            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();
View Full Code Here

    protected void onBindAndValidate(HttpServletRequest request,
            Object command, BindException errors) throws Exception
    {

        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)
View Full Code Here

            HttpServletResponse response, Object command, BindException errors)
            throws Exception
    {
        ProjectDTO grantDTO = (ProjectDTO) command;
        String code = grantDTO.getSourceID();
        Project grant = null;
        if (code != null && !code.isEmpty())
        {
            grant = applicationService.getResearcherGrantByCode(code);
            if (grant != null)
            {

                return new ModelAndView("redirect:/cris/ou/"
                        + "administrator/index.htm?error=true");
            }
        }
        else
        {

            grant = new Project();
            grant.setSourceID(code);
            grant.setStatus(false);
            grant.getDynamicField().setProject(grant);
            applicationService.saveOrUpdate(Project.class, grant);

        }
        return new ModelAndView(getSuccessView() + grant.getId());

    }
View Full Code Here

    public ModelAndView handleDetails(HttpServletRequest request,
            HttpServletResponse response) throws Exception
    {
        Map<String, Object> model = new HashMap<String, Object>();

        Project grant = extractProject(request);

        if (grant == null)
        {
            response.sendError(HttpServletResponse.SC_NOT_FOUND,
                    "Grant page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);

        EPerson currentUser = context.getCurrentUser();
       
        if ((grant.getStatus() == null || grant.getStatus().booleanValue() == false)
                && !AuthorizeManager.isAdmin(context))
        {
           
            if (currentUser != null
                    || Authenticate.startAuthentication(context, request,
View Full Code Here

    }

    @Override
    protected Integer getAnagraficaId(HttpServletRequest request)
    {
        Project grant = null;
        try
        {
            grant = extractProject(request);
        }
        catch (NumberFormatException e)
        {
            return -1;
        }
        return grant.getDynamicField().getId();
    }
View Full Code Here

                    {

                        String projectcode = (String) (rpp.getValue()
                                .getObject());

                        Project rg = null;
                        // use dto to fill dynamic metadata
                        AnagraficaObjectDTO dtoRG = new AnagraficaObjectDTO();
                        AnagraficaObjectWithTypeDTO dtoNested = new AnagraficaObjectWithTypeDTO();
                        if (projectcode != null && !projectcode.isEmpty())
                        {
                            rg = applicationService
                                    .getResearcherGrantByCode(projectcode
                                            .trim());
                        }
                        else
                        {
                            log.error("Grant discarded ( projectCode not founded) [researcher: "
                                    + ResearcherPageUtils
                                            .getPersistentIdentifier(rp) + "]");
                            discardImported++;
                            continue;
                        }

                        // skip if only new grants mode and rg is found
                        if (newly && rg != null)
                        {
                            skipImported++;
                            continue;
                        }

                        // create new grants
                        if (rg == null)
                        {
                            log.info("Create new GRANT with code "
                                    + projectcode);
                            rg = new Project();
                            rg.setSourceID(projectcode);
                            rg.setStatus(active);
                            newImported++;
                        }
                        else
                        {
                            log.info("Edit GRANT with code " + projectcode);
View Full Code Here

TOP

Related Classes of org.dspace.app.cris.model.Project

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.