Skip to content

Commit

Permalink
Provide ability to extend webXml generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jad-el-khoury committed Jul 19, 2023
1 parent 61a60ff commit 1b1bca2
Showing 1 changed file with 38 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,41 @@
[import org::eclipse::lyo::oslc4j::codegenerator::services::domainSpecificationServices/]
[import org::eclipse::lyo::oslc4j::codegenerator::services::vocabularyServices/]

[template public servlet(anAdaptorInterface : AdaptorInterface)]
<servlet>
<servlet-name>JAX-RS Servlet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>[javaClassFullNameForAdaptorApplication(anAdaptorInterface)/]</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- [protected ('webxml_servlet')]
-->
<!-- TODO: Add additional configurations here to avoid them be overridden upon future re-generation -->
<!-- [/protected]
-->
<servlet-mapping>
<servlet-name>JAX-RS Servlet</servlet-name>
<url-pattern>[anAdaptorInterface.configuration.servletUrlPattern/]</url-pattern>
</servlet-mapping>
[/template]

[template public filter(anAdaptorInterface : AdaptorInterface)]
[if anAdaptorInterface.authenticationEnabled()]
<filter>
<display-name>CredentialsFilter</display-name>
<filter-name>CredentialsFilter</filter-name>
<filter-class>[javaClassFullNameForCredentialsFilter(anAdaptorInterface)/]</filter-class>
</filter>
<filter-mapping>
<filter-name>CredentialsFilter</filter-name>
<url-pattern>[anAdaptorInterface.configuration.servletUrlPattern/]</url-pattern>
</filter-mapping>
[/if]
[/template]

[template public generateWebXml(anAdaptorInterface : AdaptorInterface)]
[if (not anAdaptorInterface.doNotGenerateProjectFiles())]
[file (anAdaptorInterface.webFilesBasePath().concatenatePaths('/WEB-INF/web.xml'), false, 'UTF-8')]
Expand Down Expand Up @@ -56,36 +91,9 @@
<!-- TODO: Add additional configurations here to avoid them be overridden upon future re-generation -->
<!-- [/protected]
-->
<servlet>
<servlet-name>JAX-RS Servlet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>[javaClassFullNameForAdaptorApplication(anAdaptorInterface)/]</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- [protected ('webxml3')]
-->
<!-- TODO: Add additional configurations here to avoid them be overridden upon future re-generation -->
<!-- [/protected]
-->
<servlet-mapping>
<servlet-name>JAX-RS Servlet</servlet-name>
<url-pattern>[anAdaptorInterface.configuration.servletUrlPattern/]</url-pattern>
</servlet-mapping>
[if anAdaptorInterface.authenticationEnabled()]
<filter>
<display-name>CredentialsFilter</display-name>
<filter-name>CredentialsFilter</filter-name>
<filter-class>[javaClassFullNameForCredentialsFilter(anAdaptorInterface)/]</filter-class>
</filter>
<filter-mapping>
<filter-name>CredentialsFilter</filter-name>
<url-pattern>[anAdaptorInterface.configuration.servletUrlPattern/]</url-pattern>
</filter-mapping>
[/if]
<!-- [protected ('webxml4')]
[servlet(anAdaptorInterface)/]
[filter(anAdaptorInterface)/]
<!-- [protected ('webxml_final')]
-->
<!-- TODO: Add additional configurations here to avoid them be overridden upon future re-generation -->
<!-- [/protected]
Expand Down

0 comments on commit 1b1bca2

Please sign in to comment.