Uncomment Spring configuration and remove test bitstore.xml configuration

This commit is contained in:
Mark Diggory
2025-03-29 11:58:49 -04:00
parent 89c28d43e3
commit afd4fd2b4c
4 changed files with 36 additions and 93 deletions

View File

@@ -198,8 +198,7 @@ logging.server.include-stacktrace-for-httpcode = 422, 400
# Enabled the JCloudStore
assetstore.jcloud.enabled = true
assetstore.jcloud.useRelativePath = false
assetstore.jcloud.subfolder = assetstore
assetstore.jcloud.provider = filesystem
assetstore.jcloud.container = assetstore-jclouds-container
assetstore.jcloud.basedir = target/testing/dspace

View File

@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd"
default-lazy-init="true">
<bean name="org.dspace.storage.bitstore.BitstreamStorageService" class="org.dspace.storage.bitstore.BitstreamStorageServiceImpl">
<property name="incoming" value="${assetstore.index.primary}"/>
<property name="stores">
<map>
<entry key="0" value-ref="localStore"/>
<entry key="1" value-ref="s3Store"/>
<entry key="2" value-ref="jcloudStore"/>
</map>
</property>
</bean>
<bean name="localStore" class="org.dspace.storage.bitstore.DSBitStoreService" scope="singleton">
<property name="baseDir" value="${assetstore.dir}"/>
</bean>
<bean name="s3Store" class="org.dspace.storage.bitstore.S3BitStoreService" scope="singleton" lazy-init="true">
<property name="enabled" value="${assetstore.s3.enabled}"/>
<!-- AWS Security credentials, with policies for specified bucket -->
<property name="awsAccessKey" value="${assetstore.s3.awsAccessKey}"/>
<property name="awsSecretKey" value="${assetstore.s3.awsSecretKey}"/>
<property name="useRelativePath" value="${assetstore.s3.useRelativePath}"/>
<!-- S3 bucket name to store assets in. example: longsight-dspace-auk -->
<property name="bucketName" value="${assetstore.s3.bucketName}"/>
<!-- AWS S3 Region to use: {us-east-1, us-west-1, eu-west-1, eu-central-1, ap-southeast-1, ... } -->
<!-- Optional, sdk default is us-east-1 -->
<property name="awsRegionName" value="${assetstore.s3.awsRegionName}"/>
<!-- Subfolder to organize assets within the bucket, in case this bucket is shared -->
<!-- Optional, default is root level of bucket -->
<property name="subfolder" value="${assetstore.s3.subfolder}"/>
</bean>
<util:constant static-field="org.jclouds.filesystem.reference.FilesystemConstants.PROPERTY_BASEDIR"
id="propertyBaseDir"/>
<!-- Define JCloudStoreService bean -->
<bean name="jcloudStore" class="org.dspace.storage.bitstore.JCloudBitStoreService" scope="singleton" lazy-init="true">
<property name="enabled" value="${assetstore.jcloud.enabled}"/>
<property name="useRelativePath" value="${assetstore.jcloud.useRelativePath}"/>
<property name="providerOrApi" value="${assetstore.jcloud.provider}"/>
<property name="container" value="${assetstore.jcloud.container}"/>
<property name="overrides">
<props>
<prop key="#{propertyBaseDir}">target/testing/dspace</prop>
</props>
</property>
<!--
Subfolder to organize assets within the bucket, in case this bucket is shared -->
<!-- Optional, default is root level of bucket -->
<property name="subfolder" value="${assetstore.jcloud.subfolder}"/>
</bean>
<!-- <bean name="localStore2 ... -->
<!-- <bean name="s3Store2 ... -->
</beans>

View File

@@ -85,15 +85,15 @@ assetstore.s3.awsRegionName =
# The endpoint URL for the S3 service.
# Example: when using "s3" and third party provider such as Minio, https://s3.myprovider.com
# Default: (empty) requirement depends on service provider
# assetstore.jcloud.endpoint
# assetstore.jcloud.endpoint =
# The name of the container (S3 Bucket) to use for storing assets.
# Default: (empty) requirement depends on service provider
# assetstore.jcloud.container
# assetstore.jcloud.container =
# Specifies a subfolder within the container for storing assets
# Default: (empty)
# assetstore.jcloud.subfolder
# assetstore.jcloud.subfolder =
# Determines whether to use relative hash paths (12/34/56/1234567..) for storing bitstreams
# Default: false

View File

@@ -9,9 +9,7 @@
<map>
<entry key="0" value-ref="localStore"/>
<entry key="1" value-ref="s3Store"/>
<!--
<entry key="2" value-ref="jcloudStore"/>
-->
</map>
</property>
</bean>
@@ -40,35 +38,45 @@
</bean>
<!--
JCloudStoreService
Configuration properties for the JCloud assetstore integration.
Properties:
- enabled: Determines if the JCloud assetstore is enabled. Default is false.
- providerOrApi: Specifies the provider or API for the JCloud assetstore.
see https://jclouds.apache.org/reference/providers/#blobstore
- identity: The identity (e.g., username or access key) for the JCloud assetstore.
- credentials: The credentials (e.g., password or secret key) for the JCloud assetstore.
- endpoint: The endpoint URL for the JCloud assetstore.
- container: The container name in the JCloud assetstore.
- subfolder: The subfolder within the container in the JCloud assetstore.
- useRelativePath: Indicates whether to use relative paths. Default is false.
- maxCounter: The maximum counter value for reseting remote connections. Default is -1 (disabled).
JCloudStoreService: This bean is used to configure the JCloud assetstore.
-->
<!--
<bean name="jcloudStore" class="org.dspace.storage.bitstore.JCloudBitStoreService" scope="singleton" lazy-init="true">
<!-- Determines if the JCloud assetstore is enabled. Default is false. -->
<property name="enabled" value="${assetstore.jcloud.enabled:false}"/>
<!-- Specifies the provider or API for the JCloud assetstore.-->
<!-- see https://jclouds.apache.org/reference/providers/#blobstore -->
<property name="providerOrApi" value="${assetstore.jcloud.provider}"/>
<property name="identity" value="${assetstore.jcloud.identity:}"/>
<property name="credentials" value="${assetstore.jcloud.credentials:}"/>
<property name="endpoint" value="${assetstore.jcloud.endpoint:}"/>
<property name="container" value="${assetstore.jcloud.container:}"/>
<property name="subfolder" value="${assetstore.jcloud.subfolder:}"/>
<!-- The identity (e.g., username or access key) for the JCloud assetstore. -->
<property name="identity" value="${assetstore.jcloud.identity:#{null}}"/>
<!-- The credentials (e.g., password or secret key) for the JCloud assetstore. -->
<property name="credentials" value="${assetstore.jcloud.credentials:#{null}}"/>
<!-- The endpoint URL for the JCloud assetstore. -->
<property name="endpoint" value="${assetstore.jcloud.endpoint:#{null}}"/>
<!-- The container name in the JCloud assetstore. -->
<property name="container" value="${assetstore.jcloud.container:#{null}}"/>
<!-- The subfolder within the container in the JCloud assetstore. -->
<property name="subfolder" value="${assetstore.jcloud.subfolder:#{null}}"/>
<!-- Indicates whether to use relative paths. Default is false. -->
<property name="useRelativePath" value="${assetstore.jcloud.useRelativePath:false}"/>
<!-- The maximum counter value for reseting remote connections. Default is -1 (disabled). -->
<property name="maxCounter" value="${assetstore.jcloud.maxCounter:-1}"/>
<!-- A map of overrides for the underlying BlobstoreContext (current setting used in testing). -->
<property name="overrides">
<props>
<prop key="jclouds.filesystem.basedir">${assetstore.jcloud.basedir:#{null}}</prop>
</props>
</property>
</bean>
-->
<!-- <bean name="localStore2 ... -->
<!-- <bean name="s3Store2 ... -->