Skip to content

Commit

Permalink
#28563 removing template ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
jdotcms committed May 22, 2024
1 parent 325919e commit 90565d7
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 301 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.dotcms.rest.api.v1.template;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

public class TemplateImageForm implements Serializable {

@JsonProperty("templateId")
private String templateId;

@JsonCreator
public TemplateImageForm(@JsonProperty("templateId") final String templateId) {
this.templateId = templateId;
}

public String getTemplateId() {
return templateId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -816,20 +816,21 @@ public final Response delete(@Context final HttpServletRequest request,
* @throws DotSecurityException
* @throws DotDataException
*/
@GET
@Path("/{templateId}/image")
@POST
@Path("/image")
@JSONP
@NoCache
@Consumes(MediaType.APPLICATION_JSON)
@Produces({MediaType.APPLICATION_JSON, "application/javascript"})
public Map<String, Object> fetchTemplateImage(@Context final HttpServletRequest httpRequest,
@Context final HttpServletResponse httpResponse,
@PathParam("templateId") final String templateId) throws DotDataException, DotSecurityException {
final TemplateImageForm templateImageForm) throws DotDataException, DotSecurityException {

final InitDataObject initData = new WebResource.InitBuilder(webResource)
.requestAndResponse(httpRequest, httpResponse).rejectWhenNoUser(true).init();
final User user = initData.getUser();
final PageMode mode = PageMode.get(httpRequest);
final String templateId = templateImageForm.getTemplateId();

Logger.debug(this, ()-> "Getting the image working template by id: " + templateId);
final Template template = this.templateAPI.findWorkingTemplate(templateId, user, mode.respectAnonPerms);
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions dotCMS/src/main/webapp/WEB-INF/dwr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
<param name="class" value="com.dotmarketing.portlets.containers.ajax.ContainerAjaxDrawedTemplate"/>
</create>
<!-- END GRAZIANO issue-12-dnd-template -->
<create creator="new" javascript="TemplateAjax" scope="application">
<param name="class" value="com.dotmarketing.portlets.templates.ajax.TemplateAjax"/>
</create>
<create creator="new" javascript="HTMLPageViewAjax" scope="application">
<param name="class" value="com.dotmarketing.portlets.htmlpageviews.ajax.HTMLPageViewAjax"/>
</create>
Expand Down
Loading

0 comments on commit 90565d7

Please sign in to comment.