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.ProfileApi;
import com.inteligr8.alfresco.activiti.api.ShareApi; import com.inteligr8.alfresco.activiti.api.ShareApi;
import com.inteligr8.alfresco.activiti.api.TasksApi; 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 * 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); return this.getApi(ShareApi.class);
} }
default TemplatesApi getTemplatesApi() {
return this.getApi(TemplatesApi.class);
}
} }

View File

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

View File

@ -1,6 +1,7 @@
package com.inteligr8.alfresco.activiti; package com.inteligr8.alfresco.activiti;
import com.inteligr8.alfresco.activiti.api.AppDefinitionsJerseyApi; 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 * This interface appends Jersey implementation specific methods to the JAX-RS
@ -15,4 +16,8 @@ public interface ApsPublicRestJerseyApi extends ApsPublicRestApi {
return this.getApi(AppDefinitionsJerseyApi.class); 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") @Path("email-templates/system")
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public ResultList<EmailTemplateLight> getSystemEmailTemplates( public ResultList<EmailTemplateLight> getSystemEmailTemplates(
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
@GET @GET
@Path("email-templates/custom") @Path("email-templates/custom")
@ -53,21 +53,21 @@ public interface TemplatesApi {
@QueryParam("start") Integer start, @QueryParam("start") Integer start,
@QueryParam("size") Integer size, @QueryParam("size") Integer size,
@QueryParam("sort") String sort, @QueryParam("sort") String sort,
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
@GET @GET
@Path("email-templates/custom/{templateName}") @Path("email-templates/custom/{templateName}")
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getSystemEmailTemplate( public EmailTemplate getSystemEmailTemplate(
@PathParam("templateName") String name, @PathParam("templateName") String name,
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
@GET @GET
@Path("email-templates/custom/{templateId}") @Path("email-templates/custom/{templateId}")
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getCustomEmailTemplate( public EmailTemplate getCustomEmailTemplate(
@PathParam("templateId") int id, @PathParam("templateId") long id,
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
@POST @POST
@Path("email-templates/custom") @Path("email-templates/custom")
@ -89,14 +89,14 @@ public interface TemplatesApi {
@Consumes({ MediaType.APPLICATION_JSON }) @Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate updateCustomEmailTemplate( public EmailTemplate updateCustomEmailTemplate(
@PathParam("templateId") int id, @PathParam("templateId") long id,
EmailTemplate template); EmailTemplate template);
@DELETE @DELETE
@Path("email-templates/custom/{templateId}") @Path("email-templates/custom/{templateId}")
public void deleteCustomEmailTemplate( public void deleteCustomEmailTemplate(
@PathParam("templateId") int id, @PathParam("templateId") long id,
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
@ -108,11 +108,11 @@ public interface TemplatesApi {
@QueryParam("start") Integer start, @QueryParam("start") Integer start,
@QueryParam("size") Integer size, @QueryParam("size") Integer size,
@QueryParam("sort") String sort, @QueryParam("sort") String sort,
@QueryParam("tenantId") Integer tenantId); @QueryParam("tenantId") Long tenantId);
default Response getDocumentTemplate( default Response getDocumentTemplate(
DocumentTemplateLight template) { DocumentTemplateLight template) {
return this.getDocumentTemplate(template.getCreated().toInstant().toEpochMilli()); return this.getDocumentTemplate(template.getId(), template.getCreated().toInstant().toEpochMilli());
} }
@GET @GET
@ -123,6 +123,7 @@ public interface TemplatesApi {
"application/vnd.openxmlformats-officedocument.wordprocessingml.template" "application/vnd.openxmlformats-officedocument.wordprocessingml.template"
}) })
public Response getDocumentTemplate( public Response getDocumentTemplate(
@PathParam("templateId") long id,
@QueryParam("version") long version); @QueryParam("version") long version);
@DELETE @DELETE

View File

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

View File

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

View File

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