|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.logging.ApplicationLoggingImpl atg.repository.servlet.NavHistory
public class NavHistory
When you are walking in the woods, experts recommend carrying a loaf of bread and throwing down bread crumbs everywhere you walk so that when you would like to return, you can follow a trail of breadcrumbs to your home.
In this implementation of bread crumbs we will keep track of the path that the user has traversed from the top of the site to the current location. We will keep a stack of locations visited and move items on and off that stack as needed to keep the list a concise path from user's current position to the "top" of the site.
This class is intended to be instantiated as a session scoped component and used with the NavHistoryCollector.
There are 4 ways that a user can move:
This works for navigation among items in a single repository or multiple repositories. If you have a site with a catalog and a magazine, for example, and each has a separate repository, then you can use a single NavHistory for the whole site or you may maintain a MagazineNavHistory and a CatalogNavHistory service so that you can remember position in the Magazine while the user visits the catalog and vice versa.
Usage:
The property NavHistory.navHistory is a LinkedList of objects which may be RepositoryItem or NavHistoryItems which represent the special pages like "search" and "home". To render the navigation history, which gives upwards navigation:
<droplet bean="/atg/dynamo/droplet/ForEach"> <param name="array" value="property:NavHistory.navHistory"> <oparam name="output"> <a href="param:element.template.url"> <param name="itemType" value="param:element.itemDescriptor.itemDescriptorName"> <param name="itemId" value="param:element.repositoryId"> <param name="navAction" value="pop"> <valueof param="element.displayName"></valueof> </a> </oparam> </droplet>
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
NavHistory()
|
Method Summary | |
---|---|
java.util.LinkedList |
getDefaultHistory(java.lang.Object pItem)
Use this method to return the navhistory to display if there is no actual history in the user's session. |
int |
getNavCount()
|
java.util.LinkedList |
getNavHistory()
|
void |
incrementNavCount()
|
boolean |
navigate(java.lang.Object pItem,
java.lang.String pNavAction)
This method uses navAction to decide how to place pItem on the NavHistory property and then does it. |
void |
resetHistory()
this method erases all navHistory |
void |
setNavCount(int pNavCount)
|
void |
setNavHistory(java.util.LinkedList pNavHistory)
|
java.lang.String |
toString()
For debugging purposes, this method can be used to print the contents of the navHistory property. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public NavHistory()
Method Detail |
---|
public void setNavHistory(java.util.LinkedList pNavHistory)
public java.util.LinkedList getNavHistory()
public void setNavCount(int pNavCount)
public int getNavCount()
public void incrementNavCount()
public void resetHistory()
public boolean navigate(java.lang.Object pItem, java.lang.String pNavAction)
public java.util.LinkedList getDefaultHistory(java.lang.Object pItem)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |