The GeoLocatorFormHandler is used to return items in a repository based on their geographical location and uses two handle methods:

The StoreLocatorFormHandler component is the configuration responsible for displaying geo-located stores or locations. Core Commerce also includes a geo-location droplet. Refer to the Guide to Setting Up a Store for information on this droplet. Use the form handler when user input is required, for example a customer providing a postal code. Use the droplet when user input can be inferred, such as when location information is available in the browser.

The GeoLocatorFormHandler includes the following input properties. For additional information, refer to the ATG Platform API Reference.

Location Properties

Location properties provide a centralized location from which to search. Note that address, postalCode, city and state require a GeoLocatorProvider that supports these methods:

Property Name

Type

Description

address

String

Free-form address used to indicate a central location. A free-form address can be “Boston MA” or “1 Main Street”

city

String

When provided with state, both are used to identify a central location.

state

String

When provided with city, both are used to identify a central location.

postalCode

String

Postal code used as a central a location.

latitude

Double

Used if no other method of geo-location is used. It sets the latitude to use as a central location. If another input method, such as postalCode, is used, the value returned by the GeoLocatorService is used for latitude.

longitude

Double

Used if no other method of geo-location is used. It sets the longitude to use as a central location. If another input method, such as postalCode, is used, the value returned by the GeoLocatorService is used for longitude.

countryCode

String

If provided along with language, is used to create a Locale for the geo-location query. If not provided, the request’s locale is used.

language

String

If provided along with countryCode, is used to create a Locale for the geo-location query. If not provided, the request’s locale is used.

Site Filtering Properties

Site filtering properties are used when the items being located have a site membership property. By default, filtering occurs on the current site, but the search can be filtered to include specific sites.

Property Name

Type

Description

siteIds

Collection

IDs of sites by which to constrain the results.

siteScope

String

Site scope by which to constrain the results. A site scope can be:

current – Results are restricted to current sites
any – Results are filtered to items that have at least one site
all – Results are not filtered by site
none – Results include items that have no site memberships

isIncludeInactiveSites

Boolean

Runs the filter on all sites, including inactive sites.

isIncludeDisabledSites

Boolean

Runs the filter on all sites, including disabled sites. A disabled site is an inactive site. To include a disabled site, both the isIncludeDisabledSites and the isIncludeInactiveSites must be set to true.

Distance Properties

Distance properties indicate the range of the returned results. Only items within the provided distance will be in the result set. Note that by default, distance is measured in meters.

Property Name

Type

Description

distance

Double

Items within this distance in meters are returned.

unitOfMeasureTools

String

Identifies the unit of measure conversions used for distance. By default, this points to the /atg/commerce/units/
DistanceUnits
component.

maximumDistance

Double

The maximum allowed search distance, measured in meters. A value of -1 searches all items.

Redirection Properties

Redirection properties are available to set URLs for conditional redirection. If a URL parameter is not available, redirection will not occur:

Property Name

Type

Description

successURL

String

The URL that is used if no errors are encountered.

errorURL

String

The URL that is used if errors occur.

Results Properties

Results properties are available once the search has been run:

Property Name

Type

Description

locationResults

Collection

A collection of repository items that are found to be within a certain distance of a central location. These items are returned by the locateItem handle method.

Page Navigation Properties

Page navigation properties allow you to create controls that navigate between pages of results. The following properties can be used to create navigation buttons on the results page:

Property Name

Type

Description

maxResultsPerPage

Int

Maximum number of search results to display on a page. If the number of search results returned is greater than this, another page of results is displayed when the user clicks Next. The default is set to -1, which indicates there is no maximum.

resultSetSize

Int

The number of results returned by the query.

endIndex

Int

The ending index to display based on the current page.

startIndex

Int

The starting index to display based on the current page.

currentResultPageNum

Int

The current page of the results being displayed (1-based). The default is 1.

resultPageCount

Int

The number of pages of results.

startCount

Int

The index of the first record of the result set that is displayed within the current page.

endCount

Int

The index of the last record of the results set that is displayed on the current page.

The following properties determine the managers, services and types of items to use:

Property Name

Type

Description

coordinateManager

CoordinateManager

The CoordinateManager used to find items based on their location.

siteGroupManager

SiteGroupManager

The SiteGroupManager used to interpret the site scope.

siteManager

SiteManager

Identifies the SiteManager to set.

geoLocatorService

GeoLocatorService

The GeoLocatorService used to identify latitude and longitude based on an address.

itemType

String

The repository item type to search for. Must be a valid item-descriptor for the repository used by the coordinateManager.


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices