diff --git a/li.strolch.mvn.archetype.plc/.gitignore b/li.strolch.mvn.archetype.plc/.gitignore new file mode 100644 index 0000000..1e97e93 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/.gitignore @@ -0,0 +1,5 @@ +target/ +.project +.settings +.classpath +*.iml \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/pom.xml b/li.strolch.mvn.archetype.plc/pom.xml new file mode 100644 index 0000000..4218963 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/pom.xml @@ -0,0 +1,41 @@ + + + + li.strolch + li.strolch-maven-archetypes + 0.1.0-SNAPSHOT + ../pom.xml + + 4.0.0 + + li.strolch.mvn.archetype.plc + 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.plc/src/main/resources/META-INF/maven/archetype-metadata.xml b/li.strolch.mvn.archetype.plc/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000..cd77da6 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,109 @@ + + + + + Strolch App + + + + + + + + src/main/java + + + + + + + + src/main/java + + + src/main/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 + + + + + + + + src/main/java + + + src/main/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 + + + + + + + + + + README.md + + + ${rootArtifactId}-shared + ${rootArtifactId}-web + ${rootArtifactId}-plc-web + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/README.md b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/README.md new file mode 100644 index 0000000..4b7ec26 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/README.md @@ -0,0 +1,4 @@ +Strolch Project: ${appName} / ${artifactId} +====================================== + +This is an example app for Strolch PLC. It is a multi-module project. \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/pom.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/pom.xml new file mode 100644 index 0000000..eb54254 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/pom.xml @@ -0,0 +1,270 @@ + + 4.0.0 + + + ${groupId} + ${rootArtifactId} + ${version} + ../pom.xml + + + ${rootArtifactId}-plc-web + ${rootArtifactId}-plc-web + war + + + plc + plc + + + + + + + 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 + + + li.strolch + li.strolch.persistence.xml + + + + + li.strolch + strolch-plc-core + + + li.strolch + strolch-plc-rest + + + li.strolch + strolch-plc-gw-client + + + li.strolch + strolch-plc-util + + + + + ${groupId} + ${rootArtifactId}-shared + + + + + com.google.code.gson + gson + + + javax.servlet + javax.servlet-api + + + javax.websocket + javax.websocket-api + + + org.glassfish.jersey.bundles + jaxrs-ri + + + + + junit + junit + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeConfig.xml new file mode 100644 index 0000000..7071ddd --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeConfig.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeRoles.xml new file mode 100644 index 0000000..8b42517 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeRoles.xml @@ -0,0 +1,196 @@ + + + + + + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeUsers.xml new file mode 100644 index 0000000..a85e7d7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/PrivilegeUsers.xml @@ -0,0 +1,25 @@ + + + + + Admin + Admin + ENABLED + en-GB + + ModelAccessor + PrivilegeAdmin + StrolchAdmin + UserPrivileges + + + + SYSTEM + en + + ModelAccessor + PrivilegeAdmin + agent + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchConfiguration.xml new file mode 100644 index 0000000..4866155 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchConfiguration.xml @@ -0,0 +1,157 @@ + + + + + ${appName} PLC + + en + true + Europe/Zurich + + + + + PrivilegeHandler + li.strolch.runtime.privilege.PrivilegeHandler + li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler + + + RealmHandler + li.strolch.agent.api.RealmHandler + li.strolch.agent.impl.DefaultRealmHandler + PrivilegeHandler + + defaultRealm + TRANSIENT + defaultModel.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 + + + + MigrationsHandler + li.strolch.migrations.MigrationsHandler + li.strolch.migrations.MigrationsHandler + RealmHandler + + + + OperationsLog + li.strolch.handler.operationslog.OperationsLog + li.strolch.handler.operationslog.OperationsLog + RealmHandler + + 200 + + + + + 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 + + false + + + + + PlcHandler + li.strolch.plc.core.PlcHandler + li.strolch.plc.core.DefaultPlcHandler + RealmHandler + + li.strolch.plc.core.hw.DefaultPlc + plc-01 + + + + + PostInitializer + li.strolch.agent.api.PostInitializer + li.strolch.plc.core.PlcPostInitializer + StrolchJobsHandler + PlcServiceInitializer + + + + ExecutionHandler + li.strolch.execution.ExecutionHandler + li.strolch.execution.EventBasedExecutionHandler + PostInitializer + + true + + + + + PlcServiceInitializer + li.strolch.plc.core.PlcServiceInitializer + ${package}.plc.web.components.CustomPlcServiceInitializer + PlcHandler + + + + PlcGwClientHandler + li.strolch.plc.gw.client.PlcGwClientHandler + li.strolch.plc.gw.client.PlcGwClientHandler + PlcHandler + PlcServiceInitializer + + plc-01 + plc-01 + ws://localhost:8080/${rootArtifactId}-web/websocket/strolch/plc + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchPolicies.xml new file mode 100644 index 0000000..cba3b97 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/config/StrolchPolicies.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/README.md b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/README.md new file mode 100644 index 0000000..18d56fb --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/README.md @@ -0,0 +1,8 @@ +# README for Address mappings +Use the following Google Sheet to easily define the address mappings: + +https://docs.google.com/spreadsheets/d/10fgTfR3FZCVbQ5bbh0xB1u8rLIaw2KEyO45VMv7y5ho/edit?usp=sharing + +Download the sheet `strolch-plc-example` + +And then run `li.strolch.plc.core.util.PlcAddressGeneratorTest` to generate the Plc address mappings. diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/StrolchModel.xsd b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/StrolchModel.xsd new file mode 100644 index 0000000..0375feb --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/StrolchModel.xsd @@ -0,0 +1,201 @@ + + + + + This is Version 1.6.x of the StrolchModel XSD. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/defaultModel.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/defaultModel.xml new file mode 100644 index 0000000..d9de723 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/defaultModel.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-state.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-state.xml new file mode 100644 index 0000000..41b3b33 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-state.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-templates.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-templates.xml new file mode 100644 index 0000000..90bd5d7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/plc-templates.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example-connections.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example-connections.xml new file mode 100644 index 0000000..7a6c906 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example-connections.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.csv b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.csv new file mode 100644 index 0000000..9dd910c --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.csv @@ -0,0 +1,59 @@ +Description,Type,SubType,Device,Pin,Resource,Action1,Action2,Connection,DeviceId,Inverted,Value,Remote +Mode,Group,,,,,,,,Mode,,, +Automatic Mode,Virtual,Boolean,,,AutomaticMode,On,Off,VirtualBoolean.AutomaticMode,,,,TRUE +Stop All Actors,Virtual,Boolean,,,StopAllActors,Now,,VirtualBoolean.StopAllActors,,,,TRUE +Sector 1,Group,,,,,,,,Conveyor01,,, +Motor Conveyor B1.1,Output,DevPin0,1,1,Sector01,Motor1On,Motor1Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B1.1 ,Input,DevPin0,1,1,Sector01,Motor1Fault,,i2cInput.dev01,,,, +Motor Conveyor B1.2,Output,DevPin0,1,2,Sector01,Motor2On,Motor2Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B1.2,Input,DevPin0,1,2,Sector01,Motor2Fault,,i2cInput.dev01,,,, +Start Button Conveyor 1,Input,DevPin0,1,8,Sector01,StartButton,,i2cInput.dev01,,TRUE,, +Light Barrier Conveyor 1,Input,DevPin0,2,1,Sector01,BoxDetected,,i2cInput.dev02,,,, +Emergency Stop Sector 1,Input,DevPin0,3,2,Sector01,EmergencyStop,,i2cInput.dev03,,,,TRUE +Sector 2,,,,,,,,,Conveyor03,,, +Motor Conveyor B2.1,Output,DevPin0,1,3,Sector02,Motor1On,Motor1Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B2.1 ,Input,DevPin0,1,3,Sector02,Motor1Fault,,i2cInput.dev01,,,, +Motor Conveyor B2.2,Output,DevPin0,1,4,Sector02,Motor2On,Motor2Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B2.2,Input,DevPin0,1,4,Sector02,Motor2Fault,,i2cInput.dev01,,,, +Light Barrier Conveyor 2,Input,DevPin0,2,2,Sector02,BoxDetectedStart,,i2cInput.dev02,,,, +Light Barrier Conveyor End 2,Input,DevPin0,2,3,Sector02,BoxDetectedEnd,,i2cInput.dev02,,,, +Sector 3 Fill Station,Group,,,,,,,,BoxFillStation,,, +Request Next Container,Virtual,Boolean,-,,FillStation,NextContainer,NextContainerDone,VirtualBoolean.NextContainer,,,,TRUE +Release Current Container,Virtual,Boolean,-,,FillStation,ReleaseContainer,ReleaseContainerDone,VirtualBoolean.ReleaseContainer,,,,TRUE +Current Container,Virtual,String,-,,FillStation,CurrentContainer,,VirtualString.CurrentContainer,,,,TRUE +Motor Conveyor B3,Output,DevPin0,1,5,FillStation,MotorOn,MotorOff,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B3,Input,DevPin0,1,5,FillStation,MotorFault,,i2cInput.dev01,,,, +Entry Stopper Open Valve,Output,DevPin0,2,1,FillStation,EntryOpen,EntryClose,i2cOutput.dev02,,,, +Entry Stopper Opened,Input,DevPin0,3,4,FillStation,EntryClosed,,i2cInput.dev03,,TRUE,,TRUE +Entry Stopper Closed,Input,DevPin0,3,5,FillStation,EntryOpened,,i2cInput.dev03,,TRUE,,TRUE +Light Barrier Fill Station Occupied,Input,DevPin0,2,4,FillStation,Occupied,,i2cInput.dev02,,,,TRUE +Fill Station Barcode Reader,DataLogicScanner,,-,,DataLogicScanner,,,dataLogicScanner,,,, +Exit Stopper Open Valve,Output,DevPin0,2,2,FillStation,ExitOpen,ExitClose,i2cOutput.dev02,,,, +Exit Stopper Opened,Input,DevPin0,3,6,FillStation,ExitClosed,,i2cInput.dev03,,TRUE,,TRUE +Exit Stopper Closed,Input,DevPin0,3,7,FillStation,ExitOpened,,i2cInput.dev03,,TRUE,,TRUE +Emergency Stop Sector 3,Input,DevPin0,3,3,FillStation,EmergencyStop,,i2cInput.dev03,,,,TRUE +Signallampe,Group,,,,,,,,Alarm,,, +Signal Horn,Output,DevPin0,2,3,Alarm,Horn,,i2cOutput.dev02,,,, +Signal Warning,Output,DevPin0,2,4,Alarm,Warning,,i2cOutput.dev02,,,, +Signal Operation,Output,DevPin0,2,5,Alarm,Operational,,i2cOutput.dev02,,,, +Sector 4,Group,,,,,,,,Conveyor05,,, +Motor Conveyor B4.1,Output,DevPin0,1,6,Sector04,Motor1On,Motor1Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B4.1 ,Input,DevPin0,1,6,Sector04,Motor1Fault,,i2cInput.dev01,,,, +Motor Conveyor B4.2,Output,DevPin0,1,7,Sector04,Motor2On,Motor2Off,i2cOutput.dev01,,,, +Signal Motor Fault Conveyor B4.2,Input,DevPin0,1,7,Sector04,Motor2Fault,,i2cInput.dev01,,,, +Light Barrier Conveyor 4,Input,DevPin0,2,5,Sector04,BoxDetected,,i2cInput.dev02,,,, +Control Cabinet,Group,,,,,,,,Cabinet,,, +Power Supply Control 5V,Input,DevPin0,2,6,Cabinet,Power5V,,i2cInput.dev02,,TRUE,, +Power Supply Drives 24V,Input,DevPin0,2,7,Cabinet,Power24VMotors,,i2cInput.dev02,,TRUE,, +Power Supply Sensor / Actors 24V,Input,DevPin0,2,8,Cabinet,Power24VSensors,,i2cInput.dev02,,TRUE,, +Security Relay Operational,Input,DevPin0,3,1,SecurityRelay,Operational,,i2cInput.dev03,,TRUE,,TRUE +Security Relay Acknowledge,Output,DevPin0,1,8,SecurityRelay,Reset,,i2cOutput.dev01,,,, +Configuration,Group,,,,,,,,Configuration,,, +Transfer time Sector 1.1,Virtual,Integer,-,,Sector01,TransferDuration1,,VirtualInteger.Sector01TransferDuration1,,,30, +Transfer time Sector 1.2,Virtual,Integer,-,,Sector01,TransferDuration2,,VirtualInteger.Sector01TransferDuration2,,,30, +Transfer time Sector 2.1,Virtual,Integer,-,,Sector02,TransferDuration1,,VirtualInteger.Sector02TransferDuration1,,,30, +Transfer time Sector 2.2,Virtual,Integer,-,,Sector02,TransferDuration2,,VirtualInteger.Sector02TransferDuration2,,,30, +Transfer time Fill Station,Virtual,Integer,-,,FillStation,TransferDuration,,VirtualInteger.FillStationTransferDuration,,,10, +Barcode scan duration,Virtual,Integer,-,,DataLogicScanner,ScanDuration,,VirtualInteger.DataLogicScannerScanDuration,,,4, +Transfer time Sector 4.1,Virtual,Integer,-,,Sector04,TransferDuration1,,VirtualInteger.Sector04TransferDuration1,,,30, +Transfer time Sector 4.2,Virtual,Integer,-,,Sector04,TransferDuration2,,VirtualInteger.Sector04TransferDuration2,,,30, \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.xml new file mode 100644 index 0000000..63ff768 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/runtime/data/strolch-plc-example.xml @@ -0,0 +1,1132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/CustomPlcServiceInitializer.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/CustomPlcServiceInitializer.java new file mode 100644 index 0000000..87fd5fb --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/CustomPlcServiceInitializer.java @@ -0,0 +1,26 @@ +package ${package}.plc.web.components; + +import java.util.ArrayList; +import java.util.List; + +import ${package}.plc.web.services.StartupPlcService; +import li.strolch.agent.api.ComponentContainer; +import li.strolch.plc.core.PlcHandler; +import li.strolch.plc.core.PlcService; +import li.strolch.plc.core.PlcServiceInitializer; + +public class CustomPlcServiceInitializer extends PlcServiceInitializer { + + public CustomPlcServiceInitializer(ComponentContainer container, String componentName) { + super(container, componentName); + } + + @Override + protected List getPlcServices(PlcHandler plcHandler) { + ArrayList plcServices = new ArrayList<>(); + + plcServices.add(new StartupPlcService(plcHandler)); + + return plcServices; + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/PostInitializer.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/PostInitializer.java new file mode 100644 index 0000000..f6d9ede --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/components/PostInitializer.java @@ -0,0 +1,87 @@ +package ${package}.plc.web.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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/services/StartupPlcService.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/services/StartupPlcService.java new file mode 100644 index 0000000..996d700 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/services/StartupPlcService.java @@ -0,0 +1,26 @@ +package ${package}.plc.web.services; + +import static ${package}.plc.shared.SharedPlcConstants.*; + +import li.strolch.persistence.api.StrolchTransaction; +import li.strolch.plc.core.PlcHandler; +import li.strolch.plc.core.PlcService; + +public class StartupPlcService extends PlcService { + + public StartupPlcService(PlcHandler plcHandler) { + super(plcHandler); + } + + @Override + public void start(StrolchTransaction tx) { + send(PLC, STARTED); + super.start(tx); + } + + @Override + public void stop() { + send(PLC, STOPPED); + super.stop(); + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/RestfulApplication.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/RestfulApplication.java new file mode 100644 index 0000000..03b3ed9 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/RestfulApplication.java @@ -0,0 +1,50 @@ +package ${package}.plc.web.web; + +import static ${package}.plc.web.web.StartupListener.APP_NAME; + +import javax.ws.rs.ApplicationPath; +import java.util.logging.Level; + +import li.strolch.plc.rest.PlcConnectionsResource; +import li.strolch.rest.RestfulStrolchComponent; +import li.strolch.rest.StrolchRestfulClasses; +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); + + // strolch services + for (Class clazz : StrolchRestfulClasses.getRestfulClasses()) { + register(clazz); + } + packages(PlcConnectionsResource.class.getPackage().getName()); + + // filters + for (Class clazz : StrolchRestfulClasses.getProviderClasses()) { + register(clazz); + } + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/StartupListener.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/StartupListener.java new file mode 100644 index 0000000..fae927b --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/java/plc/web/web/StartupListener.java @@ -0,0 +1,108 @@ +package ${package}.plc.web.web; + +import static li.strolch.utils.helper.ExceptionHelper.hasCause; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; +import java.io.File; +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.exception.StrolchException; +import li.strolch.rest.RestfulStrolchComponent; +import li.strolch.utils.helper.FileHelper; +import li.strolch.utils.helper.StringHelper; +import li.strolch.xmlpers.api.XmlPersistenceException; +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 = "MyApp"; + + private StrolchAgent agent; + + @Override + public void contextInitialized(ServletContextEvent sce) { + + logger.info("Starting " + APP_NAME + "..."); + long start = System.currentTimeMillis(); + try { + startStrolch(sce); + } 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))); + } + + private void startStrolch(ServletContextEvent sce) { + + String bootstrapFileName = "/" + StrolchBootstrapper.FILE_BOOTSTRAP; + InputStream bootstrapFile = getClass().getResourceAsStream(bootstrapFileName); + StrolchBootstrapper bootstrapper = new StrolchBootstrapper(StartupListener.class); + this.agent = bootstrapper.setupByBootstrapFile(StartupListener.class, bootstrapFile); + + try { + this.agent.initialize(); + this.agent.start(); + RestfulStrolchComponent.getInstance().setWebPath(sce.getServletContext().getRealPath("/")); + } catch (StrolchException e) { + + if (!hasCause(e, XmlPersistenceException.class)) + throw e; + + logger.error( + "Failed to start Strolch due to a XmlPersistenceException. Deleting local dbStore and restarting the agent..."); + + this.agent.stop(); + this.agent.destroy(); + + File dataPath = this.agent.getStrolchConfiguration().getRuntimeConfiguration().getDataPath(); + File dbStorePath = new File(dataPath, "dbStore"); + if (dbStorePath.exists()) { + if (!FileHelper.deleteFile(dbStorePath, true)) + throw new IllegalStateException( + "Strolch failed to load due to a persistence exception, could not delete dbStore, so failing hard!"); + + // now try again to start + bootstrapper = new StrolchBootstrapper(StartupListener.class); + bootstrapFile = getClass().getResourceAsStream(bootstrapFileName); + this.agent = bootstrapper.setupByBootstrapFile(StartupListener.class, bootstrapFile); + this.agent.initialize(); + this.agent.start(); + } + } + } + + @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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/ENV.properties b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/ENV.properties new file mode 100644 index 0000000..8212444 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/ENV.properties @@ -0,0 +1 @@ +ENV_STROLCH=${strolch.env} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/StrolchBootstrap.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/StrolchBootstrap.xml new file mode 100644 index 0000000..4e7f495 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/StrolchBootstrap.xml @@ -0,0 +1,32 @@ + + + + + + + + dev + + + runtime + + + + + + + + + + + + + ${project.basedir}/runtime + dev + + + + /absolute/path/to/runtime + test + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/appVersion.properties b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/appVersion.properties new file mode 100644 index 0000000..a4594a2 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/appVersion.properties @@ -0,0 +1,6 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/logback.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/logback.xml new file mode 100644 index 0000000..fcc71f0 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + + + %d [%thread] %-5level %class{36}:%line %method - %msg%n + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/.bowerrc b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/.bowerrc new file mode 100644 index 0000000..5773025 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/WEB-INF/web.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..8f93aec --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,15 @@ + + + + + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/CustomWeb.js b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/CustomWeb.js new file mode 100644 index 0000000..1b14177 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/CustomWeb.js @@ -0,0 +1,12 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Bold.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Bold.ttf new file mode 100644 index 0000000..c2293d5 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Bold.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf new file mode 100644 index 0000000..ce6e784 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Italic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Italic.ttf new file mode 100644 index 0000000..a599244 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Italic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Light.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Light.ttf new file mode 100644 index 0000000..b310d15 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Light.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf new file mode 100644 index 0000000..ad0741b Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Medium.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Medium.ttf new file mode 100644 index 0000000..7340a40 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Medium.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf new file mode 100644 index 0000000..36ac1ae Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Regular.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Regular.ttf new file mode 100644 index 0000000..f98a2da Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/font/Ubuntu-Regular.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/index.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/index.html new file mode 100644 index 0000000..ce2fb14 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/index.html @@ -0,0 +1,42 @@ + + + + + ${appName} + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-app-behavior.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-app-behavior.html new file mode 100644 index 0000000..84016ef --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-app-behavior.html @@ -0,0 +1,199 @@ + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-component-behavior.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-component-behavior.html new file mode 100644 index 0000000..cd27283 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/behaviors/c-component-behavior.html @@ -0,0 +1,30 @@ + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-drawer.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-drawer.html new file mode 100644 index 0000000..82561dd --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-drawer.html @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-main.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-main.html new file mode 100644 index 0000000..c4845cc --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-main.html @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-pages.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-pages.html new file mode 100644 index 0000000..b2f8a8a --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/main/c-pages.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/styles/c-app-style.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/styles/c-app-style.html new file mode 100644 index 0000000..08da0f7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/styles/c-app-style.html @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/utils/c-app-routing.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/utils/c-app-routing.html new file mode 100644 index 0000000..a290e8c --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/utils/c-app-routing.html @@ -0,0 +1,148 @@ + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/views/c-view404.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/views/c-view404.html new file mode 100644 index 0000000..e1e1914 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/app/src/views/c-view404.html @@ -0,0 +1,46 @@ + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/bower.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/bower.json new file mode 100644 index 0000000..3c0fa1a --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/bower.json @@ -0,0 +1,43 @@ +{ + "name": "${rootArtifactId}-plc-web", + "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", + + "strolch-wc-plc": "strolch-li/strolch-wc-plc#^0.3.19", + + "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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/gulpfile.js b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/gulpfile.js new file mode 100644 index 0000000..017ff6a --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/gulpfile.js @@ -0,0 +1,93 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/index.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/index.html new file mode 100644 index 0000000..a1ff9e7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/locales.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/locales.json new file mode 100644 index 0000000..747bf6e --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/locales.json @@ -0,0 +1,155 @@ +{ + "en": { + "plcConnections": "PLC Connections", + "plcLogicalDevices": "PLC Logical Devices", + "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}", + "logout": "Logout", + "info": "Information", + "keepAlive": "Stay logged in", + "appTitle": "${appName} PLC", + "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" + }, + "de": { + "appTitle": "${appName} Steuerung", + "plcConnections": "SPS Verbindungen", + "plcLogicalDevices": "SPS Logische Geräte", + "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" + }, + "fr": { + "appTitle": "${appName} Controle", + "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.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/package.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/package.json new file mode 100644 index 0000000..7ae3819 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-plc-web/src/main/webapp/package.json @@ -0,0 +1,37 @@ +{ + "name": "${rootArtifactId}-plc-web", + "description": "${appName}", + "version": "${version}", + "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.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/pom.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/pom.xml new file mode 100644 index 0000000..74ba52c --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/pom.xml @@ -0,0 +1,100 @@ + + + 4.0.0 + + + ${groupId} + ${rootArtifactId} + ${version} + ../pom.xml + + + ${rootArtifactId}-shared + ${rootArtifactId}-shared + jar + + + + + + + + + + org.slf4j + slf4j-api + + + ch.qos.logback + logback-classic + + + + + li.strolch + li.strolch.model + + + li.strolch + li.strolch.agent + + + li.strolch + li.strolch.service + + + li.strolch + strolch-plc-model + + + + + com.google.code.gson + gson + + + + + junit + junit + test + + + + + + + + + src/main/resources + true + + **/*.properties + + + + src/main/resources + false + + **/*.properties + + + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/src/main/java/plc/shared/SharedPlcConstants.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/src/main/java/plc/shared/SharedPlcConstants.java new file mode 100644 index 0000000..acb593c --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-shared/src/main/java/plc/shared/SharedPlcConstants.java @@ -0,0 +1,78 @@ +package ${package}.plc.shared; + +public class SharedPlcConstants { + + public static final String PARAM_AUTOMATIC_MODE = "automaticMode"; + public static final String PARAM_PLC_STARTED = "plcStarted"; + public static final String PARAM_PLC_CONNECTED = "plcConnected"; + + public static final String R_ALARM = "Alarm"; + public static final String R_AUTOMATIC_MODE = "AutomaticMode"; + public static final String R_CABINET = "Cabinet"; + public static final String R_DATA_LOGIC_SCANNER = "DataLogicScanner"; + public static final String R_FILL_STATION = "FillStation"; + public static final String R_SECTOR_01 = "Sector01"; + public static final String R_SECTOR_02 = "Sector02"; + public static final String R_SECTOR_04 = "Sector04"; + public static final String R_SECURITY_RELAY = "SecurityRelay"; + public static final String R_STOP_ALL_ACTORS = "StopAllActors"; + + public static final String R_BUTTON_1 = "Button1"; + public static final String R_BUTTON_2 = "Button2"; + public static final String R_BUTTON_3 = "Button3"; + public static final String R_LED_1 = "Led1"; + public static final String R_LED_2 = "Led2"; + + public static final String A_PRESSED = "Pressed"; + public static final String A_RELEASED = "Released"; + + public static final String A_BOX_DETECTED = "BoxDetected"; + public static final String A_BOX_DETECTED_END = "BoxDetectedEnd"; + public static final String A_BOX_DETECTED_START = "BoxDetectedStart"; + public static final String A_CURRENT_CONTAINER = "CurrentContainer"; + public static final String A_EMERGENCY_STOP = "EmergencyStop"; + public static final String A_ENTRY_CLOSE = "EntryClose"; + public static final String A_ENTRY_CLOSED = "EntryClosed"; + public static final String A_ENTRY_OPEN = "EntryOpen"; + public static final String A_ENTRY_OPENED = "EntryOpened"; + public static final String A_EXIT_CLOSE = "ExitClose"; + public static final String A_EXIT_CLOSED = "ExitClosed"; + public static final String A_EXIT_OPEN = "ExitOpen"; + public static final String A_EXIT_OPENED = "ExitOpened"; + public static final String A_HORN = "Horn"; + public static final String A_MOTOR_1_FAULT = "Motor1Fault"; + public static final String A_MOTOR_1_OFF = "Motor1Off"; + public static final String A_MOTOR_1_ON = "Motor1On"; + public static final String A_MOTOR_2_FAULT = "Motor2Fault"; + public static final String A_MOTOR_2_OFF = "Motor2Off"; + public static final String A_MOTOR_2_ON = "Motor2On"; + public static final String A_MOTOR_FAULT = "MotorFault"; + public static final String A_MOTOR_OFF = "MotorOff"; + public static final String A_MOTOR_ON = "MotorOn"; + public static final String A_NEXT_CONTAINER = "NextContainer"; + public static final String A_NEXT_CONTAINER_DONE = "NextContainerDone"; + public static final String A_NOW = "Now"; + public static final String A_OCCUPIED = "Occupied"; + public static final String A_OFF = "Off"; + public static final String A_ON = "On"; + public static final String A_OPERATIONAL = "Operational"; + public static final String A_POWER_5V = "Power5V"; + public static final String A_POWER_24V_MOTORS = "Power24VMotors"; + public static final String A_POWER_24V_SENSORS = "Power24VSensors"; + public static final String A_RELEASE_CONTAINER = "ReleaseContainer"; + public static final String A_RELEASE_CONTAINER_DONE = "ReleaseContainerDone"; + public static final String A_RESET = "Reset"; + public static final String A_SCAN_DURATION = "ScanDuration"; + public static final String A_START_BUTTON = "StartButton"; + public static final String A_TRANSFER_DURATION = "TransferDuration"; + public static final String A_TRANSFER_DURATION_1 = "TransferDuration1"; + public static final String A_TRANSFER_DURATION_2 = "TransferDuration2"; + public static final String A_WARNING = "Warning"; + + public static final String PLC = "PLC"; + public static final String STARTED = "Started"; + public static final String STOPPED = "Stopped"; + + public static final String ROLE_SHOP_FLOOR = "ShopFloor"; + +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/pom.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/pom.xml new file mode 100644 index 0000000..48a0250 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/pom.xml @@ -0,0 +1,249 @@ + + 4.0.0 + + + ${groupId} + ${rootArtifactId} + ${version} + ../pom.xml + + + ${rootArtifactId}-web + ${rootArtifactId}-web + war + + + ${rootArtifactId}-web + ${rootArtifactId}-web + + + + + + + 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 + + + + + li.strolch + strolch-plc-gw-server + + + + + ${groupId} + ${rootArtifactId}-shared + + + + + javax.servlet + javax.servlet-api + + + javax.websocket + javax.websocket-api + + + org.glassfish.jersey.bundles + jaxrs-ri + + + + + junit + junit + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeConfig.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeConfig.xml new file mode 100644 index 0000000..7071ddd --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeConfig.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeRoles.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeRoles.xml new file mode 100644 index 0000000..c5bdcba --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeRoles.xml @@ -0,0 +1,216 @@ + + + + + + true + + + true + + + true + + + EnableAutomaticMode + DisableAutomaticMode + StopAll + + + + + + + + + + + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeUsers.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeUsers.xml new file mode 100644 index 0000000..b500f75 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/PrivilegeUsers.xml @@ -0,0 +1,41 @@ + + + + + + PLC + 01 + ENABLED + en + + PLC + + + + + + Application + Administrator + ENABLED + en-GB + + StrolchAdmin + ShopFloor + ModelAccessor + PrivilegeAdmin + + + + + + + + + SYSTEM + + ModelAccessor + PrivilegeAdmin + agent + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchConfiguration.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchConfiguration.xml new file mode 100644 index 0000000..a1f1538 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchConfiguration.xml @@ -0,0 +1,132 @@ + + + + + ${appName} + + en + true + Europe/Zurich + + + + PrivilegeHandler + li.strolch.runtime.privilege.PrivilegeHandler + li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler + + + 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 + + + + 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 + + false + + + + + PostInitializer + li.strolch.agent.api.PostInitializer + ${package}.server.web.components.PostInitializer + RestfulHandler + + + + ExecutionHandler + li.strolch.execution.ExecutionHandler + li.strolch.execution.EventBasedExecutionHandler + PostInitializer + + true + + + + + PlcGwServerHandler + li.strolch.plc.gw.server.PlcGwServerHandler + li.strolch.plc.gw.server.PlcGwServerHandler + ServiceHandler + + plc-server + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchPolicies.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchPolicies.xml new file mode 100644 index 0000000..cba3b97 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/config/StrolchPolicies.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/Model.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/Model.xml new file mode 100644 index 0000000..70fc329 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/Model.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/StrolchModel.xsd b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/StrolchModel.xsd new file mode 100644 index 0000000..0375feb --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/runtime/data/StrolchModel.xsd @@ -0,0 +1,201 @@ + + + + + This is Version 1.6.x of the StrolchModel XSD. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/components/PostInitializer.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/components/PostInitializer.java new file mode 100644 index 0000000..0a05353 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/components/PostInitializer.java @@ -0,0 +1,124 @@ +package ${package}.server.web.components; + +import static li.strolch.plc.model.PlcConstants.PARAM_PLC_ID; + +import java.util.concurrent.TimeUnit; + +import ${package}.server.web.service.plc.ModePlcSrvService; +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.persistence.api.StrolchTransaction; +import li.strolch.plc.gw.server.PlcGwServerHandler; +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 { + + private ModePlcSrvService modePlcService; + + public PostInitializer(ComponentContainer container, String componentName) { + super(container, componentName); + } + + @Override + public void start() throws Exception { + + registerJobs(); + registerPlcServices(); + notifyStart(); + + super.start(); + } + + @Override + public void stop() throws Exception { + unregisterPlcServices(); + super.stop(); + } + + private void registerPlcServices() throws Exception { + PlcGwServerHandler plcHandler = getComponent(PlcGwServerHandler.class); + + String plcId = runAsAgentWithResult(ctx -> { + try (StrolchTransaction tx = openTx(ctx.getCertificate(), true)) { + return tx.getConfiguration().getString(PARAM_PLC_ID); + } + }); + + if (plcId.isEmpty()) { + logger.error("No PLC ID defined on configuration! Can not start PLC Services!"); + return; + } + + this.modePlcService = new ModePlcSrvService(plcId, plcHandler); + this.modePlcService.register(); + } + + private void unregisterPlcServices() { + if (this.modePlcService != null) + this.modePlcService.unregister(); + } + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/json/JsonVisitors.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/json/JsonVisitors.java new file mode 100644 index 0000000..b05510e --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/json/JsonVisitors.java @@ -0,0 +1,34 @@ +package ${package}.server.web.json; + +import static ${package}.plc.shared.SharedPlcConstants.*; +import static li.strolch.plc.model.PlcConstants.PARAM_PLC_ID; + +import com.google.gson.JsonObject; +import li.strolch.model.Resource; +import li.strolch.model.json.StrolchRootElementToJsonVisitor; +import li.strolch.persistence.api.StrolchTransaction; +import li.strolch.plc.gw.server.PlcGwServerHandler; + +public class JsonVisitors { + + public static StrolchRootElementToJsonVisitor toJson() { + return new StrolchRootElementToJsonVisitor().withoutPolicies(); + } + + public static StrolchRootElementToJsonVisitor flatToJson() { + return toJson().withoutVersion().flat(); + } + + public static JsonObject shopFloorToJson(StrolchTransaction tx) { + + Resource configuration = tx.getConfiguration(); + PlcGwServerHandler plcHandler = tx.getContainer().getComponent(PlcGwServerHandler.class); + + JsonObject data = new JsonObject(); + data.addProperty(PARAM_AUTOMATIC_MODE, configuration.getBoolean(PARAM_AUTOMATIC_MODE)); + data.addProperty(PARAM_PLC_STARTED, configuration.getBoolean(PARAM_PLC_STARTED)); + data.addProperty(PARAM_PLC_CONNECTED, plcHandler.isPlcConnected(tx.getConfiguration().getString(PARAM_PLC_ID))); + + return data; + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/rest/ShopFloorResource.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/rest/ShopFloorResource.java new file mode 100644 index 0000000..993217b --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/rest/ShopFloorResource.java @@ -0,0 +1,66 @@ +package ${package}.server.web.rest; + +import static ${package}.plc.shared.SharedPlcConstants.ROLE_SHOP_FLOOR; +import static ${package}.server.web.json.JsonVisitors.shopFloorToJson; +import static li.strolch.model.Tags.Json.DATA; +import static li.strolch.plc.model.PlcConstants.PARAM_PLC_ID; +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}.server.web.service.ShopFloorActionService; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +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.JsonServiceArgument; +import li.strolch.service.api.ServiceHandler; + +@Path("shopFloor") +public class ShopFloorResource { + + private static String getContext() { + StackTraceElement element = new Throwable().getStackTrace()[2]; + return element.getClassName() + "." + element.getMethodName(); + } + + private StrolchTransaction openTx(Certificate certificate) { + return RestfulStrolchComponent.getInstance().openTx(certificate, getContext()); + } + + @GET + @Produces(MediaType.APPLICATION_JSON) + public Response getState(@Context HttpServletRequest request) { + Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); + + try (StrolchTransaction tx = openTx(cert)) { + tx.assertHasRole(ROLE_SHOP_FLOOR); + return ResponseUtil.toResponse(DATA, shopFloorToJson(tx)); + } + } + + @PUT + @Path("action") + @Consumes(MediaType.APPLICATION_JSON) + public Response doAction(@Context HttpServletRequest request, String data) { + Certificate cert = (Certificate) request.getAttribute(STROLCH_CERTIFICATE); + + JsonObject jsonObject = JsonParser.parseString(data).getAsJsonObject(); + try (StrolchTransaction tx = openTx(cert)) { + jsonObject.addProperty(PARAM_PLC_ID, tx.getConfiguration().getString(PARAM_PLC_ID)); + } + + ShopFloorActionService svc = new ShopFloorActionService(); + JsonServiceArgument arg = svc.getArgumentInstance(); + arg.jsonElement = jsonObject; + + ServiceHandler svcHandler = RestfulStrolchComponent.getInstance().getServiceHandler(); + return ResponseUtil.toResponse(svcHandler.doService(cert, svc, arg)); + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/ShopFloorActionService.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/ShopFloorActionService.java new file mode 100644 index 0000000..b444cc6 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/ShopFloorActionService.java @@ -0,0 +1,111 @@ +package ${package}.server.web.service; + +import static ${package}.plc.shared.SharedPlcConstants.*; +import static li.strolch.plc.model.PlcConstants.PARAM_PLC_ID; + +import java.util.Optional; + +import com.google.gson.JsonObject; +import li.strolch.model.Resource; +import li.strolch.persistence.api.StrolchTransaction; +import li.strolch.plc.gw.server.PlcGwServerHandler; +import li.strolch.plc.gw.server.PlcGwSrvI18n; +import li.strolch.plc.gw.server.service.SendPlcTelegramCommand; +import li.strolch.plc.model.PlcAddressResponse; +import li.strolch.plc.model.PlcConstants; +import li.strolch.privilege.model.SimpleRestrictable; +import li.strolch.service.JsonServiceArgument; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceResult; +import li.strolch.utils.dbc.DBC; + +public class ShopFloorActionService extends AbstractService { + + @Override + protected ServiceResult getResultInstance() { + return new ServiceResult(); + } + + @Override + public JsonServiceArgument getArgumentInstance() { + return new JsonServiceArgument(); + } + + @Override + protected ServiceResult internalDoService(JsonServiceArgument arg) { + + JsonObject data = arg.jsonElement.getAsJsonObject(); + String action = data.get(PlcConstants.PARAM_ACTION).getAsString(); + DBC.PRE.assertNotEmpty("action must be set!", action); + + Optional result; + try (StrolchTransaction tx = openArgOrUserTx(arg, false)) { + + // validate that the user can do this action + tx.validateAction(new SimpleRestrictable(getPrivilegeValue(), action)); + + switch (action) { + case "EnableAutomaticMode" -> result = setAutomaticMode(tx, A_ON); + case "DisableAutomaticMode" -> result = setAutomaticMode(tx, A_OFF); + case "StopAll" -> result = stopAll(tx); + default -> { + tx.rollbackOnClose(); + throw new IllegalArgumentException("Unexpected action " + action); + } + } + + if (result.isPresent()) { + tx.rollbackOnClose(); + } else if (tx.needsCommit()) { + tx.commitOnClose(); + } + } + + return result.orElseGet(ServiceResult::success); + } + + private String getPlcId(StrolchTransaction tx) { + return tx.getConfiguration().getString(PARAM_PLC_ID); + } + + protected Optional stopAll(StrolchTransaction tx) { + return assertPlcConnected(tx).or(() -> sendPlcTelegram(tx, R_STOP_ALL_ACTORS, A_NOW)); + } + + protected Optional setAutomaticMode(StrolchTransaction tx, String action) { + return assertPlcConnected(tx) // + .or(() -> sendPlcTelegram(tx, R_AUTOMATIC_MODE, action)) // + .or(() -> { + Resource configuration = tx.getConfiguration(); + configuration.setBoolean(PARAM_AUTOMATIC_MODE, action.equals(A_ON)); + tx.update(configuration); + return Optional.empty(); + }); + } + + protected Optional assertPlcConnected(StrolchTransaction tx) { + PlcGwServerHandler plcHandler = getComponent(PlcGwServerHandler.class); + if (!plcHandler.isPlcConnected(getPlcId(tx))) + return Optional.of(ServiceResult.error("PLC " + getPlcId(tx) + " is not connected!") + .i18n(PlcGwSrvI18n.bundle, "execution.plc.notConnected", "plc", getPlcId(tx))); + + return Optional.empty(); + } + + public static Optional sendPlcTelegram(StrolchTransaction tx, String resource, String action) { + + SendPlcTelegramCommand cmd = new SendPlcTelegramCommand(tx); + cmd.setPlcId(tx.getConfiguration().getString(PARAM_PLC_ID)); + cmd.setResource(resource); + cmd.setAction(action); + + cmd.validate(); + cmd.doCommand(); + + PlcAddressResponse response = cmd.getResponse(); + if (response.isFailed()) + return Optional.of(ServiceResult.error(response.getState() + ": " + response.getStateMsg())); + + return Optional.empty(); + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/plc/ModePlcSrvService.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/plc/ModePlcSrvService.java new file mode 100644 index 0000000..3909397 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/service/plc/ModePlcSrvService.java @@ -0,0 +1,53 @@ +package ${package}.server.web.service.plc; + +import static ${package}.plc.shared.SharedPlcConstants.*; +import static li.strolch.utils.helper.ExceptionHelper.getCallerMethod; + +import li.strolch.model.Resource; +import li.strolch.persistence.api.StrolchTransaction; +import li.strolch.plc.gw.server.PlcGwServerHandler; +import li.strolch.plc.gw.server.PlcGwService; +import li.strolch.plc.model.PlcAddressKey; + +public class ModePlcSrvService extends PlcGwService { + + public ModePlcSrvService(String plcId, PlcGwServerHandler plcHandler) { + super(plcId, plcHandler); + } + + @Override + public void handleNotification(PlcAddressKey addressKey, Object value) { + run(ctx -> { + try (StrolchTransaction tx = openTx(ctx, getCallerMethod(), false)) { + + Resource configuration = tx.getConfiguration(); + + switch (addressKey.action) { + case A_ON -> configuration.setBoolean(PARAM_AUTOMATIC_MODE, (boolean) value); + case STARTED -> configuration.setBoolean(PARAM_PLC_STARTED, true); + case STOPPED -> configuration.setBoolean(PARAM_PLC_STARTED, false); + } + + logger.info(addressKey + " = " + value); + tx.update(configuration); + tx.commitOnClose(); + } + }); + } + + @Override + public void register() { + register(R_AUTOMATIC_MODE, A_ON); + register(PLC, STARTED); + register(PLC, STOPPED); + super.register(); + } + + @Override + public void unregister() { + unregister(R_AUTOMATIC_MODE, A_ON); + unregister(PLC, STARTED); + unregister(PLC, STOPPED); + super.unregister(); + } +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/RestfulApplication.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/RestfulApplication.java new file mode 100644 index 0000000..b3fc140 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/RestfulApplication.java @@ -0,0 +1,52 @@ +package ${package}.server.web.web; + +import static ${package}.server.web.web.StartupListener.APP_NAME; + +import javax.ws.rs.ApplicationPath; +import java.util.logging.Level; + +import ${package}.server.web.rest.ShopFloorResource; +import li.strolch.rest.RestfulStrolchComponent; +import li.strolch.rest.StrolchRestfulClasses; +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); + + // register app rest services + register(ShopFloorResource.class); + + // strolch services + for (Class clazz : StrolchRestfulClasses.getRestfulClasses()) { + register(clazz); + } + + // filters + for (Class clazz : StrolchRestfulClasses.getProviderClasses()) { + register(clazz); + } + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/StartupListener.java b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/StartupListener.java new file mode 100644 index 0000000..a0d4e6e --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/java/server/web/web/StartupListener.java @@ -0,0 +1,67 @@ +package ${package}.server.web.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 = "MyApp"; + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/ENV.properties b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/ENV.properties new file mode 100644 index 0000000..8212444 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/ENV.properties @@ -0,0 +1 @@ +ENV_STROLCH=${strolch.env} \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/StrolchBootstrap.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/StrolchBootstrap.xml new file mode 100644 index 0000000..4e7f495 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/StrolchBootstrap.xml @@ -0,0 +1,32 @@ + + + + + + + + dev + + + runtime + + + + + + + + + + + + + ${project.basedir}/runtime + dev + + + + /absolute/path/to/runtime + test + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/appVersion.properties b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/appVersion.properties new file mode 100644 index 0000000..a4594a2 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/appVersion.properties @@ -0,0 +1,6 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/logback.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/logback.xml new file mode 100644 index 0000000..fcc71f0 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + + + %d [%thread] %-5level %class{36}:%line %method - %msg%n + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/.bowerrc b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/.bowerrc new file mode 100644 index 0000000..5773025 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components" +} diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/web.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..8f93aec --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,15 @@ + + + + + + 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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/CustomWeb.js b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/CustomWeb.js new file mode 100644 index 0000000..1b14177 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/CustomWeb.js @@ -0,0 +1,12 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Bold.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Bold.ttf new file mode 100644 index 0000000..c2293d5 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Bold.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf new file mode 100644 index 0000000..ce6e784 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-BoldItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Italic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Italic.ttf new file mode 100644 index 0000000..a599244 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Italic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Light.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Light.ttf new file mode 100644 index 0000000..b310d15 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Light.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf new file mode 100644 index 0000000..ad0741b Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-LightItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Medium.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Medium.ttf new file mode 100644 index 0000000..7340a40 Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Medium.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf new file mode 100644 index 0000000..36ac1ae Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-MediumItalic.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Regular.ttf b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Regular.ttf new file mode 100644 index 0000000..f98a2da Binary files /dev/null and b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/font/Ubuntu-Regular.ttf differ diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/index.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/index.html new file mode 100644 index 0000000..ce2fb14 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/index.html @@ -0,0 +1,42 @@ + + + + + ${appName} + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-app-behavior.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-app-behavior.html new file mode 100644 index 0000000..84016ef --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-app-behavior.html @@ -0,0 +1,199 @@ + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-component-behavior.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-component-behavior.html new file mode 100644 index 0000000..cd27283 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/behaviors/c-component-behavior.html @@ -0,0 +1,30 @@ + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-drawer.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-drawer.html new file mode 100644 index 0000000..6792a43 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-drawer.html @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-main.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-main.html new file mode 100644 index 0000000..c4845cc --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-main.html @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-pages.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-pages.html new file mode 100644 index 0000000..fcd5be7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/main/c-pages.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/styles/c-app-style.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/styles/c-app-style.html new file mode 100644 index 0000000..08da0f7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/styles/c-app-style.html @@ -0,0 +1,14 @@ + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/utils/c-app-routing.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/utils/c-app-routing.html new file mode 100644 index 0000000..56a009f --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/utils/c-app-routing.html @@ -0,0 +1,148 @@ + + + + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-shop-floor.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-shop-floor.html new file mode 100644 index 0000000..fc9520c --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-shop-floor.html @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-view404.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-view404.html new file mode 100644 index 0000000..e1e1914 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/app/src/views/c-view404.html @@ -0,0 +1,46 @@ + + + + + + + + + \ No newline at end of file diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/bower.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/bower.json new file mode 100644 index 0000000..790bb0b --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/bower.json @@ -0,0 +1,41 @@ +{ + "name": "${rootArtifactId}-web", + "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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/gulpfile.js b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/gulpfile.js new file mode 100644 index 0000000..017ff6a --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/gulpfile.js @@ -0,0 +1,93 @@ +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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/index.html b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/index.html new file mode 100644 index 0000000..a1ff9e7 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/index.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/locales.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/locales.json new file mode 100644 index 0000000..5810c75 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/locales.json @@ -0,0 +1,183 @@ +{ + "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}", + "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", + "plc": "Control", + "automaticMode": "Automatic Mode", + "plcConnected": "PLC Connected", + "plcStarted": "PLC Started", + "stopAll": "Stop All", + "stopAllConfirm": "Should all Motors be stopped?", + "enableAutomaticMode": "Enable Automatic Mode", + "enableAutomaticModeConfirm": "Should the automatic mode be enabled?", + "disableAutomaticMode": "Disable Automatic Mode", + "disableAutomaticModeConfirm": "Should the automatic mode be disabled?", + "shop-floor": "Shop-Floor" + }, + "de": { + "shop-floor": "Fördertechnik", + "stopAll": "Alles Stoppen", + "stopAllConfirm": "Sollen alle Motoren gestoppt werden?", + "automaticMode": "Automatik Modus", + "disableAutomaticMode": "Automatik Modus Deaktivieren", + "disableAutomaticModeConfirm": "Soll der Automatik Modus deaktiviert werden?", + "enableAutomaticMode": "Automatik Modus Aktivieren", + "enableAutomaticModeConfirm": "Soll der Automatik Modus aktiviert werden?", + "plc": "Steuerung", + "plcConnected": "Steuerung Verbunden", + "plcStarted": "Steuerung gestartet", + "appTitle": "${appName}", + "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" + }, + "fr": { + "shop-floor": "Système de convoyage", + "stopAll": "Arrêter tout", + "stopAllConfirm": "Les moteurs, doivent-ils être arrêtés ?", + "automaticMode": "Mode automatique", + "plcConnected": "Contrôle connecté", + "plc": "Système de contrôle", + "disableAutomaticMode": "Désactiver le mode automatique", + "disableAutomaticModeConfirm": "Voulez-vous désactiver le mode automatique?", + "enableAutomaticMode": "Activer le mode automatique", + "enableAutomaticModeConfirm": "Voulez-vous activer le mode automatique ?", + "appTitle": "${appName}", + "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.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/package.json b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/package.json new file mode 100644 index 0000000..4b5f975 --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/__rootArtifactId__-web/src/main/webapp/package.json @@ -0,0 +1,37 @@ +{ + "name": "${rootArtifactId}-web", + "description": "${appName}", + "version": "${version}", + "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.plc/src/main/resources/archetype-resources/pom.xml b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 0000000..49c3a2a --- /dev/null +++ b/li.strolch.mvn.archetype.plc/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,474 @@ + + + 4.0.0 + + ${groupId} + ${artifactId} + pom + ${artifactId} + ${version} + Module build to build all projects for ${artifactId} + + + + scm:git:https://github.com/strolch-li/strolch.git + scm:git:https://github.com/strolch-li/strolch.git + https://github.com/strolch-li/strolch + + + + UTF-8 + yyyy-MM-dd HH:mm:ss + ${maven.build.timestamp} + + 17 + ${jdk.version} + ${jdk.version} + + + 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.0.1 + 2.3.3 + 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 + + 3.14.0 + + 1.4 + + 1.8.0-SNAPSHOT + 1.2.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 + + + + + ${rootArtifactId}-shared + ${rootArtifactId}-plc-web + ${rootArtifactId}-web + + + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + ch.qos.logback + logback-classic + ${logback.version} + runtime + + + + + ${groupId} + ${rootArtifactId}-shared + ${project.version} + + + ${groupId} + ${rootArtifactId}-plc-web + ${project.version} + + + ${groupId} + ${rootArtifactId}-web + ${project.version} + + + + + li.strolch + li.strolch.bom + pom + ${strolch.version} + import + + + + + li.strolch + strolch-plc-model + ${strolch-plc.version} + + + li.strolch + strolch-plc-core + ${strolch-plc.version} + + + li.strolch + strolch-plc-rest + ${strolch-plc.version} + + + li.strolch + strolch-plc-gw-server + ${strolch-plc.version} + + + li.strolch + strolch-plc-gw-client + ${strolch-plc.version} + + + li.strolch + strolch-plc-util + ${strolch-plc.version} + + + + + com.google.code.gson + gson + ${gson.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + + javax.xml.bind + jaxb-api + ${jaxb.api.version} + + + javax.xml + jaxp-api + ${jaxp.version} + + + javax.servlet + javax.servlet-api + ${serverlet.version} + provided + + + jakarta.xml.ws + jakarta.xml.ws-api + ${jaxws.version} + + + jakarta.jws + jakarta.jws-api + ${jakarta.jws-api.version} + + + com.sun.xml.ws + jaxws-rt + ${jaxws.version} + runtime + + + com.fasterxml.woodstox + woodstox-core + + + org.codehaus.woodstox + stax2-api + + + + + + 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 + + + + + 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 + + + + + + + + + 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} + + true + true + -Xlint:all + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources-no-fork + generate-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-site-plugin + ${maven-site-plugin.version} + + UTF-8 + + + + + org.apache.maven.plugins + maven-eclipse-plugin + ${maven-eclipse-plugin.version} + + true + true + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + true + true + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + attach-javadocs + deploy + + jar + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + ${maven-deploy-plugin.version} + + + deploy + deploy + + deploy + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib + false + false + true + false + + + + + + + maven-assembly-plugin + ${maven-assembly-plugin.version} + + + + true + + + + + + + + + + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + + + + diff --git a/pom.xml b/pom.xml index 4474319..d006735 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,7 @@ li.strolch.mvn.archetype.main li.strolch.mvn.archetype.webapp + li.strolch.mvn.archetype.plc