de.fh_mannheim.mm.dms.indexserver.gui
Class UIIndexServer

java.lang.Object
  extended byde.fh_mannheim.mm.dms.indexserver.Monitor
      extended byde.fh_mannheim.mm.dms.indexserver.IndexServer
          extended byde.fh_mannheim.mm.dms.indexserver.gui.UIIndexServer
All Implemented Interfaces:
IElement, IMonitor, IViewer

public class UIIndexServer
extends IndexServer
implements IViewer

User Interface for Index Server with event handling.

Version:
$Revision: 1.43 $
Author:
Jan Löffler, mail@jlsoft.de

Field Summary
static int EVENT_COUNT
           
static int IMPORT_UPLOADS_EVENT
           
static int WEIGHTS_ADJUSTED_EVENT
          Events for display callbacks
 
Method Summary
 boolean addCategory()
          Adds new category.
 boolean addStopword()
          Adds new stopword.
 boolean addUpload()
          Adds new upload order.
 boolean addUploadDirectory()
          Adds all files of a directory.
 boolean addUser()
          Adds new user.
 boolean adjustWeights()
          Adjust weights.
 int cleanUpDatabase()
          Cleans database by deleting all missing files.
 boolean clearLogfile()
          Deletes logfile.
 MainWindow createMainWindow()
          Creates a new MainWindow and sets it as actual setting.
 boolean deleteUpload(int nUploadID)
          Delete existing upload order.
 boolean deleteUpload(java.lang.String strFilename)
          Delete existing upload order.
 boolean editCategory(Category cat)
          Edit a category.
 boolean editCategory(java.lang.String strCategory)
          Edit a category.
 void exitHandler(javax.swing.JFrame window)
          Exit Handler.
 boolean exportCategories()
          Export categories.
 boolean exportStopwords()
          Export stopwords.
 boolean exportStopwordsToTextfile()
          Export stopwords.
 boolean exportUploads()
          Export uploads.
 boolean exportUsers()
          Export users.
static java.awt.Font getBigFont()
          Return big fonttype.
 InfoPane getInfoPane()
          Returns current InfoPane.
static UIIndexServer getInstance()
          Aquire the instance, create if not existing; so we do implizit creation.
 MainWindow getMainWindow()
          Returns current MainWindow.
 StatusPane getStatusPane()
          Returns current StatusPane.
 int importCategories()
          Import categories.
 int importStopwords()
          Import stopwords.
 int importStopwordsFromTextfile()
          Import stopwords.
 int importUploads()
          Import uploads.
 int importUsers()
          Import users.
 boolean login()
          Calls the Login-Dialog.
 void rebuildIndex()
          Rebuild index.
 void setInfoPane(InfoPane pane)
          Allows Setting a InfoPane.
 void setMainWindow(MainWindow mainWindow)
          Allows Setting a MainWindow.
 void setStatusPane(StatusPane pane)
          Allows Setting a StatusPane.
 void showCategoryManager()
          Shows category manager.
 void showEngineErrors()
          Shows engine errors.
 void showFileManager()
          Shows file manager.
 void showIndexSize()
          Shows index size by counting all keywords.
 void showLessRightsMessage()
          Show message, that user has not enough rights.
 void showLogfile()
          Shows logfile.
 void showMessage(java.lang.String strMessage)
          Show message.
 boolean showQuestion(java.lang.String strTitle, java.lang.String strPrompt)
          Show question.
 void showSearchManager()
          Shows search manager.
 void showSearchManager(java.lang.String strPattern)
          Shows search manager.
 void showStopwordManager()
          Shows stopword manager.
 void showUploadManager()
          Shows upload manager.
 void showUserManager()
          Shows user manager.
 void shutDown()
          Closes the program.
 void startEngine()
          Starts Engine.
 void startGUI()
          Starts the GUI.
 void stateHasChanged()
          Call all callbacks and send onChanged.
 void stopEngine()
          Stops Engine.
 
Methods inherited from class de.fh_mannheim.mm.dms.indexserver.IndexServer
addCategory, addStopword, addUpload, addUploadDirectory, addUser, exportCategories, exportStopwords, exportStopwords, exportUploads, exportUsers, getCategoryManager, getConfig, getContentManager, getEngine, getIndexServer, getSearchManager, getStopwordManager, getUploadManager, getUserManager, importCategories, importStopwords, importStopwords, importUploads, importUsers, login, mayModifyEngine, mayModifyUploads, mayModifyUsers, mayReadData, startEngine, toElement, toElement, toString
 
Methods inherited from class de.fh_mannheim.mm.dms.indexserver.Monitor
registerViewer, unregisterViewer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WEIGHTS_ADJUSTED_EVENT

public static final int WEIGHTS_ADJUSTED_EVENT
Events for display callbacks

See Also:
Constant Field Values

IMPORT_UPLOADS_EVENT

public static final int IMPORT_UPLOADS_EVENT
See Also:
Constant Field Values

EVENT_COUNT

public static final int EVENT_COUNT
See Also:
Constant Field Values
Method Detail

getBigFont

public static java.awt.Font getBigFont()
Return big fonttype.

Returns:
font

getInstance

public static UIIndexServer getInstance()
Aquire the instance, create if not existing; so we do implizit creation.

Returns:
UIIndexserver instance

addStopword

public boolean addStopword()
Adds new stopword.

Returns:
true, if successful

addCategory

public boolean addCategory()
Adds new category.

Returns:
true, if successful

addUpload

public boolean addUpload()
Adds new upload order.

Returns:
true, if successful

addUploadDirectory

public boolean addUploadDirectory()
Adds all files of a directory.

Returns:
true, if successful

addUser

public boolean addUser()
Adds new user.

Returns:
true, if successful

adjustWeights

public boolean adjustWeights()
Adjust weights.


cleanUpDatabase

public int cleanUpDatabase()
Cleans database by deleting all missing files.

Overrides:
cleanUpDatabase in class IndexServer
Returns:
Number of deletions

clearLogfile

public boolean clearLogfile()
Deletes logfile.

Returns:
true, if file is deleted

createMainWindow

public MainWindow createMainWindow()
Creates a new MainWindow and sets it as actual setting.

Returns:
m_mainWindow

deleteUpload

public boolean deleteUpload(java.lang.String strFilename)
Delete existing upload order.

Parameters:
strFilename - Filename
Returns:
true, if successful

deleteUpload

public boolean deleteUpload(int nUploadID)
Delete existing upload order.

Parameters:
nUploadID - ID of Upload
Returns:
true, if successful

editCategory

public boolean editCategory(Category cat)
Edit a category.

Overrides:
editCategory in class IndexServer
Parameters:
cat - Category
Returns:
true, if successful

editCategory

public boolean editCategory(java.lang.String strCategory)
Edit a category.

Parameters:
strCategory - Category
Returns:
true, if successful

exitHandler

public void exitHandler(javax.swing.JFrame window)
Exit Handler.

Parameters:
window - The current window

exportCategories

public boolean exportCategories()
Export categories.

Returns:
true, if successful

exportUploads

public boolean exportUploads()
Export uploads.

Returns:
true, if successful

exportUsers

public boolean exportUsers()
Export users.

Returns:
true, if successful

exportStopwordsToTextfile

public boolean exportStopwordsToTextfile()
Export stopwords.

Returns:
true, if successful

exportStopwords

public boolean exportStopwords()
Export stopwords.

Returns:
true, if successful

getInfoPane

public InfoPane getInfoPane()
Returns current InfoPane. Warning: If no InfoPane set, it returns null.

Returns:
current InfoPane.

getMainWindow

public MainWindow getMainWindow()
Returns current MainWindow. Warning: If no MainWindow set, it returns null.

Returns:
current MainWindow.

getStatusPane

public StatusPane getStatusPane()
Returns current StatusPane. Warning: If no StatusPane set, it returns null.

Returns:
current StatusPane.

importCategories

public int importCategories()
Import categories.

Returns:
Number of imported categories

importUsers

public int importUsers()
Import users.

Returns:
Number of imported users

importUploads

public int importUploads()
Import uploads.

Returns:
Number of imported uploads

importStopwordsFromTextfile

public int importStopwordsFromTextfile()
Import stopwords.

Returns:
Number of imported stopwords

importStopwords

public int importStopwords()
Import stopwords.

Returns:
Number of imported stopwords

login

public boolean login()
Calls the Login-Dialog.

Returns:
true, if login was successful

rebuildIndex

public void rebuildIndex()
Rebuild index.

Overrides:
rebuildIndex in class IndexServer

setInfoPane

public void setInfoPane(InfoPane pane)
Allows Setting a InfoPane.

Parameters:
pane - actual InfoPane

setMainWindow

public void setMainWindow(MainWindow mainWindow)
Allows Setting a MainWindow.

Parameters:
mainWindow - actual MainWindow

setStatusPane

public void setStatusPane(StatusPane pane)
Allows Setting a StatusPane.

Parameters:
pane - actual StatusPane

showEngineErrors

public void showEngineErrors()
Shows engine errors.


showFileManager

public void showFileManager()
Shows file manager.


showIndexSize

public void showIndexSize()
Shows index size by counting all keywords.


showLessRightsMessage

public void showLessRightsMessage()
Show message, that user has not enough rights.

Overrides:
showLessRightsMessage in class IndexServer

showLogfile

public void showLogfile()
Shows logfile.


showMessage

public void showMessage(java.lang.String strMessage)
Show message.

Overrides:
showMessage in class IndexServer
Parameters:
strMessage - Messagetext

showQuestion

public boolean showQuestion(java.lang.String strTitle,
                            java.lang.String strPrompt)
Show question.

Parameters:
strTitle - Title text
strPrompt - Prompt text
Returns:
true, if user pressed ok

showSearchManager

public void showSearchManager()
Shows search manager.


showSearchManager

public void showSearchManager(java.lang.String strPattern)
Shows search manager.

Parameters:
strPattern - Pattern, you want to search for

showStopwordManager

public void showStopwordManager()
Shows stopword manager.


showCategoryManager

public void showCategoryManager()
Shows category manager.


showUploadManager

public void showUploadManager()
Shows upload manager.


showUserManager

public void showUserManager()
Shows user manager.


shutDown

public void shutDown()
Closes the program.


startEngine

public void startEngine()
Starts Engine.

Overrides:
startEngine in class IndexServer

startGUI

public void startGUI()
Starts the GUI.


stateHasChanged

public void stateHasChanged()
Call all callbacks and send onChanged.

Specified by:
stateHasChanged in interface IViewer
Overrides:
stateHasChanged in class Monitor

stopEngine

public void stopEngine()
Stops Engine.

Overrides:
stopEngine in class IndexServer