Package org.dspace.core

Examples of org.dspace.core.Context.turnOffAuthorisationSystem()


      } else {
        if (fileDTO != null && !fileDTO.getOriginalFilename().isEmpty()) {
          Boolean defaultStatus = ConfigurationManager
              .getBooleanProperty(CrisConstants.CFG_MODULE,"researcherpage.file.import.rpdefaultstatus");
          if (AuthorizeManager.isAdmin(dspaceContext)) {
            dspaceContext.turnOffAuthorisationSystem();
          }
          ImportExportUtils.importResearchersXML(fileDTO.getInputStream(), dir,
              applicationService, dspaceContext, defaultStatus);
          saveMessage(
              request,
View Full Code Here


      } else {
        if (fileDTO != null && !fileDTO.getOriginalFilename().isEmpty()) {
          Boolean defaultStatus = ConfigurationManager
              .getBooleanProperty(CrisConstants.CFG_MODULE,"researcherpage.file.import.rpdefaultstatus");
          if (AuthorizeManager.isAdmin(dspaceContext)) {
            dspaceContext.turnOffAuthorisationSystem();
          }
          ImportExportUtils.importResearchersXML(fileDTO.getInputStream(), dir,
              applicationService, dspaceContext, defaultStatus);
          saveMessage(
              request,
View Full Code Here

        Context context = null;

        try
        {
            context = new Context();
            context.turnOffAuthorisationSystem();
            List<String> list = new ArrayList<String>();
            list.add(String.valueOf(itemID));
            relationPreferenceService.unlink(context, cris, "publications",
                    list);
            context.restoreAuthSystemState();
View Full Code Here

                .getResearcherByAuthorityKey(authorityKey);
        Context context = null;
        try
        {
            context = new Context();
            context.turnOffAuthorisationSystem();
            List<String> list = new ArrayList<String>();
            for(int itemID : itemIDs) {
                list.add(String.valueOf(itemID));   
            }
           
View Full Code Here

        Context dspaceContext = null;
        ApplicationContext context = null;
        try
        {
            dspaceContext = new Context();
            dspaceContext.turnOffAuthorisationSystem();

            DSpace dspace = new DSpace();
            ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                    "applicationService", ApplicationService.class);
View Full Code Here

        HttpSolrServer solr = indexer.getSolr();
        indexer.deleteByType(Constants.ITEM);
        solr.commit();
        System.out.println("Remove old data");
        Context context = new Context();
        context.turnOffAuthorisationSystem();
        int i = 0;
        for (SolrDocument sd : sdl)
        {
            i++;
            System.out.println("Processed access #" + i + " of "
View Full Code Here

        Context context = null;
        try
        {
            context = new Context();
            context.turnOffAuthorisationSystem();
            if(cris.getEpersonID()!=null) {
                delete(cris.getEpersonID(), cris.getId(), context);
            }
            context.complete();
        }
View Full Code Here

        Context context = null;
        try
        {
            context = new Context();
            context.turnOffAuthorisationSystem();
            if (cris.getEpersonID() != null)
            {
                ResourcePolicy resourcePolicy = ResourcePolicy.create(context);
                resourcePolicy.setAction(Constants.ADMIN);
                resourcePolicy.setEPerson(cris.getDspaceUser());
View Full Code Here

        Context context = null;
        try
        {
            context = new Context();
            context.turnOffAuthorisationSystem();
            if ((cris.getOldEpersonID() != null && !cris.getOldEpersonID()
                    .equals(cris.getEpersonID()))
                    || (cris.getOldEpersonID() == null && cris.getEpersonID() != null))
            {
                if (cris.getEpersonID() != null)
View Full Code Here

        // Create a context
        Context c;
        try
        {
            c = new Context();
            c.turnOffAuthorisationSystem();
        }
        catch (Exception e)
        {
            System.err.println("Unable to create a new DSpace Context: " + e.getMessage());
            System.exit(1);
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.