|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.alltimeflashdreamer.filelister.FileListerConfig
Title: FileListerConfig
Description: Stores the configuration settings of the current user/session.
These settings are initialized on processing of the initial site and may be altered
on reloadings of the second, file-listing site.
Organization: All Time Flash Dreamer
Field Summary | |
(package private) static String |
CONTROLLERSERVLET
the name of the controller servlet of the FileLister application |
static String |
INITIALSITE
the name of the initial site of the FileLister application |
(package private) static int |
MINIMUMENTRIESINMEMORY
defines the minimum length of one list of FileListerEntry objects |
(package private) static int |
NEWSEARCH
indicates the "new search" mode |
static String |
RESULTSSITE
the name of the (search) results site of the FileLister application |
(package private) static int |
SEARCHAGAIN
indicates a new search with the old settings |
(package private) static int |
SEARCHWITHINRESULTS
tells to search within the previous results |
(package private) static String[] |
SORTCRITERIA
|
Constructor Summary | |
(package private) |
FileListerConfig(HttpServletRequest request,
ServletContext context,
PropertyFileParameters params,
int iWindowID)
The constructor initializes the class and constructs the URL's of each site to be shown. |
(package private) |
FileListerConfig(PropertyFileParameters params)
This constructor may be called from other classes than the FileListerViewerServlet, as used to build the initial index. |
Method Summary | |
(package private) void |
createDefineSearchParameters()
Notifies the config class about the type of the next search. |
(package private) void |
createSearchParameters(HttpServletRequest request)
Reads the URL parameters and stores those values within an instance of SearchParameters. |
void |
doBackButtonInBrowserCheck(HttpServletRequest request)
Provides the check whether the user called the initial site "legally" or via the back button in the browser only. |
int |
getBufferSize()
Returns a 100th of the max. |
String |
getConfigDescriptor()
Returns a string describing the current configuration settings. |
int |
getCurrentSiteNumber()
Returns the index of the currently shown site. |
DefineSearchParameters |
getDefineSearchParameters()
Returns the previously created DefineSearchParameters instance. |
String |
getDirectoryOutput(String sDirectory)
Shows the directory string that is visible in the web output . |
(package private) String |
getDownloadSite()
Returns the fully qualified file name of the JSP download site which is filled dynamically to show a virtual progress bar and other interesting remarks during zip building. |
String |
getDownloadURL()
Returns the full URL of the download servlet, ready to be placed into e.g. |
String |
getErrorURL()
Returns the URL of the error site, to allow the redirect to this site. |
FileLister |
getFileLister()
Returns the FileLister, if set previously, or null. |
FileListerException |
getFileListerException()
Returns the currently set FileListerException instance or null, if none. |
(package private) int |
getIndexAging()
Returns value of the ini-file parameter "index.aging" which defines how old database values are allowed to be before the directory search is started again (in seconds). |
String |
getIndexTime()
Returns the index time of the search directory (which is taken as the index time of all results!). |
String |
getInitialSiteURL()
Returns the URL of the initial site. |
String |
getInverseSortOrder(String sColumnName)
Returns the inverse sort direction of the given column, i.e. asc, if it's currently set to desc and vice versa. |
(package private) String |
getJDBCTableName()
Returns the value of the "jdbc.tablename" property of the config file. |
String |
getLinkPrefix()
Returns the link prefix parameter from the config file (may be empty). |
(package private) int |
getMaxFileListerObjects()
Returns the max. number of file lister objects to be stored in the memory, as defined in the property file. |
String |
getMetaRefreshContent()
Returns the content of the meta-refresh tag (used by download.jsp only). |
String |
getNextSortOrder(String sColumnName)
Returns the URL parameter value of the "column" parameter shown in the link of each sortable table column header. |
(package private) LinkedList |
getNoGoAreas()
Returns the list of directories, inside which searching is prohibited. |
String |
getOptionBarURL()
Returns the full URL of the option bar JSP site, ready to be placed into e.g. |
String |
getProgressBarWidth()
Returns the current width of the progress bar describing the build status of the zip file (used by download.jsp only), formatted like "xy%". |
(package private) SQLQueryBuilder |
getQueryBuilder()
Returns the query builder instance defined in the property file. |
String |
getRegExpHelpLink()
Returns the value of the property file parameter "link.regexphelp", to be shown in the "define search" site. |
String |
getRequestURL(boolean bOfInitialSite)
Returns either the URL of the controller servlet or the URL of the results site, depending on bOfInitialSite. |
int |
getResultsPerSite()
Returns the current results-per-site count. |
String |
getSearchDirectory()
Returns the start directory of the (last) search as a string, formatted either absolutely or relatively, as defined in the properties file |
(package private) ArrayList |
getSearchParameters()
Returns the list of SearchParameters instances entered by the client. |
String |
getSearchType()
Returns the last stored search mode (may be null). |
String |
getSortDirection(String sColumnName)
Scans the list of currently stored sort criteria for an entry starting with sColumnName. |
String |
getSortOrderOutput(int iSortOrderNumber)
Builds the HTML to be put into a select box for the sort orders, specified within the sort orders by the given index (from 1 up to the total amount of defined sort orders). |
(package private) ArrayList |
getSortOrders()
Returns the list currently active sort criteria. |
int |
getSortPriority(String sColumnName)
Scans the list of currently stored sort criteria for an entry starting with sColumnName. |
(package private) File |
getStartDirectory()
Returns the (validated, but nevertheless abstract) directory defined by the client/user, appended to the root directory value from the property file, if defined. |
int |
getStartIndex()
Returns the index from which on the results shall be shown (default is 0, i.e. the first entry, but this value may change during navigation within the results). |
int |
getTotalSiteCount()
Returns the total amount of sites that may be shown (of course only 1, if set to "show unlimited results"). |
String |
getVersion()
Returns the visible version string of the FileLister application. |
String |
getViewerServletURL()
Returns the URL of the viewer servlet. |
(package private) String |
getViewerSite()
Returns the fully qualified file name of the JSP results site which is filled dynamically with the found entries (currently visible subset). |
(package private) String |
getVirtualRoot()
Returns the value of the ini-file parameter "directory.root", if defined. |
int |
getWindowID()
Returns the window id (or the number of this class within the user's session) that was set during initialization. |
String |
getZipArchiveSize()
Returns the descriptor for the current archive size of the zip file the user is waiting for. |
(package private) ZipBuilderThread |
getZipBuilderThread()
Returns the current ZipBuilderThread pointer, which is null if no such thread is running. |
(package private) String |
getZipCreationDirectory()
Returns the directory path, ending with a "/", to write the created zip files in. |
String |
getZipCurrentlyAdding()
Returns the currently-added-file descriptor. |
String |
getZipFilesDone()
Returns the descriptor of the progress of files packed into the current zip. |
(package private) int |
getZipLevel()
Returns the package strength of the download zips. |
String |
getZipProgressPercentage()
Asks the ZipBuilderThread for its generation/progress percentage, formats it to one fraction digit and appends a % sign to it. |
String |
getZipTimeElapsed()
Returns the descriptor for the time already elapsed since the start of the zip building. |
String |
getZipWarnings()
Returns the list of warnings generated while creating the zip file. |
(package private) boolean |
hasVirtualRoot()
Returns whether the property file contains a virtual root or not. |
boolean |
isAdvancedSearch()
Returns whether the advanced mode (which includes size and date search input in the GUI) is active or not. |
boolean |
isAllowedToZip()
Returns wether the "zip.isallowedtozip" switch is set to true in the property file or not. |
boolean |
isArchiveMode()
Tells whether the the archive mode or the directory input mode is active. |
boolean |
isCaseSensitiveSearch()
Returns whether the search string shall be handled in the case sensitive fashion or not. |
boolean |
isDirectoryListing()
Tells whether the directories shall be listed. |
boolean |
isExactMatch()
Returns whether the search string shall be matched exactly or not. |
boolean |
isFileListing()
Tells whether the files shall be listed. |
(package private) boolean |
isInitialArchivingProcess()
Returns whether this config object was initialized to run the initial archiving process or not. |
boolean |
isListingAllEntries()
Returns whether all contents shall be listed (client entered the empty string as the search string) or not. |
boolean |
isReadyToStream()
Returns whether there is currently a ZipBuilderThread in the pipeline and this thread is ready to stream the finished zip file. |
(package private) boolean |
isShowingAbsolutePaths()
Tells whether absolute or relative paths shall be shown in the output. |
boolean |
isSortCriterium(String sColumnName)
Scans the list of currently stored sort criteria for an entry starting with sColumnName. |
boolean |
isUsingRegExp()
Returns whether the user selected to use regular expressions for the search string or not. |
(package private) boolean |
isZipBuilding()
Returns whether getZipBuilderThread is existing and still working on a zip file or not. |
(package private) void |
jumpToSite(String sURLInput)
Redirects the client to a specific site. |
(package private) void |
navigate(String sURLParameterName)
Navigates according to the URL input parameter: to the first, to the previous, to the next or to the last position. |
(package private) void |
processModeChange(String sNewMode,
HttpServletRequest request)
Reacts to a click on the simple/advanced search button. |
(package private) void |
removeLastSearchParametersFromList()
Removes the last instance of SearchParameters from the internal list of SearchParameters. |
void |
resetZipBuilderThread()
Stops the ZipBuilderThread, if one is set, including the deletion of its zip file (after creation). |
(package private) void |
setAdvancedSearch(boolean bIsAdvancedSearch)
Sets the search mode (advanced or simple). |
(package private) void |
setFileLister(FileLister fileLister)
Sets the FileLister instance which contains the (filtered) list of files and/or directories that match the user's search criteria. |
void |
setFileListerException(FileListerException fle)
Allows to set a FileListerException from anywhere, including JSP sites. |
(package private) void |
setInitialSiteWasCalledLegally()
This method provides a "security" plugin: If the user didn't click on the option bar link but on the back button of the browser, the former search configuration must be removed (in case of "search within results"). |
(package private) void |
setResultsPerSite(String sURLInput)
Verifies the URL input and sets the new results-per-site count. |
void |
setSearchMode(String sURLInput)
Parses the URL input value; if "simple" or "advanced", the search mode parameter is updated to the new mode setting. |
(package private) void |
setSearchType(String sURLInput)
Sets the current search type (may be null). |
(package private) void |
setSelectedIndexesForZip(int[] iSelectedIndexes)
Steps through the currently visible FileListerEntries and marks them as selected-for-zip, if their index is within iSelectedIndexes. |
(package private) void |
setSortCriteria(String[] sSortCriteria)
Sets the given list of sort orders defined by the client to the internal list of sort orders. |
(package private) void |
setZipBuilderThread(ZipBuilderThread zipBuilderThread)
Sets an instance of ZipBuilderThread indicating that the owner session of this class is building a zip file. |
(package private) void |
sortByColumn(String sURLInput)
Verifies the URL input and sets the new sort mode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String INITIALSITE
public static final String RESULTSSITE
static final String CONTROLLERSERVLET
static final int NEWSEARCH
static final int SEARCHWITHINRESULTS
static final int SEARCHAGAIN
static final int MINIMUMENTRIESINMEMORY
static final String[] SORTCRITERIA
Constructor Detail |
FileListerConfig(HttpServletRequest request, ServletContext context, PropertyFileParameters params, int iWindowID)
request
- the request to get the request URL fromcontext
- the servlet context to get the full (physical) paths for
each DimDom template fileparams
- the object containing the property file parametersiWindowID
- the id of the session window to which this instance belongs
(generated by the FileListerFactory)FileListerConfig(PropertyFileParameters params)
params
- the object containing the property file parametersMethod Detail |
public boolean isDirectoryListing()
public boolean isFileListing()
public boolean isAllowedToZip()
public boolean isArchiveMode()
public String getSearchDirectory() throws FileListerException
FileListerException
- in case the virtual root is not the beginning
of the directory entries in the database, which means that the index
is not up to datevoid createDefineSearchParameters()
public DefineSearchParameters getDefineSearchParameters()
public String getIndexTime()
public String getRegExpHelpLink()
public boolean isListingAllEntries()
public String getRequestURL(boolean bOfInitialSite)
bOfInitialSite
- show initial site (via the controller servlet)?
getWindowID()
public String getViewerServletURL()
getWindowID()
public String getInitialSiteURL()
getWindowID()
public String getErrorURL()
getWindowID()
public String getDownloadURL()
getWindowID()
public String getOptionBarURL()
getWindowID()
public int getResultsPerSite()
public boolean isUsingRegExp()
public boolean isCaseSensitiveSearch()
public boolean isExactMatch()
public int getTotalSiteCount()
public int getCurrentSiteNumber()
public FileListerException getFileListerException()
public void setFileListerException(FileListerException fle)
fle
- which error happened (root causes are stored internally)public int getBufferSize()
public boolean isAdvancedSearch()
public void setSearchMode(String sURLInput)
sURLInput
- handled only if equals "simple" or "advanced"public int getWindowID()
public String getSortOrderOutput(int iSortOrderNumber)
iSortOrderNumber
- the number of the sort criterium within the list
of sort criteria, starting with 1
public String getZipProgressPercentage()
public String getZipWarnings()
public String getZipArchiveSize()
public String getZipFilesDone()
public String getZipCurrentlyAdding()
public String getZipTimeElapsed()
public String getMetaRefreshContent()
public String getProgressBarWidth()
void createSearchParameters(HttpServletRequest request) throws FileListerException
request
- the request to get the search parameters from
FileListerException
- wraps/describes the possibly upcoming input errorsFile getStartDirectory()
boolean isShowingAbsolutePaths()
ArrayList getSearchParameters()
void setFileLister(FileLister fileLister)
fileLister
- the previously created FileLister instance or nullpublic FileLister getFileLister()
String getDownloadSite()
String getViewerSite()
void sortByColumn(String sURLInput) throws FileListerException
sURLInput
- the URL input for the new sort mode
FileListerException
- thrown on bad or missing inputArrayList getSortOrders()
public String getNextSortOrder(String sColumnName)
sColumnName
- which column's sort order shall be returned
public boolean isSortCriterium(String sColumnName)
sColumnName
- the column name to check
public String getSortDirection(String sColumnName)
sColumnName
- the column name to check
public String getInverseSortOrder(String sColumnName)
sColumnName
- the column name to check
public int getSortPriority(String sColumnName)
sColumnName
- the column name to check
public String getConfigDescriptor() throws FileListerException
FileListerException
- in case the virtual root is not the beginning
of the directory entries in the database, which means that the index
is not up to datepublic String getDirectoryOutput(String sDirectory) throws FileListerException
sDirectory
- the directory to transform
FileListerException
- in case the virtual root is not the beginning
of the directory entries in the database, which means that the index
is not up to datevoid jumpToSite(String sURLInput) throws FileListerException
sURLInput
- what the user entered in the jump-to-site text
field
FileListerException
- if the input is not a numbervoid setResultsPerSite(String sURLInput) throws FileListerException
sURLInput
- the URL input for the new results-per-site count
FileListerException
- thrown on bad inputpublic int getStartIndex()
public String getLinkPrefix()
void navigate(String sURLParameterName) throws FileListerException
sURLParameterName
- how to navigate
FileListerException
- if the URL input is not a valid parameterint getIndexAging()
String getVirtualRoot()
boolean hasVirtualRoot()
LinkedList getNoGoAreas()
boolean isInitialArchivingProcess()
int getMaxFileListerObjects()
String getJDBCTableName()
SQLQueryBuilder getQueryBuilder()
String getZipCreationDirectory()
int getZipLevel()
void setSelectedIndexesForZip(int[] iSelectedIndexes)
iSelectedIndexes
- the list of selected indexes or null, indicating
that none was selectedvoid setAdvancedSearch(boolean bIsAdvancedSearch)
bIsAdvancedSearch
- if false, it's the simple, else the advanced modevoid setSortCriteria(String[] sSortCriteria)
sSortCriteria
- the list of sort criteria from the URL inputvoid setZipBuilderThread(ZipBuilderThread zipBuilderThread)
zipBuilderThread
- a new thread or null, if the old one's finishedZipBuilderThread getZipBuilderThread()
boolean isZipBuilding()
public void resetZipBuilderThread()
public boolean isReadyToStream()
public String getVersion()
public String getSearchType()
void setSearchType(String sURLInput)
sURLInput
- the search type, read from the URL parameter "search"void setInitialSiteWasCalledLegally()
doBackButtonInBrowserCheck(javax.servlet.http.HttpServletRequest)
public void doBackButtonInBrowserCheck(HttpServletRequest request)
request
- where to read the URL parameters for the above described checks
fromvoid removeLastSearchParametersFromList()
void processModeChange(String sNewMode, HttpServletRequest request) throws FileListerException
sNewMode
- the new mode of the define-search siterequest
- where to read the URL parameters from
FileListerException
- if the URL parameters are somehow invalid
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |