A URL configuration file defines a
BasicQueryBuilder
and a top-level
SeoUrlFormatter
.
To create a URL configuration file, follow these steps:
Create a basic query builder that invokes the
com.endeca.soleng.urlformatter.basic.BasicQueryBuilder
class:For example:
<bean id="queryBuilder" class="com.endeca.soleng.urlformatter.basic.BasicQueryBuilder"> </bean>
Option Description queryEncoding
Specifies the query encoding. For example: <value>UTF-8</value>
baseUrlENEQuery
Sets the baseUrLENEQuery
. This query is used to create theUrlENEQuery
if theUrlState
is not associated with a record or navigation state. If this value is<null/>
, a new query is created.baseNavigationUrlENEQuery
Sets the baseNavigationUrlENEQuery
. This query is used to create theUrlENEQuery
if theUrlState
is associated with a navigation state (but not a record or aggregate record). If this value is<null/>
, a new query is created.baseERecUrlENEQuery
Sets the baseERecUrlENEQuery
. This query is used to create theUrlENEQuery
if theUrlState
is associated with a record (but not an aggregate record). If this value is<null/>
, a new query is created.baseAggrERecUrlENEQuery
Sets the baseAggrERecUrlENEQuery
. This query is used to create theUrlENEQuery
if theUrlState
is associated with an aggregate record. If this value is<null/>
, a new query is created.defaultUrlENEQuery
Sets the detaultUrlENEQuery
. This query is used to create theUrlENEQuery
if theUrlState
contains no parameters.For example:
<bean id="queryBuilder" class="com.endeca.soleng.urlformatter.basic.BasicQueryBuilder"> <property name="queryEncoding"> <value>UTF-8</value> </property> <property name="baseUrlENEQuery"> <value><![CDATA[N=0&Ns=P_Price|1&Nr=8020]]></value> </property> <property name="baseNavigationUrlENEQuery"> <value><![CDATA[N=0&Ns=P_Price|1&Nr=8020]]></value> </property> <property name="baseERecUrlENEQuery"> <null/> </property> <property name="baseAggrERecUrlENEQuery"> <value>An=0</value> <null/> </property> <property name="defaultUrlENEQuery"> <value>N=0</value> </property> </bean>
Create a top-level
seoUrlFormatter
bean to invoke thecom.endeca.soleng.urlformatter.seo.SeoUrlFormatter
class:For example:
<bean id="seoUrlFormatter" class="com.endeca.soleng.urlformatter.seo.SeoUrlFormatter"> </bean>
Option Description defaultEncoding
Specifies the default query encoding. For example: <value>UTF-8</value>
pathSeparatorToken
Specifies the character used to separate the misc-path from the path-params section in URLs. pathKeyValueSeparator
Specifies the character used to separate key-value pairs in the path parameter section of the URL. For example:
<bean id="seoUrlFormatter" class="com.endeca.soleng.urlformatter.seo.SeoUrlFormatter"> <property name="defaultEncoding"> <value>UTF-8</value> </property> <property name="pathSeparatorToken"> <value>_</value> </property> <property name="pathKeyValueSeparator"> <value>-</value> </property> <!-- additional elements deleted from this example --!> </bean>
Set any required properties to specify configuration beans.
Note
The instructions in this chapter explain which of beans are required for each task. You can set these properties on your
SeoUrlProvider
object as you work through the chapter.For example:
<bean id="seoUrlFormatter" class="com.endeca.soleng.urlformatter.seo.SeoUrlFormatter"> <property name="pathParamKeys"> <list> <value>R</value> <value>A</value> <value>An</value> <value>Au</value> <value>N</value> <value>No</value> <value>Np</value> <value>Nu</value> <value>D</value> <value>Ntt</value> <value>Ne</value> </list> </property> <property name="navStateFormatter"> <ref bean="navStateFormatter"/> </property> <property name="ERecFormatter"> <ref bean="erecFormatter"/> </property> <property name="aggrERecFormatter"> <ref bean="aggrERecFormatter"/> </property> <property name="navStateCanonicalizer"> <ref bean="navStateCanonicalizer"/> </property> <property name="urlParamEncoders"> <list> <ref bean="N-paramEncoder"/> <ref bean="Ne-paramEncoder"/> <ref bean="An-paramEncoder"/> </list> </property> </bean>
After you have created the basic URL configuration file, you create additional beans to specify further configuration for the misc-path and path-params. Follow the procedures in the sections below to complete your URL configuration.
Related links