|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.ActionSupport
com.opensymphony.webwork.components.AbstractRichtexteditorConnector
public abstract class AbstractRichtexteditorConnector
An abstract class to be extended in order for the Rich text editor to perform server-side browsing and uploading.
<package name="richtexteditor-browse" extends="webwork-default" namespace="/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp"> <action name="connector" class="com.opensymphony.webwork.components.DefaultRichtexteditorConnector" method="browse"> <result name="getFolders" type="richtexteditorGetFolders" /> <result name="getFoldersAndFiles" type="richtexteditorGetFoldersAndFiles" /> <result name="createFolder" type="richtexteditorCreateFolder" /> <result name="fileUpload" type="richtexteditorFileUpload" /> </action> </package> <package name="richtexteditor-upload" extends="webwork-default" namespace="/webwork/richtexteditor/editor/filemanager/upload"> <action name="uploader" class="com.opensymphony.webwork.components.DefaultRichtexteditorConnector" method="upload"> <result name="richtexteditorFileUpload" /> </action> </package>
DefaultRichtexteditorConnector
,
Serialized FormNested Class Summary | |
---|---|
static class |
AbstractRichtexteditorConnector.CreateFolderResult
Represensts the result of a server-side 'CreateFolder' command call. |
static class |
AbstractRichtexteditorConnector.File
Class represens a File in the server side. |
static class |
AbstractRichtexteditorConnector.FileUploadResult
Represents the result of a server-side 'FileUpload' command call. |
static class |
AbstractRichtexteditorConnector.Folder
Class represents a Folder in the server side. |
static class |
AbstractRichtexteditorConnector.FoldersAndFiles
Represents the files and folders to be returned from the server-side. |
Field Summary | |
---|---|
protected String |
_command
|
protected String |
_currentFolder
|
protected File |
_newFile
|
protected String |
_newFileContentType
|
protected String |
_newFileFileName
|
protected String |
_newFolderName
|
protected HttpServletRequest |
_request
|
protected HttpServletResponse |
_response
|
protected String |
_serverPath
|
protected String |
_type
|
static String |
CREATE_FOLDER
|
static String |
FILE_UPLOAD
|
static String |
GET_FOLDERS
|
static String |
GET_FOLDERS_AND_FILES
|
Fields inherited from class com.opensymphony.xwork.ActionSupport |
---|
LOG |
Fields inherited from interface com.opensymphony.xwork.Action |
---|
ERROR, INPUT, LOGIN, NONE, SUCCESS |
Constructor Summary | |
---|---|
AbstractRichtexteditorConnector()
|
Method Summary | |
---|---|
String |
browse()
The method that does the functionality when the richtexteditor 'browse' command is issued. |
protected abstract String |
calculateServerPath(String serverPath,
String folderPath,
String type)
This method should return the url that could be used to access the server-side object. |
protected abstract AbstractRichtexteditorConnector.CreateFolderResult |
createFolder(String virtualFolderPath,
String type,
String newFolderName)
Method that gets called when a 'CreateFolder' command is issued by the rich text editor. |
protected abstract AbstractRichtexteditorConnector.FileUploadResult |
fileUpload(String virtualFolderPath,
String type,
String filename,
String contentType,
File newFile)
Method that gets called when a 'FileUpload' command is issued by the rich text editor. |
String |
getCommand()
|
String |
getCurrentFolder()
|
protected abstract AbstractRichtexteditorConnector.Folder[] |
getFolders(String virtualFolderPath,
String type)
Method that gets called when a 'GetFolders' command is issued by the rich text editor. |
protected abstract AbstractRichtexteditorConnector.FoldersAndFiles |
getFoldersAndFiles(String virtualFolderPath,
String type)
Method that gets called when a 'GetFoldersAndFiles' command is issued by the rich text editor. |
File |
getNewFile()
|
String |
getNewFileContentType()
|
String |
getNewFileFileName()
|
String |
getNewFolderName()
|
String |
getServerPath()
|
String |
getType()
|
void |
setCommand(String command)
|
void |
setCurrentFolder(String currentFolder)
|
void |
setNewFile(File newFile)
|
void |
setNewFileContentType(String newFileContentType)
|
void |
setNewFileFileName(String newFileFileName)
|
void |
setNewFolderName(String newFolderName)
|
void |
setServerPath(String serverPath)
|
void |
setServletRequest(HttpServletRequest request)
Sets the HTTP request object in implementing classes. |
void |
setServletResponse(HttpServletResponse response)
Sets the HTTP response object in implementing classes. |
void |
setType(String type)
|
protected abstract void |
unknownCommand(String command,
String virtualFolderPath,
String type,
String filename,
String contentType,
File newFile)
Methods that get called when an unrecognized command is issued. |
String |
upload()
The method that does the functionality when the richtexteditor 'upload' command is '/webwork/richtexteditor/data/' issued. |
Methods inherited from class com.opensymphony.xwork.ActionSupport |
---|
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, doInput, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, pause, setActionErrors, setActionMessages, setFieldErrors, validate |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String GET_FOLDERS
public static String GET_FOLDERS_AND_FILES
public static String CREATE_FOLDER
public static String FILE_UPLOAD
protected HttpServletRequest _request
protected HttpServletResponse _response
protected File _newFile
protected String _newFileFileName
protected String _newFileContentType
protected String _type
protected String _command
protected String _currentFolder
protected String _serverPath
protected String _newFolderName
Constructor Detail |
---|
public AbstractRichtexteditorConnector()
Method Detail |
---|
public String browse() throws Exception
Browse Command | Result Name |
GetFolders | getFolders |
GetFoldersAndFiles | getFoldersAndFiles |
CreateFolder | createFolder |
FileUpload | fileUpload |
Exception
public String upload() throws Exception
Exception
protected abstract String calculateServerPath(String serverPath, String folderPath, String type) throws Exception
<img src='/aaa/bbb/ccc/myImage.gif' .... /<For example, if the folderPath is '/folder1' and the type is 'Image', the calculated server path might be '/aaa/bbb/ccc/Image/folder1/' such that if the image is 'myImage.gif' the src attribute of the image tag might be '/aaa/bbb/ccc/Image/folder1/myImage.gif'.
serverPath
- the server path provided through setServerPath (by default it isfolderPath
- the current folder path requestedtype
- the type (Image, Link or Flash)
Exception
protected abstract AbstractRichtexteditorConnector.Folder[] getFolders(String virtualFolderPath, String type) throws Exception
folderPath
. While the
type of could be one of 'Image', 'Link' or 'Flash'.
virtualFolderPath
- type
-
Exception
protected abstract AbstractRichtexteditorConnector.FoldersAndFiles getFoldersAndFiles(String virtualFolderPath, String type) throws Exception
virtualFolderPath
.
While the type could be one of 'Image', 'Link' or 'Flash'.
virtualFolderPath
- type
-
Exception
protected abstract AbstractRichtexteditorConnector.CreateFolderResult createFolder(String virtualFolderPath, String type, String newFolderName) throws Exception
virtualFolderPath
.
While the type could be one of 'Image', 'Link' or 'Flash'. The new folder name
to be created is newFolderName
.
virtualFolderPath
- type
- newFolderName
-
Exception
protected abstract AbstractRichtexteditorConnector.FileUploadResult fileUpload(String virtualFolderPath, String type, String filename, String contentType, File newFile) throws Exception
virtualFolderPath
.
While the type could be one of 'Image', 'Link' or 'Flash'. The upload file name
is filename
while its content type is conetnType
and
its content could be read off the newFile
object.
virtualFolderPath
- type
- filename
- contentType
- newFile
-
Exception
protected abstract void unknownCommand(String command, String virtualFolderPath, String type, String filename, String contentType, File newFile) throws Exception
command
- virtualFolderPath
- type
- filename
- contentType
- newFile
-
Exception
public File getNewFile()
public void setNewFile(File newFile)
public String getNewFileFileName()
public void setNewFileFileName(String newFileFileName)
public String getNewFileContentType()
public void setNewFileContentType(String newFileContentType)
public String getCommand()
public void setCommand(String command)
public String getType()
public void setType(String type)
public String getCurrentFolder()
public void setCurrentFolder(String currentFolder)
public String getNewFolderName()
public void setNewFolderName(String newFolderName)
public String getServerPath()
public void setServerPath(String serverPath)
public void setServletRequest(HttpServletRequest request)
ServletRequestAware
setServletRequest
in interface ServletRequestAware
request
- the HTTP request.public void setServletResponse(HttpServletResponse response)
ServletResponseAware
setServletResponse
in interface ServletResponseAware
response
- the HTTP response.
|
WebWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |