Changeset 1986
- Timestamp:
- 2008-05-10 21:58:17 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/branches/2.4/src/site/apt/connector.apt
r1972 r1986 34 34 [[1]] Declare the ConnectorServlet in your <<<web.xml>>> 35 35 36 +-------------------------------------------------- -----------------+36 +--------------------------------------------------+ 37 37 <web-app version="2.4"> 38 38 ... … … 53 53 ... 54 54 </web-app> 55 +-------------------------------------------------- -----------------+55 +--------------------------------------------------+ 56 56 57 57 Assuming you installed the editor in the <<</fckeditor>>> folder in your webapp.\ … … 61 61 [[2]] Create a <<<fckeditor.properties>>> file in your classpath and add: 62 62 63 +------------------------------------------------------------------- +63 +------------------------------------------------------------------------+ 64 64 connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl 65 +------------------------------------------------------------------- +65 +------------------------------------------------------------------------+ 66 66 67 67 [] … … 74 74 Connector. 75 75 76 The basic idea of extending the Connector is to provide some interfaces for special user depended interactions, 77 which can be implemented by the developer of a webapp. All methods get the <<<HttpServletRequest>>>-object, 78 so the developer could identify the user with a session attribute for example and return a user 79 specific value. We intentionally make no suggestions how to do this, so you have the free of choice to 80 implement whatever and however you like. 76 The basic idea of extending the Connector is to provide interfaces for user-dependent 77 interactions which can be implemented by the web application developer. All 78 methods are passed the current <<<HttpServletRequest>>> instance in order to 79 retrieve request and/or session attributes and to assemble a user-specific 80 return value. We intentionally do not impose any contraints or indorse any 81 particular implementation approach to give you the freedom to implement the 82 interfaces the way it fits best in your environment. 81 83 82 The fully-qualified class name of the implemented classes can now be setas described in83 {{{properties.html}Configuration settings}}.84 Suppy the fully-qualified class names of the implemented classes as described in 85 the {{{properties.html}Configuration settings}}. 84 86 85 At the moment, the integration pack provides two interfaces to extend the connector:87 Right now, the integration pack provides two interfaces to extend the Connector: 86 88 87 89 [[1]] {{{java-core/apidocs/net/fckeditor/requestcycle/UserPathBuilder.html}<<<net.fckeditor.requestcycle.UserPathBuilder>>>}} 88 90 89 In this interface there is only one method <<<getUserFilesPath(final HttpServletRequest request)>>>, 90 return value is a string. There you can implement a user dependent construction of the 'BaseDir' path, 91 the path for all resource files. 91 This interface consists only of one method <<<#getUserFilesPath(final HttpServletRequest)>>> 92 which returns a string. You are able to construct a user-dependent 93 <<<UserFilesPath>>>, e.g. <<</userfiles/johndoe>>> if johndoe is a valid 94 username. 92 95 93 96 [[2]] {{{java-core/apidocs/net/fckeditor/requestcycle/UserAction.html}<<<net.fckeditor.requestcycle.UserAction>>>}} 94 97 95 There are two methods to authorize users to do filebased actions:98 There are two methods to authorize users to do file-based actions: 96 99 97 * <<<#isEnabledForFileUpload(HttpServletRequest)>>> Enables/disables the user for uploading files. 100 * <<<#isEnabledForFileBrowsing(HttpServletRequest)>>> which returns a 101 <<<boolean>>> denoting the user's ability to browse files on the server. 102 103 * <<<#isEnabledForFileUpload(HttpServletRequest)>>> which returns a 104 <<<boolean>>> denoting the user's ability to upload files to the server. 98 105 99 * <<<#isEnabledForFileBrowsing(HttpServletRequest)>>> Enables/disables the user for browsing files. 106 [] 107 108 For those who want to enable all users to browse and upload files, there 109 is a ready-to-use implementation <<<{{{java-core/apidocs/net/fckeditor/requestcycle/impl/UserActionImpl.html}UserActionImpl}}>>>. 100 110 101 111 [] 102 103 For those who wants to enable all users for browsing and uploading files, there is an implementation104 of <<<UserAction>>> you can use: {{{java-core/apidocs/net/fckeditor/requestcycle/impl/UserActionImpl.html}UserActionImpl}}