"Fossies" - the Fresh Open Source Software Archive

Member "WEB-INF/classes/spring/fcrepo-config.xml" (22 Jul 2020, 11589 Bytes) of package /linux/www/fcrepo-webapp-5.1.1.war:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <?xml version="1.0" encoding="UTF-8"?>
    2 <beans xmlns="http://www.springframework.org/schema/beans"
    3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4     xmlns:context="http://www.springframework.org/schema/context"
    5     xmlns:task="http://www.springframework.org/schema/task"
    6     xmlns:p="http://www.springframework.org/schema/p"
    7     xmlns:util="http://www.springframework.org/schema/util"
    8     xsi:schemaLocation="
    9     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   10     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
   11     http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
   12     http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
   13 
   14     <!-- Master context for fcrepo4. -->
   15 
   16     <!-- Context that supports the actual ModeShape JCR itself -->
   17     <context:property-placeholder/>
   18     <context:annotation-config/>
   19     <context:component-scan base-package="org.fcrepo"/>
   20 
   21 
   22         <!-- **********************************
   23                         MODESHAPE configuration
   24                  ********************************** -->
   25         
   26     <!-- Authentication Not Enabled -->
   27     <!--
   28     <bean name="modeshapeRepofactory"
   29         class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean"
   30         p:repositoryConfiguration="${fcrepo.modeshape.configuration}" />
   31     -->
   32     <!-- To use Authentication:
   33       1. Comment out the above bean definition.
   34       2. Uncomment this bean definition.
   35       3. Uncomment one of the provider definitions (WebAC)
   36       4. Uncomment the "authenticationProvider" bean definition below.
   37     -->
   38 
   39     <bean name="modeshapeRepofactory"
   40         class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean"
   41         p:repositoryConfiguration="${fcrepo.modeshape.configuration}"
   42         depends-on="authenticationProvider"/>
   43   
   44     <bean name="authenticationProvider" class="org.fcrepo.auth.common.ShiroAuthenticationProvider"/>
   45         
   46 
   47 
   48     <!-- **************************
   49               Authentication
   50          ************************** -->
   51 
   52     <!-- Optional PrincipalProvider filter that will inspect the request header, "some-header", for user role values -->
   53     <!--
   54     <bean name="headerProvider" class="org.fcrepo.auth.common.HttpHeaderPrincipalProvider">
   55         <property name="headerName" value="some-header"/>
   56         <property name="separator" value=","/>
   57     </bean>
   58     -->
   59 
   60     <!-- Optional PrincipalProvider filter that will use container configured roles as principals -->
   61     <!--
   62     <bean name="containerRolesProvider" class="org.fcrepo.auth.common.ContainerRolesPrincipalProvider">
   63       <property name="roleNames">
   64         <util:set set-class="java.util.HashSet">
   65           <value>tomcat-role-1</value>
   66           <value>tomcat-role-2</value>
   67         </util:set>
   68       </property>
   69     </bean>
   70     -->
   71 
   72     <!-- delegatedPrincipleProvider filter allows a single user to be passed in the header "On-Behalf-Of",
   73            this is to be used as the actor making the request when authenticating.
   74            NOTE: On users with the role fedoraAdmin can delegate to another user.
   75            NOTE: Only supported in WebAC authentication -->
   76     <bean name="delegatedPrincipalProvider" class="org.fcrepo.auth.common.DelegateHeaderPrincipalProvider"/>
   77 
   78     <bean name="accessRolesProvider" class="org.fcrepo.auth.webac.WebACRolesProvider"/>
   79 
   80     <!-- Shiro Auth Confiuration -->
   81     <!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
   82     <!-- WebAC Authorization Realm -->
   83     <bean id="webACAuthorizingRealm" class="org.fcrepo.auth.webac.WebACAuthorizingRealm" />
   84 
   85     <!-- Servlet Container Authentication Realm -->
   86     <bean id="servletContainerAuthenticatingRealm" class="org.fcrepo.auth.common.ServletContainerAuthenticatingRealm" />
   87 
   88     <!-- Security Manager  -->
   89     <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
   90       <property name="realms">
   91         <util:set set-class="java.util.HashSet">
   92           <ref bean="webACAuthorizingRealm"/>
   93           <ref bean="servletContainerAuthenticatingRealm"/>
   94         </util:set>
   95       </property>
   96       <!-- By default the servlet container sessions will be used.  Uncomment this line
   97           to use shiro's native sessions (see the JavaDoc for more): -->
   98       <!-- <property name="sessionMode" value="native"/> -->
   99     </bean>
  100 
  101     <!-- Post processor that automatically invokes init() and destroy() methods -->
  102     <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
  103 
  104     <!-- Authentication Filter -->
  105     <bean id="servletContainerAuthFilter" class="org.fcrepo.auth.common.ServletContainerAuthFilter"/>
  106 
  107     <!-- Authorization Filter -->
  108     <bean id="webACFilter" class="org.fcrepo.auth.webac.WebACFilter"/>
  109 
  110     <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
  111       <property name="securityManager" ref="securityManager"/>
  112       <property name="filterChainDefinitions">
  113         <value>
  114           <!-- The Auth filter should come first, followed by 0 or more of the principal provider filters, -->
  115           <!-- and finally the webACFilter -->
  116           /** = servletContainerAuthFilter,delegatedPrincipalProvider,webACFilter
  117         </value>
  118       </property>
  119     </bean>
  120 
  121     <!-- **************************
  122             END Authentication
  123          ************************** -->
  124 
  125 
  126     <!-- **************************
  127                  AUDIT
  128          publish audit events to JMS
  129          ************************** -->
  130     <!--
  131     <bean class="org.fcrepo.audit.InternalAuditor"/>
  132     -->
  133 
  134     <!-- **************************
  135               PID Minter
  136          ************************** -->
  137     <!-- Mint hierarchical identifiers with args to control length and count
  138           of the pairtree. A length or count of ZERO will return a 
  139           non-hierarchical identifier.
  140     <bean class="org.fcrepo.kernel.api.services.functions.ConfigurableHierarchicalSupplier"
  141         c:desiredLength="${fcrepo.uuid.path.length:2}"
  142         c:desiredCount="${fcrepo.uuid.path.count:4}"/>
  143     -->
  144 
  145     <!-- Mints Pids with no additional hierarchy.
  146           Choose this if you use the AppleTreeConverter
  147           in the translation chain below. -->
  148     <!--
  149     <bean class="org.fcrepo.mint.UUIDPidMinter" />
  150     -->
  151 
  152     <!-- Mints PIDs using external REST service
  153     <bean class="org.fcrepo.mint.HttpPidMinter"
  154         c:url="http://localhost/my/minter" c:method="POST"
  155         c:username="${fcrepo.minter.username:minterUser}"
  156         c:password="${fcrepo.minter.password:minterPass}"
  157         c:regex="" c:xpath="/response/ids/value"/>
  158     -->
  159 
  160     
  161     <!-- Identifier translation chain -->
  162     <util:list id="translationChain" value-type="org.fcrepo.kernel.api.identifiers.InternalIdentifierConverter">
  163       <!-- Use AppleTreeConverter to hide Fedora's Pairtree hierarchy from public view
  164           https://gitlab.amherst.edu/acdc/acrepo-apple-trees.
  165           NOTE: It is recommended to use the UUIDPidMinter above with this converter.
  166       -->
  167       <!--
  168         <bean class="edu.amherst.acdc.orchard.AppleTreeConverter"/>
  169       -->
  170         <bean class="org.fcrepo.kernel.modeshape.identifiers.HashConverter"/>
  171         <bean class="org.fcrepo.kernel.modeshape.identifiers.NamespaceConverter"/>
  172     </util:list>
  173 
  174 
  175     <!-- *************************************
  176                JMS/Eventing Configuration
  177          ************************************* -->
  178     
  179     <!-- publishes events from the internal bus to a JMS Topic or Queue.
  180          "constructor-arg" for both is topic/queue name. -->
  181     
  182     <!-- JMS Topic -->
  183     <!-- IMPORTANT: While the JMS Topic is adequate for demonstrating Fedora's JMS message system,
  184                     for production use it is recommended to either use the JMS Queue instead,
  185                     or to disable JMS messaging entirely if you are not using any services that
  186                     require it (e.g., indexers, fixity checking, auditing, etc.) -->
  187     <bean class="org.fcrepo.jms.JMSTopicPublisher">
  188       <constructor-arg value="fedora"/>
  189     </bean>
  190     
  191     <!-- JMS Queue -->
  192     <!-- The JMS Queue is the RECOMMENDED messaging configuration for production deployments.
  193          Unlike the topic, the queue will retain messages until they are consumed. To use the
  194          queue, comment out the topic bean above and uncomment the queue bean below. -->
  195     <!--
  196     <bean class="org.fcrepo.jms.JMSQueuePublisher">
  197       <constructor-arg value="fedora"/>
  198     </bean>
  199     -->
  200     
  201     <!-- ActiveMQ connection -->  
  202     <bean id="connectionFactory"
  203         class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="jmsBroker"
  204         p:brokerURL="vm://${fcrepo.jms.host:localhost}:${fcrepo.dynamic.jms.port:61616}?create=false"/>
  205 
  206     <!-- JMS Broker configuration -->
  207     <bean name="jmsBroker" class="org.apache.activemq.xbean.BrokerFactoryBean"
  208       p:config="${fcrepo.activemq.configuration:classpath:/config/activemq.xml}" p:start="true"/>
  209 
  210 
  211     <!-- translates events into JMS header-only format-->
  212     <bean class="org.fcrepo.jms.DefaultMessageFactory"/>
  213 
  214     <!-- listener that moves JCR Events to the Fedora internal event bus -->
  215     <bean class="org.fcrepo.kernel.modeshape.observer.SimpleObserver"/>
  216 
  217     <!-- used by bean above to filter which events get put on the bus -->
  218     <bean name="fedoraEventFilter" class="org.fcrepo.kernel.modeshape.observer.DefaultFilter"/>
  219 
  220     <!-- used by observer bean to map JCR events into Fedora events -->
  221     <bean name="fedoraEventMapper" class="org.fcrepo.kernel.modeshape.observer.eventmappings.AllNodeEventsOneEvent"/>
  222 
  223     <!-- Fedora's lightweight internal event bus. Currently memory-resident.-->
  224     <bean name="fedoraInternalEventBus" class="com.google.common.eventbus.EventBus"/>
  225 
  226     <!-- Configuration of namespace prefixes -->
  227     <bean name="rdfNamespaceRegistry" class="org.fcrepo.kernel.api.rdf.RdfNamespaceRegistry"
  228         init-method="init" destroy-method="shutdown">
  229       <property name="configPath" value="${fcrepo.namespace.registry:classpath:/namespaces.yml}" />
  230       <property name="monitorForChanges" value="true" />
  231     </bean>
  232 
  233     <!-- External content configuration -->
  234     <bean name="externalContentPathValidator" class="org.fcrepo.http.api.ExternalContentPathValidator"
  235         init-method="init" destroy-method="shutdown">
  236         <property name="configPath" value="${fcrepo.external.content.allowed:#{null}}" />
  237         <property name="monitorForChanges" value="true" />
  238     </bean>
  239     
  240     <bean name="externalContentHandlerFactory" class="org.fcrepo.http.api.ExternalContentHandlerFactory">
  241         <property name="validator" ref="externalContentPathValidator" />
  242     </bean>
  243 
  244     <!-- ***********************************
  245             Internal system configuration
  246          *********************************** -->
  247     <task:scheduler id="taskScheduler" />
  248     <task:executor id="taskExecutor" pool-size="1" />
  249     <task:annotation-driven executor="taskExecutor" scheduler="taskScheduler" />
  250 
  251 
  252     <!-- Start the Modeshape JCR -->
  253     <bean class="org.modeshape.jcr.ModeShapeEngine" init-method="start"/>
  254 
  255     <bean id="connectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" />
  256 
  257     <!-- Generates HTTP Sessions -->
  258     <bean class="org.fcrepo.http.commons.session.SessionFactory"/>
  259     
  260 </beans>