Examples of EPerson


Examples of com.avaje.tests.model.embedded.EPerson

    EAddress address = new EAddress();
    address.setStreet("92 Someplace Else");
    address.setSuburb("Sandringham");
    address.setCity("Auckland");

    EPerson person = new EPerson();
    person.setId(98989L);
    person.setName("Rob");
    person.setAddress(address);
   
    CachedBeanData addressCacheData = (CachedBeanData)addressBeanProperty.getCacheDataValue((EntityBean) person);
   
    EPerson newPersonCheck = new EPerson();
    newPersonCheck.setId(98989L);
    addressBeanProperty.setCacheDataValue((EntityBean) newPersonCheck, addressCacheData);

    EAddress newAddress = newPersonCheck.getAddress();
    Assert.assertEquals(address.getStreet(), newAddress.getStreet());
    Assert.assertEquals(address.getCity(), newAddress.getCity());
    Assert.assertEquals(address.getSuburb(), newAddress.getSuburb());



   
    CachedBeanData cacheData = desc.cacheBeanExtractData((EntityBean)person);
   
    Assert.assertNotNull(cacheData);
   
    EPerson newPerson = new EPerson();
    desc.cacheBeanLoadData((EntityBean)newPerson, cacheData);
   
    Assert.assertNotNull(newPerson.getId());
    Assert.assertNotNull(newPerson.getName());
    Assert.assertNotNull(newPerson.getAddress());

    Assert.assertEquals(person.getId(), newPerson.getId());
    Assert.assertEquals(person.getName(), newPerson.getName());
    Assert.assertEquals(person.getAddress().getStreet(), newPerson.getAddress().getStreet());
    Assert.assertEquals(person.getAddress().getCity(), newPerson.getAddress().getCity());
       
  }
View Full Code Here

Examples of org.dspace.eperson.EPerson

                        ApplicationService.class);

        String researcher = req.getParameter("researcher");

       
        EPerson currUser = context.getCurrentUser();
       
        ResearcherPage rp = service.get(ResearcherPage.class, ResearcherPageUtils
                .getRealPersistentIdentifier(researcher, ResearcherPage.class), true);

        try
        {
            if (rp == null  && // cv is hide
                    !(AuthorizeManager.isAdmin(context) || // the user logged in is
                                                           // not an admin
                    (currUser != null && (rp.getEpersonID() != null && currUser
                            .getID() == rp.getEpersonID())))) // the user logged
                                                                 // in is not the
                                                                 // rp owner
                   
            {
View Full Code Here

Examples of org.dspace.eperson.EPerson

                    "OU page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);
        EPerson currentUser = context.getCurrentUser();
        if ((ou.getStatus() == null || ou.getStatus().booleanValue() == false)
                && !AuthorizeManager.isAdmin(context))
        {
           
            if (currentUser != null
View Full Code Here

Examples of org.dspace.eperson.EPerson

        String uuid = arg0.getParameter("uid");
        int type = UIUtil.getIntParameter(arg0, "type");
        boolean showList = UIUtil.getBoolParameter(arg0, "list");
        int[] freqs = UIUtil.getIntParameters(arg0, "freq");
        Context context = UIUtil.obtainContext(arg0);
        EPerson e = context.getCurrentUser();

        statSubService.subscribeUUID(e, uuid, freqs, type);

        if (showList)
        {
View Full Code Here

Examples of org.dspace.eperson.EPerson

        String clearAll = arg0.getParameter("clear");
        String uuid = arg0.getParameter("uid");
        int type = UIUtil.getIntParameter(arg0, "type");
        boolean showList = UIUtil.getBoolParameter(arg0, "list");
        Context context = UIUtil.obtainContext(arg0);
        EPerson e = context.getCurrentUser();
        if (StringUtils.isNotEmpty(clearAll)
                && clearAll.equalsIgnoreCase("all"))
        {
            statSubService.clearAll(e);
            showList = true;
View Full Code Here

Examples of org.dspace.eperson.EPerson

    public ModelAndView list(HttpServletRequest arg0, HttpServletResponse arg1)
            throws Exception
    {
        Context context = UIUtil.obtainContext(arg0);
        EPerson e = context.getCurrentUser();

        List<StatSubscriptionViewBean> subscriptions = statSubService
                .getSubscriptions(context, e);

        ModelAndView mv = new ModelAndView(listView);
View Full Code Here

Examples of org.dspace.eperson.EPerson

            HttpServletRequest request)
    {
        try
        {
            Context context = UIUtil.obtainContext(request);
            EPerson currUser = context.getCurrentUser();
            if (currUser != null)
            {
                List<StatSubscription> statSubs = applicationService
                        .getStatSubscriptionByEPersonIDAndUID(currUser.getID(), getObject(request).getHandle());                               
                for (StatSubscription sub : statSubs)
                {
                    switch (sub.getFreq())
                    {
                    case StatSubscription.FREQUENCY_DAILY:
View Full Code Here

Examples of org.dspace.eperson.EPerson

  @Override
  protected Map referenceData(HttpServletRequest request) throws Exception {
    Map<String, Object> model = new HashMap<String, Object>();
    Context context = UIUtil.obtainContext(request);
    EPerson currUser = context.getCurrentUser();
    boolean isAdmin = AuthorizeManager.isAdmin(context);
    if (currUser != null) {
      model.put("researcher_page_menu", new Boolean(true));
    }
    if (isAdmin) {
View Full Code Here

Examples of org.dspace.eperson.EPerson

 
  @Override
  public ModelAndView handleRequest(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
      Context context = UIUtil.obtainContext(request);
      EPerson currUser = context.getCurrentUser();
        if (currUser == null)
        {
            throw new ServletException("Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in or the user's netid is null");
        }
       
        if (AuthorizeManager.isAdmin(context))
        {
            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));
            }
View Full Code Here

Examples of org.dspace.eperson.EPerson

            id = Integer.parseInt(paramId);
        }
        ResearcherPage researcher = getApplicationService().get(
                ResearcherPage.class, id);
        Context context = UIUtil.obtainContext(request);
        EPerson currentUser = context.getCurrentUser();
        if ((currentUser==null || (researcher.getEpersonID()!=null && currentUser.getID()!=researcher.getEpersonID()))
               && !AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException(
                    "Only system admin can edit not personal researcher page");
        }
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.