org.apache.jetspeed.profiler
Interface ProfileLocator


public interface ProfileLocator

Profile Locators are used to locate profiled portal resources such as pages, documents, and fragments. A locator contains properties describing the actually resource to be located. Since the locator is based on properties that are usually related to a user or other subject's profile, it is referred to as a profile locator.

Profiles can be created from a normalized Profile Locator Path The format of the path is name/value pairs of all property, separated by a path separator. An example locator path:

page:default.psml:artist:al-stewart:song:on-the-border
path:/sports/football/nfl/chiefs:language:en

Version:
$Id: ProfileLocator.java 216120 2005-07-13 06:40:27Z rwatler $
Author:
David Sean Taylor

Field Summary
static String PAGE_LOCATOR
           
static String PATH_SEPARATOR
           
static String SECURITY_LOCATOR
           
 
Method Summary
 void add(RuleCriterion criterion, boolean isControl, boolean isNavigation, String value)
          Add a property based on a @link org.apache.jetspeed.profiler.rules.RuleCriterion and a value.
 void add(String name, boolean isControl, boolean isNavigation, String value)
          Add a property based on a simple name and value.
 void add(String name, String value)
          Add a property based on a simple name and value assumed to be control property.
 void createFromLocatorPath(String path)
          Profiles can be created from a normalized Profile Locator Path The format of the path is name:value pairs of all property, separated by a path separator.
 String getLocatorPath()
          Profiles can be converted to a normalized Profile Locator Path The format of the path is name/value pairs of all property, separated by a path separator.
 String getLocatorPath(ProfileLocatorProperty[] properties)
          Normalize profile properties obtained from profile locator iterators into a Profile Locator Path.
 String getRequestPath()
          Locators are intended to be sufficient to locate managed pages, so the request path must be generally available in the event it is not otherwise captured in a rule criterion.
 String getValue(String name)
          For a given property name, get a property of type @link ProfileLocatorProperty
 void init(Profiler profiler, String requestPath)
          Initialize this page context.
 boolean isControl(String name)
          For a given property name, return control status of property.
 boolean isNavigation(String name)
          For a given property name, return navigation status of property.
 Iterator iterator()
          Get an iterator over the locator's properties.
 String toString()
          Returns a normalized path.
 

Field Detail

PAGE_LOCATOR

public static final String PAGE_LOCATOR
See Also:
Constant Field Values

SECURITY_LOCATOR

public static final String SECURITY_LOCATOR
See Also:
Constant Field Values

PATH_SEPARATOR

public static final String PATH_SEPARATOR
See Also:
Constant Field Values
Method Detail

init

public void init(Profiler profiler,
                 String requestPath)
Initialize this page context.

Parameters:
profiler - The profiler initializing this locator.
requestPath - The request path used to create this locator.

iterator

public Iterator iterator()
Get an iterator over the locator's properties. Elements are returned as @link ProfileLocatorProperty array.

Returns:
an iterator over the profile locator properties

add

public void add(RuleCriterion criterion,
                boolean isControl,
                boolean isNavigation,
                String value)
Add a property based on a @link org.apache.jetspeed.profiler.rules.RuleCriterion and a value. Rule criteria are templates for locating profile properties. The value is combined with the rule to create a property.

Parameters:
criterion - The rule criterion on which this property is based.
isControl - The control classification for property.
isNavigation - The navigation classification for property.
value - The value to set on the property.

add

public void add(String name,
                boolean isControl,
                boolean isNavigation,
                String value)
Add a property based on a simple name and value.

Parameters:
name - The name of the property.
isControl - The control classification for property.
isNavigation - The control classification for property.
value - The value to set on the property.

add

public void add(String name,
                String value)
Add a property based on a simple name and value assumed to be control property.

Parameters:
name - The name of the property.
value - The value to set on the property.

getValue

public String getValue(String name)
For a given property name, get a property of type @link ProfileLocatorProperty

Parameters:
name - The name of the property
Returns:
a property of type @link ProfileLocatorProperty

isControl

public boolean isControl(String name)
For a given property name, return control status of property.

Parameters:
name - The name of the property
Returns:
control classification flag

isNavigation

public boolean isNavigation(String name)
For a given property name, return navigation status of property.

Parameters:
name - The name of the property
Returns:
navigation classification flag

createFromLocatorPath

public void createFromLocatorPath(String path)

Profiles can be created from a normalized Profile Locator Path The format of the path is name:value pairs of all property, separated by a path separator. Note: all locator property elements are assumed to be control properties. An example locator path:

:page:default.psml:artist:air:song:all-i-need

Parameters:
path - The normalized path as shown above from which the locator is created.

getLocatorPath

public String getLocatorPath()

Profiles can be converted to a normalized Profile Locator Path The format of the path is name/value pairs of all property, separated by a path separator. An example locator path:

:page:default.psml:artist:joni-mitchell:song:cary

Returns:
The normalized path as shown above.

getLocatorPath

public String getLocatorPath(ProfileLocatorProperty[] properties)

Normalize profile properties obtained from profile locator iterators into a Profile Locator Path.

Parameters:
properties - The array of profile properties.
Returns:
The normalized path for properties.

toString

public String toString()
Returns a normalized path. @see #getLocatorPath()

Returns:
The normalized path representation of this locator.

getRequestPath

public String getRequestPath()

Locators are intended to be sufficient to locate managed pages, so the request path must be generally available in the event it is not otherwise captured in a rule criterion.

Returns:
The request path.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.