Class ServletPluginExtension
java.lang.Object
ro.sync.ecss.extensions.api.webapp.plugin.ServletPluginExtension
- All Implemented Interfaces:
- PluginExtension
- Direct Known Subclasses:
- ServletPluginConfigExtension
@API(type=EXTENDABLE,
     src=PUBLIC)
public abstract class ServletPluginExtension
extends Object
implements PluginExtension
This abstract class should be extended in order to create a servlet.
To register the servlet you just have to declare an extension of type "WebappServlet"
 in the plugin's plugin.xml file. For example: 
  <extension type="WebappServlet" class="com.domain.example.ServletPluginExtensionImpl"/>
 
 
Web Author installs servlet extensions automatically, each one receiving requests from specific URLs 
 based on the path returned by the getPath() method.
 
 
For example, if the Web Author is available at https://example.com/oxygen-xml-web-author/ and
 the getPath() method returns custom-path, the servlet handles requests for the
 URLs starting with: https://example.com/oxygen-xml-web-author/plugins-dispatcher/custom-path/.
- Since:
- 26
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddoDelete(HttpServletRequest req, HttpServletResponse resp) Servlet's doDelete method.voiddoGet(HttpServletRequest req, HttpServletResponse resp) Servlet's doGet method.voiddoPost(HttpServletRequest req, HttpServletResponse resp) Servlet's doPost method.voiddoPut(HttpServletRequest req, HttpServletResponse resp) Servlet's doPut method.abstract StringgetPath()Should be implemented to return the relative path handled by this plugin.voidinit()Servlet's init() method.voidinit(ServletConfig config) Init function that stores the config.booleanvoidservice(HttpServletRequest req, HttpServletResponse resp) Servlet's service method.
- 
Field Details- 
configThe servlet configuration.
 
- 
- 
Constructor Details- 
ServletPluginExtensionpublic ServletPluginExtension()
 
- 
- 
Method Details- 
getPathShould be implemented to return the relative path handled by this plugin. The path should be unique among other webapp servlet plugins paths and should contain only lower case letters or the '-' sign. Example: "plugin-path"- Returns:
- the path at which the servlet will be accessed.
 
- 
initInit function that stores the config. Consider overriding theinit()method instead. If you decide to override this one, call the super implementation.- Parameters:
- config- The configuration.
- Throws:
- ServletException
 
- 
initServlet's init() method.- Throws:
- ServletException
 
- 
servicepublic void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Servlet's service method.- Parameters:
- req- the request.
- resp- the response.
- Throws:
- ServletException
- IOException
 
- 
doGetpublic void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Servlet's doGet method.- Parameters:
- req- the request.
- resp- the response.
- Throws:
- ServletException
- IOException
 
- 
doPostpublic void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Servlet's doPost method.- Parameters:
- req- the request.
- resp- the response.
- Throws:
- ServletException
- IOException
 
- 
doPutpublic void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Servlet's doPut method.- Parameters:
- req- the request.
- resp- the response.
- Throws:
- ServletException
- IOException
 
- 
doDeletepublic void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException Servlet's doDelete method.- Parameters:
- req- the request.
- resp- the response.
- Throws:
- ServletException
- IOException
 
- 
getServletConfig- Returns:
- Returns the servlet configuration.
 
- 
requiresAuthorizationpublic boolean requiresAuthorization()- Returns:
- True if this extension requires user to be authenticated as administrator.
 
 
-