|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portalpages.common.mediator.CListURLTemplateMediator
public class 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 = arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_LABEL]; String strURL = arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_URL]; String strImageURL = arURLTempl[CListURLTemplateMediator.TEMPLATEARR_INDEX_IMGURL]; ... }
Field Summary | |
---|---|
static int |
ACTIONIMAGE_SPACE_WIDTH
|
static int |
IMAGE_SPACE_WIDTH
The constant amount of space in pixels images should take up. |
protected java.lang.String |
m_strImageAlign
|
static int |
TEMPLATEARR_INDEX_IMGURL
|
static int |
TEMPLATEARR_INDEX_LABEL
Index constants for the elements in the array generated by this mediator |
static int |
TEMPLATEARR_INDEX_URL
|
Constructor Summary | |
---|---|
CListURLTemplateMediator(AActivitySpace aspace,
ICPListEntryIterator list)
Constructor for CompoundListASURLMediator. |
Method Summary | |
---|---|
protected java.lang.String[] |
CreateCommPageURLTemplate(ListEntry entry)
Creates a Template URL for Community pages |
protected java.lang.String[] |
CreateDirPageURLTemplate(ListEntry entry)
Create a Template URL for Directory pages |
protected java.lang.String[] |
CreateDocURL(ListEntry entry)
Creates a Template URL for document pages |
protected java.lang.String[] |
CreateEditorURLTemplate(ListEntry entry)
Create a Template URL for editor pages |
protected java.lang.String[] |
CreateFullInternalURL(ListEntry entry)
|
protected java.lang.String[] |
CreateFullURL(ListEntry entry)
Creates a full url with associated label and image if one |
protected java.lang.String[] |
CreateGenericURL(ListEntry entry)
Creates a generic Plumtree Portal 50 URL |
protected java.lang.String[] |
CreateMyPageURLTemplate(ListEntry entry)
Creates a Template URL for mypages |
protected java.lang.String[] |
CreatePrefsURL(ListEntry entry)
Creates a Template URL for users preferences |
protected java.lang.String[] |
CreateSiteMapRootURLTemplate(ListEntry entry)
Creates a Template URL for Community Knowledge Directory Root |
protected java.lang.String[] |
CreateStringLabel(ListEntry entry)
Creates an array with just a label without url but possible image |
protected java.lang.String[] |
CreateUserURL(ListEntry entry)
Creates a Template URL for user profile pages |
java.lang.Object |
GetEntry()
Get the current entry in the list. |
java.lang.Object |
GetEntryAtIndex(int nIndex)
Get the entry at a specific index |
java.lang.String |
GetEntryOrigLabel()
Late added method, get the untruncated label of the current entry. |
java.lang.String |
GetImageSource()
Creates a string containing the image source for the assigned image |
protected java.lang.String |
GetImageString(ListEntry entry)
Creates a string containing the html for the assigned images |
ICPListEntryIterator |
GetList()
Get an iterator, the index is set to before the first element, call Next() to advance to first entry. |
java.lang.String |
GetNonEncodedEntryOrigLabel()
Late added method, get the untruncated label of the current entry (non encoded). |
boolean |
IsImageEntry(java.lang.String[] entry)
Checks if an entry has image assigned. |
boolean |
Next()
Advances the iterator to next element. |
void |
SetLabelMaxLength(int nMax)
Set the truncation width for all subsequent entries, can be altered between entries during an iteration |
protected java.lang.String |
SetListEntryImage(ListEntry entry)
Get the image string for the specified entry |
void |
SetShowImages(boolean bShow)
Set to display images for subsequent entries in the list, can be altered between entries during an iteration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TEMPLATEARR_INDEX_LABEL
public static final int TEMPLATEARR_INDEX_URL
public static final int TEMPLATEARR_INDEX_IMGURL
public static final int IMAGE_SPACE_WIDTH
public static final int ACTIONIMAGE_SPACE_WIDTH
protected java.lang.String m_strImageAlign
Constructor Detail |
---|
public CListURLTemplateMediator(AActivitySpace aspace, ICPListEntryIterator list)
aspace
- Current Activityspacelist
- ICPListEntryIterator to wrapMethod Detail |
---|
public java.lang.String GetEntryOrigLabel()
public java.lang.String GetNonEncodedEntryOrigLabel()
public java.lang.Object GetEntry()
ICPListIterator
GetEntry
in interface ICPListIterator
ICPListIterator.GetEntry()
public java.lang.Object GetEntryAtIndex(int nIndex)
ICPListIterator
GetEntryAtIndex
in interface ICPListIterator
nIndex
- Index of the entry
ICPListIterator.GetEntryAtIndex(int)
public ICPListEntryIterator GetList()
ICPListIterator
GetList
in interface ICPListIterator
ICPListIterator.GetList()
public boolean Next()
ICPListIterator
Next
in interface ICPListIterator
ICPListIterator.Next()
public void SetLabelMaxLength(int nMax)
ICPListIterator
SetLabelMaxLength
in interface ICPListIterator
nMax
- Character position to truncate atICPListIterator.SetLabelMaxLength(int)
public void SetShowImages(boolean bShow)
ICPListIterator
SetShowImages
in interface ICPListIterator
bShow
- true to show images (default), false to no show images in entriesICPListIterator.SetShowImages(boolean)
protected java.lang.String[] CreateCommPageURLTemplate(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateSiteMapRootURLTemplate(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateDirPageURLTemplate(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateDocURL(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateEditorURLTemplate(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateFullInternalURL(ListEntry entry)
entry
-
protected java.lang.String[] CreateFullURL(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateGenericURL(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateMyPageURLTemplate(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreatePrefsURL(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateStringLabel(ListEntry entry)
entry
- Current listentry element
protected java.lang.String[] CreateUserURL(ListEntry entry)
entry
- Current listentry element
protected java.lang.String GetImageString(ListEntry entry)
entry
- Current listentry element
public java.lang.String GetImageSource()
public boolean IsImageEntry(java.lang.String[] entry)
entry
- Template entry from this mediator.
protected java.lang.String SetListEntryImage(ListEntry entry)
entry
-
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |