Package org.dspace.app.cris.model

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


            response.sendRedirect(request.getContextPath()+ "/dspace-admin/");
        }
        else
        {
            Integer id = currUser.getID();
            ResearcherPage rp = applicationService.getResearcherPageByEPersonId(id);
            if (rp != null && rp.getStatus() != null && rp.getStatus().booleanValue())
            {
                response.sendRedirect(request.getContextPath() + "/rp/" + ResearcherPageUtils.getPersistentIdentifier(rp));
            }
            else
            {
View Full Code Here


    {
        Map<String, Object> reference = new HashMap<String, Object>();
       
        String id_s = request.getParameter("id");
        Integer id = Integer.parseInt(id_s);
        ResearcherPage researcher = getApplicationService().get(
                    ResearcherPage.class, id);
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context)
                || (researcher.getEpersonID()!=null && currUser != null && researcher.getEpersonID().equals(
                        currUser.getID())))
        {
            reference.put("researcher_page_menu", new Boolean(true));
            reference.put("researcher", researcher);        
        }
View Full Code Here

    protected List<TabResearcherPage> findTabsWithVisibility(
            HttpServletRequest request, Map<String, Object> model,
            HttpServletResponse response) throws Exception
    {
        Integer researcherId = extractEntityId(request);
        ResearcherPage researcher = null;
        try
        {
            researcher = ((ApplicationService) applicationService).get(
                    ResearcherPage.class, researcherId);
        }
        catch (NumberFormatException e)
        {
            return null;
        }
        // check admin authorization
        Boolean isAdmin = null; // anonymous access
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context))
        {
            isAdmin = true; // admin
        }
        else if ((currUser != null && researcher.getId() == currUser.getID()))
        {
            isAdmin = false; // owner
        }
        List<TabResearcherPage> tabs = applicationService.getTabsByVisibility(
                TabResearcherPage.class, isAdmin);
View Full Code Here

            dto.setFirstName(eperson.getFirstName());
            dto.setId(eperson.getID());
            dto.setLastName(eperson.getLastName());
            dto.setNetId(eperson.getNetid());
            dto.setEmail(eperson.getEmail());
            ResearcherPage rp = getApplicationService().getResearcherPageByEPersonId(eperson.getID());
            if(rp!=null) {
                dto.setRpID(rp.getId());
                dto.setFullNameRPOwnered(rp.getFullName());
            }
            epersons.add(dto);
        }
        return epersons;
    }
View Full Code Here

    @Override
    protected Integer getAnagraficaId(HttpServletRequest request)
    {
        Integer researcherId = extractEntityId(request);
        ResearcherPage researcher = null;
        try
        {
            researcher = ((ApplicationService) applicationService).get(
                    ResearcherPage.class, researcherId);
        }
        catch (NumberFormatException e)
        {
            return -1;
        }
        return researcher.getDynamicField().getId();
    }
View Full Code Here

    if(matcher1.find()) {
        typo = "rp";
        request.setAttribute("fullname", ResearcherPageUtils.getFullName(focus));
    }
   
    ResearcherPage researcherTarget = new ResearcherPage();
    String authorityTarget = target;
    if (target != null) {
     
      Matcher matcher = patt.matcher(target);
      if (matcher.find()) {
        researcherTarget = applicationService
            .getResearcherByAuthorityKey(target);

      } else {
        researcherTarget.setInternalRP(false);
        researcherTarget.setFullName(target);
      }
    }
       
    request.setAttribute("researchertarget", researcherTarget);
    request.setAttribute("authoritytarget", authorityTarget);
View Full Code Here

    public ModelAndView create(HttpServletRequest request,
            HttpServletResponse response) throws Exception
    {
        // authorization is checked by the getMyRP method
        ResearcherPage rp = getMyResearcherPage(request);
        if (rp == null)
        {
            rp = new ResearcherPage();
            rp.setEpersonID(getCurrentUser(request).getID());
            RPPropertiesDefinition fN = applicationService
                    .findPropertiesDefinitionByShortName(
                            RPPropertiesDefinition.class, "fullName");
            TextValue val = new TextValue();
            val.setOggetto(getCurrentUser(request).getFullName());
            RPProperty prop = rp.createProprieta(fN);
            prop.setValue(val);
            prop.setVisibility(1);
            applicationService.saveOrUpdate(ResearcherPage.class, rp);
        }
        returnStatusJSON(response, rp);
View Full Code Here

            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }

        ResearcherPage rp = ResearcherPageUtils.getCrisObject(id,
                ResearcherPage.class);
        File file = new File(
                ConfigurationManager.getProperty(CrisConstants.CFG_MODULE, "researcherpage.file.path")                       
                        + File.separatorChar
                        + JDynATagLibraryFunctions.getFileFolder(rp.getPict()
                                .getValue())
                        + File.separatorChar
                        + JDynATagLibraryFunctions.getFileName(rp.getPict()
                                .getValue()));

        InputStream is = null;
        try
        {
View Full Code Here

            throw new ServletException(
                    "Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in");
        }

        int id = currUser.getID();
        ResearcherPage rp = applicationService.getResearcherPageByEPersonId(id);
        return rp;
    }
View Full Code Here

    }

    public ModelAndView activate(HttpServletRequest request,
            HttpServletResponse response) throws Exception
    {
        ResearcherPage rp = getMyResearcherPage(request);
        if (rp.getStatus() == null || rp.getStatus() == false)
        {
            rp.setStatus(true);
            applicationService.saveOrUpdate(ResearcherPage.class, rp);
        }

        returnStatusJSON(response, rp);
        return null;
View Full Code Here

TOP

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

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.