www.element4solution.com

e4s.application.sysmodule
Class E4ModuleFileselection

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.servlet.E4ModuleImplementation
              extended by e4s.application.sysmodule.E4ModuleFileselection

public class E4ModuleFileselection
extends E4ModuleImplementation

This class provides file tree and directory selection handling. Usually, this functions run as E4MethodPickup in a dedicated window. Two, or three, frames will be used - depending if initFileSelection or initImageSelection will be called by the pickup. In the case of the initImageSelection the third frame will be used as preview for an image selection. In the left frame, the directory tree is viewed as a E4Tree. When a directory is clicked, then in the right frame a directory listing is viewed using E4SortedList. You can specify a directory using the parameter PARAM_INIT_PATH. Or when no parameter is defined, and an application-object (E4ApplObj_Intf) is available, the current path will be taken from the E4Client's root-path. If no parameter and no application object is defined, then selection goes to c:\\. For multiple uploads, a Java applet from http://www.jfileupload.com/ can be included by putting the .jar files of the applets in a directory named UPLOAD_APPLET_RELATIVE_CODEBASE under the project directory (e4s.util.E4Settings.getHttpRoot().

Since:
JDK 1.4

Nested Class Summary
static interface E4ModuleFileselection.AEP_DeleteFile
          Exit point for deleteion of files.
static interface E4ModuleFileselection.AEP_ImagePreviewWorker
           
 
Field Summary
static E4Method activateNode
          Defines the method for activating (selecting) a node.
static E4Method createDirectory
           
static E4Method createDirectory_Execute
           
static E4Method deleteFile
           
static E4Method deleteFileExecute
           
static E4Method dirListingOrViewing
           
static E4Method displayImage
           
static java.lang.String FILE_EXTENSION_SEPERATOR
           
static java.lang.String[] IMAGE_FILE_TYPES
           
static E4Method initBrowse
           
static E4Method initFileBrowse
           
static E4MethodPickup initFileSelection
           
static E4Method initImageBrowse
           
static E4MethodPickup initImageSelection
           
static E4MethodPickup initSelection
           
static E4Method listFiles
           
static E4Method listHandling_Sort
           
static java.lang.String PARAM_AEP_DELETE
          Involve an AEP function for deleteing files.
static java.lang.String PARAM_CAN_DELETE
          Enable deletion of files.
static java.lang.String PARAM_CAN_UPLOAD
           
static java.lang.String PARAM_DISPLAY_IMAGE
           
static java.lang.String PARAM_EXTRA_SELECTED_LAYOUT
           
static java.lang.String PARAM_EXTRA_SELECTED_MREF
           
static java.lang.String PARAM_FILE_EXTENSIONS
          A list of allowed file extensions, seperated by comma (,).
static java.lang.String PARAM_FILENAME
           
static java.lang.String PARAM_INIT_PATH
          This parameter can be used to handle an init path value for the directory path using the E4CgiParams in function initImageSelection or initFileSelection
static java.lang.String PARAM_LIMIT_PATH
          This parameter can be used to limit the possible directory for selection, several values can be by ','.
static java.lang.String PARAM_RESIZE_HEIGHT
           
static java.lang.String PARAM_RESIZE_USES_CLIENT
           
static java.lang.String PARAM_RESIZE_WIDTH
           
static java.lang.String PARAM_UPLOAD_SIZE
           
static E4Method selectedFile
           
static E4Method selectFilePreview
           
static int SELECTION_FILES
           
static int SELECTION_IMAGES
           
static java.lang.String SESSION_OBJ_ROOTPATH
           
static E4Method toggleNode
          Defines the mothod for toggling (open/close) a tree node.
static E4Method uploadFile
           
static E4Method uploadFile_Execute
           
static E4Method uploadFile_ExecuteApplet
           
static E4Method viewFile
           
static E4Method viewFiles
           
static E4Method viewFileTail
           
 
Fields inherited from class e4s.html.E4HtmlObject
m_parent_e4sID
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4ModuleFileselection()
           
 
Method Summary
static java.lang.String _getSVNVersionString()
           
 void activateNode(HTML html, E4CgiParams p)
          Change the activate (selected) state of a tree node as well as of all other nodes.
 E4TreeNode_Intf addDir(e4s.application.sysmodule.E4ModuleFileselection.E4ModuleFileSelectionParameters p, E4TreeNode_Intf tree, boolean deeper)
           
 E4TreeNode_Intf addDir(e4s.application.sysmodule.E4ModuleFileselection.E4ModuleFileSelectionParameters p, E4TreeNode_Intf tree, e4s.application.sysmodule.E4ModuleFileselection.DirNodeEntry dnTop, boolean deeper)
           
 void createDirectory_Execute(HTML html, E4CgiParams params)
           
 void createDirectory(HTML html, E4CgiParams params)
           
 void createDirectory(HTML html, E4CgiParams params, java.lang.String defaultvalue, E4Label_Intf errormsg)
           
 void deleteFile(HTML html, E4CgiParams params)
           
 void deleteFileExecute(HTML html, E4CgiParams params)
           
 void dirListing(BODY body, E4CgiParams p, long nodeId, java.lang.String treeId)
           
 void dirListingOrViewing(HTML html, E4CgiParams params)
           
 void displayImage(HTML html, E4CgiParams params)
           
 void initBrowse(HTML html, E4CgiParams params)
           
 void initFileBrowse(HTML html, E4CgiParams params)
           
 void initFileSelection(HTML html, E4CgiParams params)
           
 void initImageBrowse(HTML html, E4CgiParams params)
           
 void initImageSelection(HTML html, E4CgiParams params)
           
 void initSelection(HTML html, E4CgiParams params)
           
 void listFiles(HTML html, E4CgiParams params)
           
 void listHandling_Sort(HTML html, E4CgiParams params)
           
 void selectedFile(HTML html, E4CgiParams params)
           
 void selectFilePreview(HTML html, E4CgiParams params)
           
static void setAEP(java.lang.String extension, E4ModuleFileselection.AEP_ImagePreviewWorker worker)
           
 void toggleNode(HTML html, E4CgiParams params)
          Change the open (display) mode of a tree node (E4TreeNode_Intf).
 void uploadFile_Execute(HTML html, E4CgiParams params)
           
 void uploadFile_ExecuteApplet(HTML html, E4CgiParams params)
           
 void uploadFile(HTML html, E4CgiParams params)
           
 void viewFile(HTML html)
           
 void viewFiles(HTML html, E4CgiParams params)
           
 void viewFileTail(HTML html, E4CgiParams params)
           
 
Methods inherited from class e4s.servlet.E4ModuleImplementation
canDo, canDo, canRun, closeHtmlOutput, empty2nbsp, empty2nbsp, getApplication_Permissions, getApplication, getApplObj, getClient, getClientImage, getClientObject, getClientObject, getClientObject, getClientValue, getClientValueBool, getClientValueDate, getClientValueFloat, getClientValueInt, getClientValueLong, getCookie, getCookieArr, getCookieBool, getCookieDate, getCookieLong, getCountryCode, getCSS, getDateFormat, getDbConnection, getDecimalSign, getE4ClientLogo, getE4S_Permissions, getLanguage_App, getLanguage_Sys, getLanguage, getParameters, getPersistantParameter, getPersistantParameterBoolean, getPersistantParameterDate, getPersistantParameterInt, getPersistantParameterIntArr, getPersistantParameterLong, getPickParams, getRemoteAddr, getRequiredModulePermission, getServlet, getSession, getSessionId, getSessionObject_Boolean, getSessionObject_Long, getSessionObject_String, getSessionObject, getSessionObject, getSessionObjects, getTimeFormat, getTimeZone, getUrl, getUserEmail, getUserValue, getUserValue, getUserValueArr, getUserValueBool, getUserValueBool, getUserValueDate, getUserValueDate, getUserValueInt, getUserValueInt, getUserValueLong, getUserValueLong, isok, isPersistant, isRunningWindow, isTimeout, ok, openHtmlOutput, removeApplicationObject, removeClientObject, removeClientObject, removeClientObject, removeClientValue, removeSessionObject, removeSessionObject, removeUserValue, removeUserValue, resetClientLogo, setAjaxTrace, setApplication, setApplicationObject, setClientObject, setClientObject, setClientObject, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setClientValue, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setPersistantParameter, setPersistantParameter, setPersistantParameter, setPersistantParameter, setPersistantParameter, setPersistantParameter, setServlet, setSessionObject, setSessionObject, setSessionObject, setSessionObject, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, setUserValue, SystemError, write, write, write, write, write, writeln, writeln, writeln, writeln
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, E4ID, set_e4sID
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toggleNode

public static E4Method toggleNode
Defines the mothod for toggling (open/close) a tree node.

See Also:
toggleNode(e4s.html.HTML html, e4s.html.E4CgiParams p)

activateNode

public static E4Method activateNode
Defines the method for activating (selecting) a node.

See Also:
activateNode(e4s.html.HTML html, e4s.html.E4CgiParams p)

listFiles

public static E4Method listFiles

viewFiles

public static E4Method viewFiles

uploadFile

public static E4Method uploadFile

uploadFile_Execute

public static E4Method uploadFile_Execute

uploadFile_ExecuteApplet

public static E4Method uploadFile_ExecuteApplet

createDirectory

public static E4Method createDirectory

createDirectory_Execute

public static E4Method createDirectory_Execute

listHandling_Sort

public static E4Method listHandling_Sort

initSelection

public static E4MethodPickup initSelection

initFileSelection

public static E4MethodPickup initFileSelection

initImageSelection

public static E4MethodPickup initImageSelection

initBrowse

public static E4Method initBrowse

initFileBrowse

public static E4Method initFileBrowse

initImageBrowse

public static E4Method initImageBrowse

dirListingOrViewing

public static E4Method dirListingOrViewing

selectFilePreview

public static E4Method selectFilePreview

selectedFile

public static E4Method selectedFile

displayImage

public static E4Method displayImage

viewFile

public static E4Method viewFile

viewFileTail

public static E4Method viewFileTail

deleteFile

public static E4Method deleteFile

deleteFileExecute

public static E4Method deleteFileExecute

PARAM_INIT_PATH

public static final java.lang.String PARAM_INIT_PATH
This parameter can be used to handle an init path value for the directory path using the E4CgiParams in function initImageSelection or initFileSelection

See Also:
FILESELECTION.setInitPath(java.lang.String), Constant Field Values

PARAM_LIMIT_PATH

public static final java.lang.String PARAM_LIMIT_PATH
This parameter can be used to limit the possible directory for selection, several values can be by ','. Using the E4CgiParams in function initImageSelection or initFileSelection.

See Also:
FILESELECTION.setLimitPath(java.lang.String), Constant Field Values

PARAM_EXTRA_SELECTED_MREF

public static final java.lang.String PARAM_EXTRA_SELECTED_MREF
See Also:
Constant Field Values

PARAM_EXTRA_SELECTED_LAYOUT

public static final java.lang.String PARAM_EXTRA_SELECTED_LAYOUT
See Also:
Constant Field Values

PARAM_CAN_UPLOAD

public static final java.lang.String PARAM_CAN_UPLOAD
See Also:
Constant Field Values

PARAM_CAN_DELETE

public static final java.lang.String PARAM_CAN_DELETE
Enable deletion of files.

See Also:
PARAM_AEP_DELETE, Constant Field Values

PARAM_AEP_DELETE

public static final java.lang.String PARAM_AEP_DELETE
Involve an AEP function for deleteing files. The parameter value is a class name that can be instanciated with an ampty constructor implementing interface E4ModuleFileselection.AEP_DeleteFile.

See Also:
PARAM_CAN_DELETE, Constant Field Values

PARAM_UPLOAD_SIZE

public static final java.lang.String PARAM_UPLOAD_SIZE
See Also:
Constant Field Values

PARAM_FILENAME

public static final java.lang.String PARAM_FILENAME
See Also:
Constant Field Values

PARAM_DISPLAY_IMAGE

public static final java.lang.String PARAM_DISPLAY_IMAGE
See Also:
Constant Field Values

SELECTION_FILES

public static final int SELECTION_FILES
See Also:
Constant Field Values

SELECTION_IMAGES

public static final int SELECTION_IMAGES
See Also:
Constant Field Values

PARAM_RESIZE_WIDTH

public static final java.lang.String PARAM_RESIZE_WIDTH
See Also:
Constant Field Values

PARAM_RESIZE_HEIGHT

public static final java.lang.String PARAM_RESIZE_HEIGHT
See Also:
Constant Field Values

PARAM_RESIZE_USES_CLIENT

public static final java.lang.String PARAM_RESIZE_USES_CLIENT
See Also:
Constant Field Values

FILE_EXTENSION_SEPERATOR

public static final java.lang.String FILE_EXTENSION_SEPERATOR
See Also:
Constant Field Values

PARAM_FILE_EXTENSIONS

public static final java.lang.String PARAM_FILE_EXTENSIONS
A list of allowed file extensions, seperated by comma (,).

See Also:
Constant Field Values

SESSION_OBJ_ROOTPATH

public static final java.lang.String SESSION_OBJ_ROOTPATH
See Also:
Constant Field Values

IMAGE_FILE_TYPES

public static final java.lang.String[] IMAGE_FILE_TYPES
Constructor Detail

E4ModuleFileselection

public E4ModuleFileselection()
Method Detail

initBrowse

public void initBrowse(HTML html,
                       E4CgiParams params)
                throws java.lang.Exception
Throws:
java.lang.Exception

initSelection

public void initSelection(HTML html,
                          E4CgiParams params)
                   throws java.lang.Exception
Throws:
java.lang.Exception

initImageBrowse

public void initImageBrowse(HTML html,
                            E4CgiParams params)
                     throws java.lang.Exception
Throws:
java.lang.Exception

initImageSelection

public void initImageSelection(HTML html,
                               E4CgiParams params)
                        throws java.lang.Exception
Throws:
java.lang.Exception

initFileBrowse

public void initFileBrowse(HTML html,
                           E4CgiParams params)
                    throws java.lang.Exception
Throws:
java.lang.Exception

initFileSelection

public void initFileSelection(HTML html,
                              E4CgiParams params)
                       throws java.lang.Exception
Throws:
java.lang.Exception

addDir

public E4TreeNode_Intf addDir(e4s.application.sysmodule.E4ModuleFileselection.E4ModuleFileSelectionParameters p,
                              E4TreeNode_Intf tree,
                              boolean deeper)
                       throws E4DBException
Throws:
E4DBException

addDir

public E4TreeNode_Intf addDir(e4s.application.sysmodule.E4ModuleFileselection.E4ModuleFileSelectionParameters p,
                              E4TreeNode_Intf tree,
                              e4s.application.sysmodule.E4ModuleFileselection.DirNodeEntry dnTop,
                              boolean deeper)
                       throws E4DBException
Throws:
E4DBException

dirListingOrViewing

public void dirListingOrViewing(HTML html,
                                E4CgiParams params)
                         throws java.lang.Exception
Throws:
java.lang.Exception

dirListing

public void dirListing(BODY body,
                       E4CgiParams p,
                       long nodeId,
                       java.lang.String treeId)
                throws java.lang.Exception
Throws:
java.lang.Exception

toggleNode

public void toggleNode(HTML html,
                       E4CgiParams params)
                throws java.lang.Exception
Change the open (display) mode of a tree node (E4TreeNode_Intf). If a user clicks on the [+] or [-] symbol beside a tree node, this changes the E4TreeNode_Intf.isOpen() state of the node. The whole tree needs to be stored in the session objects (see E4ServletImplementation_Intf.getSessionObject(String)).

Parameters:
html - the active HTML context to be used for output.
params - parameters, including the tree-object handle and the node-id as well as the target frame.
Throws:
java.lang.Exception
See Also:
E4ModuleTreeHandling._PARAM_TREE_OBJ, E4ModuleTreeHandling._PARAM_NODE_ID, E4ModuleTreeHandling._PARAM_TARGET

activateNode

public void activateNode(HTML html,
                         E4CgiParams p)
Change the activate (selected) state of a tree node as well as of all other nodes. (See E4TreeNode_Intf). If a user clicks on the node text or associated images, this changes the E4TreeNode_Intf.isActive() state of the selected node to true but all other nodes to false. The whole tree needs to be stored in the session objects (see E4ServletImplementation_Intf.getSessionObject(String)).

Parameters:
html - the active HTML context to be used for output.
p - handles the HTML/CGI-parameters, including the tree-object handle and the node-id as well as the target frame.
See Also:
E4ModuleTreeHandling._PARAM_TREE_OBJ, E4ModuleTreeHandling._PARAM_NODE_ID, E4ModuleTreeHandling._PARAM_TARGET

selectFilePreview

public void selectFilePreview(HTML html,
                              E4CgiParams params)
                       throws java.lang.Exception
Throws:
java.lang.Exception

selectedFile

public void selectedFile(HTML html,
                         E4CgiParams params)
                  throws java.lang.Exception
Throws:
java.lang.Exception

displayImage

public void displayImage(HTML html,
                         E4CgiParams params)
                  throws java.lang.Exception
Throws:
java.lang.Exception

listFiles

public void listFiles(HTML html,
                      E4CgiParams params)
               throws java.lang.Exception
Throws:
java.lang.Exception

uploadFile

public void uploadFile(HTML html,
                       E4CgiParams params)
                throws java.lang.Exception
Throws:
java.lang.Exception

uploadFile_ExecuteApplet

public void uploadFile_ExecuteApplet(HTML html,
                                     E4CgiParams params)
                              throws java.lang.Exception
Throws:
java.lang.Exception

uploadFile_Execute

public void uploadFile_Execute(HTML html,
                               E4CgiParams params)
                        throws java.lang.Exception
Throws:
java.lang.Exception

createDirectory

public void createDirectory(HTML html,
                            E4CgiParams params)
                     throws java.lang.Exception
Throws:
java.lang.Exception

createDirectory

public void createDirectory(HTML html,
                            E4CgiParams params,
                            java.lang.String defaultvalue,
                            E4Label_Intf errormsg)
                     throws java.lang.Exception
Throws:
java.lang.Exception

createDirectory_Execute

public void createDirectory_Execute(HTML html,
                                    E4CgiParams params)
                             throws java.lang.Exception
Throws:
java.lang.Exception

viewFile

public void viewFile(HTML html)
              throws java.lang.Exception
Throws:
java.lang.Exception

viewFileTail

public void viewFileTail(HTML html,
                         E4CgiParams params)
                  throws java.lang.Exception
Throws:
java.lang.Exception

listHandling_Sort

public void listHandling_Sort(HTML html,
                              E4CgiParams params)
                       throws java.lang.Exception
Throws:
java.lang.Exception

deleteFile

public void deleteFile(HTML html,
                       E4CgiParams params)
                throws java.lang.Exception
Throws:
java.lang.Exception

deleteFileExecute

public void deleteFileExecute(HTML html,
                              E4CgiParams params)
                       throws java.lang.Exception
Throws:
java.lang.Exception

viewFiles

public void viewFiles(HTML html,
                      E4CgiParams params)
               throws java.lang.Exception
Throws:
java.lang.Exception

setAEP

public static void setAEP(java.lang.String extension,
                          E4ModuleFileselection.AEP_ImagePreviewWorker worker)

_getSVNVersionString

public static java.lang.String _getSVNVersionString()

www.element4solution.com