|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
UploadPolicy | This package contains upload policies, which allow easy configuration of the applet behavior. |
Class Summary | |
---|---|
CoppermineUploadPolicy | Specific UploadPolicy for the coppermine picture gallery. |
CustomizedNbFilesPerRequestUploadPolicy | Deprecated. This class is of no use, as it actually behaves exactly as the
DefaultUploadPolicy . |
DefaultUploadPolicy | This class implements all UploadPolicy
methods. |
FileByFileUploadPolicy | Deprecated. You can use the applet, without the uploadPolicy applet parameter, and put the nbFilesPerRequest to 1. |
FilesTogetherUploadPolicy | Upload policy that is a simple box. |
PictureUploadPolicy | This class add handling of pictures to upload. |
UploadPolicyFactory | This class is used to control creation of the uploadPolicy instance, according to applet parameters (or System properties). |
This package contains the upload policies: they give you hook entry points, to override the default applet behaviour with a minimum of java code.
This pages describes how to create a new upload policy, to adapt the applet to your needs, without interfering with the core applet, that is: with having compatibility with future JUpload versions. Here are other links on this subject:UploadPolicy
for the list of applet parametersYou'll find on this page a description of the UploadPolicy
methods, grouped by categories.
Note: Creating a new upload policy is mandatory, if you want to manage some other kind of FileData
.
You can then add some kind of 'before upload check', or have a specific applet behaviour, for instance be able to hear
sound file before upload.
To create a new upload policy, you need to create a new java class: the easiest way is to inherit from @link wjhk.jupload2.policies.DefaultUploadPolicy}. You can then override methods of the UploadPolicy interface that you need to update for your needs.
This kind of customization will be compatible within next JUpload applet release. If you need other hooks (method within the UploadPolicy interface, to allow other customizations), please let me know by posting a message on the sourceforge jupload forums (open discussions for instance), or post a new Feature Request in the jupload sourceforge project page. For instance, some attributes and methods from DefaultUploadPolicy are protected (not private), so that you can use them in your own upload policies.
Here is a sample description of the customization that you can do by using the creating a new policy, using the UploadPolicy interface. All methods are described in the next section of this page.
UploadPolicy.createFileData(File, File)
checks that the added
files are valid pictures.The JuploadApplet asks the UploadPolicyFactory to create (instanciate) the needed UploadPolicy. That is:
To create a new UploadPolicy, you'll need to:
This methods creates a new FileData
object. It returns null is no file data was created, for instance
if this file didn't check some specific validation checks.
Note: use this method to use any FileData specific to your needs. See PictureUploadPolicy
for a sample
of this.
Specific reaction of the applet, when file are dropped onto it.
JUploadFileChooser
has to do.
Allows the applet to change the way the top part of the applet is displayed, that is: the place where the
Choose, remove, remove all buttons are. If you override this method, you must use the given button if you want
these functionalities to work. If you don't put the browse button, for instance, the user won't be able to
display a file chooser, unless you manage it yourself. See PictureUploadPolicy
, for a way to use the
standard buttons, and add specific ones.
Extension of the createTopPanel() idea. You can place any component of JUpload at any place ... or at no place.
If you override this method, you'll have to call the JUploadPanel
getter to get core applet objects.
These are:
You probably won't have to override this method. Note that this method allows you to not display the stop and upload buttons.
This method should not be used any more. Use the showStatusBar applet parameter instead.
Reaction of the applet, when a file is selected in the file list. For instance, PictureUploadPolicy
displays the selected picture in the preview component.
Reaction of the applet, when a file is double clicked. For instance, PictureUploadPolicy
opens a dialog
box, that contain a full screen display of the current picture.
JUploadFileChooser
has to do.
Allows the applet to change user another JFileChooser. Your specific file chooser should inherit from JUploadFileChooser
Called by the JUploadFileFilter
. This method contains the actual response to the {
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |