org.alltimeflashdreamer.filelister
Class JSPMethods

java.lang.Object
  extended byorg.alltimeflashdreamer.filelister.JSPMethods

public class JSPMethods
extends Object

Title: JSPMethods

Description: This class collects all the methods that are used in the JSP sites in a statically accessible manner.

Organization: All Time Flash Dreamer

Version:
0.5.1
Author:
Copyright (c) 2002-2004 by Florian Steinsiepe

Method Summary
static String formatSize(long lSizeInBytes, boolean bIsDirectory)
          Used by viewresults.jsp: Calls SearchParameters.formatSize except it's a directory and its size is 0.
static String getActionTag(FileListerConfig fileListerConfig)
          Used by viewresults.jsp: Returns the action attribute's value for the form tag.
static String getColumnLink(FileListerConfig fileListerConfig, String sColumnName)
          Used by viewresults.jsp: Returns the fully configured navigation link for a table header column's name .
static String getDirectoryColumnLink(FileListerEntry fle, FileListerConfig fileListerConfig)
          Used by viewresults.jsp: Builds the link for each entry in the "Location" column (direct access to this directory).
static String getImageSrc(String sName)
          Used by different JSP's: Builds one image src attribute value based on the given name.
static String getModeDescriptor(FileListerConfig fileListerConfig)
          Used by definesearch.jsp: Returns the appropriate URL parameter for the next search mode, i.e.
static String getNameColumnLink(FileListerEntry fle, FileListerConfig fileListerConfig)
          Used by viewresults.jsp: Builds the link for each entry in the "Name" column (direct access to this file or directory).
static String getNavigationLink(FileListerConfig fileListerConfig, String sNextSortOrder)
          Used by viewresults.jsp: Helper method for getColumnLink, builds one link target (of three).
static String getSiteTitle(FileListerConfig fileListerConfig)
          Used by viewresults.jsp: Returns the site title, for both a certain result count and no results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getModeDescriptor

public static String getModeDescriptor(FileListerConfig fileListerConfig)
Used by definesearch.jsp: Returns the appropriate URL parameter for the next search mode, i.e. "simple" or "advanced", depending on the current search mode.

Parameters:
fileListerConfig - the magic config object
Returns:
the URL parameter describing the next search mode

getSiteTitle

public static String getSiteTitle(FileListerConfig fileListerConfig)
Used by viewresults.jsp: Returns the site title, for both a certain result count and no results.

Parameters:
fileListerConfig - the magic config object
Returns:
the fully formatted site title.

getActionTag

public static String getActionTag(FileListerConfig fileListerConfig)
Used by viewresults.jsp: Returns the action attribute's value for the form tag.

Parameters:
fileListerConfig - the magic config object
Returns:
either a link to the download or the results site URL

formatSize

public static String formatSize(long lSizeInBytes,
                                boolean bIsDirectory)
Used by viewresults.jsp: Calls SearchParameters.formatSize except it's a directory and its size is 0.

Parameters:
lSizeInBytes - the size of the entry in bytes
bIsDirectory - whether its a directory or not
Returns:
the formatted size string
See Also:
StringUtils.formatSize(long)

getNameColumnLink

public static String getNameColumnLink(FileListerEntry fle,
                                       FileListerConfig fileListerConfig)
                                throws FileListerException
Used by viewresults.jsp: Builds the link for each entry in the "Name" column (direct access to this file or directory).

Parameters:
fle - the entry to get the link of
fileListerConfig - the magic config object
Returns:
the fully formatted link target string
Throws:
FileListerException - missing configurations?

getDirectoryColumnLink

public static String getDirectoryColumnLink(FileListerEntry fle,
                                            FileListerConfig fileListerConfig)
                                     throws FileListerException
Used by viewresults.jsp: Builds the link for each entry in the "Location" column (direct access to this directory). This link is forced to end with a "/" (forward slash).

Parameters:
fle - the entry to get the link of
fileListerConfig - the magic config object
Returns:
the fully formatted link target string
Throws:
FileListerException - missing configurations?

getColumnLink

public static String getColumnLink(FileListerConfig fileListerConfig,
                                   String sColumnName)
Used by viewresults.jsp: Returns the fully configured navigation link for a table header column's name .

Parameters:
fileListerConfig - the magic config object
sColumnName - the name of the column to configure
Returns:
the fully configured navigation link

getNavigationLink

public static String getNavigationLink(FileListerConfig fileListerConfig,
                                       String sNextSortOrder)
Used by viewresults.jsp: Helper method for getColumnLink, builds one link target (of three).

Parameters:
fileListerConfig - the magic config object
sNextSortOrder - how to sort after the click on this link?
Returns:
the fully configured link target

getImageSrc

public static String getImageSrc(String sName)
Used by different JSP's: Builds one image src attribute value based on the given name.

Parameters:
sName - how to name the link
Returns:
the full image src value