URL configuration in the Discover Electronics reference application is located in the Assembler context file, WEB-INF\assembler-context.xml. Configuration is divided between the navigationStateBuilder and the NavigationCartridgeHandler.

The configuration for the navigationStateBuilder specifies a urlFormatter to use when serializing a NavigationState:

<!--
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~ Navigation state (including record state) and related config
-->

<bean id="navigationStateBuilder" scope="request"
      class="com.endeca.infront.navigation.url.UrlNavigationStateBuilder">
    <property name="urlFormatter" ref="seoUrlFormatter" />
    <property name="mdexRequestBroker" ref="mdexRequestBroker"/>
    <property name="defaultSearchKey" value="All" />
    <property name="defaultMatchMode" value="ALLPARTIAL" />
    <property name="defaultFilterState" ref="defaultFilterState"/>
        <!-- Filter state properties removed from this example -->
    </property>
    

The content paths that prefix navigation and record states when creating Action URLs are configured in the actionPathProvider of the NavigationCartridgeHandler as sets of key-value pairs:

<bean id="NavigationCartridgeHandler" abstract="true">
        <property name="navigationState" ref="navigationState" />
        <property name="mdexRequestBroker" ref="mdexRequestBroker" />
        <property name="actionPathProvider" ref="actionPathProvider"/>
        <property name="siteState" ref="siteState"/>
								<property name="userState" ref="${user.state.ref}"/>
    <bean id="actionPathProvider" scope="request" class="com.endeca.infront.refapp.navigation.BasicActionPathProvider">
    <constructor-arg index="0" ref="contentSource"/>
    <constructor-arg index="1" ref="httpServletRequest"/>
    <!-- navigationActionUriMap -->
    <constructor-arg index="2">
        <map>
            <entry key="^/pages/[^/]*/mobile/detail$"value="/mobile/browse"/>
            <entry key="^/pages/[^/]*/services/recorddetails/.*$"value="/services/guidedsearch"/>
            <entry key="^/pages/[^/]*/detail$"value="/browse"/>
            <entry key="^/services/.*$"value="/services/guidedsearch"/>
        </map>
    </constructor-arg>
    <!-- recordActionUriMap -->
    <constructor-arg index="3">
        <map>
            <entry key="^/pages/[^/]*/mobile/.*$"value="/mobile/detail"/>
            <entry key="^/pages/[^/]*/services/.*$"value="/services/recorddetails"/>
            <entry key="^/pages/[^/]*/.*$"value="/detail"/>
            <entry key="^/services/.*$"value="/recorddetails"/>
        </map>
    </constructor-arg>
    <constructor-arg index="4" ref="siteState"/>
</bean>

The Discover Electronics reference application serializes NavigationState objects through the use of a UrlNavigationStateBuilder configured with a UrlFormatter. By default, the application is configured for search engine optimized (SEO) URLs using the SeoUrlFormatter class, but it also includes a BasicUrlFormatter for creating basic URLs.

The following properties can be set on the seoUrlFormatter bean:

The configuration in WEB-INF\endeca-seo-url-config is shown below:

<!--
    ########################################################################
    # BEAN: seoUrlFormatter
    #
    # This is the SEO URL formatter, which is responsible for
    # transforming UrlState objects into URL strings. 
    #
-->
    <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>

    <property name="pathParamKeys">
        <list>
            <value>R</value>
            <value>A</value>
            <value>N</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="useNavStateCanonicalizer">
        <value>false</value>
    </property>

    <property name="urlParamEncoders">
        <list>
            <ref bean="N-paramEncoder"/>
        </list>
    </property>
</bean>


Copyright © Legal Notices