Merge branch 'develop' into stable

This commit is contained in:
Brian Long 2023-11-15 16:25:43 -05:00
commit 09d6f5b885
11 changed files with 409 additions and 1 deletions

View File

@ -163,7 +163,7 @@ public interface ExecutionApi {
@GET @GET
@Produces({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON })
public ResultList<Execution> getByAny( ResultList<Execution> getByAny(
@QueryParam("id") String executionId, @QueryParam("id") String executionId,
@QueryParam("activityId") String activityId, @QueryParam("activityId") String activityId,
@QueryParam("processDefinitionKey") String processDefinitionKey, @QueryParam("processDefinitionKey") String processDefinitionKey,

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
@ -14,5 +15,9 @@ public interface ApsPublicRestCxfApi extends ApsPublicRestApi {
default AppDefinitionsCxfApi getAppDefinitionsCxfApi() { default AppDefinitionsCxfApi getAppDefinitionsCxfApi() {
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
@ -14,5 +15,9 @@ public interface ApsPublicRestJerseyApi extends ApsPublicRestApi {
default AppDefinitionsJerseyApi getAppDefinitionsJerseyApi() { default AppDefinitionsJerseyApi getAppDefinitionsJerseyApi() {
return this.getApi(AppDefinitionsJerseyApi.class); return this.getApi(AppDefinitionsJerseyApi.class);
} }
default TemplatesJerseyApi getTemplatesJerseyApi() {
return this.getApi(TemplatesJerseyApi.class);
}
} }

View File

@ -0,0 +1,133 @@
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.inteligr8.alfresco.activiti.api;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.inteligr8.activiti.model.ResultList;
import com.inteligr8.alfresco.activiti.model.DocumentTemplateLight;
import com.inteligr8.alfresco.activiti.model.EmailTemplate;
import com.inteligr8.alfresco.activiti.model.EmailTemplateLight;
/**
* This is an undocumented API.
*
* @author brian@inteligr8.com
*/
@Path("/app/rest")
public interface TemplatesApi {
@GET
@Path("email-templates/system")
@Produces({ MediaType.APPLICATION_JSON })
public ResultList<EmailTemplateLight> getSystemEmailTemplates(
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom")
@Produces({ MediaType.APPLICATION_JSON })
public ResultList<EmailTemplateLight> getCustomEmailTemplates(
@QueryParam("nameFilter") String nameFilter,
@QueryParam("start") Integer start,
@QueryParam("size") Integer size,
@QueryParam("sort") String sort,
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom/{templateName}")
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getSystemEmailTemplate(
@PathParam("templateName") String name,
@QueryParam("tenantId") Long tenantId);
@GET
@Path("email-templates/custom/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate getCustomEmailTemplate(
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId);
@POST
@Path("email-templates/custom")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplateLight createCustomEmailTemplate(
EmailTemplate template);
@PUT
@Path("email-templates/custom/{templateName}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate updateSystemEmailTemplate(
@PathParam("templateName") String name,
EmailTemplate template);
@PUT
@Path("email-templates/custom/{templateId}")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public EmailTemplate updateCustomEmailTemplate(
@PathParam("templateId") long id,
EmailTemplate template);
@DELETE
@Path("email-templates/custom/{templateId}")
public void deleteCustomEmailTemplate(
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId);
@GET
@Path("document-templates")
@Produces({ MediaType.APPLICATION_JSON })
public ResultList<DocumentTemplateLight> getDocumentTemplates(
@QueryParam("nameFilter") String nameFilter,
@QueryParam("start") Integer start,
@QueryParam("size") Integer size,
@QueryParam("sort") String sort,
@QueryParam("tenantId") Long tenantId);
default Response getDocumentTemplate(
DocumentTemplateLight template) {
return this.getDocumentTemplate(template.getId(), template.getCreated().toInstant().toEpochMilli());
}
@GET
@Path("document-templates/{templateId}/file")
@Produces({
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.wordprocessingml.template"
})
public Response getDocumentTemplate(
@PathParam("templateId") long id,
@QueryParam("version") long version);
@DELETE
@Path("document-templates/{templateId}")
public void deleteDocumentTemplate();
}

View File

@ -0,0 +1,50 @@
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.inteligr8.alfresco.activiti.api;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.inteligr8.alfresco.activiti.model.DocumentTemplateLight;
import com.inteligr8.alfresco.activiti.model.FileMultipartCxf;
/**
* This is an undocumented API.
*
* @author brian@inteligr8.com
*/
@Path("/app/rest")
public interface TemplatesCxfApi extends TemplatesApi {
@POST
@Path("admin/document-templates")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight createDocumentTemplate(
@QueryParam("tenantId") Long tenantId,
FileMultipartCxf file);
@POST
@Path("admin/document-templates/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight updateDocumentTemplate(
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId,
FileMultipartCxf file);
}

View File

@ -0,0 +1,50 @@
/*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.inteligr8.alfresco.activiti.api;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.inteligr8.alfresco.activiti.model.DocumentTemplateLight;
import com.inteligr8.alfresco.activiti.model.FileMultipartJersey;
/**
* This is an undocumented API.
*
* @author brian@inteligr8.com
*/
@Path("/app/rest")
public interface TemplatesJerseyApi extends TemplatesApi {
@POST
@Path("admin/document-templates")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight createDocumentTemplate(
@QueryParam("tenantId") Long tenantId,
FileMultipartJersey file);
@POST
@Path("admin/document-templates/{templateId}")
@Produces({ MediaType.APPLICATION_JSON })
public DocumentTemplateLight updateDocumentTemplate(
@PathParam("templateId") long id,
@QueryParam("tenantId") Long tenantId,
FileMultipartJersey file);
}

View File

@ -0,0 +1,64 @@
package com.inteligr8.alfresco.activiti.model;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BaseTemplateLight {
@JsonProperty
private Long id;
@JsonProperty(required = true)
private String name;
@JsonProperty
private OffsetDateTime created;
@JsonProperty
private UserLight createdBy;
@JsonProperty
private Integer tenantId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public OffsetDateTime getCreated() {
return created;
}
public void setCreated(OffsetDateTime created) {
this.created = created;
}
public UserLight getCreatedBy() {
return createdBy;
}
public void setCreatedBy(UserLight createdBy) {
this.createdBy = createdBy;
}
public Integer getTenantId() {
return tenantId;
}
public void setTenantId(Integer tenantId) {
this.tenantId = tenantId;
}
}

View File

@ -0,0 +1,42 @@
package com.inteligr8.alfresco.activiti.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DocumentTemplateLight extends BaseTemplateLight {
@JsonProperty
private Integer modelId;
@JsonProperty
private String mimeType;
@JsonProperty
private String simpleType;
public Integer getModelId() {
return modelId;
}
public void setModelId(Integer modelId) {
this.modelId = modelId;
}
public String getMimeType() {
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getSimpleType() {
return simpleType;
}
public void setSimpleType(String simpleType) {
this.simpleType = simpleType;
}
}

View File

@ -0,0 +1,22 @@
package com.inteligr8.alfresco.activiti.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EmailTemplate extends EmailTemplateLight {
@JsonProperty
private String template;
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
}

View File

@ -0,0 +1,32 @@
package com.inteligr8.alfresco.activiti.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EmailTemplateLight extends BaseTemplateLight {
@JsonProperty
private String systemTemplateId;
@JsonProperty
private String subject;
public String getSystemTemplateId() {
return systemTemplateId;
}
public void setSystemTemplateId(String systemTemplateId) {
this.systemTemplateId = systemTemplateId;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
}