Package org.dspace.utils

Examples of org.dspace.utils.DSpace


    public static void main(String[] args) throws ParseException, SQLException
    {

        Context dspaceContext = new Context();
        dspaceContext.setIgnoreAuthorization(true);
        DSpace dspace = new DSpace();
        ApplicationService applicationService = dspace.getServiceManager()
                .getServiceByName("applicationService",
                        ApplicationService.class);

       for (ResearcherPage rp : applicationService
                .getList(ResearcherPage.class))
View Full Code Here


    {

        log.info("#### START Script index collaboration network: -----"
                + new Date() + " ----- ####");

        DSpace dspace = new DSpace();
        VisualizationGraphSolrService service = dspace.getServiceManager()
                .getServiceByName("visualNetworkSolrService",
                        VisualizationGraphSolrService.class);

        CommandLineParser parser = new PosixParser();
View Full Code Here

    {

        log.info("#### START Script index metrics on collaboration network: -----"
                + new Date() + " ----- ####");

        DSpace dspace = new DSpace();
        VisualizationGraphSolrService service = dspace.getServiceManager()
                .getServiceByName("visualNetworkSolrService",
                        VisualizationGraphSolrService.class);

        ApplicationService applicationService = dspace.getServiceManager()
                .getServiceByName("applicationService",
                        ApplicationService.class);

        CommandLineParser parser = new PosixParser();
View Full Code Here

    {

        log.info("#### START Script bind item to researcher page: -----"
                + new Date() + " ----- ####");

        DSpace dspace = new DSpace();
               
        RelationPreferenceService relationPreferenceService = dspace.getServiceManager().getServiceByName(
                "org.dspace.app.cris.service.RelationPreferenceService", RelationPreferenceService.class);
        ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);
       
        CommandLineParser parser = new PosixParser();

        Options options = new Options();
View Full Code Here

        try
        {
            dspaceContext = new Context();
            dspaceContext.turnOffAuthorisationSystem();

            DSpace dspace = new DSpace();
            ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                    "applicationService", ApplicationService.class);

            CommandLineParser parser = new PosixParser();

            Options options = new Options();
View Full Code Here

        log
                .info("#### START Script update researcher page's items search index: -----"
                        + new Date() + " ----- ####");

        DSpace dspace = new DSpace();
        ApplicationService applicationService = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);

        CommandLineParser parser = new PosixParser();

        Options options = new Options();
View Full Code Here

     * @throws SQLException
     */
    public static void main(String[] args) throws SolrServerException,
            IOException, SQLException
    {
        DSpace dspace = new DSpace();

        SolrLogger indexer = dspace.getServiceManager().getServiceByName(SolrLogger.class.getName(),SolrLogger.class);

       
        SolrDocumentList sdl = indexer.getRawData(Constants.ITEM);
        System.out.println("Found " + sdl.getNumFound()
                + " access in the statistics core");
        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 "
                    + sdl.getNumFound());
            SolrInputDocument sdi = ClientUtils.toSolrInputDocument(sd);
            Integer id = (Integer) sd.getFieldValue("id");
            Integer type = (Integer) sd.getFieldValue("type");

            DSpaceObject dso = DSpaceObject.find(context, type, id);
           
            // Do any additional indexing, depends on the plugins
            List<SolrStatsIndexPlugin> solrServiceIndexPlugins = new DSpace()
                    .getServiceManager().getServicesByType(
                            SolrStatsIndexPlugin.class);
            for (SolrStatsIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins)
            {
                solrServiceIndexPlugin.additionalIndex(null, dso,
                        sdi);
            }

           
            context.removeCached(dso, id);
            solr.add(sdi);
        }
        solr.commit();
        solr.optimize();

        sdl = indexer.getRawData(CrisConstants.RP_TYPE_ID);
        System.out.println("Found " + sdl.getNumFound()
                + " access in the RP statistics core");
        HttpSolrServer rpsolr = indexer.getSolr();
        indexer.deleteByType(CrisConstants.RP_TYPE_ID);
        rpsolr.commit();

        System.out.println("Remove old data");
       
        ApplicationService as = dspace.getServiceManager().getServiceByName(
                "applicationService", ApplicationService.class);
        i = 0;
        for (SolrDocument sd : sdl)
        {
            i++;
            System.out.println("Processed RP access #" + i + " of "
                    + sdl.getNumFound());
            SolrInputDocument sdi = ClientUtils.toSolrInputDocument(sd);
            Integer id = (Integer) sd.getFieldValue("id");

            ResearcherPage rp = as.get(ResearcherPage.class, id);
            if (rp == null)
                continue;

            // Do any additional indexing, depends on the plugins
            List<SolrStatsIndexPlugin> solrServiceIndexPlugins = new DSpace()
                    .getServiceManager().getServicesByType(
                            SolrStatsIndexPlugin.class);
            for (SolrStatsIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins)
            {
                solrServiceIndexPlugin.additionalIndex(null, rp,
View Full Code Here

        if (test)
            log.setLevel(Level.DEBUG);
        Context context = null;
        try
        {
            DSpace dspace = new DSpace();
            StatSubscribeService service = dspace.getServiceManager()
                    .getServiceByName("statSubscribeService",
                            StatSubscribeService.class);

            context = new Context();
            processDaily(dspace, service, context, freq, test);
View Full Code Here

        if (bitstream != null)
        {
            log.info(LogManager.getHeader(context, "view_html", "handle="
                    + handle + ",bitstream_id=" + bitstream.getID()));
           
            new DSpace().getEventService().fireEvent(
                new UsageEvent(
                    UsageEvent.Action.VIEW,
                    request,
                    context,
                    bitstream));
View Full Code Here

     */
    protected SourceValidity validity;

    protected SearchService getSearchService()
    {
        DSpace dspace = new DSpace();
       
        org.dspace.kernel.ServiceManager manager = dspace.getServiceManager() ;

        return manager.getServiceByName(SearchService.class.getName(),SearchService.class);
    }
View Full Code Here

TOP

Related Classes of org.dspace.utils.DSpace

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.