several fixes after developing more

This commit is contained in:
Brian Long 2023-11-15 16:25:34 -05:00
parent ce6e4752df
commit c716057a24
7 changed files with 35 additions and 19 deletions

View File

@ -24,6 +24,7 @@ import com.inteligr8.alfresco.activiti.api.ProcessInstancesApi;
import com.inteligr8.alfresco.activiti.api.ProfileApi;
import com.inteligr8.alfresco.activiti.api.ShareApi;
import com.inteligr8.alfresco.activiti.api.TasksApi;
import com.inteligr8.alfresco.activiti.api.TemplatesApi;
/**
* This interface consolidates the JAX-RS APIs available in the APS Public
@ -75,4 +76,8 @@ public interface ApsPublicRestApi extends ActivitiPublicRestApi {
return this.getApi(ShareApi.class);
}
default TemplatesApi getTemplatesApi() {
return this.getApi(TemplatesApi.class);
}
}

View File

@ -1,6 +1,7 @@
package com.inteligr8.alfresco.activiti;
import com.inteligr8.alfresco.activiti.api.AppDefinitionsCxfApi;
import com.inteligr8.alfresco.activiti.api.TemplatesCxfApi;
/**
* This interface appends Apache CXF implementation specific methods to the
@ -14,5 +15,9 @@ public interface ApsPublicRestCxfApi extends ApsPublicRestApi {
default AppDefinitionsCxfApi getAppDefinitionsCxfApi() {
return this.getApi(AppDefinitionsCxfApi.class);
}
default TemplatesCxfApi getTemplatesCxfApi() {
return this.getApi(TemplatesCxfApi.class);
}
}

View File

@ -1,6 +1,7 @@
package com.inteligr8.alfresco.activiti;
import com.inteligr8.alfresco.activiti.api.AppDefinitionsJerseyApi;
import com.inteligr8.alfresco.activiti.api.TemplatesJerseyApi;
/**
* This interface appends Jersey implementation specific methods to the JAX-RS
@ -14,5 +15,9 @@ public interface ApsPublicRestJerseyApi extends ApsPublicRestApi {
default AppDefinitionsJerseyApi getAppDefinitionsJerseyApi() {
return this.getApi(AppDefinitionsJerseyApi.class);
}
default TemplatesJerseyApi getTemplatesJerseyApi() {
return this.getApi(TemplatesJerseyApi.class);
}
}

View File

@ -43,7 +43,7 @@ public interface TemplatesApi {
@Path("email-templates/system")
@Produces({ MediaType.APPLICATION_JSON })
public ResultList<EmailTemplateLight> getSystemEmailTemplates(
@QueryParam("tenantId") Integer tenantId);
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom")
@ -53,21 +53,21 @@ public interface TemplatesApi {
@QueryParam("start") Integer start,
@QueryParam("size") Integer size,
@QueryParam("sort") String sort,
@QueryParam("tenantId") Integer tenantId);
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom/{templateName}")
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getSystemEmailTemplate(
@PathParam("templateName") String name,
@QueryParam("tenantId") Integer tenantId);
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getCustomEmailTemplate(
@PathParam("templateId") int id,
@QueryParam("tenantId") Integer tenantId);
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId);
@POST
@Path("email-templates/custom")
@ -89,14 +89,14 @@ public interface TemplatesApi {
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate updateCustomEmailTemplate(
@PathParam("templateId") int id,
@PathParam("templateId") long id,
EmailTemplate template);
@DELETE
@Path("email-templates/custom/{templateId}")
public void deleteCustomEmailTemplate(
@PathParam("templateId") int id,
@QueryParam("tenantId") Integer tenantId);
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId);
@ -108,11 +108,11 @@ public interface TemplatesApi {
@QueryParam("start") Integer start,
@QueryParam("size") Integer size,
@QueryParam("sort") String sort,
@QueryParam("tenantId") Integer tenantId);
@QueryParam("tenantId") Long tenantId);
default Response getDocumentTemplate(
DocumentTemplateLight template) {
return this.getDocumentTemplate(template.getCreated().toInstant().toEpochMilli());
return this.getDocumentTemplate(template.getId(), template.getCreated().toInstant().toEpochMilli());
}
@GET
@ -123,6 +123,7 @@ public interface TemplatesApi {
"application/vnd.openxmlformats-officedocument.wordprocessingml.template"
})
public Response getDocumentTemplate(
@PathParam("templateId") long id,
@QueryParam("version") long version);
@DELETE

View File

@ -36,15 +36,15 @@ public interface TemplatesCxfApi extends TemplatesApi {
@Path("admin/document-templates")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight createDocumentTemplate(
@QueryParam("tenantId") Integer tenantId,
@QueryParam("tenantId") Long tenantId,
FileMultipartCxf file);
@POST
@Path("admin/document-templates/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight updateDocumentTemplate(
@PathParam("templateId") int id,
@QueryParam("tenantId") Integer tenantId,
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId,
FileMultipartCxf file);
}

View File

@ -36,15 +36,15 @@ public interface TemplatesJerseyApi extends TemplatesApi {
@Path("admin/document-templates")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight createDocumentTemplate(
@QueryParam("tenantId") Integer tenantId,
@QueryParam("tenantId") Long tenantId,
FileMultipartJersey file);
@POST
@Path("admin/document-templates/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight updateDocumentTemplate(
@PathParam("templateId") int id,
@QueryParam("tenantId") Integer tenantId,
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId,
FileMultipartJersey file);
}

View File

@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class BaseTemplateLight {
@JsonProperty
private Integer id;
private Long id;
@JsonProperty(required = true)
private String name;
@JsonProperty
@ -21,11 +21,11 @@ public class BaseTemplateLight {
@JsonProperty
private Integer tenantId;
public Integer getId() {
public Long getId() {
return id;
}
public void setId(Integer id) {
public void setId(Long id) {
this.id = id;
}