|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
wt.clients.util.http.HTTPUploadDownloadPanel
Panel for uploading and downloading files via HTTP.
Supported API:false
Extendable:false
Nested Class Summary | |
(package private) class |
HTTPUploadDownloadPanel.DocumentHandle
|
(package private) class |
HTTPUploadDownloadPanel.TargetInfo
|
(package private) class |
HTTPUploadDownloadPanel.UploadDownloadController
|
Nested classes inherited from class java.awt.Panel |
Panel.AccessibleAWTPanel |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
(package private) symantec.itools.awt.LabelButton |
browseButton
|
(package private) Panel |
buttonPanel
|
private ContentItem |
cachedContentItem
|
(package private) Choice |
chooseFileOrURL
|
private ThreadGroup |
contextGroup
|
private ReferenceHolder |
documentHandle
|
static int |
DOWNLOAD
Download mode indicator. |
private boolean |
embeddedApplet
|
private FileAccess |
fileAccess
|
(package private) TextField |
fileOrURLTextField
|
(package private) symantec.itools.awt.LabelButton |
getButton
|
(package private) Panel |
mainPanel
|
private int |
mode
|
private String |
noPrimaryContentMessage
|
private Applet |
parentApplet
|
private boolean |
removable
|
(package private) symantec.itools.awt.LabelButton |
removeButton
|
private static String |
RESOURCE
|
static int |
TARGET_TYPE_FILE
Target type indicator, indicates a file is the target. |
static int |
TARGET_TYPE_UNKNOWN
Target type indicator, indicates the type is unknown. |
static int |
TARGET_TYPE_URL
Target type indicator, indicates a url is the target. |
private boolean |
uiModeViewOnly
|
static int |
UPLOAD
Upload mode indicator |
private HTTPUploadDownload |
uploadDownload
|
private HTTPUploadDownloadInfo |
uploadDownloadInfo
|
private HTTPUploadDownloadView |
uploadDownloadView
|
(package private) static boolean |
VALID_EMPTY_FILE
|
(package private) static boolean |
VERBOSE
|
Fields inherited from class java.awt.Panel |
|
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HTTPUploadDownloadPanel()
|
Method Summary | |
void |
addHTTPUploadDownloadListener(HTTPUploadDownloadListener l)
Add listeners to upload and download events. |
private boolean |
addNewFile(int uploadIndex,
boolean sameTargetType,
boolean isFile,
HTTPUploadDownloadPanel.TargetInfo info,
String targetName)
|
boolean |
addPostParameter(String key,
String value)
Record a parameter to be supplied with the upload operation for the file. |
void |
browse()
Invoke the file browse function and allow user to select a path. |
boolean |
cancelOperation()
|
boolean |
checksumsMatch()
|
private boolean |
checksumsMatch(String localPath,
long checksum)
|
private String |
chooseFile()
|
void |
clear()
|
static String |
createFileURLString(String fileString)
|
private String |
display(String key,
Object[] params)
Returns the localized string to be displayed to the user given a key. |
private void |
displayException(Exception e)
This displays an exception to the user and prints out a stack trace. |
private void |
displayNoPrimaryMessage()
|
String |
getContentName()
Retrieve the name which will be used on the HTTP upload CONTENT-DISPOSITION. |
private WTContext |
getContext()
|
boolean |
getDebugOption()
|
String |
getDefaultFilename()
Return the default file name. |
FormatContentHolder |
getDocument()
Returns the FormatContentHolder created by this frame. |
ReferenceHolder |
getDocumentHandle()
Get the oid of the content holder for this panel. |
private HTTPUploadDownloadPanel.TargetInfo |
getExistingTargetInfo(ContentItem item)
|
private FileAccess |
getFileAccess()
|
boolean |
getGlobalFileChangePrompt()
|
boolean |
getGlobalOverwriteWarning()
|
String |
getHostURL()
Return the host url. |
int |
getHTTPResponseCode()
|
Dimension |
getMaximumSize()
|
Dimension |
getMininumSize()
|
int |
getMode()
Return the file upload download mode. |
private String |
getNoPrimaryContentMessage()
|
int |
getOperationFailureCode()
|
int |
getOperationStatus()
Return the most recent status. |
String |
getOperationStatusMessage()
Return a user readable status message. |
Applet |
getParentApplet()
Return the launching applet (if any). |
protected Frame |
getParentFrame()
Return the parent frame. |
Dimension |
getPreferredSize()
|
private ContentItem |
getPrimaryContentItem()
|
String |
getTarget()
Return the target file or url. |
int |
getTargetType()
|
boolean |
getUIModeViewOnly()
|
HTTPUploadDownload |
getUploadDownload()
|
String |
getUploadURL()
Return the upload url. |
void |
init(Applet parentApplet)
Initialize this panel. |
void |
init(Applet parentApplet,
HTTPUploadDownload newUploadDownload,
HTTPUploadDownloadView view,
int targetType)
Initialize this panel to use the passed HTTPUploadDownload) object. |
boolean |
isDebug()
|
boolean |
isDirty()
Should be invoked before a call to save; this is where checksumming and initial file validation occurs. |
boolean |
isEmbeddedApplet()
|
boolean |
isGetButtonVisible()
|
boolean |
isRemovable()
|
boolean |
isValidTarget()
|
boolean |
isValidTarget(String target)
|
void |
launchDebugDialog()
|
private void |
localize()
This sets the display text of the fields to the localized string from the resource bundle. |
void |
performDownloadOperation(boolean separateThread)
|
private void |
performGet()
|
void |
performOperation()
Perform the upload or download operation indicated by the mode property. |
void |
performOperation(boolean separateThread)
Perform the upload or download operation indicated by the mode property. |
void |
performUploadOperation(boolean separateThread)
|
protected void |
performUploadOperation(boolean separateThread,
boolean needsSynch)
|
private void |
reactFieldGainedFocus(TextField tf)
|
private void |
reactFieldLostFocus(TextField tf)
|
private boolean |
removeCurrentFile(int uploadIndex,
boolean isFile,
HTTPUploadDownloadPanel.TargetInfo info)
|
void |
removeHTTPUploadDownloadListener(HTTPUploadDownloadListener l)
Remove upload/download listener. |
boolean |
removePostParameter(String key)
Remove the parameter from the upload operation for the file at the specified index. |
void |
resetPrimaryContent()
|
boolean |
save()
|
boolean |
save(boolean check)
Save the target content. |
private boolean |
savePrimaryContentItem(ContentItem primary)
|
void |
setChooseFileOrURLVisible(boolean visible)
Set the chooseFileOrURL choice menu to visible or not visible based on the boolean parameter. |
boolean |
setContentName(String name)
Set the name which will be used on the HTTP upload CONTENT-DISPOSITION |
void |
setDebug(boolean newValue)
|
void |
setDebugOption(boolean debugOption)
|
void |
setDefaultFilename(String defaultName)
Set the default file name. |
void |
setDisplayDeleteCheckbox()
|
void |
setDisplayDeleteNotDisplay()
|
void |
setDisplayUploadCheckbox()
|
void |
setDisplayUploadNotDisplay()
|
private void |
setDocument(FormatContentHolder newDocument)
|
void |
setDocumentHandle(ReferenceHolder referenceHolder)
|
void |
setEmbeddedApplet(boolean embeddedApplet)
|
void |
setGetButtonVisible(boolean visible)
|
void |
setGlobalFileChangePrompt(boolean newValue)
|
void |
setGlobalOverwriteWarning(boolean newValue)
|
boolean |
setHostURL(String url)
Set the host url. |
void |
setMode(int newMode)
Set the file upload or download mode. |
void |
setParentApplet(Applet parentApplet)
|
void |
setRemovable(boolean a_removable)
|
boolean |
setTarget(String target)
Set the target file or url. |
void |
setTargetType(int targetType)
|
void |
setUIModeViewOnly(boolean newValue)
|
boolean |
setUploadURL(String urlString)
Set the upload url. |
protected void |
showMessageDialog(String message,
boolean modal)
|
private void |
synch(int updateMode)
|
private void |
synch(int updateMode,
int index)
|
private void |
targetTypeChanged()
|
private void |
update(int updateMode)
|
private void |
update(int updateMode,
int targetType,
int index)
|
private void |
updateDocumentInformation(boolean reset)
|
Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static String RESOURCE
static boolean VERBOSE
static boolean VALID_EMPTY_FILE
public static final int UPLOAD
public static final int DOWNLOAD
public static final int TARGET_TYPE_UNKNOWN
public static final int TARGET_TYPE_FILE
public static final int TARGET_TYPE_URL
Panel mainPanel
Panel buttonPanel
Choice chooseFileOrURL
TextField fileOrURLTextField
symantec.itools.awt.LabelButton browseButton
symantec.itools.awt.LabelButton removeButton
symantec.itools.awt.LabelButton getButton
private HTTPUploadDownload uploadDownload
private HTTPUploadDownloadView uploadDownloadView
private HTTPUploadDownloadInfo uploadDownloadInfo
private Applet parentApplet
private ReferenceHolder documentHandle
private ThreadGroup contextGroup
private FileAccess fileAccess
private String noPrimaryContentMessage
private boolean uiModeViewOnly
private boolean removable
private boolean embeddedApplet
private int mode
private ContentItem cachedContentItem
Constructor Detail |
public HTTPUploadDownloadPanel()
Method Detail |
public void init(Applet parentApplet)
init(HTTPUploadDownload)
) must be
called once this panel has been added to its
parent container. This operation automatically creates
an HTTPUploadDownload object. To supply your own
HTTPUploadDownload object call operation init(HTTPUploadDownload)
.
public void init(Applet parentApplet, HTTPUploadDownload newUploadDownload, HTTPUploadDownloadView view, int targetType)
init()
) must be
called once this panel has been added to its
parent container.
public Dimension getMininumSize()
public Dimension getMaximumSize()
public Dimension getPreferredSize()
public ReferenceHolder getDocumentHandle()
public void setDocumentHandle(ReferenceHolder referenceHolder)
public HTTPUploadDownload getUploadDownload()
public String getUploadURL()
public boolean setUploadURL(String urlString)
public String getHostURL()
public boolean setHostURL(String url)
url
- The host url.
public String getTarget()
public boolean setTarget(String target)
target
- The file path, e.g. "E:\abcd\test.txt" or "E:\abcd\*.txt" or url.public String getContentName()
public boolean setContentName(String name)
public boolean getUIModeViewOnly()
public void setUIModeViewOnly(boolean newValue)
public int getMode()
public void setMode(int newMode)
newMode
- HTTPUploadDownload.DOWNLOAD or HTTPUploadDownload.UPLOAD.public int getTargetType()
public void setTargetType(int targetType)
public void setRemovable(boolean a_removable)
public boolean isRemovable()
public void setGetButtonVisible(boolean visible)
public boolean isGetButtonVisible()
public boolean isValidTarget()
public boolean isValidTarget(String target)
public boolean isEmbeddedApplet()
public void setEmbeddedApplet(boolean embeddedApplet)
public boolean addPostParameter(String key, String value)
key
- The name of the parameter.value
- The value of the parameter.
public boolean removePostParameter(String key)
key
- The parameter key.
public String getDefaultFilename()
public void setDefaultFilename(String defaultName)
public boolean getGlobalOverwriteWarning()
public void setGlobalOverwriteWarning(boolean newValue)
public boolean getGlobalFileChangePrompt()
public void setGlobalFileChangePrompt(boolean newValue)
public Applet getParentApplet()
public void setParentApplet(Applet parentApplet)
public void performOperation()
public void performOperation(boolean separateThread)
separateThread
- launch a separate thhread when true.
public boolean cancelOperation()
public void performUploadOperation(boolean separateThread)
protected void performUploadOperation(boolean separateThread, boolean needsSynch)
public void performDownloadOperation(boolean separateThread)
public boolean save()
public boolean save(boolean check)
isDirty()
.
public FormatContentHolder getDocument()
FormatContentHolder
created by this frame.
FormatContentHolder
public int getOperationStatus()
public String getOperationStatusMessage()
public int getOperationFailureCode()
public int getHTTPResponseCode()
public void clear()
public void addHTTPUploadDownloadListener(HTTPUploadDownloadListener l)
UploadDownloadEvent
public void removeHTTPUploadDownloadListener(HTTPUploadDownloadListener l)
public void setChooseFileOrURLVisible(boolean visible)
public boolean checksumsMatch()
public boolean isDirty()
public void browse()
public void resetPrimaryContent()
private void setDocument(FormatContentHolder newDocument)
private ContentItem getPrimaryContentItem()
private boolean savePrimaryContentItem(ContentItem primary)
private boolean removeCurrentFile(int uploadIndex, boolean isFile, HTTPUploadDownloadPanel.TargetInfo info)
private boolean addNewFile(int uploadIndex, boolean sameTargetType, boolean isFile, HTTPUploadDownloadPanel.TargetInfo info, String targetName)
private String chooseFile()
private boolean checksumsMatch(String localPath, long checksum)
private HTTPUploadDownloadPanel.TargetInfo getExistingTargetInfo(ContentItem item)
private void updateDocumentInformation(boolean reset)
private FileAccess getFileAccess()
protected Frame getParentFrame()
private void update(int updateMode)
private void update(int updateMode, int targetType, int index)
private void performGet()
private void synch(int updateMode)
private void synch(int updateMode, int index)
private void displayNoPrimaryMessage()
private void targetTypeChanged()
private void localize()
private String getNoPrimaryContentMessage()
private WTContext getContext()
private String display(String key, Object[] params)
key
- The string that represents the key in the
BeansRB
.
private void displayException(Exception e)
protected void showMessageDialog(String message, boolean modal)
public static String createFileURLString(String fileString)
private void reactFieldGainedFocus(TextField tf)
private void reactFieldLostFocus(TextField tf)
public void setDisplayDeleteNotDisplay()
public void setDisplayDeleteCheckbox()
public void setDisplayUploadCheckbox()
public void setDisplayUploadNotDisplay()
public boolean getDebugOption()
public void setDebugOption(boolean debugOption)
public boolean isDebug()
public void setDebug(boolean newValue)
public void launchDebugDialog()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |