diff --git a/li.strolch.mvn.archetype.main/.gitignore b/li.strolch.mvn.archetype.main/.gitignore deleted file mode 100644 index 1e97e93ea..000000000 --- a/li.strolch.mvn.archetype.main/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -target/ -.project -.settings -.classpath -*.iml \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/pom.xml b/li.strolch.mvn.archetype.main/pom.xml deleted file mode 100644 index e00764e4d..000000000 --- a/li.strolch.mvn.archetype.main/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - li.strolch - li.strolch - 1.8.0-SNAPSHOT - - 4.0.0 - - li.strolch.mvn.archetype.main - maven-archetype - - - - localhost - file://${project.basedir}/../target/${project.artifactId} - - - - - - - - src/main/resources - false - - - - - - org.apache.maven.archetype - archetype-packaging - ${archetype-packaging.version} - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/META-INF/maven/archetype-metadata.xml b/li.strolch.mvn.archetype.main/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index bad952b51..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Strolch App - - - - - - src/main/java - - - src/main/resources - - - src/test/java - - - src/test/resources - - - runtime - - - - - README.md - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/README.md b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/README.md deleted file mode 100644 index 584d1e00c..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/README.md +++ /dev/null @@ -1,37 +0,0 @@ -Strolch Project: ${appName} / ${artifactId} -====================================== - -This is a Strolch project which is started by a main()-method. It has an example -test class to show how to start an agent for tests. - -The project's runtime directory is in the root folder and contains the -configuration and data files needed to start via the main()-method. - -The test has it's own runtime directory, with its own configuration, but the -model file in the data directory points to the main runtime directory and uses -that model file, so that one does not need to duplicate resource files. - -Preparation ------------------- - -Please change the SCM connection in the pom.xml: - - - - scm:git:https://github.com/4treesCH/strolch.git - scm:git:https://github.com/4treesCH/strolch.git - https://github.com/4treesCH/strolch - - -Running tests -------------------------- - - mvn clean test - - -Running App --------------------------- - - mvn clean compile - mvn exec:java - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/pom.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index e3c8f2458..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,247 +0,0 @@ - - 4.0.0 - - ${groupId} - ${artifactId} - ${appName} - ${version} - jar - - - - scm:git:https://github.com/4treesCH/strolch.git - scm:git:https://github.com/4treesCH/strolch.git - https://github.com/4treesCH/strolch - - - - ${artifactId} - - UTF-8 - yyyy-MM-dd HH:mm:ss - ${maven.build.timestamp} - - 17 - - - 1.7.30 - 1.2.9 - 2.8.9 - - 1.7.0-SNAPSHOT - - - 4.13.2 - 2.2 - - - 1.12.2 - 3.0.0 - 2.8.1 - 3.8.1 - 3.2.1 - 3.10.0 - 2.10 - 3.2.0 - 3.3.2 - 2.2 - 3.3.1 - 3.0.0-M2 - 3.2.0 - 3.2.0 - 3.3.0 - 3.1.2 - 3.0.1 - 1.6.12 - 2.22.2 - 3.0.0 - 3.2.0 - 3.2.0 - - - - - - - li.strolch - li.strolch.bom - pom - ${strolch.version} - import - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - ch.qos.logback - logback-classic - ${logback.version} - runtime - - - - com.google.code.gson - gson - ${gson.version} - - - - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-core - ${hamcrest.version} - test - - - org.hamcrest - hamcrest-library - ${hamcrest.version} - test - - - - - - - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - runtime - - - com.google.code.gson - gson - - - - - li.strolch - li.strolch.model - - - li.strolch - li.strolch.agent - - - li.strolch - li.strolch.service - - - li.strolch - li.strolch.testbase - test - - - - - junit - junit - test - - - org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library - test - - - - - ${appFinalName} - - - - src/main/resources - true - - **/*.properties - - - - src/main/resources - false - - **/*.properties - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - ${buildnumber-maven-plugin.version} - - - validate - - create - - - - - false - false - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${jdk.version} - ${jdk.version} - true - true - -Xlint:all - - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - ${package}.Main - - - - - - - - - - - dev.local - - true - - - dev - - - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml deleted file mode 100644 index c0e3aba5d..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml deleted file mode 100644 index a009e8eb8..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - true - - - true - - - true - - - true - - - - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - li.strolch.service.privilege.users.PrivilegeSetUserPasswordService - li.strolch.service.privilege.users.PrivilegeSetUserLocaleService - - - - - - - li.strolch.service.privilege.users.PrivilegeUpdateUserService - li.strolch.service.privilege.users.PrivilegeUpdateUserRolesService - li.strolch.service.privilege.users.PrivilegeSetUserPasswordService - li.strolch.service.privilege.users.PrivilegeSetUserLocaleService - li.strolch.service.privilege.users.PrivilegeRemoveUserService - li.strolch.service.privilege.users.PrivilegeRemoveRoleFromUserService - li.strolch.service.privilege.users.PrivilegeAddUserService - li.strolch.service.privilege.users.PrivilegeAddRoleToUserService - li.strolch.service.privilege.roles.PrivilegeUpdateRoleService - li.strolch.service.privilege.roles.PrivilegeRemoveRoleService - li.strolch.service.privilege.roles.PrivilegeRemovePrivilegeFromRoleService - li.strolch.service.privilege.roles.PrivilegeAddRoleService - li.strolch.service.privilege.roles.PrivilegeAddOrReplacePrivilegeOnRoleService - - - true - - - true - - - true - - - true - - - true - - - true - - - Reload - GetPolicies - Persist - GetCertificates - PersistSessions - - - true - - - SYSTEM - DISABLED - ENABLED - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - true - - - true - - - true - - - li.strolch.runtime.privilege.StrolchSystemAction - li.strolch.runtime.privilege.StrolchSystemActionWithResult - li.strolch.persistence.postgresql.PostgreSqlSchemaInitializer - - - Persist - GetCertificates - PersistSessions - - - true - - - true - - - true - - - true - - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml deleted file mode 100644 index 27e29a92f..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - User - Bob - ENABLED - en-GB - - AppUser - ModelAccessor - UserPrivileges - - - - - - - - - - Application - Administrator - ENABLED - en-GB - - StrolchAdmin - ModelAccessor - PrivilegeAdmin - - - - - - - - - SYSTEM - - ModelAccessor - PrivilegeAdmin - agent - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml deleted file mode 100644 index 85305a07c..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - ${appName} - - en - true - Europe/Zurich - - - - PrivilegeHandler - li.strolch.runtime.privilege.PrivilegeHandler - li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler - - PrivilegeConfig.xml - - - - RealmHandler - li.strolch.agent.api.RealmHandler - li.strolch.agent.impl.DefaultRealmHandler - PrivilegeHandler - - defaultRealm - TRANSIENT - Model.xml - true - - - - - EnumHandler - li.strolch.runtime.query.enums.EnumHandler - li.strolch.runtime.query.enums.DefaultEnumHandler - RealmHandler - - - - ServiceHandler - li.strolch.service.api.ServiceHandler - li.strolch.service.api.DefaultServiceHandler - RealmHandler - PrivilegeHandler - - true - - - - - PolicyHandler - li.strolch.policy.PolicyHandler - li.strolch.policy.DefaultPolicyHandler - - true - - - - - MigrationsHandler - li.strolch.migrations.MigrationsHandler - li.strolch.migrations.MigrationsHandler - RealmHandler - - - - OperationsLog - li.strolch.handler.operationslog.OperationsLog - li.strolch.handler.operationslog.OperationsLog - RealmHandler - - - - StrolchJobsHandler - li.strolch.job.StrolchJobsHandler - li.strolch.job.StrolchJobsHandler - RealmHandler - - - - PostInitializer - li.strolch.agent.api.PostInitializer - ${package}.PostInitializer - ServiceHandler - - - - - - ExecutionHandler - li.strolch.execution.ExecutionHandler - li.strolch.execution.EventBasedExecutionHandler - PostInitializer - - true - - - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml deleted file mode 100644 index cba3b97d9..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/Model.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/Model.xml deleted file mode 100644 index c6ac1692a..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/Model.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd deleted file mode 100644 index 0375feb57..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd +++ /dev/null @@ -1,201 +0,0 @@ - - - - - This is Version 1.6.x of the StrolchModel XSD. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/Main.java b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/Main.java deleted file mode 100644 index 48bbf83e1..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/Main.java +++ /dev/null @@ -1,50 +0,0 @@ -package ${package}; - -import li.strolch.agent.api.StrolchAgent; -import li.strolch.agent.api.StrolchBootstrapper; -import li.strolch.runtime.configuration.StrolchEnvironment; -import li.strolch.utils.helper.StringHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Main { - - private static final Logger logger = LoggerFactory.getLogger(Main.class); - private static final String APP_NAME = "${appName}"; - - private static StrolchAgent agent; - - public static void main(String[] args) throws Throwable { - - logger.info("Starting " + APP_NAME + "..."); - long start = System.currentTimeMillis(); - try { - // find environment from ENV.properties - String env = StrolchEnvironment.getEnvironmentFromResourceEnv(Main.class); - - // and now start by system properties user.dir - StrolchBootstrapper bootstrapper = new StrolchBootstrapper(Main.class); - Main.agent = bootstrapper.setupByUserDir(env, "runtime"); - Main.agent.initialize(); - Main.agent.start(); - - } catch (Throwable e) { - logger.error("Failed to start " + APP_NAME + " due to: " + e.getMessage(), e); - throw e; - } - - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - Thread.sleep(200); - System.out.println("Shutting down ..."); - Main.agent.stop(); - Main.agent.destroy(); - } catch (InterruptedException e) { - logger.error("Failed to stop " + APP_NAME + " due to " + e.getMessage(), e); - } - })); - - long took = System.currentTimeMillis() - start; - logger.info("Started " + APP_NAME + " in " + (StringHelper.formatMillisecondsDuration(took))); - } -} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/PostInitializer.java b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/PostInitializer.java deleted file mode 100644 index 8174aa8d1..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/java/PostInitializer.java +++ /dev/null @@ -1,87 +0,0 @@ -package ${package}; - -import java.util.concurrent.TimeUnit; - -import li.strolch.agent.api.ComponentContainer; -import li.strolch.agent.api.StrolchAgent; -import li.strolch.agent.impl.SimplePostInitializer; -import li.strolch.execution.ArchiveExecutedActivitiesJob; -import li.strolch.execution.ExecutionHandler; -import li.strolch.handler.mail.MailHandler; -import li.strolch.job.JobMode; -import li.strolch.job.StrolchJobsHandler; -import li.strolch.policy.ReloadPoliciesJob; -import li.strolch.policy.ReloadPrivilegeHandlerJob; -import li.strolch.runtime.configuration.RuntimeConfiguration; -import li.strolch.utils.helper.ExceptionHelper; - -public class PostInitializer extends SimplePostInitializer { - - public PostInitializer(ComponentContainer container, String componentName) { - super(container, componentName); - } - - @Override - public void start() throws Exception { - - registerJobs(); - notifyStart(); - - super.start(); - } - - private void registerJobs() throws Exception { - if (!getContainer().hasComponent(StrolchJobsHandler.class)) - return; - - StrolchJobsHandler jobsHandler = getComponent(StrolchJobsHandler.class); - - // Manually triggered jobs to run once on startup - // jobsHandler.register(XXX.class).runNow(); - - // special jobs which are triggered by an admin, and not run at startup - jobsHandler.register(ReloadPoliciesJob.class); - jobsHandler.register(ReloadPrivilegeHandlerJob.class); - - // recurring jobs - // jobsHandler.registerAndScheduleJob(XXX.class); - - if (getContainer().hasComponent(ExecutionHandler.class)) { - StrolchAgent agent = getContainer().getAgent(); - ArchiveExecutedActivitiesJob archiveExecutedActivitiesJob = new ArchiveExecutedActivitiesJob(agent, - JobMode.Recurring, 5, TimeUnit.MINUTES, 6, TimeUnit.HOURS); - jobsHandler.register(archiveExecutedActivitiesJob).runNow(); - } - } - - private void notifyStart() { - - if (!(getConfiguration().getBoolean("notifyStart", Boolean.FALSE) && getContainer() - .hasComponent(MailHandler.class))) - return; - - String recipients = getConfiguration().getString("notifyStartRecipients", ""); - if (recipients.isEmpty()) { - logger.error("config param notifyStartRecipients is empty, can not notify of boot!"); - return; - } - - StrolchAgent agent = getContainer().getAgent(); - RuntimeConfiguration runtimeConfiguration = agent.getStrolchConfiguration().getRuntimeConfiguration(); - String subject = runtimeConfiguration.getApplicationName() + ":" + runtimeConfiguration.getEnvironment() - + " Startup Complete!"; - - String body = "Dear User\n\n" // - + "The " + getConfiguration().getRuntimeConfiguration().getApplicationName() - + " Server has just completed startup with version " // - + agent.getVersion().getAppVersion().getArtifactVersion() // - + "\n\n" // - + "\tYour Server."; - - try { - getContainer().getComponent(MailHandler.class).sendMail(subject, body, recipients); - } catch (Exception e) { - logger.error("Notifying of server startup failed: " + ExceptionHelper.getRootCause(e), e); - } - } -} diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/ENV.properties b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/ENV.properties deleted file mode 100644 index 8212444c1..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/ENV.properties +++ /dev/null @@ -1 +0,0 @@ -ENV_STROLCH=${strolch.env} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/appVersion.properties b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/appVersion.properties deleted file mode 100644 index a4594a250..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/appVersion.properties +++ /dev/null @@ -1,6 +0,0 @@ -groupId=${project.groupId} -artifactId=${project.artifactId} -artifactVersion=${project.version} -scmRevision=${buildNumber} -scmBranch=${scmBranch} -buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/logback.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/logback.xml deleted file mode 100644 index fcc71f058..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/main/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - %d [%thread] %-5level %class{36}:%line %method - %msg%n - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/java/SimpleTest.java b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/java/SimpleTest.java deleted file mode 100644 index 82529388f..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/java/SimpleTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package ${package}; - -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import li.strolch.model.Resource; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.privilege.model.Certificate; -import li.strolch.testbase.runtime.RuntimeMock; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class SimpleTest { - - private static final String SRC_PATH = "src/test/resources/runtime-SimpleTest"; - private static final String TARGET_PATH = "target/" + SimpleTest.class; - - private static RuntimeMock runtimeMock; - private static Certificate certificate; - - @BeforeClass - public static void beforeClass() { - runtimeMock = new RuntimeMock().mockRuntime(TARGET_PATH, SRC_PATH); - runtimeMock.startContainer(); - certificate = runtimeMock.loginTest(); - } - - @AfterClass - public static void afterClass() { - - if (certificate != null) - runtimeMock.logout(certificate); - - if (runtimeMock != null) - runtimeMock.destroyRuntime(); - } - - @Test - public void shouldLoadIntoRealm() { - - try (StrolchTransaction tx = runtimeMock.openUserTx(certificate, true)) { - - Resource ball = tx.getResourceBy("Ball", "yellowBall", true); - assertTrue(ball.hasParameter("parameters", "color")); - assertEquals("yellow", ball.getParameter("parameters", "color", true).getValue()); - } - } -} diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/logback.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/logback.xml deleted file mode 100644 index fcc71f058..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - %d [%thread] %-5level %class{36}:%line %method - %msg%n - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml deleted file mode 100644 index be4bbfc8e..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml deleted file mode 100644 index 43cc29709..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - li.strolch.runtime.privilege.StrolchSystemAction - li.strolch.runtime.privilege.StrolchSystemActionWithResult - li.strolch.persistence.postgresql.PostgreSqlSchemaInitializer - - - true - - - true - - - true - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - true - - - true - - - true - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml deleted file mode 100644 index 12159214f..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - SYSTEM - - agent - - - - - Application - Administrator - ENABLED - en-GB - - AppUser - - - - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml deleted file mode 100644 index 891421bad..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - ${appName} - - en - true - - - - PrivilegeHandler - li.strolch.runtime.privilege.PrivilegeHandler - li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler - - PrivilegeConfig.xml - - - - RealmHandler - li.strolch.agent.api.RealmHandler - li.strolch.agent.impl.DefaultRealmHandler - PrivilegeHandler - - defaultRealm - TRANSIENT - Model.xml - true - - - - ServiceHandler - li.strolch.service.api.ServiceHandler - li.strolch.service.api.DefaultServiceHandler - RealmHandler - PrivilegeHandler - - true - - - - PostInitializer - li.strolch.agent.api.PostInitializer - ${package}.PostInitializer - ServiceHandler - - - - - diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml deleted file mode 100644 index cba3b97d9..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml deleted file mode 100644 index f81c9843a..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore b/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore deleted file mode 100644 index 738567283..000000000 --- a/li.strolch.mvn.archetype.main/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/sessions.dat diff --git a/li.strolch.mvn.archetype.webapp/.gitignore b/li.strolch.mvn.archetype.webapp/.gitignore deleted file mode 100644 index 1e97e93ea..000000000 --- a/li.strolch.mvn.archetype.webapp/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -target/ -.project -.settings -.classpath -*.iml \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/pom.xml b/li.strolch.mvn.archetype.webapp/pom.xml deleted file mode 100644 index d6f48ee04..000000000 --- a/li.strolch.mvn.archetype.webapp/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - li.strolch - li.strolch - 1.8.0-SNAPSHOT - - 4.0.0 - - li.strolch.mvn.archetype.webapp - maven-archetype - - - - localhost - file://${project.basedir}/../target/${project.artifactId} - - - - - - - - src/main/resources - false - - - - - - org.apache.maven.archetype - archetype-packaging - ${archetype-packaging.version} - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/META-INF/maven/archetype-metadata.xml deleted file mode 100644 index 4e6b912a2..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/META-INF/maven/archetype-metadata.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Strolch App - - - - - - src/main/java - - - src/main/resources - - - src/test/java - - - src/test/resources - - - src/main/webapp/ - - bower.json - package.json - locales.json - app/index.html - app/src/behaviors/c-app-behavior.html - app/src/main/c-drawer.html - - - - src/main/webapp/ - - bower.json - package.json - locales.json - app/index.html - app/src/behaviors/c-app-behavior.html - app/src/main/c-drawer.html - - - - runtime - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/README.md b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/README.md deleted file mode 100644 index 6b8ca14db..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/README.md +++ /dev/null @@ -1,61 +0,0 @@ -Strolch Project: ${appName} / ${artifactId} -====================================== - -This is a Strolch project which is started by a servlet container as this -project builds WARs. - -The project's runtime directory is in the root folder and contains the -configuration and data files needed to start via the `StartupListener`. - -The test has it's own runtime directory, with its own configuration, but the -model file in the data directory points to the main runtime directory and uses -that model file, so that one does not need to duplicate resource files. - -Preparation ------------------- - -Please change the SCM connection in the pom.xml: - - - - scm:git:https://github.com/strolch-li/strolch.git - scm:git:https://github.com/strolch-li/strolch.git - https://github.com/strolch-li/strolch - - -Before you are able to start the app, you need to update the path in the -`StrolchBootstrap.xml` file in web `src/main/webapp/WEB-INF`. There add a new -environment with the following format: - - - ${path.to.runtime.directory} - dev - - -Now install web dependencies: - - cd src/main/webapp - npm install - gulp - - -Running tests -------------------------- - - mvn clean test - - -Building WAR --------------------------- -Without compressing the web files: - - mvn clean package - -With compressing the web files for local runtime: - - mvn clean package -Prelease -Pdev.local - -And if you want to prepare for deployment, which uses a different environment: - - mvn clean package -Prelease -Dstrolch.env= - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/pom.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index a30e3af68..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,432 +0,0 @@ - - 4.0.0 - - ${groupId} - ${artifactId} - ${appName} - ${version} - war - - - - scm:git:https://github.com/strolch-li/strolch.git - scm:git:https://github.com/strolch-li/strolch.git - https://github.com/strolch-li/strolch - - - - ${artifactId} - ${artifactId} - - UTF-8 - yyyy-MM-dd HH:mm:ss - ${maven.build.timestamp} - - 17 - - - 1.7.30 - 1.2.9 - 2.34 - 2.8.9 - 5.0.0 - 42.4.1 - 4.9.3 - 1.3.2 - 1.1.1 - 1.6.2 - 4.0.1 - 2.1.1 - 2.35 - 2.3.1 - 2.3.3 - 2.1.0 - 1.4.2 - 1.17 - 2.4.4 - 1.1 - 2.0.1 - 1.9.0 - 1.6.2 - - - 4.13.2 - 2.2 - - - 1.8.0-SNAPSHOT - - - 1.12.2 - 3.0.0 - 2.8.1 - 3.8.1 - 3.2.1 - 3.10.0 - 2.10 - 3.2.0 - 3.3.2 - 2.2 - 3.3.1 - 3.0.0-M2 - 3.2.0 - 3.2.0 - 3.3.0 - 3.1.2 - 3.0.1 - 1.6.12 - 2.22.2 - 3.0.0 - 3.2.0 - 3.2.0 - - - - - - - li.strolch - li.strolch.bom - pom - ${strolch.version} - import - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - ch.qos.logback - logback-classic - ${logback.version} - runtime - - - - com.google.code.gson - gson - ${gson.version} - - - - - javax.xml.bind - jaxb-api - ${jaxb.api.version} - - - javax.servlet - javax.servlet-api - ${serverlet.version} - provided - - - javax.ws.rs - javax.ws.rs-api - ${jaxrs.api.version} - - - org.glassfish.jersey.bundles - jaxrs-ri - ${jaxrs.ri.version} - - - org.glassfish.jersey - jersey-bom - ${jersey.version} - pom - import - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - - - org.glassfish.tyrus - tyrus-container-grizzly-server - ${tyrus.version} - - - org.glassfish.grizzly - grizzly-framework - ${grizzly.version} - - - - - javax.websocket - javax.websocket-api - ${websocket.version} - provided - - - - - junit - junit - ${junit.version} - test - - - org.hamcrest - hamcrest-core - ${hamcrest.version} - test - - - org.hamcrest - hamcrest-library - ${hamcrest.version} - test - - - - - - - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - compile - - - com.google.code.gson - gson - - - - - li.strolch - li.strolch.model - - - li.strolch - li.strolch.agent - - - li.strolch - li.strolch.rest - - - li.strolch - li.strolch.service - - - li.strolch - li.strolch.testbase - test - - - - - javax.servlet - javax.servlet-api - - - javax.websocket - javax.websocket-api - - - org.glassfish.jersey.bundles - jaxrs-ri - - - org.glassfish.tyrus - tyrus-client - - - org.glassfish.tyrus - tyrus-container-grizzly-client - - - org.glassfish.grizzly - grizzly-framework - - - - - junit - junit - test - - - org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library - test - - - - - ${appFinalName} - - - - src/main/resources - true - - **/*.properties - StrolchBootstrap.xml - - - - src/main/resources - false - - **/*.properties - StrolchBootstrap.xml - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - ${buildnumber-maven-plugin.version} - - - validate - - create - - - - - false - false - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${jdk.version} - ${jdk.version} - true - true - -Xlint:all - - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - false - ${warFinalName} - - - - - - - - - - - dev.local - - true - - - dev.local - - - - - release - - false - - - - - - org.apache.maven.plugins - maven-clean-plugin - ${maven-clean-plugin.version} - - - - src/main/webapp/app/bower_components - - ** - - false - - - - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - exec-npm-install - generate-sources - - npm - - install - - ${basedir}/src/main/webapp - - - exec - - - - exec-gulp - generate-sources - - gulp - ${basedir}/src/main/webapp - - - exec - - - - - - - org.apache.maven.plugins - maven-war-plugin - - false - ${warFinalName} - app/**/*,node_modules/**/* - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml deleted file mode 100644 index 7071dddd7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeConfig.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml deleted file mode 100644 index cdf7da195..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeRoles.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - ${package}.service.CreateBookService - ${package}.service.UpdateBookService - ${package}.service.RemoveBookService - - - - internal - ${package}.search.BookSearch - - - true - - - - - - - - Get - Update - - - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - Get - Update - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - li.strolch.service.privilege.users.PrivilegeSetUserPasswordService - li.strolch.service.privilege.users.PrivilegeSetUserLocaleService - - - - - - - li.strolch.service.privilege.users.PrivilegeUpdateUserService - li.strolch.service.privilege.users.PrivilegeUpdateUserRolesService - li.strolch.service.privilege.users.PrivilegeSetUserPasswordService - li.strolch.service.privilege.users.PrivilegeSetUserLocaleService - li.strolch.service.privilege.users.PrivilegeRemoveUserService - li.strolch.service.privilege.users.PrivilegeRemoveRoleFromUserService - li.strolch.service.privilege.users.PrivilegeAddUserService - li.strolch.service.privilege.users.PrivilegeAddRoleToUserService - li.strolch.service.privilege.roles.PrivilegeUpdateRoleService - li.strolch.service.privilege.roles.PrivilegeRemoveRoleService - li.strolch.service.privilege.roles.PrivilegeRemovePrivilegeFromRoleService - li.strolch.service.privilege.roles.PrivilegeAddRoleService - li.strolch.service.privilege.roles.PrivilegeAddOrReplacePrivilegeOnRoleService - - - true - - - true - - - true - - - true - - - true - - - true - - - Reload - GetPolicies - Persist - GetCertificates - PersistSessions - - - true - - - SYSTEM - DISABLED - ENABLED - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - true - - - true - - - true - - - li.strolch.runtime.privilege.StrolchSystemAction - li.strolch.runtime.privilege.StrolchSystemActionWithResult - li.strolch.persistence.postgresql.PostgreSqlSchemaInitializer - - - Persist - GetCertificates - PersistSessions - - - true - - - true - - - true - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml deleted file mode 100644 index 27e29a92f..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/PrivilegeUsers.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - User - Bob - ENABLED - en-GB - - AppUser - ModelAccessor - UserPrivileges - - - - - - - - - - Application - Administrator - ENABLED - en-GB - - StrolchAdmin - ModelAccessor - PrivilegeAdmin - - - - - - - - - SYSTEM - - ModelAccessor - PrivilegeAdmin - agent - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml deleted file mode 100644 index 5324bdaf7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchConfiguration.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - ${appName} - - en - true - Europe/Zurich - - - - PrivilegeHandler - li.strolch.runtime.privilege.PrivilegeHandler - li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler - - PrivilegeConfig.xml - - - - RealmHandler - li.strolch.agent.api.RealmHandler - li.strolch.agent.impl.DefaultRealmHandler - PrivilegeHandler - - defaultRealm - TRANSIENT - Model.xml - true - - - - - EnumHandler - li.strolch.runtime.query.enums.EnumHandler - li.strolch.runtime.query.enums.DefaultEnumHandler - RealmHandler - - - - ServiceHandler - li.strolch.service.api.ServiceHandler - li.strolch.service.api.DefaultServiceHandler - RealmHandler - PrivilegeHandler - - true - - - - - PolicyHandler - li.strolch.policy.PolicyHandler - li.strolch.policy.DefaultPolicyHandler - - true - - - - - MigrationsHandler - li.strolch.migrations.MigrationsHandler - li.strolch.migrations.MigrationsHandler - RealmHandler - - - - OperationsLog - li.strolch.handler.operationslog.OperationsLog - li.strolch.handler.operationslog.OperationsLog - RealmHandler - - - - StrolchJobsHandler - li.strolch.job.StrolchJobsHandler - li.strolch.job.StrolchJobsHandler - RealmHandler - - - - SessionHandler - li.strolch.rest.StrolchSessionHandler - li.strolch.rest.DefaultStrolchSessionHandler - PrivilegeHandler - - 30 - 10080 - true - - - - RestfulHandler - li.strolch.rest.RestfulStrolchComponent - li.strolch.rest.RestfulStrolchComponent - SessionHandler - - 30 - false - - - - - PostInitializer - li.strolch.agent.api.PostInitializer - ${package}.components.PostInitializer - RestfulHandler - - - - - - ExecutionHandler - li.strolch.execution.ExecutionHandler - li.strolch.execution.EventBasedExecutionHandler - PostInitializer - - true - - - - - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml deleted file mode 100644 index cba3b97d9..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/config/StrolchPolicies.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/Model.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/Model.xml deleted file mode 100644 index 8084d4eda..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/Model.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd deleted file mode 100644 index 0375feb57..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/runtime/data/StrolchModel.xsd +++ /dev/null @@ -1,201 +0,0 @@ - - - - - This is Version 1.6.x of the StrolchModel XSD. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/components/PostInitializer.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/components/PostInitializer.java deleted file mode 100644 index 651f3b19a..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/components/PostInitializer.java +++ /dev/null @@ -1,87 +0,0 @@ -package ${package}.components; - -import java.util.concurrent.TimeUnit; - -import li.strolch.agent.api.ComponentContainer; -import li.strolch.agent.api.StrolchAgent; -import li.strolch.agent.impl.SimplePostInitializer; -import li.strolch.execution.ArchiveExecutedActivitiesJob; -import li.strolch.execution.ExecutionHandler; -import li.strolch.handler.mail.MailHandler; -import li.strolch.job.JobMode; -import li.strolch.job.StrolchJobsHandler; -import li.strolch.policy.ReloadPoliciesJob; -import li.strolch.policy.ReloadPrivilegeHandlerJob; -import li.strolch.runtime.configuration.RuntimeConfiguration; -import li.strolch.utils.helper.ExceptionHelper; - -public class PostInitializer extends SimplePostInitializer { - - public PostInitializer(ComponentContainer container, String componentName) { - super(container, componentName); - } - - @Override - public void start() throws Exception { - - registerJobs(); - notifyStart(); - - super.start(); - } - - private void registerJobs() throws Exception { - if (!getContainer().hasComponent(StrolchJobsHandler.class)) - return; - - StrolchJobsHandler jobsHandler = getComponent(StrolchJobsHandler.class); - - // Manually triggered jobs to run once on startup - // jobsHandler.register(XXX.class).runNow(); - - // special jobs which are triggered by an admin, and not run at startup - jobsHandler.register(ReloadPoliciesJob.class); - jobsHandler.register(ReloadPrivilegeHandlerJob.class); - - // recurring jobs - // jobsHandler.registerAndScheduleJob(XXX.class); - - if (getContainer().hasComponent(ExecutionHandler.class)) { - StrolchAgent agent = getContainer().getAgent(); - ArchiveExecutedActivitiesJob archiveExecutedActivitiesJob = new ArchiveExecutedActivitiesJob(agent, - JobMode.Recurring, 5, TimeUnit.MINUTES, 6, TimeUnit.HOURS); - jobsHandler.register(archiveExecutedActivitiesJob).runNow(); - } - } - - private void notifyStart() { - - if (!(getConfiguration().getBoolean("notifyStart", Boolean.FALSE) && getContainer() - .hasComponent(MailHandler.class))) - return; - - String recipients = getConfiguration().getString("notifyStartRecipients", ""); - if (recipients.isEmpty()) { - logger.error("config param notifyStartRecipients is empty, can not notify of boot!"); - return; - } - - StrolchAgent agent = getContainer().getAgent(); - RuntimeConfiguration runtimeConfiguration = agent.getStrolchConfiguration().getRuntimeConfiguration(); - String subject = runtimeConfiguration.getApplicationName() + ":" + runtimeConfiguration.getEnvironment() - + " Startup Complete!"; - - String body = "Dear User\n\n" // - + "The " + getConfiguration().getRuntimeConfiguration().getApplicationName() - + " Server has just completed startup with version " // - + agent.getVersion().getAppVersion().getArtifactVersion() // - + "\n\n" // - + "\tYour Server."; - - try { - getContainer().getComponent(MailHandler.class).sendMail(subject, body, recipients); - } catch (Exception e) { - logger.error("Notifying of server startup failed: " + ExceptionHelper.getRootCause(e), e); - } - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/Constants.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/Constants.java deleted file mode 100644 index b453fb512..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/Constants.java +++ /dev/null @@ -1,20 +0,0 @@ -package ${package}.model; - -public class Constants { - - public static final String TYPE_BOOK = "Book"; - public static final String TYPE_LOCATION = "Location"; - public static final String TYPE_STOCK = "Stock"; - - public static final String BAG_PARAMETERS = "parameters"; - - public static final String PARAM_STOCK = "stock"; - public static final String PARAM_STOCKS = "stocks"; - public static final String PARAM_BOOK = "book"; - public static final String PARAM_BOOK_NAME = "bookName"; - public static final String PARAM_AUTHOR = "author"; - public static final String PARAM_TITLE = "title"; - public static final String PARAM_CITY = "city"; - -} - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/JsonVisitors.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/JsonVisitors.java deleted file mode 100644 index b489609b7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/model/JsonVisitors.java +++ /dev/null @@ -1,39 +0,0 @@ -package ${package}.model; - -import static ${package}.model.Constants.*; - -import java.util.Optional; - -import com.google.gson.JsonArray; -import li.strolch.model.StrolchElement; -import li.strolch.model.json.StrolchRootElementToJsonVisitor; -import li.strolch.persistence.api.StrolchTransaction; - -public class JsonVisitors { - - public static StrolchRootElementToJsonVisitor toJson() { - return new StrolchRootElementToJsonVisitor().withoutPolicies(); - } - - public static StrolchRootElementToJsonVisitor flatToJson() { - return toJson().withoutVersion().flat(); - } - - public static StrolchRootElementToJsonVisitor bookToJson() { - return flatToJson(); - } - - public static StrolchRootElementToJsonVisitor stockBagToJson(StrolchTransaction tx) { - return flatToJson().bagHook((stockBag, stockJ) -> stockJ.addProperty(PARAM_BOOK_NAME, - Optional.ofNullable(tx.getResourceBy(stockBag.getParameter(PARAM_BOOK), false)) - .map(StrolchElement::getName).orElse("???"))); - } - - public static StrolchRootElementToJsonVisitor locationToJson(StrolchTransaction tx) { - StrolchRootElementToJsonVisitor stockVisitor = stockBagToJson(tx); - return flatToJson().ignoreBagByType(TYPE_STOCK).resourceHook( - (location, locationJ) -> locationJ.add(PARAM_STOCKS, - location.streamOfParameterBagsByType(TYPE_STOCK).map(b -> b.accept(stockVisitor)) - .collect(JsonArray::new, JsonArray::add, JsonArray::addAll))); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/BooksResource.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/BooksResource.java deleted file mode 100644 index d23c960cc..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/BooksResource.java +++ /dev/null @@ -1,157 +0,0 @@ -package ${package}.rest; - -import static ${package}.model.Constants.*; -import static ${package}.model.JsonVisitors.bookToJson; -import static li.strolch.rest.StrolchRestfulConstants.*; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import ${package}.model.Constants; -import ${package}.model.JsonVisitors; -import ${package}.search.BookSearch; -import ${package}.service.CreateBookService; -import ${package}.service.RemoveBookService; -import ${package}.service.UpdateBookService; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import li.strolch.model.Resource; -import li.strolch.model.json.StrolchRootElementToJsonVisitor; -import li.strolch.model.visitor.ResourceVisitor; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.privilege.model.Certificate; -import li.strolch.rest.RestfulStrolchComponent; -import li.strolch.rest.StrolchRestfulConstants; -import li.strolch.rest.helper.ResponseUtil; -import li.strolch.service.JsonServiceArgument; -import li.strolch.service.JsonServiceResult; -import li.strolch.service.StringServiceArgument; -import li.strolch.service.api.ServiceHandler; -import li.strolch.service.api.ServiceResult; -import li.strolch.utils.collections.Paging; - -@Path("books") -public class BooksResource { - - @GET - @Produces(MediaType.APPLICATION_JSON) - public Response query(@Context HttpServletRequest request, @QueryParam("query") String query, - @DefaultValue("0") @QueryParam("offset") int offset, @DefaultValue("20") @QueryParam("limit") int limit) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // open the TX with the certificate, using this class as context - Paging paging; - try (StrolchTransaction tx = RestfulStrolchComponent.getInstance().openTx(cert, getClass())) { - - // perform a book search - paging = new BookSearch() // - .stringQuery(query) // - .search(tx) // - .orderByName(false) // - .toPaging(offset, limit); - } - - return ResponseUtil.toResponse(paging, e -> e.accept(bookToJson())); - } - - @GET - @Path("{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response get(@Context HttpServletRequest request, @PathParam("id") String id) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // open the TX with the certificate, using this class as context - try (StrolchTransaction tx = RestfulStrolchComponent.getInstance().openTx(cert, getClass())) { - - // get the book - Resource book = tx.getResourceBy(TYPE_BOOK, id, true); - - // transform to JSON - JsonObject bookJ = book.accept(bookToJson()); - - // return - return ResponseUtil.toResponse(DATA, bookJ); - } - } - - @POST - @Produces(MediaType.APPLICATION_JSON) - public Response create(@Context HttpServletRequest request, String data) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // parse data to JSON - JsonObject jsonData = JsonParser.parseString(data).getAsJsonObject(); - - // instantiate the service with the argument - CreateBookService svc = new CreateBookService(); - JsonServiceArgument arg = svc.getArgumentInstance(); - arg.jsonElement = jsonData; - - // perform the service - ServiceHandler serviceHandler = RestfulStrolchComponent.getInstance().getServiceHandler(); - JsonServiceResult result = serviceHandler.doService(cert, svc, arg); - - // return depending on the result state - if (result.isOk()) - return ResponseUtil.toResponse(DATA, result.getResult()); - return ResponseUtil.toResponse(result); - } - - @PUT - @Path("{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response update(@Context HttpServletRequest request, @PathParam("id") String id, String data) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // parse data to JSON - JsonObject jsonData = JsonParser.parseString(data).getAsJsonObject(); - - // instantiate the service with the argument - UpdateBookService svc = new UpdateBookService(); - JsonServiceArgument arg = svc.getArgumentInstance(); - arg.objectId = id; - arg.jsonElement = jsonData; - - // perform the service - ServiceHandler serviceHandler = RestfulStrolchComponent.getInstance().getServiceHandler(); - JsonServiceResult result = serviceHandler.doService(cert, svc, arg); - - // return depending on the result state - if (result.isOk()) - return ResponseUtil.toResponse(DATA, result.getResult()); - return ResponseUtil.toResponse(result); - } - - @DELETE - @Path("{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response remove(@Context HttpServletRequest request, @PathParam("id") String id) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // instantiate the service with the argument - RemoveBookService svc = new RemoveBookService(); - StringServiceArgument arg = svc.getArgumentInstance(); - arg.value = id; - - // perform the service - ServiceHandler serviceHandler = RestfulStrolchComponent.getInstance().getServiceHandler(); - ServiceResult result = serviceHandler.doService(cert, svc, arg); - - // return depending on the result state - return ResponseUtil.toResponse(result); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/LocationsResource.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/LocationsResource.java deleted file mode 100644 index a51ff21f8..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/rest/LocationsResource.java +++ /dev/null @@ -1,95 +0,0 @@ -package ${package}.rest; - -import static ${package}.model.Constants.TYPE_LOCATION; -import static ${package}.model.JsonVisitors.locationToJson; -import static li.strolch.rest.StrolchRestfulConstants.DATA; -import static li.strolch.rest.StrolchRestfulConstants.STROLCH_CERTIFICATE; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import ${package}.search.LocationSearch; -import ${package}.service.RemoveLocationService; -import com.google.gson.JsonObject; -import li.strolch.model.Resource; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.privilege.model.Certificate; -import li.strolch.rest.RestfulStrolchComponent; -import li.strolch.rest.helper.ResponseUtil; -import li.strolch.service.StringServiceArgument; -import li.strolch.service.api.ServiceHandler; -import li.strolch.service.api.ServiceResult; -import li.strolch.utils.collections.Paging; - -@Path("locations") -public class LocationsResource { - @GET - @Produces(MediaType.APPLICATION_JSON) - public Response query(@Context HttpServletRequest request, @QueryParam("query") String query, - @DefaultValue("0") @QueryParam("offset") int offset, @DefaultValue("20") @QueryParam("limit") int limit) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // open the TX with the certificate, using this class as context - Paging paging; - try (StrolchTransaction tx = RestfulStrolchComponent.getInstance().openTx(cert, getClass())) { - - // perform a book search - paging = new LocationSearch() // - .stringQuery(query) // - .search(tx) // - .orderByName(false) // - .map(l -> l.accept(locationToJson(tx))) // - .toPaging(offset, limit); - } - - return ResponseUtil.toResponse(paging); - } - - @GET - @Path("{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response get(@Context HttpServletRequest request, @PathParam("id") String id) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // open the TX with the certificate, using this class as context - try (StrolchTransaction tx = RestfulStrolchComponent.getInstance().openTx(cert, getClass())) { - - // get the book - Resource location = tx.getResourceBy(TYPE_LOCATION, id, true); - - // transform to JSON - JsonObject locationJ = location.accept(locationToJson(tx)); - - // return - return ResponseUtil.toResponse(DATA, locationJ); - } - } - - @DELETE - @Path("{id}") - @Produces(MediaType.APPLICATION_JSON) - public Response remove(@Context HttpServletRequest request, @PathParam("id") String id) { - - // this is an authenticated method call, thus we can get the certificate from the request: - Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); - - // instantiate the service with the argument - RemoveLocationService svc = new RemoveLocationService(); - StringServiceArgument arg = svc.getArgumentInstance(); - arg.value = id; - - // perform the service - ServiceHandler serviceHandler = RestfulStrolchComponent.getInstance().getServiceHandler(); - ServiceResult result = serviceHandler.doService(cert, svc, arg); - - // return depending on the result state - return ResponseUtil.toResponse(result); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/BookSearch.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/BookSearch.java deleted file mode 100644 index 5149440f7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/BookSearch.java +++ /dev/null @@ -1,29 +0,0 @@ -package ${package}.search; - -import static ${package}.model.Constants.*; -import static li.strolch.utils.helper.StringHelper.isEmpty; - -import li.strolch.search.ResourceSearch; - -public class BookSearch extends ResourceSearch { - - public BookSearch() { - types(TYPE_BOOK); - } - - public BookSearch stringQuery(String value) { - if (isEmpty(value)) - return this; - - // split by spaces - value = value.trim(); - String[] values = value.split(" "); - - // add where clauses for id, name and description - where(id().containsIgnoreCase(values) // - .or(name().containsIgnoreCase(values)) // - .or(param(BAG_PARAMETERS, PARAM_TITLE).containsIgnoreCase(values))); - - return this; - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/LocationSearch.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/LocationSearch.java deleted file mode 100644 index 74ad40cd2..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/search/LocationSearch.java +++ /dev/null @@ -1,29 +0,0 @@ -package ${package}.search; - -import static ${package}.model.Constants.*; -import static li.strolch.utils.helper.StringHelper.isEmpty; - -import li.strolch.search.ResourceSearch; - -public class LocationSearch extends ResourceSearch { - - public LocationSearch() { - types(TYPE_LOCATION); - } - - public LocationSearch stringQuery(String value) { - if (isEmpty(value)) - return this; - - // split by spaces - value = value.trim(); - String[] values = value.split(" "); - - // add where clauses for id, name and description - where(id().containsIgnoreCase(values) // - .or(name().containsIgnoreCase(values)) // - .or(param(PARAM_CITY).containsIgnoreCase(values))); - - return this; - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/CreateBookService.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/CreateBookService.java deleted file mode 100644 index 575c1ced1..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/CreateBookService.java +++ /dev/null @@ -1,53 +0,0 @@ -package ${package}.service; - -import static ${package}.model.JsonVisitors.bookToJson; -import static li.strolch.model.StrolchModelConstants.BAG_RELATIONS; - -import ${package}.model.Constants; -import com.google.gson.JsonObject; -import li.strolch.model.Resource; -import li.strolch.model.json.FromFlatJsonVisitor; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.service.JsonServiceArgument; -import li.strolch.service.JsonServiceResult; -import li.strolch.service.api.AbstractService; - -public class CreateBookService extends AbstractService { - - @Override - protected JsonServiceResult getResultInstance() { - return new JsonServiceResult(); - } - - @Override - public JsonServiceArgument getArgumentInstance() { - return new JsonServiceArgument(); - } - - @Override - protected JsonServiceResult internalDoService(JsonServiceArgument arg) throws Exception { - - // open a new transaction, using the realm from the argument, or the certificate - Resource book; - try (StrolchTransaction tx = openArgOrUserTx(arg)) { - - // get a new book "instance" from the template - book = tx.getResourceTemplate(Constants.TYPE_BOOK); - - // map all values from the JSON object into the new book element - book.accept(new FromFlatJsonVisitor(arg.jsonElement.getAsJsonObject()).ignoreBag(BAG_RELATIONS)); - - // save changes - tx.add(book); - - // notify the TX that it should commit on close - tx.commitOnClose(); - } - - // map the return value to JSON - JsonObject result = book.accept(bookToJson()); - - // and return the result - return new JsonServiceResult(result); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveBookService.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveBookService.java deleted file mode 100644 index a27d864c6..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveBookService.java +++ /dev/null @@ -1,41 +0,0 @@ -package ${package}.service; - -import ${package}.model.Constants; -import li.strolch.model.Resource; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.service.StringServiceArgument; -import li.strolch.service.api.AbstractService; -import li.strolch.service.api.ServiceResult; - -public class RemoveBookService extends AbstractService { - - @Override - protected ServiceResult getResultInstance() { - return new ServiceResult(); - } - - @Override - public StringServiceArgument getArgumentInstance() { - return new StringServiceArgument(); - } - - @Override - protected ServiceResult internalDoService(StringServiceArgument arg) throws Exception { - - // open a new transaction, using the realm from the argument, or the certificate - try (StrolchTransaction tx = openArgOrUserTx(arg)) { - - // get the existing book - Resource book = tx.getResourceBy(Constants.TYPE_BOOK, arg.value, true); - - // save changes - tx.remove(book); - - // notify the TX that it should commit on close - tx.commitOnClose(); - } - - // and return the result - return ServiceResult.success(); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveLocationService.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveLocationService.java deleted file mode 100644 index af95dc205..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/RemoveLocationService.java +++ /dev/null @@ -1,42 +0,0 @@ -package ${package}.service; - -import static ${package}.model.Constants.TYPE_LOCATION; - -import li.strolch.model.Resource; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.service.StringServiceArgument; -import li.strolch.service.api.AbstractService; -import li.strolch.service.api.ServiceResult; - -public class RemoveLocationService extends AbstractService { - - @Override - protected ServiceResult getResultInstance() { - return new ServiceResult(); - } - - @Override - public StringServiceArgument getArgumentInstance() { - return new StringServiceArgument(); - } - - @Override - protected ServiceResult internalDoService(StringServiceArgument arg) throws Exception { - - // open a new transaction, using the realm from the argument, or the certificate - try (StrolchTransaction tx = openArgOrUserTx(arg)) { - - // get the existing book - Resource location = tx.getResourceBy(TYPE_LOCATION, arg.value, true); - - // save changes - tx.remove(location); - - // notify the TX that it should commit on close - tx.commitOnClose(); - } - - // and return the result - return ServiceResult.success(); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/UpdateBookService.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/UpdateBookService.java deleted file mode 100644 index 2d1dc7ec7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/service/UpdateBookService.java +++ /dev/null @@ -1,59 +0,0 @@ -package ${package}.service; - -import static li.strolch.model.StrolchModelConstants.BAG_RELATIONS; - -import ${package}.model.Constants; -import com.google.gson.JsonObject; -import li.strolch.model.Resource; -import li.strolch.model.Tags.Json; -import li.strolch.model.json.FromFlatJsonVisitor; -import li.strolch.model.json.StrolchRootElementToJsonVisitor; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.service.JsonServiceArgument; -import li.strolch.service.JsonServiceResult; -import li.strolch.service.api.AbstractService; -import li.strolch.utils.dbc.DBC; - -public class UpdateBookService extends AbstractService { - - @Override - protected JsonServiceResult getResultInstance() { - return new JsonServiceResult(); - } - - @Override - public JsonServiceArgument getArgumentInstance() { - return new JsonServiceArgument(); - } - - @Override - protected JsonServiceResult internalDoService(JsonServiceArgument arg) throws Exception { - - // verify same book - DBC.PRE.assertEquals("ObjectId and given Id must be same!", arg.objectId, - arg.jsonElement.getAsJsonObject().get(Json.ID).getAsString()); - - // open a new transaction, using the realm from the argument, or the certificate - Resource book; - try (StrolchTransaction tx = openArgOrUserTx(arg)) { - - // get the existing book - book = tx.getResourceBy(Constants.TYPE_BOOK, arg.objectId, true); - - // map all values from the JSON object into the new book element - book.accept(new FromFlatJsonVisitor(arg.jsonElement.getAsJsonObject()).ignoreBag(BAG_RELATIONS)); - - // save changes - tx.update(book); - - // notify the TX that it should commit on close - tx.commitOnClose(); - } - - // map the return value to JSON - JsonObject result = book.accept(new StrolchRootElementToJsonVisitor().flat()); - - // and return the result - return new JsonServiceResult(result); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/RestfulApplication.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/RestfulApplication.java deleted file mode 100644 index ed8763c38..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/RestfulApplication.java +++ /dev/null @@ -1,71 +0,0 @@ -package ${package}.web; - -import static ${package}.web.StartupListener.APP_NAME; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.Priorities; -import java.util.logging.Level; - -import ${package}.rest.BooksResource; -import li.strolch.rest.RestfulStrolchComponent; -import li.strolch.rest.StrolchRestfulExceptionMapper; -import li.strolch.rest.endpoint.*; -import li.strolch.rest.filters.*; -import org.glassfish.jersey.logging.LoggingFeature; -import org.glassfish.jersey.server.ResourceConfig; -import org.glassfish.jersey.server.ServerProperties; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@ApplicationPath("rest") -public class RestfulApplication extends ResourceConfig { - - private static final Logger logger = LoggerFactory.getLogger(RestfulApplication.class); - - public RestfulApplication() { - setApplicationName(APP_NAME); - - // add project resources by package name - packages(BooksResource.class.getPackage().getName()); - - // strolch services - register(AuthenticationService.class); - register(StrolchJobsResource.class); - register(ReportResource.class); - register(ControlResource.class); - register(EnumQuery.class); - register(Inspector.class); - register(UserSessionsService.class); - register(PrivilegeUsersService.class); - register(PrivilegeRolesService.class); - register(PrivilegePoliciesService.class); - register(OperationsLogResource.class); - register(VersionQuery.class); - - // filters - register(AuthenticationRequestFilter.class, Priorities.AUTHENTICATION); - register(AccessControlResponseFilter.class); - register(AuthenticationResponseFilter.class); - register(HttpCacheResponseFilter.class); - - // log exceptions and return them as plain text to the caller - register(StrolchRestfulExceptionMapper.class); - - // the JSON generated is in UTF-8 - register(CharsetResponseFilter.class); - - RestfulStrolchComponent restfulComponent = RestfulStrolchComponent.getInstance(); - if (restfulComponent.isRestLogging()) { - register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), - Level.SEVERE, LoggingFeature.Verbosity.PAYLOAD_ANY, Integer.MAX_VALUE)); - - property(ServerProperties.TRACING, "ALL"); - property(ServerProperties.TRACING_THRESHOLD, "TRACE"); - } - - logger.info( - "Initialized REST application " + getApplicationName() + " with " + getClasses().size() + " classes, " - + getInstances().size() + " instances, " + getResources().size() + " resources and " - + getProperties().size() + " properties"); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/StartupListener.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/StartupListener.java deleted file mode 100644 index c4ed7417d..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/java/web/StartupListener.java +++ /dev/null @@ -1,67 +0,0 @@ -package ${package}.web; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; -import java.io.InputStream; - -import ch.qos.logback.classic.LoggerContext; -import ch.qos.logback.classic.util.ContextInitializer; -import li.strolch.agent.api.StrolchAgent; -import li.strolch.agent.api.StrolchBootstrapper; -import li.strolch.utils.helper.StringHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.impl.StaticLoggerBinder; - -@WebListener -public class StartupListener implements ServletContextListener { - - private static final Logger logger = LoggerFactory.getLogger(StartupListener.class); - public static final String APP_NAME = "eSyTest"; - - private StrolchAgent agent; - - @Override - public void contextInitialized(ServletContextEvent sce) { - - logger.info("Starting " + APP_NAME + "..."); - long start = System.currentTimeMillis(); - try { - String bootstrapFileName = "/" + StrolchBootstrapper.FILE_BOOTSTRAP; - InputStream bootstrapFile = getClass().getResourceAsStream(bootstrapFileName); - StrolchBootstrapper bootstrapper = new StrolchBootstrapper(StartupListener.class); - this.agent = bootstrapper.setupByBootstrapFile(StartupListener.class, bootstrapFile); - this.agent.initialize(); - this.agent.start(); - } catch (Throwable e) { - logger.error("Failed to start " + APP_NAME + " due to: " + e.getMessage(), e); - throw e; - } - - long took = System.currentTimeMillis() - start; - logger.info("Started " + APP_NAME + " in " + (StringHelper.formatMillisecondsDuration(took))); - } - - @Override - public void contextDestroyed(ServletContextEvent sce) { - try { - new ContextInitializer((LoggerContext) StaticLoggerBinder.getSingleton().getLoggerFactory()).autoConfig(); - } catch (Exception e) { - System.err.println("Failed to reconfigure logging..."); - e.printStackTrace(System.err); - } - - if (this.agent != null) { - logger.info("Destroying " + APP_NAME + "..."); - try { - this.agent.stop(); - this.agent.destroy(); - } catch (Throwable e) { - logger.error("Failed to stop " + APP_NAME + " due to: " + e.getMessage(), e); - throw e; - } - } - logger.info("Destroyed " + APP_NAME); - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/ENV.properties b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/ENV.properties deleted file mode 100644 index 8212444c1..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/ENV.properties +++ /dev/null @@ -1 +0,0 @@ -ENV_STROLCH=${strolch.env} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/StrolchBootstrap.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/StrolchBootstrap.xml deleted file mode 100644 index 4e7f4951a..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/StrolchBootstrap.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - dev - - - runtime - - - - - - - - - - - - - ${project.basedir}/runtime - dev - - - - /absolute/path/to/runtime - test - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/appVersion.properties b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/appVersion.properties deleted file mode 100644 index a4594a250..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/appVersion.properties +++ /dev/null @@ -1,6 +0,0 @@ -groupId=${project.groupId} -artifactId=${project.artifactId} -artifactVersion=${project.version} -scmRevision=${buildNumber} -scmBranch=${scmBranch} -buildTimestamp=${buildTimestamp} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml deleted file mode 100644 index fcc71f058..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - %d [%thread] %-5level %class{36}:%line %method - %msg%n - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.bowerrc b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.bowerrc deleted file mode 100755 index 5773025bf..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "app/bower_components" -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.gitignore b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.gitignore deleted file mode 100644 index 20efec5fc..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -package-lock.json -node_modules/ -app/bower_components/ -www/ \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/.gitignore b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/.gitignore deleted file mode 100644 index b34062e0c..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/classes/ -/lib/ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 8f93aec12..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - org.apache.tomcat.websocket.textBufferSize - 1048576 - - - org.apache.tomcat.websocket.binaryBufferSize - 1048576 - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/CustomWeb.js b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/CustomWeb.js deleted file mode 100644 index 1b141774e..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/CustomWeb.js +++ /dev/null @@ -1,12 +0,0 @@ -CustomWeb = { - // -}; - -(function () { - var basePath = window.location.pathname.substr(0, window.location.pathname.indexOf('/index.html')); - basePath = basePath.substr(0, basePath.lastIndexOf('/')); - CustomWeb.baseRestPath = basePath + '/rest'; - console.log('Base REST Path is ' + CustomWeb.baseRestPath); - CustomWeb.baseWsPath = basePath + '/websocket'; - console.log('Base WebSocket Path is ' + CustomWeb.baseWsPath); -})(); diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Bold.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Bold.ttf deleted file mode 100644 index c2293d5c8..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Bold.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf deleted file mode 100644 index ce6e784df..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Italic.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Italic.ttf deleted file mode 100644 index a599244e7..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Italic.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Light.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Light.ttf deleted file mode 100644 index b310d150b..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Light.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-LightItalic.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-LightItalic.ttf deleted file mode 100644 index ad0741b4a..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-LightItalic.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Medium.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Medium.ttf deleted file mode 100644 index 7340a40aa..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Medium.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf deleted file mode 100644 index 36ac1aed6..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Regular.ttf b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Regular.ttf deleted file mode 100644 index f98a2dab8..000000000 Binary files a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/font/Ubuntu-Regular.ttf and /dev/null differ diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/index.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/index.html deleted file mode 100644 index ce2fb14d2..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - ${appName} - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-app-behavior.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-app-behavior.html deleted file mode 100644 index 84016ef53..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-app-behavior.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-component-behavior.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-component-behavior.html deleted file mode 100644 index cd272831b..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-component-behavior.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-drawer.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-drawer.html deleted file mode 100644 index 38ff65594..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-drawer.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-main.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-main.html deleted file mode 100644 index c4845cc72..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-main.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-pages.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-pages.html deleted file mode 100644 index 2e57cc660..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/main/c-pages.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/styles/c-app-style.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/styles/c-app-style.html deleted file mode 100644 index 08da0f735..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/styles/c-app-style.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/utils/c-app-routing.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/utils/c-app-routing.html deleted file mode 100644 index c80e0c205..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/utils/c-app-routing.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-books.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-books.html deleted file mode 100644 index b3ed26406..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-books.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-locations.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-locations.html deleted file mode 100644 index 6b511a01b..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-demo-locations.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-view404.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-view404.html deleted file mode 100644 index e1e1914a7..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/views/c-view404.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-books-table.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-books-table.html deleted file mode 100644 index 1e5bced79..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-books-table.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-detail.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-detail.html deleted file mode 100644 index 44ca3c705..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-detail.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-table.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-table.html deleted file mode 100644 index 660587c77..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/widgets/c-demo-location-table.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/bower.json b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/bower.json deleted file mode 100644 index c4ba2f713..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/bower.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "${artifactId}", - "authors": [ - "Robert von Burg " - ], - "private": true, - "dependencies": { - "strolchjs": "strolch-li/strolchjs#^0.5.3", - "strolch-wc-styles": "strolch-li/strolch-wc-styles#^0.4.8", - "strolch-wc-auth": "strolch-li/strolch-wc-auth#^0.9.9", - "strolch-wc-badge": "strolch-li/strolch-wc-badge#^0.1.4", - "strolch-wc-notification": "strolch-li/strolch-wc-notification#^0.1.1", - "strolch-wc-inspector": "strolch-li/strolch-wc-inspector#^0.23.6", - "strolch-wc-util-behavior": "strolch-li/strolch-wc-util-behavior#^0.3.7", - "strolch-wc-localize-behavior": "strolch-li/strolch-wc-localize-behavior#^1.1.15", - "strolch-wc-debounced-input": "strolch-li/strolch-wc-debounced-input#^0.1.6", - "strolch-wc-dialog-button": "strolch-li/strolch-wc-dialog-button#^0.1.7", - "strolch-wc-information-dialog": "strolch-li/strolch-wc-information-dialog#^0.1.14", - "strolch-wc-parameter-input": "strolch-li/strolch-wc-parameter-input#^0.1.5", - "strolch-wc-reports": "strolch-li/strolch-wc-reports#^0.5.3", - "strolch-wc-paging": "strolch-li/strolch-wc-paging#^0.1.7", - "strolch-wc-ws-observer": "strolch-li/strolch-wc-ws-observer#^0.2.11", - "strolch-wc-tree": "strolch-li/strolch-wc-tree#^0.2.6", - - "polymer": "Polymer/polymer#^1.12.0", - "iron-pages": "PolymerElements/iron-pages#^1.0.9", - "font-awesome": "FortAwesome/Font-Awesome#^4.7.0", - "app-route": "PolymerElements/app-route#^1.0.1", - "app-layout": "PolymerElements/app-layout#^1.0.1", - "paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^1.5.1", - "paper-menu": "PolymerElements/paper-menu#^1.3.0", - "paper-icon-button": "PolymerElements/paper-icon-button#^1.1.6", - "paper-header-panel": "PolymerElements/paper-header-panel#^1.1.7", - "paper-input": "PolymerElements/paper-input#^1.1.24", - "paper-radio-group": "PolymerElements/paper-radio-group#^1.2.2", - "paper-toggle-button": "PolymerElements/paper-toggle-button#^1.3.0", - "paper-toast": "PolymerElements/paper-toast#^1.3.1" - }, - "devDependencies": { - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/gulpfile.js b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/gulpfile.js deleted file mode 100644 index 017ff6a81..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/gulpfile.js +++ /dev/null @@ -1,93 +0,0 @@ -const gulp = require('gulp'); -const $ = require('gulp-load-plugins')(); -const merge = require('merge-stream'); -const del = require('del'); - -// temporary until gulp 4.0 is released -const runSequence = require('run-sequence'); - -const vulcanize = require('gulp-vulcanize'); -const minify = require('gulp-minify'); -const crisper = require('gulp-crisper'); -const shell = require('gulp-shell'); -const rename = require("gulp-rename"); -const replace = require('gulp-replace'); - -// Copy All Files At The Root Level -gulp.task('copy', function () { - - var svg = gulp.src([ - 'app/**/*.svg', '!app/bower_components/**/hero.svg', '!app/bower_components/mocha/**/*', '!app/bower_components/**/{demo,test,site}/**/*' - ]) - .pipe(gulp.dest('www/')); - - var font = gulp.src([ - 'app/font/*' - ]) - .pipe(gulp.dest('www/font/')); - - var imgs = gulp.src([ - 'app/img/*.svg', 'app/img/*.ico', 'app/img/*.png', 'app/img/*.gif' - ]) - .pipe(gulp.dest('www/img/')); - - var locales = gulp.src([ - 'app/bower_components/**/locales.json' - ]) - .pipe(gulp.dest('www/bower_components/')); - - var app_files = gulp.src([ - 'app/bower.json', 'app/manifest.json', 'app/locales.json', '**/moment.min.js' - ]) - .pipe(gulp.dest('www/')); - - var js = gulp.src([ - 'src/**/*' - ]) - .pipe(gulp.dest('js')); - - return merge(svg, font, imgs, locales, app_files, js) - .pipe($.size({title: 'Copy app files to dist dir:'})); -}); - -gulp.task('vulcanize', function () { - return gulp.src('app/index.html') - .pipe(vulcanize({ - stripComments: true, - inlineScripts: true, - inlineCss: true - })) - .pipe(replace('', '')) - .pipe(replace("font-family: 'Roboto', 'Noto', sans-serif;", "font-family: 'Ubuntu-local', sans-serif;")) - .pipe(crisper()) - .pipe(gulp.dest('www/')); -}); - -gulp.task('compress', function () { - return gulp.src('www/index.js') - .pipe(minify({})) - .pipe(gulp.dest('www/')) -}); - -// Clean Output Directory -gulp.task('clean-www', del.bind(null, ['www/'])); - -// Remove unneeded files -gulp.task('del-files', del.bind(null, ['www/index-min.js'])); -gulp.task('move-indexjs-js', function () { - return gulp.src('./www/index-min.js') // - .pipe(rename('index.js')) - .pipe(gulp.dest('./www/')); -}); - -// bower install -gulp.task('bower', shell.task('bower install')); - -// Build Production Files, the Default Task -gulp.task('prepare', ['bower'], function (cb) { - runSequence('clean-www', cb); -}); - -gulp.task('default', ['prepare'], function (cb) { - runSequence('copy', 'vulcanize', 'compress', 'del-files', cb); -}); diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/index.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/index.html deleted file mode 100644 index a1ff9e757..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/locales.json b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/locales.json deleted file mode 100644 index f7043f7a5..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/locales.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "de": { - "appTitle": "${appName}", - "demo-locations": "Demo Locations", - "demo-books": "Demo Books", - "title": "Title", - "author": "Author", - "logout": "Ausloggen", - "language": "Sprache", - "reports": "Berichte", - "operations-log": "Betriebsnachrichten", - "jobs": "Jobs", - "sessions": "Sitzungen", - "users": "Benutzer", - "roles": "Rollen", - "control": "Control", - "inspector": "Inspector", - "newVersionAvailableRefreshRequired": "Eine neue Version steht zur Verfügung", - "refresh": "Aktualisieren", - "close": "Schliessen", - "cancel": "Abbrechen", - "ok": "Ok", - "reconnect": "Wiederhestellen", - "serverNotAvailable": "Server nicht erreichbar", - "serverNotAvailableMsg": "Die Verbindung zum Server ist zur Zeit unterbrochen", - "privilegeDenied": "Aktion verweigert", - "privilegeDeniedText": "Die Aktion wurde verweigert.", - "sessionInvalid": "Sitzung ungültig", - "sessionInvalidConfirmNavToLogin": "Die Sitzung ist abgelaufen oder ungültig. Bitte neu anmelden.", - "sessionInvalidLoggingBackIn": "Die Sitzung ist ungültig oder abgelaufen, automatische Anmeldung wird ausgeführt...", - "errorOccurred": "Ein Fehler ist aufgetreten", - "login": "Login", - "i18n-editor": "Internationalisierungs Editor", - "user": "Benutzer", - "mode": "Modus", - "enable": "Aktivieren", - "disable": "Deaktivieren", - "status": "Status", - "id": "ID", - "deleted": "Gelöscht", - "date": "Datum", - "Created": "Erstellt", - "Planning": "In Planung", - "Planned": "Geplant", - "Execution": "In Ausführung", - "Warning": "Warnung", - "Error": "Fehler", - "Executed": "Ausgeführt", - "Closed": "Geschlossen", - "keepAlive": "Eingeloggt bleiben", - "systemAction.failed": "Systembefehl {action} fehlgeschlagen: {reason}", - "enabled": "Aktiv", - "severity": "Schweregrad", - "true": "Ja", - "false": "Nein", - "Info": "Information", - "Exception": "Ausnahme", - "clearInactiveMessages": "Inaktive Meldungen entfernen", - "clearInactiveMessagesConfirm": "Sollen alle inaktive Meldungen entfernt werden?", - "executionDate": "Ausführungsdatum", - "orderDate": "Auftragsdatum", - "info": "Information", - "agent.service.failed.access.denied": "Benutzer {user} darf Service {service} nicht ausführen", - "agent.query.failed.access.denied": "Benutzer {user} darf Abfrage {query} nicht ausführen", - "agent.search.failed.access.denied": "Benutzer {user} darf Suche {search} nicht ausführen" - }, - "en": { - "agent.service.failed.access.denied": "User {user} may not perform service {service}", - "agent.query.failed.access.denied": "User {user} may not perform query {query}", - "agent.search.failed.access.denied": "User {user} may not perform search {search}", - "demo-locations": "Demo Locations", - "demo-books": "Demo Books", - "title": "Titel", - "author": "Author", - "logout": "Logout", - "info": "Information", - "keepAlive": "Stay logged in", - "appTitle": "${appName}", - "language": "Language", - "reports": "Reports", - "operations-log": "Operation Logs", - "jobs": "Jobs", - "sessions": "Sessions", - "users": "Users", - "roles": "Roles", - "control": "Control", - "inspector": "Inspector", - "newVersionAvailableRefreshRequired": "A new version is available", - "refresh": "Refresh", - "close": "Close", - "cancel": "Cancel", - "ok": "Ok", - "reconnect": "Reconnect", - "serverNotAvailable": "Server not available", - "serverNotAvailableMsg": "The connection to the server is currently not available", - "privilegeDenied": "Action denied", - "privilegeDeniedText": "The action has been denied", - "sessionInvalid": "Session Invalid", - "sessionInvalidConfirmNavToLogin": "The session has expired or is invalid. Please logon again.", - "sessionInvalidLoggingBackIn": "The session is invalid or has expired, automatic logon has commenced...", - "enabled": "Active", - "severity": "Severity", - "true": "Yes", - "false": "No", - "Info": "Information", - "Exception": "Exception", - "clearInactiveMessages": "Remove inactive messages", - "clearInactiveMessagesConfirm": "Should all inactive messages be removed?", - "errorOccurred": "An error occurred", - "systemAction.failed": "SystemAction {action} failed: {reason}", - "Created": "Created", - "Planning": "Planning", - "Planned": "Planned", - "Execution": "Execution", - "Warning": "Warning", - "Error": "Error", - "Executed": "Executed", - "Closed": "Closed", - "date": "Date", - "deleted": "Deleted", - "id": "ID", - "status": "Status", - "enable": "Enable", - "disable": "Disable", - "mode": "Mode", - "user": "User", - "i18n-editor": "Internationalization editor", - "login": "Login" - }, - "fr": { - "appTitle": "${appName}", - "demo-locations": "Demo Locations", - "demo-books": "Demo Books", - "language": "Langue", - "reports": "Rapports", - "operations-log": "Logs", - "jobs": "Jobs", - "sessions": "Sessions", - "users": "Utilisateurs", - "roles": "Rôles", - "control": "Controle", - "inspector": "Inspecteur", - "newVersionAvailableRefreshRequired": "Une nouvelle version est disponible!", - "refresh": "Actualiser", - "close": "Fermer", - "cancel": "Annuler", - "ok": "Ok", - "reconnect": "Reconnecter", - "serverNotAvailable": "Server indisponible", - "serverNotAvailableMsg": "La connexion au serveur est indisponible", - "privilegeDenied": "Action refusée", - "privilegeDeniedText": "L'action a été refusée.", - "sessionInvalid": "Session invalide", - "sessionInvalidConfirmNavToLogin": "La session a expirée, veuillez vous reconnecter.", - "sessionInvalidLoggingBackIn": "La session a expirée, reconnexion automatiqque...", - "errorOccurred": "Une erreur s'est produite", - "agent.service.failed.access.denied": "Utilisateur {user} ne peut exécuter le service {service}", - "agent.query.failed.access.denied": "Utilisateur {user} ne peut exécuter la demande {query}", - "agent.search.failed.access.denied": "Utilisateur {user} ne peut exécuter la recherche {search}" - } -} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/package.json b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/package.json deleted file mode 100644 index a261ef647..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "${artifactId}", - "description": "${appName}", - "version": "0.1.0", - "private": true, - "repository": { - "type": "git", - "url": "https://github.com/strolch-li/strolch.git" - }, - "author": "Robert von Burg ", - "license": "Proprietary", - "keywords": [], - "bugs": { - "url": "https://github.com/strolch-li/strolch/issues" - }, - "homepage": "https://www.strolch.li", - "devDependencies": { - "bower": "^1.8.8", - "del": "^2.2.2", - "gulp": "^3.9.1", - "gulp-crisper": "^1.1.0", - "gulp-imagemin": "^7.1.0", - "gulp-load-plugins": "^1.4.0", - "gulp-minify": "0.0.15", - "gulp-rename": "^1.2.2", - "gulp-shell": "^0.8.0", - "gulp-size": "^2.1.0", - "gulp-vulcanize": "^6.1.0", - "gulp-replace": "^1.1.3", - "merge-stream": "^1.0.0", - "run-sequence": "^1.2.2", - "vulcanize": "^1.15.3" - }, - "scripts": { - "postinstall": "bower install" - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/java/test/SimpleTest.java b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/java/test/SimpleTest.java deleted file mode 100644 index acc5d1474..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/java/test/SimpleTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package ${package}.test; - -import static ${package}.model.Constants.TYPE_BOOK; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertEquals; - -import li.strolch.model.Resource; -import li.strolch.persistence.api.StrolchTransaction; -import li.strolch.privilege.model.Certificate; -import li.strolch.testbase.runtime.RuntimeMock; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class SimpleTest { - - private static final String SRC_PATH = "src/test/resources/runtime-SimpleTest"; - private static final String TARGET_PATH = "target/" + SimpleTest.class; - - private static RuntimeMock runtimeMock; - private static Certificate certificate; - - @BeforeClass - public static void beforeClass() { - runtimeMock = new RuntimeMock().mockRuntime(TARGET_PATH, SRC_PATH); - runtimeMock.startContainer(); - certificate = runtimeMock.loginTest(); - } - - @AfterClass - public static void afterClass() { - - if (certificate != null) - runtimeMock.logout(certificate); - - if (runtimeMock != null) - runtimeMock.destroyRuntime(); - } - - @Test - public void shouldLoadIntoRealm() { - - try (StrolchTransaction tx = runtimeMock.openUserTx(certificate, true)) { - - Resource book = tx.getResourceBy(TYPE_BOOK, "book1", true); - assertTrue(book.hasParameter("author")); - assertEquals("Roger Penrose", book.getParameter("author", true).getValue()); - } - } -} diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml deleted file mode 100644 index fcc71f058..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - %d [%thread] %-5level %class{36}:%line %method - %msg%n - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml deleted file mode 100644 index c0e3aba5d..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeConfig.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml deleted file mode 100644 index 69c94084b..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeRoles.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - true - - - true - - - true - - - - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - - - - true - - - true - - - true - - - li.strolch.runtime.privilege.StrolchSystemAction - li.strolch.runtime.privilege.StrolchSystemActionWithResult - li.strolch.persistence.postgresql.PostgreSqlSchemaInitializer - - - Persist - GetCertificates - PersistSessions - - - true - - - true - - - true - - - true - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml deleted file mode 100644 index 12159214f..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/PrivilegeUsers.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - SYSTEM - - agent - - - - - Application - Administrator - ENABLED - en-GB - - AppUser - - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml deleted file mode 100644 index b87be7f8a..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchConfiguration.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - ${appName} - - en - true - - - - PrivilegeHandler - li.strolch.runtime.privilege.PrivilegeHandler - li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler - - PrivilegeConfig.xml - - - - RealmHandler - li.strolch.agent.api.RealmHandler - li.strolch.agent.impl.DefaultRealmHandler - PrivilegeHandler - - defaultRealm - TRANSIENT - Model.xml - true - - - - ServiceHandler - li.strolch.service.api.ServiceHandler - li.strolch.service.api.DefaultServiceHandler - RealmHandler - PrivilegeHandler - - true - - - - PostInitializer - li.strolch.agent.api.PostInitializer - ${package}.components.PostInitializer - ServiceHandler - - - - - diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml deleted file mode 100644 index cba3b97d9..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/config/StrolchPolicies.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml deleted file mode 100644 index f81c9843a..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/data/Model.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore deleted file mode 100644 index 738567283..000000000 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/test/resources/runtime-SimpleTest/temp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/sessions.dat diff --git a/pom.xml b/pom.xml index ab7a29368..41956b62f 100644 --- a/pom.xml +++ b/pom.xml @@ -170,9 +170,6 @@ li.strolch.performancetest li.strolch.bom - li.strolch.mvn.archetype.main - li.strolch.mvn.archetype.webapp -