Jetspeed provides very flexible ways for specific configuration settings.
Jetspeed components are initially loaded from /WEB-INF/assembly/
folder, while the default configuration properties are loaded from /WEB-INF/conf/jetspeed.properties.
The initial/default configurations can be overrided through the /WEB-INF/assembly/override/
folder, while overrides/additional values can be provided through the /WEB-INF/conf/override.properties.
Another new feature is conditional Spring assembly loading. Jetspeed provides an extended BeanFactory which checks a loaded Spring BeanDefinition for some extra meta data (defined within the Spring configuration itself) against a predefined configuration, registering a BeanDefinition within Spring can be "prevented", effectively filtering out certain definitions.
In Jetspeed assembly files, a bean definition should have j2:cat
meta data like the following example:
<bean name="xmlPageManager" class="org.apache.jetspeed.page.psml.CastorXmlPageManager"> <meta key="j2:cat" value="xmlPageManager or pageSerializer" /> ... </bean>
xmlPageManager
bean definition is included for two categories: xmlPageManager
and pageSerializer
.
If the Spring filter key setting of Jetspeed contains one of the categories, then the xmlPageManager
bean definition will be registered. Otherwise, the bean definition will be ignored. By the Spring filter key setting, bean definitions in assembly files will be filtered according to their categories.
The Spring filter settings of Jetspeed are defined in /WEB-INF/conf/spring-filter.properties
.
In the file, the following category definitions are provided by default:
Filter Key | Mapped Categories | Description |
---|---|---|
default | default | Default category for most common components |
basePortal | ${default}, jndiDS, xmlPageManager | The base category for a portal instance, to be used for other cateogry definitions. In this category, the data source component and xml-based page manager are provided. |
portal | ${basePortal}, dbSecurity | The default category for a portal instance. With the components by the basePortal category, the security components based on database are provided. |
portal.ldap | ${basePortal}, ldapSecurity | A category for a portal instance. With the components by the basePortal category, the security components based on LDAP are provided. |
portal.dbPageManager | ${default}, jndiDS, dbPageManager, dbSecurity | A category for a portal instance. In this category, the default components, the data source component and database-based page manager and database-based security components are provided. |
portal.dbPageManager.ldap | ${default}, jndiDS, dbPageManager, ldapSecurity | A category for a portal instance. In this category, the default components, the data source component and database-based page manager and LDAP-based security components are provided. |
baseSerializer | jdbcDS, serializer, capabilities, security, profiler, registry, search, transaction, cache, prefs, springProperties, noRequestContext, noPageManager | The base category for Jetspeed Serializer, to be used for other serializer cateogry definitions. In this category, the necessary components for seeding and serializing Jetspeed data are provided. |
serializer | ${baseSerializer}, dbSecurity | The default category for serializer. In this category, database-based security components are provided. |
serializer.ldap | ${baseSerializer}, ldapSecurity | A category for serializer. In this category, LDAP-based security components are provided. |
pageSerializer | jdbcDS, base, pageSerializer, transaction, springProperties, security, dbSecurity, cache | A category for page serializer. |
Note: the expression enclosed by ${} will be expanded by the referenced property values.
By default, the filter key of a portal instance is set to portal
. To change this, you may define a property, spring.filter.key
in one of the following properties files:
/WEB-INF/conf/spring-filter-key.properties
, /WEB-INF/conf/override.properties
or /WEB-INF/conf/jetspeed.properties
.
For example, you can use Jetspeed Portal with LDAP-based Security components:
spring.filter.key = portal.ldap
Because the ids of every beans must be unique within the BeanFactory or ApplicationContext the bean is hosted in, we cannot use same bean id for several different beans.
For example, there could be two options to choose page manager bean component: xml-based page manager or database-based page manager. If some other beans should refer the filtered page manager, they should be grouped in a same category as the filtered page manager. So, there should be many redundant bean definitions which make the maintenance very difficult.
Therefore, Jetspeed provides a way to alias beans dynamically with spring bean filtering solution.
In the following example, the first two bean definitions do not have id, but they have the same j2:alias
meta data value. Jetspeed custom BeanFactory register the alias(es) dynamically according to this meta data.
Finally, the last bean definition can refer the selected bean by using the alias, org.apache.jetspeed.page.PageManager
.
<bean class="org.springframework.beans.factory.config.BeanReferenceFactoryBean"> <meta key="j2:cat" value="xmlPageManager" /> <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" /> <property name="targetBeanName" value="xmlPageManager" /> </bean> <bean class="org.springframework.beans.factory.config.BeanReferenceFactoryBean"> <meta key="j2:cat" value="dbPageManager" /> <meta key="j2:alias" value="org.apache.jetspeed.page.PageManager" /> <property name="targetBeanName" value="dbPageManager" /> </bean> <bean id="org.apache.jetspeed.portalsite.PortalSite" name="portalSite" class="org.apache.jetspeed.portalsite.impl.PortalSiteImpl"> <meta key="j2:cat" value="default" /> <constructor-arg index="0"> <ref bean="org.apache.jetspeed.page.PageManager" /> </constructor-arg> </bean>
Note: multiple alias names can be set to j2:alias meta data value by a string separated by comma or space.