Skip to content

Commit

Permalink
tr(servlet): deprecate non SCA servlets (#2745)
Browse files Browse the repository at this point in the history
  • Loading branch information
akantcheff authored Oct 10, 2023
1 parent 053aa13 commit 17f0e88
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@

import java.util.Optional;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lombok.extern.slf4j.Slf4j;
import org.bonitasoft.engine.api.APIClient;
import org.bonitasoft.engine.api.ApplicationAPI;
import org.bonitasoft.engine.business.application.Application;
Expand All @@ -32,6 +35,7 @@
import org.bonitasoft.web.toolkit.client.common.exception.http.ServerException;
import org.bonitasoft.web.toolkit.client.data.APIID;

@Slf4j
public class ApplicationIconServlet extends IconServlet {

@Override
Expand All @@ -49,7 +53,26 @@ protected Optional<IconContent> retrieveIcon(Long iconId, APISession apiSession)
}
}

/**
* {@inheritDoc}
*
* @deprecated as of 9.0.0, Application icon should be deleted/updated at startup.
*/
@Override
@Deprecated(since = "9.0.0")
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException {
log.warn("DELETE request on Application Icon is deprecated! " +
"An application icon should be deleted or updated at startup instead.");
super.doDelete(request, response);
}

/**
* {@inheritDoc}
*
* @deprecated as of 9.0.0, Application icon should be deleted/updated at startup.
*/
@Override
@Deprecated(since = "9.0.0")
protected void deleteIcon(Long entityId, APISession apiSession, HttpServletRequest request) throws ServerException {
ApplicationAPI applicationApi = getApplicationApi(apiSession);
ApplicationUpdater updater = new ApplicationUpdater();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@

import javax.activation.FileTypeMap;
import javax.activation.MimetypesFileTypeMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.io.FileUtils;
import org.bonitasoft.console.common.server.page.CustomPageService;
Expand All @@ -37,6 +40,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @deprecated as of 9.0.0, Application page should be created/updated at startup.
*/
@Slf4j
@Deprecated(since = "9.0.0")
public class PageUploadServlet extends TenantFileUploadServlet {

/**
Expand All @@ -56,6 +64,19 @@ public class PageUploadServlet extends TenantFileUploadServlet {

protected File pageTmp;

/**
* {@inheritDoc}
*
* @deprecated as of 9.0.0, Application page should be created/updated at startup.
*/
@Override
@Deprecated(since = "9.0.0")
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
log.warn("Application Page upload is deprecated! " +
"An application page should be created or updated at startup instead.");
super.doPost(request, response);
}

@Override
protected String generateResponseString(final HttpServletRequest request, final String fileName,
final String uploadedFileName) throws Exception {
Expand Down
10 changes: 10 additions & 0 deletions bpm/bonita-web-server/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
<param-value>true</param-value>
</init-param>
</servlet>
<!-- @deprecated as of 9.0.0, Process should be created/updated at startup -->
<servlet>
<servlet-name>processUploadServlet</servlet-name>
<servlet-class>org.bonitasoft.console.common.server.servlet.TenantFileUploadServlet</servlet-class>
Expand All @@ -391,6 +392,7 @@
<param-value>bar</param-value>
</init-param>
</servlet>
<!-- @deprecated as of 9.0.0, Process should be created/updated at startup -->
<servlet>
<servlet-name>apiProcessUploadServlet</servlet-name>
<servlet-class>org.bonitasoft.console.common.server.servlet.TenantFileUploadServlet</servlet-class>
Expand Down Expand Up @@ -601,10 +603,12 @@
<servlet-name>livingApplicationPageServlet</servlet-name>
<url-pattern>/portal/resource/app/*</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Process should be created/updated at startup -->
<servlet-mapping>
<servlet-name>processUploadServlet</servlet-name>
<url-pattern>/portal/processUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Process should be created/updated at startup -->
<servlet-mapping>
<servlet-name>apiProcessUploadServlet</servlet-name>
<url-pattern>/API/processUpload</url-pattern>
Expand All @@ -613,22 +617,27 @@
<servlet-name>xmlUploadServlet</servlet-name>
<url-pattern>/portal/organizationUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Applications should be created/updated at startup -->
<servlet-mapping>
<servlet-name>xmlUploadServlet</servlet-name>
<url-pattern>/portal/applicationsUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Actors should be created/updated at startup -->
<servlet-mapping>
<servlet-name>xmlUploadServlet</servlet-name>
<url-pattern>/portal/actorsUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, BDM should be created/updated at startup -->
<servlet-mapping>
<servlet-name>zipUploadServlet</servlet-name>
<url-pattern>/portal/bdmUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Application page should be created/updated at startup -->
<servlet-mapping>
<servlet-name>pageUploadServlet</servlet-name>
<url-pattern>/portal/pageUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Application page should be created/updated at startup -->
<servlet-mapping>
<servlet-name>apiPageUploadServlet</servlet-name>
<url-pattern>/API/pageUpload</url-pattern>
Expand All @@ -645,6 +654,7 @@
<servlet-name>fileUploadServlet</servlet-name>
<url-pattern>/portal/fileUpload</url-pattern>
</servlet-mapping>
<!-- @deprecated as of 9.0.0, Process Form should be created/updated at startup -->
<servlet-mapping>
<servlet-name>formFileUploadServlet</servlet-name>
<url-pattern>/API/formFileUpload</url-pattern>
Expand Down

0 comments on commit 17f0e88

Please sign in to comment.