Plumtree Pluggable Navigation API  
 

com.plumtree.portalpages.common.mediator Namespace

Pluggable Navigation Documentation.

Namespace hierarchy

Classes

Class Description
CListURLFullLinkMediator Generates HTMLAnchors with target URLs in href, display string and image(s) if assigned. This class is similar to CListURLTemplateMediator, except that the HREF is used to go to the URL instead of onlick evens. Hence, it is 508 compatible since no browser Javascript capability is required. Example use: ICPListIterator mediator = new CListURLFullMediator(m_asOwner, cpList1); mediator.SetLabelMaxLength(50); //set the maximum label length to 50 characters while (mediator.Next()) { HTMLAnchor anchor = (HTMLAnchor) mediator.GetEntry(); ... } Extension of ASURL mediator that wraps links in HTMLAnchors. 508 compatible
CListURLFullMediator NOTE: Use CListURLFullLinkMediator to get HTMLAnchors, this class might get changed in the future. Generates HTMLAnchors with target URLs in href, display string and image(s) if assigned. This class is similar to CListURLTemplateMediator, except that the HREF is used to go to the URL instead of onlick evens. Hence, it is 508 compatible since no browser Javascript capability is required. Example use: ICPListIterator mediator = new CListURLFullMediator(m_asOwner, cpList1); mediator.SetLabelMaxLength(50); //set the maximum label length to 50 characters while (mediator.Next()) { HTMLAnchor anchor = (HTMLAnchor) mediator.GetEntry(); ... }
CListURLMediator This class uses delegation to pass on link generation requests to the appropriate link mediator. If in 508 or low bandwidth access style, the class delegates to CListURLFullMediator. If not, it delegates to CListURLTemplateLinkMediator. This class is not a real CListURLMediator in itself. It dynamically decides which CListURLMediator to delegate to given the Display Option from the HTML source. From a practical point of view, use the Model methods to get an ICPListEntryIterator appropriate for the navigation you're constructing, and then use a mediator to quickly form HTMLAnchors for those links.
CListURLTemplateLinkMediator This class extends CListURLTemplateMediator generating HTMLAnchors using URL Templates. Clicking on the URL will construct the full URL and redirect to it. The downside with these links is users can't open the link in a new window with "Open in New Window" option since a javascript onclick event is used to trigger the redirect and not the HREF. See javadoc for CListURLTemplateMediator for more information on URL Templates.
CListURLTemplateMediator Created on Oct 29, 2002 Mediator for ASCompoundList, takes values from ASCompoundList and returns URL Templates, comma separated String with the type of URL and its parameters. A CommunityPage URL would look like 'C,201,-201' where C stands for Community Template, 201 for the community id and -201 for page id. URL Templates are used to lessen the data being sent down to the client. The full URL is constructed by calling the buildURLFromTemplate javascript function (use the NavigationCommonHelpers.JSCRIPT_FUNC_BUILD_URL_FROM_TEMPL constant). The templateURLRedirect javascript function (use the NavigationCommonHelpers.URLTEMPLATE_REDIRECT_JSFUNCNAME) to construct the full url and redirect to it. This mediator is for menus with their own onclick event handling. Use the CListURLTemplateLinkMediator to get an HTMLAnchor elements that redirects to the url in the template. Example use: ICPListIterator mediator = new CListURLTemplateMediator(m_asOwner, cpList1); mediator.SetLabelMaxLength(50); //set the maximum label length to 50 characters while (mediator.Next()) { String[] arURLTempl = (String[]) mediator.GetEntry(); String strLabel \u0009= arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_LABEL]; String strURL\u0009\u0009= arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_URL]; String strImageURL\u0009= arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_IMGURL]; ... }

Interfaces

Interface Description
ICPListIterator Iterator interface for iterating through entries This iterator interface uses the .net style iterator where the index of the iterator starts at -1. A call to Next() is required to advance to the first element. Example use: while (iter.Next()) { Object entry = iter.GetEntry(); } The interface is implemented by two different types of classes. First, ASCompoundList, which is used by the NavigationModel when creating lists of links. These are the same lists that are returneed from methods on the different NavigationPages. They are populated by ListEntry object, objects that store different parts of a link, such as page id, community id, label or image. Cast the result from GetEntry or GetEntryAtIndex to ListEntry. Example: Getting the Community ID from every community a user is member of CommunityNavPage commP = (CommunityNavPage)m_model.GetPageSpecificMethods(); ICPListIterator cpList = commP.GetMyCommunities(false); // only communities, no actions while ( cpList.Next() ) { ListEntry entry = (ListEntry)cpList.GetEntry(); int nCommunityID = entry.GetCommunityID() ... } The second type of classes are the mediators. Mediators are simply helper classes that formats an ListEntry objects from an ICPListIterator list to a specific format. For example, CListURLFullLinkMediator creates HTMLAnchor objects with image, label and url for each link. Example: CommunityNavPage commP = (CommunityNavPage)m_model.GetPageSpecificMethods(); ICPListIterator cpList = commP.GetMyCommunities(true); // both actions and communities ICPListIterator mediator = new CListURLFullLinkMediator(m_asOwner, cpList); mediator.SetLabelMaxLength(50); //set the maximum label length to 50 characters while (mediator.Next()) { HTMLAnchor anchor = (HTMLAnchor) mediator.GetEntry(); ... }