mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Create factory to retrieve an instance of the "configurationService" object
This commit is contained in:
@@ -22,7 +22,7 @@ import org.dspace.content.service.MetadataFieldService;
|
||||
import org.dspace.content.service.MetadataSchemaService;
|
||||
import org.dspace.content.authority.Choices;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -275,7 +275,7 @@ public class DSpaceCSV implements Serializable
|
||||
// Specify default values
|
||||
String[] defaultValues = new String[]{"dc.date.accessioned, dc.date.available, " +
|
||||
"dc.date.updated, dc.description.provenance"};
|
||||
String[] toIgnoreArray = new DSpace().getConfigurationService().getArrayProperty("bulkedit.ignore-on-export", defaultValues);
|
||||
String[] toIgnoreArray = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("bulkedit.ignore-on-export", defaultValues);
|
||||
for (String toIgnoreString : toIgnoreArray)
|
||||
{
|
||||
if (!"".equals(toIgnoreString.trim()))
|
||||
@@ -310,7 +310,7 @@ public class DSpaceCSV implements Serializable
|
||||
private void setValueSeparator()
|
||||
{
|
||||
// Get the value separator
|
||||
valueSeparator = new DSpace().getConfigurationService().getProperty("bulkedit.valueseparator");
|
||||
valueSeparator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("bulkedit.valueseparator");
|
||||
if ((valueSeparator != null) && (!"".equals(valueSeparator.trim())))
|
||||
{
|
||||
valueSeparator = valueSeparator.trim();
|
||||
@@ -339,7 +339,7 @@ public class DSpaceCSV implements Serializable
|
||||
private void setFieldSeparator()
|
||||
{
|
||||
// Get the value separator
|
||||
fieldSeparator =new DSpace().getConfigurationService().getProperty("bulkedit.fieldseparator");
|
||||
fieldSeparator =DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("bulkedit.fieldseparator");
|
||||
if ((fieldSeparator != null) && (!"".equals(fieldSeparator.trim())))
|
||||
{
|
||||
fieldSeparator = fieldSeparator.trim();
|
||||
@@ -381,7 +381,7 @@ public class DSpaceCSV implements Serializable
|
||||
private void setAuthoritySeparator()
|
||||
{
|
||||
// Get the value separator
|
||||
authoritySeparator = new DSpace().getConfigurationService().getProperty("bulkedit.authorityseparator");
|
||||
authoritySeparator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("bulkedit.authorityseparator");
|
||||
if ((authoritySeparator != null) && (!"".equals(authoritySeparator.trim())))
|
||||
{
|
||||
authoritySeparator = authoritySeparator.trim();
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.app.itemexport.factory;
|
||||
|
||||
import org.dspace.app.itemexport.service.ItemExportService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the itemexport package, use ItemExportServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -20,6 +20,6 @@ public abstract class ItemExportServiceFactory {
|
||||
public abstract ItemExportService getItemExportService();
|
||||
|
||||
public static ItemExportServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("itemExportServiceFactory", ItemExportServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("itemExportServiceFactory", ItemExportServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.app.itemimport.factory;
|
||||
|
||||
import org.dspace.app.itemimport.service.ItemImportService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the itemimport package, use ItemImportService.getInstance() to retrieve an implementation
|
||||
@@ -20,6 +20,6 @@ public abstract class ItemImportServiceFactory {
|
||||
public abstract ItemImportService getItemImportService();
|
||||
|
||||
public static ItemImportServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("itemImportServiceFactory", ItemImportServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("itemImportServiceFactory", ItemImportServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.app.mediafilter.factory;
|
||||
|
||||
import org.dspace.app.mediafilter.service.MediaFilterService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the mediafilter package, use MediaFilterServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -20,6 +20,6 @@ public abstract class MediaFilterServiceFactory {
|
||||
public abstract MediaFilterService getMediaFilterService();
|
||||
|
||||
public static MediaFilterServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("mediaFilterServiceFactory", MediaFilterServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("mediaFilterServiceFactory", MediaFilterServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,8 +8,7 @@
|
||||
package org.dspace.app.requestitem.factory;
|
||||
|
||||
import org.dspace.app.requestitem.service.RequestItemService;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the requestitem package, use RequestItemServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -22,6 +21,6 @@ public abstract class RequestItemServiceFactory {
|
||||
|
||||
public static RequestItemServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("requestItemServiceFactory", RequestItemServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("requestItemServiceFactory", RequestItemServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.app.sfx.factory;
|
||||
|
||||
import org.dspace.app.sfx.service.SFXFileReaderService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the sfx package, use SfxServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -20,6 +20,6 @@ public abstract class SfxServiceFactory {
|
||||
public abstract SFXFileReaderService getSfxFileReaderService();
|
||||
|
||||
public static SfxServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("sfxServiceFactory", SfxServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("sfxServiceFactory", SfxServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -10,12 +10,12 @@ package org.dspace.app.util;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.w3c.dom.*;
|
||||
import javax.xml.parsers.*;
|
||||
|
||||
import org.dspace.content.MetadataSchema;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Submission form generator for DSpace. Reads and parses the installation
|
||||
@@ -88,7 +88,7 @@ public class DCInputsReader
|
||||
throws DCInputsReaderException
|
||||
{
|
||||
// Load from default file
|
||||
String defsFile = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String defsFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator + FORM_DEF_FILE;
|
||||
|
||||
buildInputs(defsFile);
|
||||
|
@@ -20,6 +20,7 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.w3c.dom.Document;
|
||||
@@ -40,7 +41,6 @@ import com.sun.syndication.feed.module.opensearch.impl.OpenSearchModuleImpl;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import java.util.Arrays;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Utility Class with static methods for producing OpenSearch-compliant search results,
|
||||
@@ -84,7 +84,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
enabled = config.getBooleanProperty("websvc.opensearch.enable");
|
||||
svcUrl = config.getProperty("dspace.url") + "/" +
|
||||
config.getProperty("websvc.opensearch.svccontext");
|
||||
@@ -214,7 +214,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
|
||||
*/
|
||||
protected org.jdom.Document getServiceDocument(String scope)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
Namespace ns = Namespace.getNamespace(osNs);
|
||||
Element root = new Element("OpenSearchDescription", ns);
|
||||
|
@@ -15,7 +15,7 @@ import java.util.Properties;
|
||||
|
||||
import org.dspace.app.util.factory.UtilServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Display information about this DSpace, its environment, and how it was built.
|
||||
@@ -61,7 +61,7 @@ public class Version
|
||||
}
|
||||
|
||||
// Is Discovery available?
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
String consumers = config.getPropertyAsType("event.dispatcher.default.consumers", ""); // Avoid null pointer
|
||||
List<String> consumerList = Arrays.asList(consumers.split("\\s*,\\s*"));
|
||||
if (consumerList.contains("discovery"))
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.app.util.factory;
|
||||
import org.dspace.app.util.service.MetadataExposureService;
|
||||
import org.dspace.app.util.service.OpenSearchService;
|
||||
import org.dspace.app.util.service.WebAppService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the util package, use UtilServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -27,7 +27,7 @@ public abstract class UtilServiceFactory
|
||||
|
||||
public static UtilServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("appUtilServiceFactory", UtilServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("appUtilServiceFactory", UtilServiceFactory.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Adds users to special groups based on IP address. Configuration parameter
|
||||
@@ -85,7 +85,7 @@ public class IPAuthentication implements AuthenticationMethod
|
||||
ipMatcherGroupNames = new HashMap<>();
|
||||
groupService = EPersonServiceFactory.getInstance().getGroupService();
|
||||
|
||||
List<String> propNames = new DSpace().getConfigurationService().getPropertyKeys("authentication-ip");
|
||||
List<String> propNames = DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyKeys("authentication-ip");
|
||||
|
||||
for(String propName : propNames)
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class IPAuthentication implements AuthenticationMethod
|
||||
|
||||
if (nameParts.length == 2)
|
||||
{
|
||||
addMatchers(nameParts[1], new DSpace().getConfigurationService().getProperty(propName));
|
||||
addMatchers(nameParts[1], DSpaceServicesFactory.getInstance().getConfigurationService().getProperty(propName));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* A stackable authentication method
|
||||
@@ -66,7 +66,7 @@ public class PasswordAuthentication
|
||||
throws SQLException
|
||||
{
|
||||
// Is there anything set in domain.valid?
|
||||
String[] domains = new DSpace().getConfigurationService().getArrayProperty("authentication-password.domain.valid");
|
||||
String[] domains = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("authentication-password.domain.valid");
|
||||
if ((domains == null) || (domains.length==0))
|
||||
{
|
||||
// No conditions set, so must be able to self register
|
||||
@@ -138,7 +138,7 @@ public class PasswordAuthentication
|
||||
{
|
||||
if (EPersonServiceFactory.getInstance().getEPersonService().getPasswordHash(context.getCurrentUser()) != null && !EPersonServiceFactory.getInstance().getEPersonService().getPasswordHash(context.getCurrentUser()).toString().equals(""))
|
||||
{
|
||||
String groupName = new DSpace().getConfigurationService().getProperty("authentication-password.login.specialgroup");
|
||||
String groupName = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("authentication-password.login.specialgroup");
|
||||
if ((groupName != null) && (!groupName.trim().equals("")))
|
||||
{
|
||||
Group specialGroup = EPersonServiceFactory.getInstance().getGroupService().findByName(context, groupName);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.authenticate.factory;
|
||||
|
||||
import org.dspace.authenticate.service.AuthenticationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the authenticate package, use AuthenticateServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class AuthenticateServiceFactory {
|
||||
|
||||
public static AuthenticateServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("authenticateServiceFactory", AuthenticateServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("authenticateServiceFactory", AuthenticateServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import org.dspace.authority.indexer.AuthorityIndexerInterface;
|
||||
import org.dspace.authority.indexer.AuthorityIndexingService;
|
||||
import org.dspace.authority.service.AuthorityService;
|
||||
import org.dspace.authority.service.AuthorityValueService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,6 +38,6 @@ public abstract class AuthorityServiceFactory {
|
||||
|
||||
public static AuthorityServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("authorityServiceFactory", AuthorityServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("authorityServiceFactory", AuthorityServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import org.dspace.authority.orcid.xml.XMLtoBio;
|
||||
import org.dspace.authority.orcid.xml.XMLtoWork;
|
||||
import org.dspace.authority.rest.RestSource;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
@@ -39,7 +39,7 @@ public class Orcid extends RestSource {
|
||||
|
||||
public static Orcid getOrcid() {
|
||||
if (orcid == null) {
|
||||
orcid = new DSpace().getServiceManager().getServiceByName("OrcidSource", Orcid.class);
|
||||
orcid = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("OrcidSource", Orcid.class);
|
||||
}
|
||||
return orcid;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ package org.dspace.authorize.factory;
|
||||
|
||||
import org.dspace.authorize.service.AuthorizeService;
|
||||
import org.dspace.authorize.service.ResourcePolicyService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the authorize package, use AuthorizeServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -24,6 +24,6 @@ public abstract class AuthorizeServiceFactory {
|
||||
|
||||
public static AuthorizeServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("authorizeServiceFactory", AuthorizeServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("authorizeServiceFactory", AuthorizeServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import org.dspace.discovery.DiscoverResult.FacetResult;
|
||||
import org.dspace.discovery.SearchService;
|
||||
import org.dspace.discovery.SearchServiceException;
|
||||
import org.dspace.discovery.configuration.DiscoveryConfigurationParameters;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Discovery (Solr) driver implementing ItemCountDAO interface to look up item
|
||||
@@ -52,11 +52,9 @@ public class ItemCountDAOSolr implements ItemCountDAO
|
||||
/** Hold the collection item count obtained from SOLR after the first query **/
|
||||
private Map<String, Integer> collectionsCount = null;
|
||||
|
||||
/** DSpace helper services access object */
|
||||
DSpace dspace = new DSpace();
|
||||
|
||||
/** Solr search service */
|
||||
SearchService searcher = dspace.getServiceManager().getServiceByName(SearchService.class.getName(), SearchService.class);
|
||||
SearchService searcher = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(SearchService.class.getName(), SearchService.class);
|
||||
|
||||
/**
|
||||
* Throw an ItemCountException as caching is not supported by ItemCountDAOSolr.
|
||||
|
@@ -23,10 +23,10 @@ import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.discovery.SolrServiceImpl;
|
||||
import org.dspace.discovery.SolrServiceIndexPlugin;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.sort.OrderFormat;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -136,13 +136,11 @@ public class SolrBrowseCreateDAO implements BrowseCreateDAO,
|
||||
{
|
||||
int minConfidence = metadataAuthorityService.getMinConfidence(values.get(0).getMetadataField());
|
||||
|
||||
boolean ignoreAuthority = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignoreAuthority = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore."
|
||||
+ bi.getName(),
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore",
|
||||
new Boolean(false)),
|
||||
@@ -187,13 +185,11 @@ public class SolrBrowseCreateDAO implements BrowseCreateDAO,
|
||||
distValuesForAC.add(values.get(x).getValue());
|
||||
|
||||
String preferedLabel = null;
|
||||
boolean ignorePrefered = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignorePrefered = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore-prefered."
|
||||
+ bi.getName(),
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore-prefered",
|
||||
new Boolean(
|
||||
@@ -206,13 +202,11 @@ public class SolrBrowseCreateDAO implements BrowseCreateDAO,
|
||||
}
|
||||
List<String> variants = null;
|
||||
|
||||
boolean ignoreVariants = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignoreVariants = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore-variants."
|
||||
+ bi.getName(),
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.browse.authority.ignore-variants",
|
||||
new Boolean(
|
||||
|
@@ -24,7 +24,7 @@ import org.dspace.discovery.DiscoverResult.SearchDocument;
|
||||
import org.dspace.discovery.SearchService;
|
||||
import org.dspace.discovery.SearchServiceException;
|
||||
import org.dspace.discovery.configuration.DiscoveryConfigurationParameters;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -127,9 +127,8 @@ public class SolrBrowseDAO implements BrowseDAO
|
||||
|
||||
// administrative attributes for this class
|
||||
|
||||
DSpace dspace = new DSpace();
|
||||
|
||||
SearchService searcher = dspace.getServiceManager().getServiceByName(
|
||||
SearchService searcher = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(
|
||||
SearchService.class.getName(), SearchService.class);
|
||||
|
||||
private DiscoverResult sResponse = null;
|
||||
|
@@ -11,7 +11,7 @@ import org.dspace.checker.service.SimpleReporterService;
|
||||
import org.dspace.checker.service.ChecksumHistoryService;
|
||||
import org.dspace.checker.service.ChecksumResultService;
|
||||
import org.dspace.checker.service.MostRecentChecksumService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the checker package, use CheckerServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -30,6 +30,6 @@ public abstract class CheckerServiceFactory {
|
||||
|
||||
public static CheckerServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("checkerServiceFactory", CheckerServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("checkerServiceFactory", CheckerServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import java.io.File;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import javax.xml.xpath.XPath;
|
||||
@@ -27,7 +28,6 @@ import org.apache.log4j.Logger;
|
||||
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* ChoiceAuthority source that reads the JSPUI-style hierarchical vocabularies
|
||||
@@ -95,7 +95,7 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
return name.endsWith(".xml");
|
||||
}
|
||||
}
|
||||
String vocabulariesPath = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String vocabulariesPath = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ "/config/controlled-vocabularies/";
|
||||
String[] xmlFiles = (new File(vocabulariesPath)).list(new xmlFilter());
|
||||
List<String> names = new ArrayList<String>();
|
||||
@@ -112,7 +112,7 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
|
||||
{
|
||||
if (vocabulary == null)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
log.info("Initializing " + this.getClass().getName());
|
||||
vocabularyName = this.getPluginInstanceName();
|
||||
|
@@ -21,7 +21,7 @@ import org.apache.solr.common.params.CommonParams;
|
||||
import org.dspace.authority.service.AuthorityValueService;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@@ -38,7 +38,7 @@ import java.util.Map;
|
||||
public class SolrAuthority implements ChoiceAuthority {
|
||||
|
||||
private static final Logger log = Logger.getLogger(SolrAuthority.class);
|
||||
protected RestSource source = new DSpace().getServiceManager().getServiceByName("AuthoritySource", RestSource.class);
|
||||
protected RestSource source = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("AuthoritySource", RestSource.class);
|
||||
protected boolean externalResults = false;
|
||||
protected final AuthorityValueService authorityValueService = AuthorityServiceFactory.getInstance().getAuthorityValueService();
|
||||
|
||||
@@ -249,9 +249,7 @@ public class SolrAuthority implements ChoiceAuthority {
|
||||
|
||||
|
||||
public static AuthoritySearchService getSearchService() {
|
||||
DSpace dspace = new DSpace();
|
||||
|
||||
org.dspace.kernel.ServiceManager manager = dspace.getServiceManager();
|
||||
org.dspace.kernel.ServiceManager manager = DSpaceServicesFactory.getInstance().getServiceManager();
|
||||
|
||||
return manager.getServiceByName(AuthoritySearchService.class.getName(), AuthoritySearchService.class);
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ package org.dspace.content.authority.factory;
|
||||
|
||||
import org.dspace.content.authority.service.ChoiceAuthorityService;
|
||||
import org.dspace.content.authority.service.MetadataAuthorityService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the content.authority package, use ContentAuthorityServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -23,6 +23,6 @@ public abstract class ContentAuthorityServiceFactory {
|
||||
public abstract MetadataAuthorityService getMetadataAuthorityService();
|
||||
|
||||
public static ContentAuthorityServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("contentAuthorityServiceFactory", ContentAuthorityServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("contentAuthorityServiceFactory", ContentAuthorityServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -11,9 +11,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.InProgressSubmission;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.content.service.*;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
|
||||
import java.util.List;
|
||||
@@ -101,7 +99,7 @@ public abstract class ContentServiceFactory {
|
||||
}
|
||||
|
||||
public static ContentServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("contentServiceFactory", ContentServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("contentServiceFactory", ContentServiceFactory.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ import org.apache.commons.configuration.Configuration;
|
||||
import org.apache.commons.configuration.ConfigurationConverter;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Class for reading the DSpace system configuration. The main configuration is
|
||||
@@ -49,7 +49,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static boolean isConfigured()
|
||||
{
|
||||
return new DSpace().getConfigurationService() != null;
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static Properties getProperties()
|
||||
{
|
||||
return new DSpace().getConfigurationService().getProperties();
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getProperties();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public class ConfigurationManager
|
||||
public static Properties getProperties(String module)
|
||||
{
|
||||
// Find subset of Configurations which have been prefixed with the module name
|
||||
Configuration subset = new DSpace().getConfigurationService().getConfiguration().subset(module);
|
||||
Configuration subset = DSpaceServicesFactory.getInstance().getConfigurationService().getConfiguration().subset(module);
|
||||
|
||||
// Convert to a Properties object and return it
|
||||
return ConfigurationConverter.getProperties(subset);
|
||||
@@ -89,7 +89,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static String getProperty(String property)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getProperty(property);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getProperty(property);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +127,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static int getIntProperty(String property)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getIntProperty(property);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getIntProperty(property);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static int getIntProperty(String property, int defaultValue)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getIntProperty(property, defaultValue);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getIntProperty(property, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +213,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static long getLongProperty(String property)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getLongProperty(property);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getLongProperty(property);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static long getLongProperty(String property, int defaultValue)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getLongProperty(property, defaultValue);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getLongProperty(property, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,7 +301,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static boolean getBooleanProperty(String property)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getBooleanProperty(property);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty(property);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,7 +349,7 @@ public class ConfigurationManager
|
||||
*/
|
||||
public static boolean getBooleanProperty(String property, boolean defaultValue)
|
||||
{
|
||||
return new DSpace().getConfigurationService().getBooleanProperty(property, defaultValue);
|
||||
return DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty(property, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,7 +390,7 @@ public class ConfigurationManager
|
||||
public static Enumeration<?> propertyNames()
|
||||
{
|
||||
// Get a list of all property keys, and convert into an Enumeration
|
||||
return java.util.Collections.enumeration(new DSpace().getConfigurationService().getPropertyKeys());
|
||||
return java.util.Collections.enumeration(DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyKeys());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -404,7 +404,7 @@ public class ConfigurationManager
|
||||
public static Enumeration<?> propertyNames(String module)
|
||||
{
|
||||
// Get property keys beginning with this prefix, and convert into an Enumeration
|
||||
return java.util.Collections.enumeration(new DSpace().getConfigurationService().getPropertyKeys(module));
|
||||
return java.util.Collections.enumeration(DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyKeys(module));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -38,8 +38,7 @@ import javax.mail.internet.MimeMessage;
|
||||
import javax.mail.internet.MimeMultipart;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.EmailService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Class representing an e-mail message, also used to send e-mails.
|
||||
@@ -237,7 +236,7 @@ public class Email
|
||||
*/
|
||||
public void send() throws MessagingException, IOException
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
// Get the mail configuration properties
|
||||
String from = config.getProperty("mail.from.address");
|
||||
@@ -250,8 +249,7 @@ public class Email
|
||||
}
|
||||
|
||||
// Get session
|
||||
Session session = new DSpace().getServiceManager().
|
||||
getServicesByType(EmailService.class).get(0).getSession();
|
||||
Session session = DSpaceServicesFactory.getInstance().getEmailService().getSession();
|
||||
|
||||
// Create message
|
||||
MimeMessage message = new MimeMessage(session);
|
||||
@@ -465,7 +463,7 @@ public class Email
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
String to = config.getProperty("mail.admin");
|
||||
String subject = "DSpace test email";
|
||||
String server = config.getProperty("mail.server");
|
||||
|
@@ -19,7 +19,7 @@ import java.util.StringTokenizer;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class I18nUtil
|
||||
*/
|
||||
public static Locale getDefaultLocale()
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
// First, try configured default locale
|
||||
Locale defaultLocale = null;
|
||||
if (config.hasProperty("default.locale"))
|
||||
@@ -126,7 +126,7 @@ public class I18nUtil
|
||||
*/
|
||||
public static Locale[] getSupportedLocales()
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
String[] locales = config.getArrayProperty("webui.supported.locales");
|
||||
if (locales != null && locales.length>0)
|
||||
@@ -235,7 +235,7 @@ public class I18nUtil
|
||||
String fileName = "";
|
||||
final String FORM_DEF_FILE = "input-forms";
|
||||
final String FILE_TYPE = ".xml";
|
||||
String defsFilename = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String defsFilename = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator + FORM_DEF_FILE;
|
||||
fileName = getFilename(locale, defsFilename, FILE_TYPE);
|
||||
return fileName;
|
||||
@@ -323,7 +323,7 @@ public class I18nUtil
|
||||
/** Name of the default license */
|
||||
final String DEF_LIC_FILE = "default";
|
||||
final String FILE_TYPE = ".license";
|
||||
String defsFilename = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String defsFilename = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator + DEF_LIC_FILE;
|
||||
|
||||
fileName = getFilename(locale, defsFilename, FILE_TYPE);
|
||||
@@ -423,7 +423,7 @@ public class I18nUtil
|
||||
public static String getEmailFilename(Locale locale, String name)
|
||||
{
|
||||
String templateName = "";
|
||||
String templateFile = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String templateFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator + "emails"
|
||||
+ File.separator + name;
|
||||
|
||||
|
@@ -19,7 +19,7 @@ import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import org.dspace.core.service.LicenseService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -128,7 +128,7 @@ public class LicenseServiceImpl implements LicenseService
|
||||
*/
|
||||
protected void init()
|
||||
{
|
||||
File licenseFile = new File(new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
File licenseFile = new File(DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator + "default.license");
|
||||
|
||||
FileInputStream fir = null;
|
||||
|
@@ -19,7 +19,7 @@ import org.apache.log4j.PropertyConfigurator;
|
||||
import org.apache.log4j.xml.DOMConfigurator;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.KernelStartupCallbackService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Service which simply initializes DSpace logging *after* the kernel starts
|
||||
@@ -67,7 +67,7 @@ public class LoggerServiceImpl implements KernelStartupCallbackService
|
||||
* so do not instantiate another Logging configuration.
|
||||
*
|
||||
*/
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
String dsLogConfiguration = config.getProperty(LOG_CONFIG_PROPERTY);
|
||||
|
||||
if (dsLogConfiguration == null || System.getProperty(LOG_DISABLE_PROPERTY) != null)
|
||||
|
@@ -17,7 +17,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import org.dspace.core.service.NewsService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class NewsServiceImpl implements NewsService
|
||||
@Override
|
||||
public String getNewsFilePath()
|
||||
{
|
||||
String filePath = new DSpace().getConfigurationService().getProperty("dspace.dir")
|
||||
String filePath = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir")
|
||||
+ File.separator + "config" + File.separator;
|
||||
return filePath;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.core.factory;
|
||||
import org.dspace.core.service.LicenseService;
|
||||
import org.dspace.core.service.NewsService;
|
||||
import org.dspace.core.service.PluginService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the core package, use CoreServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -27,6 +27,6 @@ public abstract class CoreServiceFactory {
|
||||
|
||||
public static CoreServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("coreServiceFactory", CoreServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("coreServiceFactory", CoreServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.curate.factory;
|
||||
|
||||
import org.dspace.curate.service.WorkflowCuratorService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the curate package, use CurateServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class CurateServiceFactory {
|
||||
|
||||
public static CurateServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("curateServiceFactory", CurateServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("curateServiceFactory", CurateServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.discovery;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.cli.*;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
@@ -102,9 +102,7 @@ public class IndexClient {
|
||||
* new DSpace.getServiceManager().getServiceByName("org.dspace.discovery.SolrIndexer");
|
||||
*/
|
||||
|
||||
DSpace dspace = new DSpace();
|
||||
|
||||
IndexingService indexer = dspace.getServiceManager().getServiceByName(IndexingService.class.getName(),IndexingService.class);
|
||||
IndexingService indexer = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(IndexingService.class.getName(),IndexingService.class);
|
||||
|
||||
if (line.hasOption("r")) {
|
||||
log.info("Removing " + line.getOptionValue("r") + " from Index");
|
||||
|
@@ -14,7 +14,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.event.Consumer;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -38,9 +38,7 @@ public class IndexEventConsumer implements Consumer {
|
||||
// handles to delete since IDs are not useful by now.
|
||||
private Set<String> handlesToDelete = null;
|
||||
|
||||
DSpace dspace = new DSpace();
|
||||
|
||||
IndexingService indexer = dspace.getServiceManager().getServiceByName(IndexingService.class.getName(),IndexingService.class);
|
||||
IndexingService indexer = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(IndexingService.class.getName(),IndexingService.class);
|
||||
|
||||
@Override
|
||||
public void initialize() throws Exception {
|
||||
|
@@ -12,7 +12,7 @@ import org.dspace.content.Collection;
|
||||
import org.dspace.discovery.configuration.DiscoveryConfiguration;
|
||||
import org.dspace.discovery.configuration.DiscoveryConfigurationService;
|
||||
import org.dspace.kernel.ServiceManager;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
@@ -32,8 +32,7 @@ public class SearchUtils {
|
||||
public static SearchService getSearchService()
|
||||
{
|
||||
if(searchService == null){
|
||||
DSpace dspace = new DSpace();
|
||||
org.dspace.kernel.ServiceManager manager = dspace.getServiceManager() ;
|
||||
org.dspace.kernel.ServiceManager manager = DSpaceServicesFactory.getInstance().getServiceManager();
|
||||
searchService = manager.getServiceByName(SearchService.class.getName(),SearchService.class);
|
||||
}
|
||||
return searchService;
|
||||
@@ -62,8 +61,7 @@ public class SearchUtils {
|
||||
}
|
||||
|
||||
public static DiscoveryConfigurationService getConfigurationService() {
|
||||
DSpace dspace = new DSpace();
|
||||
ServiceManager manager = dspace.getServiceManager();
|
||||
ServiceManager manager = DSpaceServicesFactory.getInstance().getServiceManager();
|
||||
return manager.getServiceByName(DiscoveryConfigurationService.class.getName(), DiscoveryConfigurationService.class);
|
||||
}
|
||||
|
||||
|
@@ -47,9 +47,9 @@ import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.*;
|
||||
import org.dspace.discovery.configuration.*;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.storage.rdbms.DatabaseUtils;
|
||||
import org.dspace.util.MultiFormatDateParser;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -127,7 +127,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
{
|
||||
if ( solr == null)
|
||||
{
|
||||
String solrService = new DSpace().getConfigurationService().getProperty("discovery.search.server");
|
||||
String solrService = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.search.server");
|
||||
|
||||
UrlValidator urlValidator = new UrlValidator(UrlValidator.ALLOW_LOCAL_URLS);
|
||||
if (urlValidator.isValid(solrService)||ConfigurationManager.getBooleanProperty("discovery","solr.url.validation.enabled",true))
|
||||
@@ -771,7 +771,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
addContainerMetadataField(doc, highlightedMetadataFields, toIgnoreMetadataFields, "dc.title", title);
|
||||
|
||||
//Do any additional indexing, depends on the plugins
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
for (SolrServiceIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins)
|
||||
{
|
||||
solrServiceIndexPlugin.additionalIndex(context, community, doc);
|
||||
@@ -827,7 +827,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
|
||||
|
||||
//Do any additional indexing, depends on the plugins
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
for (SolrServiceIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins)
|
||||
{
|
||||
solrServiceIndexPlugin.additionalIndex(context, collection, doc);
|
||||
@@ -958,7 +958,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
|
||||
|
||||
List<String> toProjectionFields = new ArrayList<String>();
|
||||
String projectionFieldsString = new DSpace().getConfigurationService().getProperty("discovery.index.projection");
|
||||
String projectionFieldsString = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.index.projection");
|
||||
if(projectionFieldsString != null){
|
||||
if(projectionFieldsString.indexOf(",") != -1){
|
||||
for (int i = 0; i < projectionFieldsString.split(",").length; i++) {
|
||||
@@ -1008,12 +1008,10 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
if (isAuthorityControlled && meta.getAuthority() != null
|
||||
&& meta.getConfidence() >= minConfidence)
|
||||
{
|
||||
boolean ignoreAuthority = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignoreAuthority = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore." + field,
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore",
|
||||
new Boolean(false)), true);
|
||||
@@ -1021,13 +1019,11 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
{
|
||||
authority = meta.getAuthority();
|
||||
|
||||
boolean ignorePrefered = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignorePrefered = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore-prefered."
|
||||
+ field,
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore-prefered",
|
||||
new Boolean(false)),
|
||||
@@ -1039,13 +1035,11 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
.getLabel(meta, meta.getLanguage());
|
||||
}
|
||||
|
||||
boolean ignoreVariants = new DSpace()
|
||||
.getConfigurationService()
|
||||
boolean ignoreVariants = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore-variants."
|
||||
+ field,
|
||||
new DSpace()
|
||||
.getConfigurationService()
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType(
|
||||
"discovery.index.authority.ignore-variants",
|
||||
new Boolean(false)),
|
||||
@@ -1070,7 +1064,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
for (DiscoverySearchFilter searchFilter : searchFilterConfigs)
|
||||
{
|
||||
Date date = null;
|
||||
String separator = new DSpace().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
String separator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
if(separator == null)
|
||||
{
|
||||
separator = FILTER_SEPARATOR;
|
||||
@@ -1387,7 +1381,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
}
|
||||
|
||||
//Do any additional indexing, depends on the plugins
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
List<SolrServiceIndexPlugin> solrServiceIndexPlugins = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrServiceIndexPlugin.class);
|
||||
for (SolrServiceIndexPlugin solrServiceIndexPlugin : solrServiceIndexPlugins)
|
||||
{
|
||||
solrServiceIndexPlugin.additionalIndex(context, item, doc);
|
||||
@@ -1725,7 +1719,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
}
|
||||
|
||||
//Add any configured search plugins !
|
||||
List<SolrServiceSearchPlugin> solrServiceSearchPlugins = new DSpace().getServiceManager().getServicesByType(SolrServiceSearchPlugin.class);
|
||||
List<SolrServiceSearchPlugin> solrServiceSearchPlugins = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(SolrServiceSearchPlugin.class);
|
||||
for (SolrServiceSearchPlugin searchPlugin : solrServiceSearchPlugins)
|
||||
{
|
||||
searchPlugin.additionalSearchParameters(context, discoveryQuery, solrQuery);
|
||||
@@ -2206,7 +2200,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
|| field.endsWith("_acid"))
|
||||
{
|
||||
//We have a filter make sure we split !
|
||||
String separator = new DSpace().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
String separator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
if(separator == null)
|
||||
{
|
||||
separator = FILTER_SEPARATOR;
|
||||
@@ -2239,7 +2233,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
|| field.endsWith("_acid"))
|
||||
{
|
||||
//We have a filter make sure we split !
|
||||
String separator = new DSpace().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
String separator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
if(separator == null)
|
||||
{
|
||||
separator = FILTER_SEPARATOR;
|
||||
@@ -2274,7 +2268,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
|| field.endsWith("_acid"))
|
||||
{
|
||||
//We have a filter make sure we split !
|
||||
String separator = new DSpace().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
String separator = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("discovery.solr.facets.split.char");
|
||||
if(separator == null)
|
||||
{
|
||||
separator = FILTER_SEPARATOR;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.discovery.configuration;
|
||||
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -38,9 +38,8 @@ public class DiscoveryConfigurationService {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
DSpace dspace = new DSpace();
|
||||
System.out.println(dspace.getServiceManager().getServicesNames().size());
|
||||
DiscoveryConfigurationService mainService = dspace.getServiceManager().getServiceByName(DiscoveryConfigurationService.class.getName(), DiscoveryConfigurationService.class);
|
||||
System.out.println(DSpaceServicesFactory.getInstance().getServiceManager().getServicesNames().size());
|
||||
DiscoveryConfigurationService mainService = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(DiscoveryConfigurationService.class.getName(), DiscoveryConfigurationService.class);
|
||||
|
||||
for(String key : mainService.getMap().keySet()){
|
||||
System.out.println(key);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.disseminate.factory;
|
||||
|
||||
import org.dspace.disseminate.service.CitationDocumentService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the disseminate package, use DisseminateServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class DisseminateServiceFactory {
|
||||
|
||||
public static DisseminateServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("disseminateServiceFactory", DisseminateServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("disseminateServiceFactory", DisseminateServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DCDate;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Plugin implementation of the embargo setting function. The parseTerms()
|
||||
@@ -52,7 +52,7 @@ public class DayTableEmbargoSetter extends DefaultEmbargoSetter
|
||||
public DCDate parseTerms(Context context, Item item, String terms)
|
||||
throws SQLException, AuthorizeException {
|
||||
|
||||
String termsOpen = new DSpace().getConfigurationService().getProperty("embargo.terms.open");
|
||||
String termsOpen = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("embargo.terms.open");
|
||||
Properties termProps = getTermProperties();
|
||||
|
||||
if (terms != null) {
|
||||
@@ -77,7 +77,7 @@ public class DayTableEmbargoSetter extends DefaultEmbargoSetter
|
||||
{
|
||||
Properties termProps = new Properties();
|
||||
|
||||
String terms = new DSpace().getConfigurationService().getProperty("embargo.terms.days");
|
||||
String terms = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("embargo.terms.days");
|
||||
if (terms != null && terms.length() > 0) {
|
||||
for (String term : terms.split(",")) {
|
||||
String[] parts = term.trim().split(":");
|
||||
|
@@ -26,7 +26,7 @@ import org.dspace.embargo.service.EmbargoService;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.license.CreativeCommonsServiceImpl;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Default plugin implementation of the embargo setting function.
|
||||
@@ -62,7 +62,7 @@ public class DefaultEmbargoSetter implements EmbargoSetter
|
||||
public DCDate parseTerms(Context context, Item item, String terms)
|
||||
throws SQLException, AuthorizeException
|
||||
{
|
||||
String termsOpen = new DSpace().getConfigurationService().getProperty("embargo.terms.open");
|
||||
String termsOpen = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("embargo.terms.open");
|
||||
|
||||
if (terms != null && terms.length() > 0)
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.embargo.factory;
|
||||
|
||||
import org.dspace.embargo.service.EmbargoService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the embargo package, use EmbargoServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class EmbargoServiceFactory {
|
||||
|
||||
public static EmbargoServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("embargoServiceFactory", EmbargoServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("embargoServiceFactory", EmbargoServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ import java.util.Arrays;
|
||||
import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PasswordHash
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(PasswordHash.class);
|
||||
private static final ConfigurationService config
|
||||
= new DSpace().getConfigurationService();
|
||||
= DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
private static final Charset UTF_8 = Charset.forName("UTF-8"); // Should always succeed: UTF-8 is required
|
||||
|
||||
private static final String DEFAULT_DIGEST_ALGORITHM = "SHA-512"; // XXX magic
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.eperson.factory;
|
||||
|
||||
import org.dspace.eperson.service.*;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the eperson package, use EPersonServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -30,6 +30,6 @@ public abstract class EPersonServiceFactory {
|
||||
public abstract SupervisorService getSupervisorService();
|
||||
|
||||
public static EPersonServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("ePersonServiceFactory", EPersonServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("ePersonServiceFactory", EPersonServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.event.factory;
|
||||
|
||||
import org.dspace.event.service.EventService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the event package, use EventServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class EventServiceFactory {
|
||||
|
||||
public static EventServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("eventServiceFactory", EventServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("eventServiceFactory", EventServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import com.google.api.client.json.jackson2.JacksonFactory;
|
||||
import com.google.api.services.analytics.Analytics;
|
||||
import com.google.api.services.analytics.AnalyticsScopes;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
@@ -51,10 +51,10 @@ public class GoogleAccount {
|
||||
|
||||
|
||||
private GoogleAccount() {
|
||||
applicationName = new DSpace().getConfigurationService().getProperty("google-analytics.application.name");
|
||||
tableId = new DSpace().getConfigurationService().getProperty("google-analytics.table.id");
|
||||
emailAddress = new DSpace().getConfigurationService().getProperty("google-analytics.account.email");
|
||||
certificateLocation = new DSpace().getConfigurationService().getProperty("google-analytics.certificate.location");
|
||||
applicationName = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("google-analytics.application.name");
|
||||
tableId = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("google-analytics.table.id");
|
||||
emailAddress = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("google-analytics.account.email");
|
||||
certificateLocation = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("google-analytics.certificate.location");
|
||||
|
||||
jsonFactory = JacksonFactory.getDefaultInstance();
|
||||
|
||||
|
@@ -16,15 +16,13 @@ import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.DSpaceObjectService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.services.model.Event;
|
||||
import org.dspace.usage.AbstractUsageEventListener;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
@@ -63,9 +61,9 @@ public class GoogleRecorderEventListener extends AbstractUsageEventListener {
|
||||
log.debug("Usage event received " + event.getName());
|
||||
|
||||
// This is a wee bit messy but these keys should be combined in future.
|
||||
analyticsKey = new DSpace().getConfigurationService().getProperty("jspui.google.analytics.key");
|
||||
analyticsKey = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("jspui.google.analytics.key");
|
||||
if (analyticsKey == null ) {
|
||||
analyticsKey = new DSpace().getConfigurationService().getProperty("xmlui.google.analytics.key");
|
||||
analyticsKey = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("xmlui.google.analytics.key");
|
||||
}
|
||||
|
||||
if (analyticsKey != null ) {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.handle.factory;
|
||||
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the handle package, use HandleServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class HandleServiceFactory {
|
||||
|
||||
public static HandleServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("handleServiceFactory", HandleServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("handleServiceFactory", HandleServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.harvest.factory;
|
||||
import org.dspace.harvest.service.HarvestSchedulingService;
|
||||
import org.dspace.harvest.service.HarvestedCollectionService;
|
||||
import org.dspace.harvest.service.HarvestedItemService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the harvest package, use HarvestServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -27,6 +27,6 @@ public abstract class HarvestServiceFactory {
|
||||
|
||||
public static HarvestServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("harvestServiceFactory", HarvestServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("harvestServiceFactory", HarvestServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ package org.dspace.identifier.factory;
|
||||
|
||||
import org.dspace.identifier.service.DOIService;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the identifier package, use IdentifierServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -23,6 +23,6 @@ public abstract class IdentifierServiceFactory {
|
||||
public abstract DOIService getDOIService();
|
||||
|
||||
public static IdentifierServiceFactory getInstance(){
|
||||
return new DSpace().getServiceManager().getServiceByName("identifierServiceFactory", IdentifierServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("identifierServiceFactory", IdentifierServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
package org.dspace.license.factory;
|
||||
|
||||
import org.dspace.license.service.CreativeCommonsService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the license package, use LicenseServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class LicenseServiceFactory {
|
||||
|
||||
public static LicenseServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("licenseServiceFactory", LicenseServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("licenseServiceFactory", LicenseServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import org.dspace.rdf.conversion.RDFConverter;
|
||||
import org.dspace.rdf.storage.RDFStorage;
|
||||
import org.dspace.rdf.storage.URIGenerator;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -115,7 +115,7 @@ public class RDFConfiguration {
|
||||
|
||||
public static String[] getDSOTypesToConvert()
|
||||
{
|
||||
String dsoTypes = (new DSpace()).getConfigurationService().getProperty(
|
||||
String dsoTypes = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty(
|
||||
CONVERTER_DSOTYPES_KEY);
|
||||
if (StringUtils.isEmpty(dsoTypes))
|
||||
{
|
||||
@@ -147,7 +147,7 @@ public class RDFConfiguration {
|
||||
public static boolean isContentNegotiationEnabled()
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
return configurationService.getPropertyAsType(CONTENT_NEGOTIATION_KEY,
|
||||
false);
|
||||
}
|
||||
@@ -155,14 +155,14 @@ public class RDFConfiguration {
|
||||
public static String getPublicSparqlEndpointAddress()
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
return configurationService.getProperty(SPARQL_ENDPOINT_KEY);
|
||||
}
|
||||
|
||||
public static String getInternalSparqlEndpointAddress()
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
String internalSparqlEndpoint =
|
||||
configurationService.getProperty(STORAGE_SPARQL_ENDPOINT_KEY);
|
||||
String externalSparqlEndpoint =
|
||||
@@ -175,7 +175,7 @@ public class RDFConfiguration {
|
||||
public static String getDSpaceRDFModuleURI()
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
return configurationService.getProperty(CONTEXT_PATH_KEY);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class RDFConfiguration {
|
||||
if (converter == null)
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
converter = (RDFConverter) initializeClass(configurationService,
|
||||
RDFCONVERTER_KEY, "RDFConverter");
|
||||
}
|
||||
@@ -204,7 +204,7 @@ public class RDFConfiguration {
|
||||
if (generator == null)
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
generator = (URIGenerator) initializeClass(configurationService,
|
||||
URIGENERATOR_KEY, "URIGenerator");
|
||||
}
|
||||
@@ -224,7 +224,7 @@ public class RDFConfiguration {
|
||||
if (storage == null)
|
||||
{
|
||||
ConfigurationService configurationService =
|
||||
new DSpace().getConfigurationService();
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
storage = (RDFStorage) initializeClass(configurationService,
|
||||
RDFSTORAGE_KEY, "RDFStorage");
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class RDFConfiguration {
|
||||
*/
|
||||
public static String[] loadConfigurationArray(String key)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
if(config.hasProperty(key))
|
||||
return config.getArrayProperty(key);
|
||||
else
|
||||
|
@@ -40,7 +40,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* This class manages the handling of RDF data in DSpace. It generates
|
||||
@@ -75,7 +75,7 @@ public class RDFizer {
|
||||
|
||||
public RDFizer()
|
||||
{
|
||||
this.configurationService = new DSpace().getConfigurationService();
|
||||
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
this.stdout = false;
|
||||
this.verbose = false;
|
||||
this.dryrun = false;
|
||||
|
@@ -19,7 +19,7 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.rdf.RDFConfiguration;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -33,7 +33,7 @@ public class RDFConverterImpl implements RDFConverter
|
||||
|
||||
public RDFConverterImpl()
|
||||
{
|
||||
this.configurationService = new DSpace().getConfigurationService();
|
||||
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
this.plugins = new ArrayList<ConverterPlugin>();
|
||||
|
||||
String pluginNames[] = RDFConfiguration.getConverterPlugins();
|
||||
|
@@ -32,7 +32,7 @@ import org.apache.jena.web.DatasetGraphAccessorHTTP;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.rdf.RDFConfiguration;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -54,7 +54,7 @@ implements RDFStorage
|
||||
|
||||
public RDFStorageImpl()
|
||||
{
|
||||
this.configurationService = new DSpace().getConfigurationService();
|
||||
this.configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
this.GRAPHSTORE_ENDPOINT = this.configurationService
|
||||
.getProperty(RDFConfiguration.STORAGE_GRAPHSTORE_ENDPOINT_KEY);
|
||||
|
@@ -13,11 +13,11 @@ import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.util.ClientUtils;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.statistics.Dataset;
|
||||
import org.dspace.statistics.ObjectCount;
|
||||
import org.dspace.statistics.SolrLoggerServiceImpl;
|
||||
import org.dspace.statistics.content.filter.StatisticsFilter;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
@@ -113,7 +113,7 @@ public class StatisticsDataSearches extends StatisticsData {
|
||||
|
||||
dataset.setRowLabel(i, String.valueOf(i + 1));
|
||||
String displayedValue = queryCount.getValue();
|
||||
if(new DSpace().getConfigurationService().getPropertyAsType("usage-statistics.search.statistics.unescape.queries", Boolean.TRUE)){
|
||||
if(DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyAsType("usage-statistics.search.statistics.unescape.queries", Boolean.TRUE)){
|
||||
displayedValue = displayedValue.replace("\\", "");
|
||||
}
|
||||
dataset.addValueToMatrix(i, 0, displayedValue);
|
||||
|
@@ -19,11 +19,11 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.statistics.Dataset;
|
||||
import org.dspace.statistics.ObjectCount;
|
||||
import org.dspace.statistics.SolrLoggerServiceImpl;
|
||||
import org.dspace.statistics.content.filter.StatisticsFilter;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -166,7 +166,7 @@ public class StatisticsDataWorkflow extends StatisticsData {
|
||||
|
||||
|
||||
protected Date getOldestWorkflowItemDate() throws SolrServerException {
|
||||
ConfigurationService configurationService = new DSpace().getConfigurationService();
|
||||
ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
String workflowStartDate = configurationService.getProperty("usage-statistics.workflow-start-date");
|
||||
if(workflowStartDate == null){
|
||||
//Query our solr for it !
|
||||
|
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
package org.dspace.statistics.factory;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.statistics.service.ElasticSearchLoggerService;
|
||||
import org.dspace.statistics.service.SolrLoggerService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the statistics package, use StatisticsServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -24,6 +24,6 @@ public abstract class StatisticsServiceFactory {
|
||||
|
||||
public static StatisticsServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("statisticsServiceFactory", StatisticsServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("statisticsServiceFactory", StatisticsServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@
|
||||
*/
|
||||
package org.dspace.statistics.factory;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.statistics.service.ElasticSearchLoggerService;
|
||||
import org.dspace.statistics.service.SolrLoggerService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Factory implementation to get services for the statistics package, use StatisticsServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,12 +21,12 @@ public class StatisticsServiceFactoryImpl extends StatisticsServiceFactory {
|
||||
@Override
|
||||
public SolrLoggerService getSolrLoggerService() {
|
||||
// In order to lazy load, we cannot autowire it and instead load it by name
|
||||
return new DSpace().getServiceManager().getServiceByName("solrLoggerService", SolrLoggerService.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("solrLoggerService", SolrLoggerService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElasticSearchLoggerService getElasticSearchLoggerService() {
|
||||
// In order to lazy load, we cannot autowire it and instead load it by name
|
||||
return new DSpace().getServiceManager().getServiceByName("elasticSearchLoggerService", ElasticSearchLoggerService.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("elasticSearchLoggerService", ElasticSearchLoggerService.class);
|
||||
}
|
||||
}
|
||||
|
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
package org.dspace.storage.bitstore.factory;
|
||||
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.storage.bitstore.service.BitstreamStorageService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the storage package, use StorageServiceFactory.getInstance() to retrieve an implementation
|
||||
@@ -21,6 +21,6 @@ public abstract class StorageServiceFactory {
|
||||
|
||||
public static StorageServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("storageServiceFactory", StorageServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("storageServiceFactory", StorageServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import org.dspace.administer.MetadataImporter;
|
||||
import org.dspace.administer.RegistryLoader;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.flywaydb.core.api.MigrationInfo;
|
||||
import org.flywaydb.core.api.callback.FlywayCallback;
|
||||
import org.slf4j.Logger;
|
||||
@@ -45,7 +45,7 @@ public class DatabaseRegistryUpdater implements FlywayCallback
|
||||
*/
|
||||
private void updateRegistries()
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
Context context = null;
|
||||
try
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.discovery.IndexingService;
|
||||
import org.dspace.discovery.SearchServiceException;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.core.api.FlywayException;
|
||||
import org.flywaydb.core.api.MigrationInfo;
|
||||
@@ -62,7 +62,7 @@ public class DatabaseUtils
|
||||
// When this temp file exists, the "checkReindexDiscovery()" method will auto-reindex Discovery
|
||||
// Reindex flag file is at [dspace]/solr/search/conf/reindex.flag
|
||||
// See also setReindexDiscovery()/getReindexDiscover()
|
||||
private static final String reindexDiscoveryFilePath = new DSpace().getConfigurationService().getProperty("dspace.dir") +
|
||||
private static final String reindexDiscoveryFilePath = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") +
|
||||
File.separator + "solr" +
|
||||
File.separator + "search" +
|
||||
File.separator + "conf" +
|
||||
@@ -79,7 +79,7 @@ public class DatabaseUtils
|
||||
*/
|
||||
public static void main(String[] argv)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
// Usage checks
|
||||
if (argv.length < 1)
|
||||
@@ -372,7 +372,7 @@ public class DatabaseUtils
|
||||
*/
|
||||
private synchronized static Flyway setupFlyway(DataSource datasource)
|
||||
{
|
||||
ConfigurationService config = new DSpace().getConfigurationService();
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
if (flywaydb==null)
|
||||
{
|
||||
@@ -422,7 +422,7 @@ public class DatabaseUtils
|
||||
// Set flyway callbacks (i.e. classes which are called post-DB migration and similar)
|
||||
// In this situation, we have a Registry Updater that runs PRE-migration
|
||||
// NOTE: DatabaseLegacyReindexer only indexes in Legacy Lucene & RDBMS indexes. It can be removed once those are obsolete.
|
||||
List<FlywayCallback> flywayCallbacks = new DSpace().getServiceManager().getServicesByType(FlywayCallback.class);
|
||||
List<FlywayCallback> flywayCallbacks = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(FlywayCallback.class);
|
||||
flywaydb.setCallbacks(flywayCallbacks.toArray(new FlywayCallback[flywayCallbacks.size()]));
|
||||
}
|
||||
catch(SQLException e)
|
||||
@@ -1030,7 +1030,7 @@ public class DatabaseUtils
|
||||
// If we don't know our schema, let's try the schema in the DSpace configuration
|
||||
if(StringUtils.isBlank(schema))
|
||||
{
|
||||
schema = canonicalize(connection, new DSpace().getConfigurationService().getProperty("db.schema"));
|
||||
schema = canonicalize(connection, DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("db.schema"));
|
||||
}
|
||||
|
||||
// Still blank? Ok, we'll find a "sane" default based on the DB type
|
||||
@@ -1290,7 +1290,7 @@ public class DatabaseUtils
|
||||
protected static DataSource getDataSource()
|
||||
{
|
||||
// DataSource is configured via our ServiceManager (i.e. via Spring).
|
||||
return new DSpace().getServiceManager().getServiceByName("dataSource", BasicDataSource.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("dataSource", BasicDataSource.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -34,6 +34,7 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.submit.AbstractProcessingStep;
|
||||
import org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator;
|
||||
import org.dspace.submit.lookup.SubmissionItemDataLoader;
|
||||
@@ -41,7 +42,6 @@ import org.dspace.submit.lookup.SubmissionLookupService;
|
||||
import org.dspace.submit.util.ItemSubmissionLookupDTO;
|
||||
import org.dspace.submit.util.SubmissionLookupDTO;
|
||||
import org.dspace.submit.util.SubmissionLookupPublication;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* StartSubmissionLookupStep is used when you want enabled the user to auto fill
|
||||
@@ -81,8 +81,8 @@ public class StartSubmissionLookupStep extends AbstractProcessingStep
|
||||
|
||||
public static final int STATUS_SUBMISSION_EXPIRED = 4;
|
||||
|
||||
private SubmissionLookupService slService = new DSpace()
|
||||
.getServiceManager().getServiceByName(
|
||||
private SubmissionLookupService slService = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(
|
||||
SubmissionLookupService.class.getCanonicalName(),
|
||||
SubmissionLookupService.class);
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.versioning.factory;
|
||||
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.versioning.service.VersionHistoryService;
|
||||
import org.dspace.versioning.service.VersioningService;
|
||||
|
||||
@@ -24,6 +24,6 @@ public abstract class VersionServiceFactory {
|
||||
|
||||
public static VersionServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("versionServiceFactory", VersionServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("versionServiceFactory", VersionServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.workflow.factory;
|
||||
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
import org.dspace.workflow.WorkflowService;
|
||||
|
||||
@@ -24,6 +24,6 @@ public abstract class WorkflowServiceFactory {
|
||||
|
||||
public static WorkflowServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("workflowServiceFactory", WorkflowServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("workflowServiceFactory", WorkflowServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -25,8 +25,8 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageWorkflowEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.workflowbasic.service.BasicWorkflowItemService;
|
||||
import org.dspace.workflowbasic.service.BasicWorkflowService;
|
||||
import org.dspace.workflowbasic.service.TaskListItemService;
|
||||
@@ -602,7 +602,7 @@ public class BasicWorkflowServiceImpl implements BasicWorkflowService
|
||||
if(newOwnerGroup != null){
|
||||
usageWorkflowEvent.setGroupOwners(newOwnerGroup);
|
||||
}
|
||||
new DSpace().getEventService().fireEvent(usageWorkflowEvent);
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(usageWorkflowEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.workflowbasic.factory;
|
||||
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.workflowbasic.service.BasicWorkflowItemService;
|
||||
import org.dspace.workflowbasic.service.BasicWorkflowService;
|
||||
@@ -28,6 +28,6 @@ public abstract class BasicWorkflowServiceFactory extends WorkflowServiceFactory
|
||||
|
||||
public static BasicWorkflowServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("workflowServiceFactory", BasicWorkflowServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("workflowServiceFactory", BasicWorkflowServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ import org.apache.log4j.Logger;
|
||||
import org.apache.xpath.XPathAPI;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowFactory;
|
||||
import org.dspace.xmlworkflow.state.Step;
|
||||
import org.dspace.xmlworkflow.state.actions.UserSelectionActionConfig;
|
||||
@@ -175,12 +175,12 @@ public class XmlWorkflowFactoryImpl implements XmlWorkflowFactory {
|
||||
|
||||
}
|
||||
protected UserSelectionActionConfig createUserAssignmentActionConfig(String userSelectionActionID) {
|
||||
return new DSpace().getServiceManager().getServiceByName(userSelectionActionID, UserSelectionActionConfig.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(userSelectionActionID, UserSelectionActionConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkflowActionConfig createWorkflowActionConfig(String actionID){
|
||||
return new DSpace().getServiceManager().getServiceByName(actionID, WorkflowActionConfig.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(actionID, WorkflowActionConfig.class);
|
||||
}
|
||||
|
||||
protected LinkedHashMap<String, Role> getRoles(Node workflowNode) throws WorkflowConfigurationException {
|
||||
|
@@ -22,8 +22,8 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageWorkflowEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.xmlworkflow.factory.XmlWorkflowFactory;
|
||||
import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
|
||||
@@ -410,7 +410,7 @@ public class XmlWorkflowServiceImpl implements XmlWorkflowService {
|
||||
usageWorkflowEvent.setEpersonOwners(currentEpersonOwners.toArray(new EPerson[currentEpersonOwners.size()]));
|
||||
usageWorkflowEvent.setGroupOwners(currentGroupOwners.toArray(new Group[currentGroupOwners.size()]));
|
||||
|
||||
new DSpace().getEventService().fireEvent(usageWorkflowEvent);
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(usageWorkflowEvent);
|
||||
} catch (Exception e) {
|
||||
//Catch all errors we do not want our workflow to crash because the logging threw an exception
|
||||
log.error(LogManager.getHeader(c, "Error while logging workflow event", "Workflow Item: " + wfi.getID()), e);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
package org.dspace.xmlworkflow.factory;
|
||||
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.dspace.xmlworkflow.service.WorkflowRequirementsService;
|
||||
import org.dspace.xmlworkflow.service.XmlWorkflowService;
|
||||
@@ -40,6 +40,6 @@ public abstract class XmlWorkflowServiceFactory extends WorkflowServiceFactory {
|
||||
|
||||
public static XmlWorkflowServiceFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("workflowServiceFactory", XmlWorkflowServiceFactory.class);
|
||||
return DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("workflowServiceFactory", XmlWorkflowServiceFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,6 @@ import org.dspace.content.service.*;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.versioning.Version;
|
||||
import org.dspace.versioning.VersionHistory;
|
||||
import org.dspace.versioning.factory.VersionServiceFactory;
|
||||
@@ -48,7 +47,6 @@ public class VersioningTest extends AbstractUnitTest {
|
||||
private Item originalItem;
|
||||
private Item versionedItem;
|
||||
private String summary = "Unit test version";
|
||||
private DSpace dspace = new DSpace();
|
||||
protected CommunityService communityService = ContentServiceFactory.getInstance().getCommunityService();
|
||||
protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService();
|
||||
protected InstallItemService installItemService = ContentServiceFactory.getInstance().getInstallItemService();
|
||||
|
@@ -36,7 +36,7 @@ import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.junit.*;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ITDSpaceAIP extends AbstractUnitTest
|
||||
protected InstallItemService installItemService = ContentServiceFactory.getInstance().getInstallItemService();
|
||||
protected HandleService handleService = HandleServiceFactory.getInstance().getHandleService();
|
||||
protected PluginService pluginService = CoreServiceFactory.getInstance().getPluginService();
|
||||
protected ConfigurationService configService = new DSpace().getConfigurationService();
|
||||
protected ConfigurationService configService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
/** InfoMap multiple value separator (see saveObjectInfo() and assertObject* methods) **/
|
||||
private static final String valueseparator = "::";
|
||||
|
@@ -12,7 +12,6 @@ import java.util.Locale;
|
||||
import mockit.Expectations;
|
||||
import org.dspace.AbstractDSpaceTest;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
@@ -143,7 +142,7 @@ public class I18nUtilTest extends AbstractDSpaceTest
|
||||
public void testGetMessage_String()
|
||||
{
|
||||
System.out.println("getMessage");
|
||||
final ConfigurationService configService = new DSpace().getConfigurationService();
|
||||
final ConfigurationService configService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
// Override "default.locale" and ensure it is set to US English
|
||||
new Expectations(configService.getClass()) {{
|
||||
|
@@ -25,7 +25,6 @@ import org.dspace.content.service.WorkspaceItemService;
|
||||
import org.dspace.identifier.factory.IdentifierServiceFactory;
|
||||
import org.dspace.identifier.service.DOIService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
@@ -93,7 +92,7 @@ public class DOIIdentifierProviderTest
|
||||
//we need to commit the changes so we don't block the table for testing
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
config = new DSpace().getConfigurationService();
|
||||
config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
// Configure the service under test.
|
||||
config.setProperty(DOIIdentifierProvider.CFG_PREFIX, PREFIX);
|
||||
config.setProperty(DOIIdentifierProvider.CFG_NAMESPACE_SEPARATOR,
|
||||
@@ -101,7 +100,7 @@ public class DOIIdentifierProviderTest
|
||||
|
||||
connector = new MockDOIConnector();
|
||||
|
||||
provider = new DSpace().getServiceManager().getServiceByName(DOIIdentifierProvider.class.getName(), DOIIdentifierProvider.class);
|
||||
provider = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(DOIIdentifierProvider.class.getName(), DOIIdentifierProvider.class);
|
||||
provider.setConfigurationService(config);
|
||||
provider.setDOIConnector(connector);
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ import org.dspace.core.Context;
|
||||
import org.dspace.identifier.ezid.DateToYear;
|
||||
import org.dspace.identifier.ezid.Transform;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
@@ -127,7 +126,7 @@ public class EZIDIdentifierProviderTest
|
||||
throws Exception
|
||||
{
|
||||
// Find the configuration service
|
||||
config = new DSpace().getConfigurationService();
|
||||
config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
// Configure the service under test.
|
||||
config.setProperty(EZIDIdentifierProvider.CFG_SHOULDER, TEST_SHOULDER);
|
||||
@@ -141,15 +140,15 @@ public class EZIDIdentifierProviderTest
|
||||
instance.setCrosswalk(aCrosswalk);
|
||||
instance.setCrosswalkTransform(crosswalkTransforms);
|
||||
instance.setItemService(ContentServiceFactory.getInstance().getItemService());
|
||||
new DSpace().getServiceManager().registerServiceNoAutowire(EZIDIdentifierProvider.class.getName(), instance);
|
||||
assertNotNull(new DSpace().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class));
|
||||
DSpaceServicesFactory.getInstance().getServiceManager().registerServiceNoAutowire(EZIDIdentifierProvider.class.getName(), instance);
|
||||
assertNotNull(DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class));
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass()
|
||||
throws Exception
|
||||
{
|
||||
new DSpace().getServiceManager().unregisterService(EZIDIdentifierProvider.class.getName());
|
||||
DSpaceServicesFactory.getInstance().getServiceManager().unregisterService(EZIDIdentifierProvider.class.getName());
|
||||
System.out.print("Tearing down\n\n");
|
||||
}
|
||||
|
||||
@@ -186,7 +185,7 @@ public class EZIDIdentifierProviderTest
|
||||
{
|
||||
System.out.println("supports Class");
|
||||
|
||||
EZIDIdentifierProvider instance = new DSpace().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
EZIDIdentifierProvider instance = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
|
||||
Class<? extends Identifier> identifier = DOI.class;
|
||||
boolean result = instance.supports(identifier);
|
||||
@@ -201,7 +200,7 @@ public class EZIDIdentifierProviderTest
|
||||
{
|
||||
System.out.println("supports String");
|
||||
|
||||
EZIDIdentifierProvider instance = new DSpace().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
EZIDIdentifierProvider instance = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
|
||||
String identifier = "doi:" + TEST_SHOULDER;
|
||||
boolean result = instance.supports(identifier);
|
||||
@@ -412,7 +411,7 @@ public class EZIDIdentifierProviderTest
|
||||
System.out.println("crosswalkMetadata");
|
||||
|
||||
// Set up the instance to be tested
|
||||
EZIDIdentifierProvider instance = new DSpace().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
EZIDIdentifierProvider instance = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(EZIDIdentifierProvider.class.getName(), EZIDIdentifierProvider.class);
|
||||
// instance.setConfigurationService(config);
|
||||
// instance.setCrosswalk(aCrosswalk);
|
||||
// instance.setCrosswalkTransform(crosswalkTransforms);
|
||||
|
@@ -44,13 +44,13 @@ import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.submit.lookup.MultipleSubmissionLookupDataLoader;
|
||||
import org.dspace.submit.lookup.SubmissionLookupOutputGenerator;
|
||||
import org.dspace.submit.lookup.SubmissionLookupService;
|
||||
import org.dspace.submit.lookup.SubmissionLookupUtils;
|
||||
import org.dspace.submit.util.ItemSubmissionLookupDTO;
|
||||
import org.dspace.submit.util.SubmissionLookupDTO;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -65,7 +65,7 @@ import com.google.gson.JsonObject;
|
||||
public class SubmissionLookupJSONRequest extends JSONRequest
|
||||
{
|
||||
|
||||
private SubmissionLookupService service = new DSpace().getServiceManager()
|
||||
private SubmissionLookupService service = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(SubmissionLookupService.class.getName(),
|
||||
SubmissionLookupService.class);
|
||||
|
||||
|
@@ -18,15 +18,14 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.app.webui.util.UIUtil;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeServiceImpl;
|
||||
import org.dspace.browse.BrowseEngine;
|
||||
import org.dspace.browse.BrowseException;
|
||||
import org.dspace.browse.BrowseIndex;
|
||||
import org.dspace.browse.BrowseInfo;
|
||||
import org.dspace.browse.BrowserScope;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.sort.SortOption;
|
||||
import org.dspace.sort.SortException;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.content.Collection;
|
||||
import org.dspace.content.Community;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
@@ -351,7 +350,7 @@ public abstract class AbstractBrowserServlet extends DSpaceServlet
|
||||
if (bi.isMetadataIndex() && !scope.isSecondLevel())
|
||||
{
|
||||
if (bi.isTagCloudEnabled()){
|
||||
TagCloudConfiguration tagCloudConfiguration = new DSpace().getServiceManager().getServiceByName("browseTagCloudConfiguration", TagCloudConfiguration.class);
|
||||
TagCloudConfiguration tagCloudConfiguration = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName("browseTagCloudConfiguration", TagCloudConfiguration.class);
|
||||
if (tagCloudConfiguration == null){
|
||||
tagCloudConfiguration = new TagCloudConfiguration();
|
||||
}
|
||||
|
@@ -34,8 +34,8 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Servlet for retrieving bitstreams. The bits are simply piped to the user. If
|
||||
@@ -183,7 +183,7 @@ public class BitstreamServlet extends DSpaceServlet
|
||||
//new UsageEvent().fire(request, context, AbstractUsageEvent.VIEW,
|
||||
// Constants.BITSTREAM, bitstream.getID());
|
||||
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
|
@@ -33,8 +33,8 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Servlet for HTML bitstream support.
|
||||
@@ -226,7 +226,7 @@ public class HTMLServlet extends DSpaceServlet
|
||||
log.info(LogManager.getHeader(context, "view_html", "handle="
|
||||
+ handle + ",bitstream_id=" + bitstream.getID()));
|
||||
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
|
@@ -52,8 +52,8 @@ import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.plugin.CollectionHomeProcessor;
|
||||
import org.dspace.plugin.CommunityHomeProcessor;
|
||||
import org.dspace.plugin.ItemHomeProcessor;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Text;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
@@ -468,7 +468,7 @@ public class HandleServlet extends DSpaceServlet
|
||||
}
|
||||
|
||||
// Fire usage event.
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
@@ -559,7 +559,7 @@ public class HandleServlet extends DSpaceServlet
|
||||
}
|
||||
|
||||
// Fire usage event.
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
@@ -700,7 +700,7 @@ public class HandleServlet extends DSpaceServlet
|
||||
}
|
||||
|
||||
// Fire usage event.
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
|
@@ -44,7 +44,7 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Servlet for generate a statistisc report
|
||||
@@ -224,8 +224,7 @@ public class RequestItemServlet extends DSpaceServlet
|
||||
Email email = Email.getEmail(I18nUtil.getEmailFilename(
|
||||
context.getCurrentLocale(), "request_item.author"));
|
||||
|
||||
RequestItemAuthor author = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor author = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(
|
||||
RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
|
@@ -29,8 +29,8 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Servlet for retrieving bitstreams. The bits are simply piped to the user.
|
||||
@@ -124,7 +124,7 @@ public class RetrieveServlet extends DSpaceServlet
|
||||
log.info(LogManager.getHeader(context, "view_bitstream",
|
||||
"bitstream_id=" + bitstream.getID()));
|
||||
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(
|
||||
UsageEvent.Action.VIEW,
|
||||
request,
|
||||
|
@@ -29,7 +29,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* This servlet uses the SHERPASubmitService to build an html page with the
|
||||
@@ -41,7 +41,7 @@ import org.dspace.utils.DSpace;
|
||||
public class SHERPAPublisherPolicyServlet extends DSpaceServlet
|
||||
{
|
||||
private final transient SHERPASubmitService sherpaSubmitService
|
||||
= new DSpace().getServiceManager().getServiceByName(
|
||||
= DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(
|
||||
SHERPASubmitService.class.getCanonicalName(),
|
||||
SHERPASubmitService.class);
|
||||
|
||||
|
@@ -21,9 +21,9 @@ import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.usage.UsageSearchEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Every time a user clicks on a search result he will be redirected through this servlet
|
||||
@@ -70,7 +70,7 @@ public class SearchResultLogServlet extends DSpaceServlet
|
||||
searchEvent.setPage(Integer.parseInt(request.getParameter("page")));
|
||||
}
|
||||
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
searchEvent);
|
||||
|
||||
|
||||
|
@@ -24,7 +24,7 @@ import org.dspace.content.Item;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.versioning.Version;
|
||||
import org.dspace.versioning.VersionHistory;
|
||||
import org.dspace.versioning.factory.VersionServiceFactory;
|
||||
@@ -66,7 +66,7 @@ public class VersionHistoryServlet extends DSpaceServlet
|
||||
item.getOwningCollection()))
|
||||
{
|
||||
// Check if only administrators can view the item history
|
||||
if (new DSpace().getConfigurationService().getPropertyAsType(
|
||||
if (DSpaceServicesFactory.getInstance().getConfigurationService().getPropertyAsType(
|
||||
"versioning.item.history.view.admin", true))
|
||||
{
|
||||
throw new AuthorizeException();
|
||||
|
@@ -30,9 +30,9 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.submit.lookup.SubmissionLookupService;
|
||||
import org.dspace.submit.step.StartSubmissionLookupStep;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Step which controls selecting an item from external database service to auto
|
||||
@@ -73,7 +73,7 @@ public class JSPStartSubmissionLookupStep extends JSPStep
|
||||
private static Logger log = Logger
|
||||
.getLogger(JSPStartSubmissionLookupStep.class);
|
||||
|
||||
SubmissionLookupService slService = new DSpace().getServiceManager()
|
||||
SubmissionLookupService slService = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(SubmissionLookupService.class.getCanonicalName(),
|
||||
SubmissionLookupService.class);
|
||||
|
||||
|
@@ -48,7 +48,7 @@ import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Miscellaneous UI utility methods
|
||||
@@ -543,8 +543,7 @@ public class UIUtil extends Util
|
||||
|
||||
String mark = markType.replace("mark_", "");
|
||||
|
||||
ItemMarkingExtractor markingExtractor = new DSpace()
|
||||
.getServiceManager()
|
||||
ItemMarkingExtractor markingExtractor = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(
|
||||
ItemMarkingExtractor.class.getName()+"."+mark,
|
||||
ItemMarkingExtractor.class);
|
||||
|
@@ -23,7 +23,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.rdf.RDFUtil;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -63,7 +63,7 @@ public class DataProviderServlet extends HttpServlet {
|
||||
if (StringUtils.isEmpty(pathInfo) || StringUtils.countMatches(pathInfo, "/") < 2)
|
||||
{
|
||||
String dspaceURI =
|
||||
(new DSpace()).getConfigurationService().getProperty("dspace.url");
|
||||
DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.url");
|
||||
this.serveNamedGraph(dspaceURI, lang, cType, response);
|
||||
return;
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ import org.dspace.core.Context;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.rdf.negotiation.Negotiator;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -22,8 +22,8 @@ import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.rest.exceptions.ContextException;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.usage.UsageEvent;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Superclass of all resource classes in REST API. It has methods for creating
|
||||
@@ -104,11 +104,11 @@ public class Resource
|
||||
|
||||
if ((user_ip == null) || (user_ip.length() == 0))
|
||||
{
|
||||
new DSpace().getEventService().fireEvent(new UsageEvent(action, request, context, dspaceObject));
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(new UsageEvent(action, request, context, dspaceObject));
|
||||
}
|
||||
else
|
||||
{
|
||||
new DSpace().getEventService().fireEvent(
|
||||
DSpaceServicesFactory.getInstance().getEventService().fireEvent(
|
||||
new UsageEvent(action, user_ip, user_agent, xforwardedfor, context, dspaceObject));
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ import org.dspace.kernel.ServiceManager;
|
||||
import org.dspace.servicemanager.config.DSpaceConfigurationService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.KernelStartupCallbackService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -160,7 +160,7 @@ public final class DSpaceKernelImpl implements DSpaceKernel, DynamicMBean, Commo
|
||||
kernel = this;
|
||||
running = true;
|
||||
|
||||
List<KernelStartupCallbackService> callbackServices = new DSpace().getServiceManager().getServicesByType(KernelStartupCallbackService.class);
|
||||
List<KernelStartupCallbackService> callbackServices = DSpaceServicesFactory.getInstance().getServiceManager().getServicesByType(KernelStartupCallbackService.class);
|
||||
for (KernelStartupCallbackService callbackService : callbackServices) {
|
||||
callbackService.executeCallback();
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ import javax.naming.NamingException;
|
||||
import org.dspace.kernel.mixins.InitializedService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.EmailService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -128,7 +128,7 @@ public class EmailServiceImpl
|
||||
{
|
||||
if (null == cfg)
|
||||
{
|
||||
cfg = new DSpace().getConfigurationService();
|
||||
cfg = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
}
|
||||
|
||||
return new PasswordAuthentication(
|
||||
|
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.services.factory;
|
||||
|
||||
import org.dspace.kernel.ServiceManager;
|
||||
import org.dspace.services.*;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
/**
|
||||
* Abstract factory to get services for the services package, use DSpaceServicesFactory.getInstance() to retrieve an implementation
|
||||
*/
|
||||
public abstract class DSpaceServicesFactory
|
||||
{
|
||||
public abstract CachingService getCachingService();
|
||||
|
||||
public abstract ConfigurationService getConfigurationService();
|
||||
|
||||
public abstract EmailService getEmailService();
|
||||
|
||||
public abstract EventService getEventService();
|
||||
|
||||
public abstract RequestService getRequestService();
|
||||
|
||||
public abstract SessionService getSessionService();
|
||||
|
||||
public abstract ServiceManager getServiceManager();
|
||||
|
||||
public static DSpaceServicesFactory getInstance()
|
||||
{
|
||||
return new DSpace().getServiceManager().getServiceByName("dSpaceServicesFactory", DSpaceServicesFactory.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* The contents of this file are subject to the license and copyright
|
||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||
* tree and available online at
|
||||
*
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.services.factory;
|
||||
|
||||
import org.dspace.kernel.ServiceManager;
|
||||
import org.dspace.services.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Factory implementation to get services for the services package, use DSpaceServicesFactory.getInstance() to retrieve an implementation
|
||||
*
|
||||
*/
|
||||
public class DSpaceServicesFactoryImpl extends DSpaceServicesFactory {
|
||||
|
||||
@Autowired(required = true)
|
||||
private CachingService cachingService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private ConfigurationService configurationService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private EmailService emailService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private EventService eventService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private RequestService requestService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private SessionService sessionService;
|
||||
|
||||
@Autowired(required = true)
|
||||
private ServiceManager serviceManager;
|
||||
|
||||
@Override
|
||||
public CachingService getCachingService() {
|
||||
return cachingService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationService getConfigurationService() {
|
||||
return configurationService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmailService getEmailService() {
|
||||
return emailService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventService getEventService() {
|
||||
return eventService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestService getRequestService() {
|
||||
return requestService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionService getSessionService() {
|
||||
return sessionService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceManager getServiceManager() {
|
||||
return serviceManager;
|
||||
}
|
||||
}
|
@@ -31,10 +31,9 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.handle.HandleServiceImpl;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -125,8 +124,7 @@ public class ItemRequestContactAuthor extends AbstractDSpaceTransformer implemen
|
||||
|
||||
Item item = requestItem.getItem();
|
||||
|
||||
RequestItemAuthor requestItemAuthor = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor requestItemAuthor = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
.getRequestItemAuthor(context, item);
|
||||
|
@@ -28,7 +28,7 @@ import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -115,8 +115,7 @@ public class ItemRequestContactRequester extends AbstractDSpaceTransformer imple
|
||||
|
||||
Item item = requestItem.getItem();
|
||||
|
||||
RequestItemAuthor requestItemAuthor = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor requestItemAuthor = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
.getRequestItemAuthor(context, item);
|
||||
|
@@ -31,9 +31,9 @@ import org.dspace.core.Email;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.storage.bitstore.factory.StorageServiceFactory;
|
||||
import org.dspace.storage.bitstore.service.BitstreamStorageService;
|
||||
import org.dspace.utils.DSpace;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import java.io.IOException;
|
||||
@@ -162,8 +162,7 @@ public class ItemRequestResponseAction extends AbstractAction
|
||||
String mail = request.getParameter("email");
|
||||
|
||||
if(StringUtils.isNotEmpty(name)&&StringUtils.isNotEmpty(mail)){
|
||||
RequestItemAuthor requestItemAuthor = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor requestItemAuthor = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
.getRequestItemAuthor(context, item);
|
||||
|
@@ -40,7 +40,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -132,8 +132,7 @@ public class ItemRequestResponseFalseForm extends AbstractDSpaceTransformer impl
|
||||
else
|
||||
title = "untitled";
|
||||
|
||||
RequestItemAuthor author = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor author = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
.getRequestItemAuthor(context, item);
|
||||
|
@@ -39,7 +39,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
@@ -129,8 +129,7 @@ public class ItemRequestResponseTrueForm extends AbstractDSpaceTransformer imple
|
||||
else
|
||||
title = "untitled";
|
||||
|
||||
RequestItemAuthor author = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor author = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class)
|
||||
.getRequestItemAuthor(context, item);
|
||||
|
@@ -47,6 +47,7 @@ import org.dspace.app.util.GoogleMetadata;
|
||||
import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.content.crosswalk.DisseminationCrosswalk;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Text;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
@@ -54,7 +55,6 @@ import org.xml.sax.SAXException;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.app.xmlui.wing.element.Metadata;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -212,7 +212,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
/* Temporarily switch to using metadata directly.
|
||||
* FIXME Proper fix is to have IdentifierService handle all durable
|
||||
* identifiers, whether minted here or elsewhere.
|
||||
List<IdentifierProvider> idPs = new DSpace().getServiceManager()
|
||||
List<IdentifierProvider> idPs = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServicesByType(IdentifierProvider.class);
|
||||
for (IdentifierProvider idP : idPs)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ public class ItemViewer extends AbstractDSpaceTransformer implements CacheablePr
|
||||
}
|
||||
}
|
||||
*/
|
||||
String identifierField = new DSpace().getConfigurationService()
|
||||
String identifierField = DSpaceServicesFactory.getInstance().getConfigurationService()
|
||||
.getPropertyAsType("altmetrics.field", "dc.identifier.uri");
|
||||
for (MetadataValue uri : ContentServiceFactory.getInstance().getDSpaceObjectService(dso).getMetadataByMetadataString(dso, identifierField))
|
||||
{
|
||||
|
@@ -36,10 +36,9 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.Email;
|
||||
import org.dspace.core.I18nUtil;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.handle.HandleServiceImpl;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* This action will send a mail to request a item to administrator when all mandatory data is present.
|
||||
@@ -109,8 +108,7 @@ public class SendItemRequestAction extends AbstractAction
|
||||
String title = "";
|
||||
Bitstream bitstream = bitstreamService.find(context, UUID.fromString(bitstreamId));
|
||||
|
||||
RequestItemAuthor requestItemAuthor = new DSpace()
|
||||
.getServiceManager()
|
||||
RequestItemAuthor requestItemAuthor = DSpaceServicesFactory.getInstance().getServiceManager()
|
||||
.getServiceByName(
|
||||
RequestItemAuthorExtractor.class.getName(),
|
||||
RequestItemAuthorExtractor.class
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user