diff --git a/beedk-springboot-api-archetype/.gitignore b/beedk-springboot-api-archetype/.gitignore deleted file mode 100644 index 5de9fc3..0000000 --- a/beedk-springboot-api-archetype/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Maven -/target -pom.xml.versionsBackup - -# Eclipse -.settings -.project -.classpath - diff --git a/beedk-springboot-api-archetype/pom.xml b/beedk-springboot-api-archetype/pom.xml deleted file mode 100644 index fa370ee..0000000 --- a/beedk-springboot-api-archetype/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - beedk-springboot-api-archetype - maven-archetype - - - com.inteligr8.ootbee - beedk-parent - 1.1-SNAPSHOT - .. - - - Order of the Bee Development Kit: Project Scaffolding for a Spring Boot application using ACS/API remote APIs - https://git.inteligr8.com/inteligr8/ootbee-beedk - - - - GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 - https://www.gnu.org/licenses/lgpl-3.0.txt - - - - - scm:git:https://git.inteligr8.com/inteligr8/ootbee-beedk.git - scm:git:git@git.inteligr8.com:inteligr8/ootbee-beedk.git - https://git.inteligr8.com/inteligr8/ootbee-beedk - - - Order of the Bee - https://orderofthebee.net - - - - brian.long - Brian Long - brian@inteligr8.com - Inteligr8 - https://www.inteligr8.com - https://twitter.com/brianmlong - - - - - - - org.apache.maven.archetype - archetype-packaging - ${archetype-packaging.version} - - - - diff --git a/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 3d520ae..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - [A-Za-z0-9]+ - - - quay.io - - - local - - - [1.0.0,2.0.0) - - - - - src/main/java - - **/* - - - - src/test/java - - **/* - - - - src - - main/java/**/* - test/java/**/* - - - - \ No newline at end of file diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore deleted file mode 100644 index 5de9fc3..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Maven -/target -pom.xml.versionsBackup - -# Eclipse -.settings -.project -.classpath - diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index 05eee3f..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - 4.0.0 - - ${groupId} - ${artifactId} - ${version} - jar - - ${shortname} - - - UTF-8 - 11 - 5.0.0 - - - community - 7.4.2 - - - ${dockerRegistryHost} - ${dockerImagePrefix}/${project.artifactId} - ${project.version} - - - - - - org.alfresco - alfresco-java-rest-api-spring-boot-starter - ${alfresco.restapi.version} - - - - org.alfresco - alfresco-java-event-api-spring-boot-starter - ${alfresco.restapi.version} - - - - - - - io.repaint.maven - tiles-maven-plugin - 2.40 - true - - - - com.inteligr8.ootbee:beedk-acs-platform-artifact-rad-tile:${beedkVersion} - - com.inteligr8.ootbee:beedk-springboot-docker-tile:${beedkVersion} - - - - - - - - - alfresco-public - https://artifacts.alfresco.com/nexus/content/groups/public - - - \ No newline at end of file diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile deleted file mode 100644 index b2b4625..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/docker/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ - -FROM docker.inteligr8.com/inteligr8/ubuntu-jdk:20.04-11 - -# Set default user information -ARG JAR_FILE=target/${env.project_artifactId}-${env.project_version}.jar -ARG APPGROUPNAME=alfresco -ARG APPGROUPID=1000 -ARG APPUSERNAME=atengine -ARG APPUSERID=33001 - -ENV JAVA_OPTS="-Xmx128m" -ENV JAR_PATH=/usr/local/bin/${env.project_artifactId}-${env.project_version}.jar - -COPY ${JAR_FILE} ${JAR_PATH} - -# Install your engine's dependencies here -#RUN apt update && \ -# apt -y install {dependency names in APT repository} - -RUN groupadd -g ${APPGROUPID} ${APPGROUPNAME} && \ - useradd -u ${APPUSERID} -G ${APPGROUPNAME} ${APPUSERNAME} && \ - chown ${APPUSERNAME}:${APPGROUPNAME} ${JAR_PATH} - -USER ${APPUSERNAME} - -ENTRYPOINT java ${JAVA_OPTS} -jar ${JAR_PATH} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java deleted file mode 100644 index 4573893..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/java/Application.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * #%L - * Alfresco Transform Core - * %% - * Copyright (C) 2005 - 2020 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * - - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - - * Alfresco 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. - * - - * Alfresco 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 Lesser General Public License for more details. - * - - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ -package ${package}; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ImportResource; -import org.springframework.context.event.EventListener; - -import io.micrometer.core.instrument.MeterRegistry; - -@SpringBootApplication -@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class }) -@ImportResource({"classpath*:application-context.xml"}) -public class Application { - - private final Logger logger = LoggerFactory.getLogger(Application.class); - - @Value("${container.name}") - private String containerName; - - @Bean - public MeterRegistryCustomizer metricsCommonTags() { - return registry -> registry.config().commonTags("containerName", this.containerName); - } - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - @EventListener(ApplicationReadyEvent.class) - public void startup() { - this.logger.info("Starting application components... Done"); - } -} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml deleted file mode 100644 index 863c2e5..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-context.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml deleted file mode 100644 index ed608e8..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/main/resources/application-default.yaml +++ /dev/null @@ -1,5 +0,0 @@ -#set( $dollar = '$' ) - -logging: - level: - ${groupId}: ${dollar}{LOG_LEVEL:info} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java deleted file mode 100644 index 7bf7fc7..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/HttpRequestIT.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * #%L - * Alfresco Transform Core - * %% - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * - - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - - * Alfresco 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. - * - - * Alfresco 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 Lesser General Public License for more details. - * - - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ -package ${groupId}; - -import java.util.HashSet; -import java.util.Set; - -import javax.annotation.PostConstruct; - -import org.jsoup.Jsoup; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; -import org.junit.Assert; -import org.junit.Test; -import org.junit.Ignore; -import org.junit.runner.RunWith; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.web.client.HttpStatusCodeException; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -public class HttpRequestIT { - - private final Logger logger = LoggerFactory.getLogger(HttpRequestIT.class); - - @LocalServerPort - private int port; - - @Autowired - private TestRestTemplate restTemplate; - - protected String baseUrl; - - @PostConstruct - public void init() { - this.baseUrl = "http://localhost:" + this.port; - } - - @Test - public void testRootPath() { - String result = this.restTemplate.getForObject(this.baseUrl, String.class); - if (this.logger.isDebugEnabled()) - this.logger.debug("testRootPath(): result: " + result); - - Assert.assertNotNull("A result from the HTTP GET was expected", result); - Document htmldoc = Jsoup.parse(result); - Assert.assertNotNull("An HTML compliant result was expected: " + result.substring(0, 50), htmldoc); - - Elements elements = htmldoc.select("html body h2"); - Assert.assertFalse("The HTML body is expected to have an h2 element: html: " + htmldoc.toString(), elements.isEmpty()); - Assert.assertEquals("The HTML body is expected to have just one h2 element", 1, elements.size()); - Assert.assertEquals("The HTML body header is not what was expected", "${shortname} Test Transformation", elements.html()); - - elements = htmldoc.select("html input"); - Set inputs = new HashSet(); - for (Element element : elements) - inputs.add(element.attr("name")); - Assert.assertTrue("The HTML is expected to have a form input for 'file': " + inputs.toString(), inputs.contains("file")); - Assert.assertTrue("The HTML is expected to have a form input for 'targetExtension': " + inputs.toString(), inputs.contains("targetExtension")); - } - - @Test - public void testLogPath() { - String result = this.restTemplate.getForObject(this.baseUrl + "/log", String.class); - if (this.logger.isDebugEnabled()) - this.logger.debug("testLogPath(): result: " + result); - - Assert.assertNotNull("A result from the HTTP GET was expected", result); - Document htmldoc = Jsoup.parse(result); - Assert.assertNotNull("An HTML compliant result was expected: " + result.substring(0, 50), htmldoc); - - Elements elements = htmldoc.select("html body div h2"); - Assert.assertFalse("The HTML is expected to have an html/body/div/h2 element: html: " + htmldoc.select("html").toString(), elements.isEmpty()); - Assert.assertEquals("The HTML is expected to have just one html/body/div/h2 element", 1, elements.size()); - Assert.assertEquals("The HTML body header is not what was expected", "${shortname} Log Entries", elements.html()); - } - - @Test - public void testNoPath() { - try { - ResponseEntity response = this.restTemplate.getForEntity(this.baseUrl + "/doesnotexist", String.class); - Assert.assertEquals("An unexpected path must return a 404 error", 404, response.getStatusCodeValue()); - } catch (HttpStatusCodeException hsce) { - Assert.assertEquals("An unexpected path must return a 404 error", 404, hsce.getRawStatusCode()); - } - } - - @Test - public void testServiceGet() { - try { - ResponseEntity response = this.restTemplate.getForEntity(this.baseUrl + "/transform", String.class); - Assert.assertEquals("An unexpected path must return a 405 error", 405, response.getStatusCodeValue()); - } catch (HttpStatusCodeException hsce) { - Assert.assertEquals("An unexpected path must return a 405 error", 405, hsce.getRawStatusCode()); - } - } - - @Test - public void testServiceNoFile() { - try { - ResponseEntity response = this._testService(null, "trgt"); - Assert.assertEquals("An unexpected path must return a 400 error", 400, response.getStatusCodeValue()); - } catch (HttpStatusCodeException hsce) { - Assert.assertEquals("An unexpected path must return a 400 error", 400, hsce.getRawStatusCode()); - } - } - - @Test @Ignore - public void testServiceNoTargetExtension() { - try { - ResponseEntity response = this._testService("quick.src", null); - Assert.assertEquals("An unexpected path must return a 400 error", 400, response.getStatusCodeValue()); - } catch (HttpStatusCodeException hsce) { - Assert.assertEquals("An unexpected path must return a 400 error", 400, hsce.getRawStatusCode()); - } - } - - @Test @Ignore - public void testServiceQuick() { - this._testService("quick.src", "trgt"); - } - - protected ResponseEntity _testService(String filename, String targetExtension) { - LinkedMultiValueMap parameters = new LinkedMultiValueMap<>(); - if (filename != null) - parameters.add("file", new ClassPathResource(filename)); - if (targetExtension != null) - parameters.add("targetExtension", targetExtension); - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.MULTIPART_FORM_DATA); - HttpEntity> entity = new HttpEntity<>(parameters, headers); - return this.restTemplate.postForEntity(this.baseUrl + "/transform", entity, String.class); - } - -} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java deleted file mode 100644 index 995c3cf..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/java/TransformerControllerTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package ${groupId}; - -import org.alfresco.transformer.AbstractTransformerController; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@WebMvcTest(controllers = TransformerController.class) -public class TransformerControllerTest { - - @Autowired - protected AbstractTransformerController controller; - - @Test @Ignore - public void test() { - - } -} diff --git a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml b/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml deleted file mode 100644 index 316190d..0000000 --- a/beedk-springboot-api-archetype/src/main/resources/archetype-resources/src/test/resources/application-default.yaml +++ /dev/null @@ -1,14 +0,0 @@ -queue: -#set( $dollar = '$' ) - engineRequestQueue: ${dollar}{TRANSFORM_ENGINE_REQUEST_QUEUE:${groupId}.${shortname}.acs} - -transform: - core: - config: - location: classpath:this_engine_config.json - ${shortname}: - version: ${project.version} - -logging: - level: - ${groupId}: ${dollar}{LOG_LEVEL:trace} diff --git a/pom.xml b/pom.xml index 5995484..5a650c1 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,6 @@ beedk-acs-share-module-archetype beedk-ate-archetype beedk-acs-allinone-archetype - beedk-springboot-api-archetype beedk-activiti-ext-archetype beedk-aps-ext-archetype