719 lines
94 KiB
HTML
719 lines
94 KiB
HTML
<!doctype html><html lang=en class="js csstransforms3d"><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="Hugo 0.80.0"><meta name=description content="Strolch is a parameterized framework for use on servers and IoT"><meta name=author content="Strolch"><link rel=icon href=/favicon.ico type=image/ico><title>Configuration - Strolch</title><link href=/css/nucleus.css?1660681133 rel=stylesheet><link href=/css/fontawesome-all.min.css?1660681133 rel=stylesheet><link href=/css/hybrid.css?1660681133 rel=stylesheet><link href=/css/featherlight.min.css?1660681133 rel=stylesheet><link href=/css/perfect-scrollbar.min.css?1660681133 rel=stylesheet><link href=/css/auto-complete.css?1660681133 rel=stylesheet><link href=/css/atom-one-dark-reasonable.css?1660681133 rel=stylesheet><link href=/css/theme.css?1660681133 rel=stylesheet><link href=/css/hugo-theme.css?1660681133 rel=stylesheet><link href=/css/theme-green.css?1660681133 rel=stylesheet><script src=/js/jquery-3.3.1.min.js?1660681133></script><style>:root #header+#content>#left>#rlblock_left{display:none!important}</style></head><body data-url=/tutorial/configuration/><nav id=sidebar><div id=header-wrapper><div id=header><a id=logo href=/><img src=/logo.png></a></div><div class=searchbox><label for=search-by><i class="fas fa-search"></i></label><input data-search-input id=search-by type=search placeholder=Search...>
|
|
<span data-search-clear><i class="fas fa-times"></i></span></div><script type=text/javascript src=/js/lunr.min.js?1660681133></script><script type=text/javascript src=/js/auto-complete.js?1660681133></script><script type=text/javascript>var baseurl="https:\/\/strolch.li\/";</script><script type=text/javascript src=/js/search.js?1660681133></script></div><section id=homelinks><ul><li><a class=padding href=/><i class="fas fa-home"></i>Home</a></li></ul></section><div class=highlightable><ul class=topics><li data-nav-id=/api/ title=API class=dd-item><a href=/api/>API</a></li><li data-nav-id=/documentation/ title=Documentation class=dd-item><a href=/documentation/>Documentation</a><ul><li data-nav-id=/documentation/architecture/ title=Architecture class=dd-item><a href=/documentation/architecture/>Architecture</a></li><li data-nav-id=/documentation/model/ title=Model class=dd-item><a href=/documentation/model/>Model</a></li><li data-nav-id=/documentation/do-and-donts/ title="Do and Don't" class=dd-item><a href=/documentation/do-and-donts/>Do and Don't</a></li><li data-nav-id=/documentation/runtime-configuration/ title="Runtime Configuration" class=dd-item><a href=/documentation/runtime-configuration/>Runtime Configuration</a></li><li data-nav-id=/documentation/realms/ title=Realms class=dd-item><a href=/documentation/realms/>Realms</a></li><li data-nav-id=/documentation/components/ title=Components class=dd-item><a href=/documentation/components/>Components</a></li><li data-nav-id=/documentation/services-and-commands/ title="Services and Commands" class=dd-item><a href=/documentation/services-and-commands/>Services and Commands</a></li><li data-nav-id=/documentation/searches/ title=Searches class=dd-item><a href=/documentation/searches/>Searches</a></li><li data-nav-id=/documentation/queries/ title=Queries class=dd-item><a href=/documentation/queries/>Queries</a></li><li data-nav-id=/documentation/transactions/ title=Transactions class=dd-item><a href=/documentation/transactions/>Transactions</a></li><li data-nav-id=/documentation/policies/ title=Policies class=dd-item><a href=/documentation/policies/>Policies</a></li><li data-nav-id=/documentation/observers/ title=Observers class=dd-item><a href=/documentation/observers/>Observers</a></li><li data-nav-id=/documentation/versioning/ title=Versioning class=dd-item><a href=/documentation/versioning/>Versioning</a></li><li data-nav-id=/documentation/reports/ title=Reports class=dd-item><a href=/documentation/reports/>Reports</a></li><li data-nav-id=/documentation/priviles/ title=Privileges class=dd-item><a href=/documentation/priviles/>Privileges</a></li></ul></li><li data-nav-id=/plc/ title=PLC class=dd-item><a href=/plc/>PLC</a><ul><li data-nav-id=/plc/architecture/ title=Architecture class=dd-item><a href=/plc/architecture/>Architecture</a></li><li data-nav-id=/plc/example-set-up/ title="Example Set-Up" class=dd-item><a href=/plc/example-set-up/>Example Set-Up</a></li></ul></li><li data-nav-id=/tutorial/ title=Tutorial class="dd-item
|
|
parent"><a href=/tutorial/>Tutorial</a><ul><li data-nav-id=/tutorial/configuration/ title=Configuration class="dd-item active"><a href=/tutorial/configuration/>Configuration</a></li><li data-nav-id=/tutorial/model/ title=Model class=dd-item><a href=/tutorial/model/>Model</a></li><li data-nav-id=/tutorial/crud-book/ title="CRUD Book" class=dd-item><a href=/tutorial/crud-book/>CRUD Book</a></li></ul></li><li data-nav-id=/download/ title=Download class=dd-item><a href=/download/>Download</a></li><li data-nav-id=/development/ title=Development class=dd-item><a href=/development/>Development</a><ul><li data-nav-id=/development/prerequisites/ title=Prerequisites class=dd-item><a href=/development/prerequisites/>Prerequisites</a></li><li data-nav-id=/development/building/ title="Building Strolch" class=dd-item><a href=/development/building/>Building Strolch</a></li><li data-nav-id=/development/maven-archetypes/ title="Maven Archetypes" class=dd-item><a href=/development/maven-archetypes/>Maven Archetypes</a></li><li data-nav-id=/development/web-app/ title="Web App" class=dd-item><a href=/development/web-app/>Web App</a></li><li data-nav-id=/development/main-class-app/ title="Main Class App" class=dd-item><a href=/development/main-class-app/>Main Class App</a></li><li data-nav-id=/development/converting-existing/ title="Converting Existing App" class=dd-item><a href=/development/converting-existing/>Converting Existing App</a></li></ul></li><li data-nav-id=/blog/ title=Blog class=dd-item><a href=/blog/>Blog</a><ul><li data-nav-id=/blog/post-00016/ title="Strolch PLC now also on Maven Central" class=dd-item><a href=/blog/post-00016/>Strolch PLC now also on Maven Central</a></li><li data-nav-id=/blog/post-00015/ title="Release of Strolch 1.6.100" class=dd-item><a href=/blog/post-00015/>Release of Strolch 1.6.100</a></li><li data-nav-id=/blog/post-00014/ title="Strolch Reports" class=dd-item><a href=/blog/post-00014/>Strolch Reports</a></li><li data-nav-id=/blog/post-00013/ title="Strolch Searches" class=dd-item><a href=/blog/post-00013/>Strolch Searches</a></li><li data-nav-id=/blog/post-00012/ title="Wow, the many changes!" class=dd-item><a href=/blog/post-00012/>Wow, the many changes!</a></li><li data-nav-id=/blog/post-00011/ title="Strolch now on Maven Central" class=dd-item><a href=/blog/post-00011/>Strolch now on Maven Central</a></li><li data-nav-id=/blog/post-00010/ title="Versioning of objects" class=dd-item><a href=/blog/post-00010/>Versioning of objects</a></li><li data-nav-id=/blog/post-00009/ title="Release 1.2.0" class=dd-item><a href=/blog/post-00009/>Release 1.2.0</a></li><li data-nav-id=/blog/post-00008/ title="Strolch Update" class=dd-item><a href=/blog/post-00008/>Strolch Update</a></li><li data-nav-id=/blog/post-00007/ title="Activities: Beginning of the planning engine" class=dd-item><a href=/blog/post-00007/>Activities: Beginning of the planning engine</a></li><li data-nav-id=/blog/post-00006/ title="Strolch Documentation" class=dd-item><a href=/blog/post-00006/>Strolch Documentation</a></li><li data-nav-id=/blog/post-00005/ title="Strolch Release 1.0.0" class=dd-item><a href=/blog/post-00005/>Strolch Release 1.0.0</a></li><li data-nav-id=/blog/post-00004/ title="DurationParameter and other minor changes: Release 1.0.0-RC4" class=dd-item><a href=/blog/post-00004/>DurationParameter and other minor changes: Release 1.0.0-RC4</a></li><li data-nav-id=/blog/post-00003/ title="DB Initialization: Release 1.0.0-RC3" class=dd-item><a href=/blog/post-00003/>DB Initialization: Release 1.0.0-RC3</a></li><li data-nav-id=/blog/post-00002/ title="Release 1.0.0-RC2" class=dd-item><a href=/blog/post-00002/>Release 1.0.0-RC2</a></li><li data-nav-id=/blog/post-00001/ title="Release 1.0.0-RC1" class=dd-item><a href=/blog/post-00001/>Release 1.0.0-RC1</a></li></ul></li></ul><section id=shortcuts><h3>More</h3><ul><li><a class=padding href=https://strolch.li/tags><i class="fas fa-tags"></i>Tags</a></li><li><a class=padding href=https://github.com/strolch-li target=_blank><i class="fab fa-github"></i>GitHub project</a></li></ul></section><section id=footer><p>Built with <a href=https://github.com/matcornic/hugo-theme-learn target=_blank><i class="fas fa-heart"></i></a>from <a href=https://getgrav.org target=_blank>Grav</a> and <a href=https://gohugo.io/ target=_blank>Hugo</a></p></section></div></nav><section id=body><div id=overlay></div><div class="padding highlightable"><div><div id=top-bar><div id=top-github-link><a class=github-link title="Edit this page" href=https://github.com/strolch-li/strolch-website/tree/develop/content/tutorial/configuration.md target=blank><i class="fas fa-code-branch"></i><span id=top-github-link-text>Edit this page</span></a></div><div id=breadcrumbs itemscope itemtype=http://data-vocabulary.org/Breadcrumb><span id=sidebar-toggle-span><a href=# id=sidebar-toggle data-sidebar-toggle><i class="fas fa-bars"></i></a></span><span id=toc-menu><i class="fas fa-list-alt"></i></span><span class=links><a href=/>Strolch Overview</a> > <a href=/tutorial/>Tutorial</a> > Configuration</span></div><div class=progress><div class=wrapper><nav id=TableOfContents><ul><li><a href=#configuration>Configuration</a></li></ul></nav></div></div></div></div><div id=head-tags></div><div id=body-inner><h1>Configuration</h1><h2 id=configuration>Configuration</h2><p>Let’s start by creating a new Apache Maven project. We’ll need a POM with the
|
|
proper dependencies. We expect you to be familiar with Apache Maven, so we’ll
|
|
just show you a working POM file:</p><p><strong>pom.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0"?></span>
|
|
<span style=color:#f92672><project</span> <span style=color:#a6e22e>xmlns=</span><span style=color:#e6db74>"http://maven.apache.org/POM/4.0.0"</span> <span style=color:#a6e22e>xmlns:xsi=</span><span style=color:#e6db74>"http://www.w3.org/2001/XMLSchema-instance"</span>
|
|
<span style=color:#a6e22e>xsi:schemaLocation=</span><span style=color:#e6db74>"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><modelVersion></span>4.0.0<span style=color:#f92672></modelVersion></span>
|
|
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>strolch-bookshop<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>0.1.0-SNAPSHOT<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><packaging></span>war<span style=color:#f92672></packaging></span>
|
|
|
|
<span style=color:#f92672><name></span>strolch-bookshop<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><description></span>Bookshop built on Strolch<span style=color:#f92672></description></span>
|
|
<span style=color:#f92672><inceptionYear></span>2017<span style=color:#f92672></inceptionYear></span>
|
|
|
|
<span style=color:#f92672><properties></span>
|
|
<span style=color:#f92672><project.build.sourceEncoding></span>UTF-8<span style=color:#f92672></project.build.sourceEncoding></span>
|
|
<span style=color:#f92672><maven.build.timestamp.format></span>yyyy-MM-dd HH:mm:ss<span style=color:#f92672></maven.build.timestamp.format></span>
|
|
<span style=color:#f92672><buildTimestamp></span>${maven.build.timestamp}<span style=color:#f92672></buildTimestamp></span>
|
|
|
|
<span style=color:#f92672><jdk.version></span>1.8<span style=color:#f92672></jdk.version></span>
|
|
|
|
<span style=color:#f92672><jersey.version></span>2.25.1<span style=color:#f92672></jersey.version></span>
|
|
<span style=color:#f92672><slf4j.version></span>1.7.25<span style=color:#f92672></slf4j.version></span>
|
|
<span style=color:#f92672><logback.version></span>1.2.3<span style=color:#f92672></logback.version></span>
|
|
<span style=color:#f92672><petitparser.version></span>2.1.0<span style=color:#f92672></petitparser.version></span>
|
|
<span style=color:#f92672><hikaricp.version></span>4.0.3<span style=color:#f92672></hikaricp.version></span>
|
|
<span style=color:#f92672><postgresql.version></span>42.1.4<span style=color:#f92672></postgresql.version></span>
|
|
<span style=color:#f92672><gson.version></span>2.8.2<span style=color:#f92672></gson.version></span>
|
|
<span style=color:#f92672><annotation.version></span>1.3.1<span style=color:#f92672></annotation.version></span>
|
|
<span style=color:#f92672><javaxmail.version></span>1.6.0<span style=color:#f92672></javaxmail.version></span>
|
|
<span style=color:#f92672><serverlet.version></span>3.1.0<span style=color:#f92672></serverlet.version></span>
|
|
<span style=color:#f92672><jaxrs.api.version></span>2.1<span style=color:#f92672></jaxrs.api.version></span>
|
|
|
|
<span style=color:#f92672><junit.version></span>4.12<span style=color:#f92672></junit.version></span>
|
|
<span style=color:#f92672><hamcrest.version></span>1.3<span style=color:#f92672></hamcrest.version></span>
|
|
<span style=color:#f92672><mockito.version></span>2.0.8-beta<span style=color:#f92672></mockito.version></span>
|
|
|
|
<span style=color:#f92672><maven-compiler-plugin.version></span>3.7.0<span style=color:#f92672></maven-compiler-plugin.version></span>
|
|
<span style=color:#f92672><maven-source-plugin.version></span>3.0.1<span style=color:#f92672></maven-source-plugin.version></span>
|
|
<span style=color:#f92672><maven-jar-plugin.version></span>3.0.2<span style=color:#f92672></maven-jar-plugin.version></span>
|
|
<span style=color:#f92672><maven-war-plugin.version></span>3.1.0<span style=color:#f92672></maven-war-plugin.version></span>
|
|
|
|
<span style=color:#f92672><strolch.version></span>1.7.0-SNAPSHOT<span style=color:#f92672></strolch.version></span>
|
|
|
|
<span style=color:#f92672><warFinalName></span>bookshop<span style=color:#f92672></warFinalName></span>
|
|
<span style=color:#f92672><m2eclipse.wtp.contextRoot></span>${warFinalName}<span style=color:#f92672></m2eclipse.wtp.contextRoot></span>
|
|
<span style=color:#f92672></properties></span>
|
|
|
|
<span style=color:#f92672><dependencies></span>
|
|
|
|
<span style=color:#75715e><!-- base --></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.slf4j<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>slf4j-api<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${slf4j.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>ch.qos.logback<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>logback-classic<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${logback.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>runtime<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
|
|
<span style=color:#75715e><!-- strolch --></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.utils<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.privilege<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.model<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.agent<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.rest<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.service<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>li.strolch<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>li.strolch.testbase<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${strolch.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>test<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
|
|
<span style=color:#75715e><!-- utils --></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>com.google.code.gson<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>gson<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${gson.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
|
|
<span style=color:#75715e><!-- web --></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>javax.servlet<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>javax.servlet-api<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${serverlet.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>provided<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>javax.ws.rs<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>javax.ws.rs-api<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${jaxrs.api.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.glassfish.jersey.core<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>jersey-common<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${jersey.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.glassfish.jersey.core<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>jersey-server<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${jersey.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.glassfish.jersey.containers<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>jersey-container-servlet<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${jersey.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
|
|
<span style=color:#75715e><!-- testing --></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>junit<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>junit<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${junit.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>test<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.hamcrest<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>hamcrest-core<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${hamcrest.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>test<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672><dependency></span>
|
|
<span style=color:#f92672><groupId></span>org.hamcrest<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>hamcrest-library<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${hamcrest.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><scope></span>test<span style=color:#f92672></scope></span>
|
|
<span style=color:#f92672></dependency></span>
|
|
<span style=color:#f92672></dependencies></span>
|
|
|
|
<span style=color:#f92672><build></span>
|
|
<span style=color:#f92672><resources></span>
|
|
<span style=color:#75715e><!-- filter properties files, and copy the rest --></span>
|
|
<span style=color:#f92672><resource></span>
|
|
<span style=color:#f92672><directory></span>src/main/resources<span style=color:#f92672></directory></span>
|
|
<span style=color:#f92672><filtering></span>true<span style=color:#f92672></filtering></span>
|
|
<span style=color:#f92672><includes></span>
|
|
<span style=color:#f92672><include></span>**/*.properties<span style=color:#f92672></include></span>
|
|
<span style=color:#f92672></includes></span>
|
|
<span style=color:#f92672></resource></span>
|
|
<span style=color:#f92672><resource></span>
|
|
<span style=color:#f92672><directory></span>src/main/resources<span style=color:#f92672></directory></span>
|
|
<span style=color:#f92672><filtering></span>false<span style=color:#f92672></filtering></span>
|
|
<span style=color:#f92672><excludes></span>
|
|
<span style=color:#f92672><exclude></span>**/*.properties<span style=color:#f92672></exclude></span>
|
|
<span style=color:#f92672></excludes></span>
|
|
<span style=color:#f92672></resource></span>
|
|
<span style=color:#f92672></resources></span>
|
|
|
|
<span style=color:#f92672><plugins></span>
|
|
<span style=color:#f92672><plugin></span>
|
|
<span style=color:#f92672><groupId></span>org.apache.maven.plugins<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>maven-compiler-plugin<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${maven-compiler-plugin.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><configuration></span>
|
|
<span style=color:#f92672><source></span>${jdk.version}<span style=color:#f92672></source></span>
|
|
<span style=color:#f92672><target></span>${jdk.version}<span style=color:#f92672></target></span>
|
|
<span style=color:#f92672></configuration></span>
|
|
<span style=color:#f92672></plugin></span>
|
|
<span style=color:#f92672><plugin></span>
|
|
<span style=color:#f92672><groupId></span>org.apache.maven.plugins<span style=color:#f92672></groupId></span>
|
|
<span style=color:#f92672><artifactId></span>maven-war-plugin<span style=color:#f92672></artifactId></span>
|
|
<span style=color:#f92672><version></span>${maven-war-plugin.version}<span style=color:#f92672></version></span>
|
|
<span style=color:#f92672><configuration></span>
|
|
<span style=color:#f92672><failOnMissingWebXml></span>false<span style=color:#f92672></failOnMissingWebXml></span>
|
|
<span style=color:#f92672><warName></span>${warFinalName}<span style=color:#f92672></warName></span>
|
|
<span style=color:#f92672></configuration></span>
|
|
<span style=color:#f92672></plugin></span>
|
|
<span style=color:#f92672></plugins></span>
|
|
<span style=color:#f92672></build></span>
|
|
|
|
<span style=color:#f92672><profiles></span>
|
|
<span style=color:#75715e><!-- active when building on eitch's machines --></span>
|
|
<span style=color:#f92672><profile></span>
|
|
<span style=color:#f92672><id></span>m2e.eitchpc<span style=color:#f92672></id></span>
|
|
<span style=color:#f92672><activation></span>
|
|
<span style=color:#f92672><property></span>
|
|
<span style=color:#f92672><name></span>user.name<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><value></span>eitch<span style=color:#f92672></value></span>
|
|
<span style=color:#f92672></property></span>
|
|
<span style=color:#f92672><os></span>
|
|
<span style=color:#f92672><family></span>unix<span style=color:#f92672></family></span>
|
|
<span style=color:#f92672></os></span>
|
|
<span style=color:#f92672></activation></span>
|
|
<span style=color:#f92672><properties></span>
|
|
<span style=color:#f92672><strolch.env></span>dev.eitchpc<span style=color:#f92672></strolch.env></span>
|
|
<span style=color:#f92672></properties></span>
|
|
<span style=color:#f92672></profile></span>
|
|
<span style=color:#f92672></profiles></span>
|
|
<span style=color:#f92672></project></span>
|
|
</code></pre></div><p>Now we need the rest of the directory structure:</p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-text data-lang=text>../strolch-bookshop/
|
|
- src/main/java/
|
|
- li/strolch/bookshop/
|
|
- <!-- java classes -->
|
|
- src/main/resources/
|
|
- ENV.properties
|
|
- appVersion.properties
|
|
- logback.xml
|
|
- src/main/webapp/WEB-INF/
|
|
- StrolchBootstrap.xml
|
|
- runtime
|
|
- config/
|
|
- PrivilegeConfig.xml
|
|
- PrivilegeRoles.xml
|
|
- PrivilegeUsers.xml
|
|
- StrolchConfiguration.xml
|
|
- StrolchPolicies.xml
|
|
- data/
|
|
- StrolchModel.xsd
|
|
- defaultModel.xml
|
|
- templates.xml
|
|
- temp/
|
|
</code></pre></div><p>A few notes to the resource files:</p><ul><li>The <code>ENV.properties</code> file is filtered by maven and the environment to load is
|
|
written in it using the environment variable strolch.env.</li><li>The <code>appVersion.properties</code> file is also filtered by maven and allows to reflect
|
|
on the version of this app at runtime.</li><li>The <code>logback.xml</code> file configures logging using SLF4j and Logback.</li></ul><p>The <code>StrolchBootstrap.xml</code> file is used to configure Strolch’s environment and
|
|
root directory. For a webapp it can be annoying to store Strolch’s configuration
|
|
inside the webapp, which is why we can define an absolute path where the
|
|
configuration is kept. In the following example we keep it in the root of the
|
|
sources:</p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span style=color:#f92672><StrolchBootstrap></span>
|
|
<span style=color:#f92672><env</span> <span style=color:#a6e22e>id=</span><span style=color:#e6db74>"dev.eitchpc"</span> <span style=color:#a6e22e>default=</span><span style=color:#e6db74>"true"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><root></span>/home/eitch/src/git/strolch-bookshop/runtime<span style=color:#f92672></root></span>
|
|
<span style=color:#f92672><environment></span>dev<span style=color:#f92672></environment></span>
|
|
<span style=color:#f92672></env></span>
|
|
<span style=color:#f92672></StrolchBootstrap></span>
|
|
</code></pre></div><p>Here we define two environments, but the both redefine the environment to dev.
|
|
This is because we want this app to start on two different machines with
|
|
different user home directories. See the profiles in the POM as to how these
|
|
environments are activated using a environment property strolch.env.</p><p>In this next step we’ll create Strolch’s configuration at the location we
|
|
defined in the StrolchBootstrap.xml file. Strolch’s configuration contains of
|
|
three directories: config, data and temp. config contains static files which
|
|
usually aren’t changed, data contains model files in XML format and temp is used
|
|
at runtime for any temporary files, e.g. storing active sessions.</p><p>The configuration as well as the model has been described on Strolch’s
|
|
documentation web page, we’ll just provide you with the files for the bookshop:</p><p><strong>PrivilegeConfig.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span style=color:#f92672><Privilege></span>
|
|
<span style=color:#f92672><Container></span>
|
|
<span style=color:#f92672><Parameters></span>
|
|
<span style=color:#75715e><!-- parameters for the container itself --></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"secretKey"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"45f251ce-d51f-4624-990a-8dcd5b181f0e"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"secretSalt"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"4770a32d-1512-4891-9a63-362504932500"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"persistSessions"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"true"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"autoPersistOnUserChangesData"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"false"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"privilegeConflictResolution"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"MERGE"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Parameters></span>
|
|
<span style=color:#f92672><EncryptionHandler</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.handler.DefaultEncryptionHandler"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Parameters></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"hashAlgorithm"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"PBKDF2WithHmacSHA512"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"hashIterations"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"10000"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"hashKeyLength"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"256"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Parameters></span>
|
|
<span style=color:#f92672></EncryptionHandler></span>
|
|
<span style=color:#f92672><PersistenceHandler</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.handler.XmlPersistenceHandler"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Parameters></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"usersXmlFile"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"PrivilegeUsers.xml"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Parameter</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"rolesXmlFile"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"PrivilegeRoles.xml"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Parameters></span>
|
|
<span style=color:#f92672></PersistenceHandler></span>
|
|
<span style=color:#f92672><UserChallengeHandler</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.handler.MailUserChallengeHandler"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672></UserChallengeHandler></span>
|
|
<span style=color:#f92672></Container></span>
|
|
<span style=color:#f92672><Policies></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"DefaultPrivilege"</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.policy.DefaultPrivilege"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RoleAccessPrivilege"</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.policy.RoleAccessPrivilege"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UserAccessPrivilege"</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.policy.UserAccessPrivilege"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UserSessionAccessPrivilege"</span> <span style=color:#a6e22e>class=</span><span style=color:#e6db74>"li.strolch.privilege.policy.UsernameFromCertificatePrivilege"</span><span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Policies></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
</code></pre></div><p><strong>PrivilegeRoles.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span style=color:#f92672><Roles></span>
|
|
<span style=color:#f92672><Role</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"User"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.service.api.Service"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.search.StrolchSearch"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672><Allow></span>li.strolch.bookshop.search.BookSearch<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672><Role</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UserPrivileges"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeSetUserLocale"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeSetUserPassword"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Role></span>
|
|
|
|
<span style=color:#75715e><!--
|
|
</span><span style=color:#75715e> Internal
|
|
</span><span style=color:#75715e> --></span>
|
|
<span style=color:#f92672><Role</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"StrolchAdmin"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.service.api.Service"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.search.StrolchSearch"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeAddUser"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeSetUserPassword"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672></Role></span>
|
|
|
|
<span style=color:#f92672><Role</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"agent"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.privilege.handler.SystemAction"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Allow></span>li.strolch.runtime.privilege.StrolchSystemAction<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672><Allow></span>li.strolch.runtime.privilege.StrolchSystemActionWithResult<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672><Allow></span>li.strolch.persistence.postgresql.PostgreSqlSchemaInitializer<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.service.api.Service"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.model.query.StrolchQuery"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"li.strolch.search.StrolchSearch"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"GetActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"AddActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"UpdateActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveResource"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveOrder"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"RemoveActivity"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"ModelPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeAction"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"DefaultPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Allow></span>Persist<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672><Allow></span>PersistSessions<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672><Allow></span>GetCertificates<span style=color:#f92672></Allow></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeAddUser"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeModifyUser"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672><Privilege</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"PrivilegeGetUser"</span> <span style=color:#a6e22e>policy=</span><span style=color:#e6db74>"UserAccessPrivilege"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><AllAllowed></span>true<span style=color:#f92672></AllAllowed></span>
|
|
<span style=color:#f92672></Privilege></span>
|
|
<span style=color:#f92672></Role></span>
|
|
|
|
<span style=color:#f92672></Roles></span>
|
|
</code></pre></div><p><strong>PrivilegeUsers.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span style=color:#f92672><Users></span>
|
|
<span style=color:#f92672><User</span> <span style=color:#a6e22e>userId=</span><span style=color:#e6db74>"U10"</span> <span style=color:#a6e22e>username=</span><span style=color:#e6db74>"jill"</span> <span style=color:#a6e22e>password=</span><span style=color:#e6db74>"8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Firstname></span>Jill<span style=color:#f92672></Firstname></span>
|
|
<span style=color:#f92672><Lastname></span>Someone<span style=color:#f92672></Lastname></span>
|
|
<span style=color:#f92672><State></span>ENABLED<span style=color:#f92672></State></span>
|
|
<span style=color:#f92672><Locale></span>en-GB<span style=color:#f92672></Locale></span>
|
|
<span style=color:#f92672><Roles></span>
|
|
<span style=color:#f92672><Role></span>User<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672><Role></span>UserPrivileges<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672></Roles></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><Property</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"email"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"eitch+jill@eitchnet.ch"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></User></span>
|
|
|
|
<span style=color:#f92672><User</span> <span style=color:#a6e22e>userId=</span><span style=color:#e6db74>"U01"</span> <span style=color:#a6e22e>username=</span><span style=color:#e6db74>"admin"</span> <span style=color:#a6e22e>password=</span><span style=color:#e6db74>"8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Firstname></span>Jill<span style=color:#f92672></Firstname></span>
|
|
<span style=color:#f92672><Lastname></span>Someone<span style=color:#f92672></Lastname></span>
|
|
<span style=color:#f92672><State></span>ENABLED<span style=color:#f92672></State></span>
|
|
<span style=color:#f92672><Locale></span>en-GB<span style=color:#f92672></Locale></span>
|
|
<span style=color:#f92672><Roles></span>
|
|
<span style=color:#f92672><Role></span>StrolchAdmin<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672><Role></span>UserPrivileges<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672></Roles></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><Property</span> <span style=color:#a6e22e>name=</span><span style=color:#e6db74>"email"</span> <span style=color:#a6e22e>value=</span><span style=color:#e6db74>"eitch+admin@eitchnet.ch"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></User></span>
|
|
|
|
<span style=color:#75715e><!--
|
|
</span><span style=color:#75715e> Internal
|
|
</span><span style=color:#75715e> --></span>
|
|
<span style=color:#f92672><User</span> <span style=color:#a6e22e>userId=</span><span style=color:#e6db74>"S01"</span> <span style=color:#a6e22e>username=</span><span style=color:#e6db74>"agent"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><State></span>SYSTEM<span style=color:#f92672></State></span>
|
|
<span style=color:#f92672><Roles></span>
|
|
<span style=color:#f92672><Role></span>agent<span style=color:#f92672></Role></span>
|
|
<span style=color:#f92672></Roles></span>
|
|
<span style=color:#f92672></User></span>
|
|
|
|
<span style=color:#f92672></Users></span>
|
|
</code></pre></div><p><strong>StrolchConfiguration.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#75715e><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span style=color:#f92672><StrolchConfiguration></span>
|
|
<span style=color:#f92672><env</span> <span style=color:#a6e22e>id=</span><span style=color:#e6db74>"global"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Runtime></span>
|
|
<span style=color:#f92672><applicationName></span>Bookshop<span style=color:#f92672></applicationName></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><locale></span>en<span style=color:#f92672></locale></span>
|
|
<span style=color:#f92672><verbose></span>true<span style=color:#f92672></verbose></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Runtime></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>PrivilegeHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.runtime.privilege.PrivilegeHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.runtime.privilege.DefaultStrolchPrivilegeHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><privilegeConfigFile></span>PrivilegeConfig.xml<span style=color:#f92672></privilegeConfigFile></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>RealmHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.agent.api.RealmHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.agent.impl.DefaultRealmHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><depends></span>PrivilegeHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><realms></span>defaultRealm<span style=color:#f92672></realms></span>
|
|
|
|
<span style=color:#f92672><dataStoreMode></span>TRANSIENT<span style=color:#f92672></dataStoreMode></span>
|
|
<span style=color:#f92672><dataStoreFile></span>defaultModel.xml<span style=color:#f92672></dataStoreFile></span>
|
|
<span style=color:#f92672><enableObserverUpdates></span>true<span style=color:#f92672></enableObserverUpdates></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>ServiceHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.service.api.ServiceHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.service.api.DefaultServiceHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><depends></span>RealmHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><depends></span>PrivilegeHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><verbose></span>true<span style=color:#f92672></verbose></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>PolicyHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.policy.PolicyHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.policy.DefaultPolicyHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><readPolicyFile></span>true<span style=color:#f92672></readPolicyFile></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>ExecutionHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.execution.ExecutionHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.execution.EventBasedExecutionHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><depends></span>RealmHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><depends></span>PrivilegeHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>RestfulHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.rest.RestfulStrolchComponent<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.rest.RestfulStrolchComponent<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><depends></span>SessionHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><secureCookie></span>false<span style=color:#f92672></secureCookie></span>
|
|
<span style=color:#f92672><restLogging></span>false<span style=color:#f92672></restLogging></span>
|
|
<span style=color:#f92672><restLoggingEntity></span>false<span style=color:#f92672></restLoggingEntity></span>
|
|
<span style=color:#f92672><restTracing></span>ALL<span style=color:#f92672></restTracing></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>SessionHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.rest.StrolchSessionHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.rest.DefaultStrolchSessionHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><depends></span>PrivilegeHandler<span style=color:#f92672></depends></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><session.ttl.minutes></span>30<span style=color:#f92672></session.ttl.minutes></span>
|
|
<span style=color:#f92672><session.reload></span>true<span style=color:#f92672></session.reload></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672><Component></span>
|
|
<span style=color:#f92672><name></span>MailHandler<span style=color:#f92672></name></span>
|
|
<span style=color:#f92672><api></span>li.strolch.handler.mail.MailHandler<span style=color:#f92672></api></span>
|
|
<span style=color:#f92672><impl></span>li.strolch.handler.mail.SmtpMailHandler<span style=color:#f92672></impl></span>
|
|
<span style=color:#f92672><Properties></span>
|
|
<span style=color:#f92672><fromAddr></span>relayer@eitchnet.ch<span style=color:#f92672></fromAddr></span>
|
|
<span style=color:#f92672><fromName></span>Susi<span style=color:#f92672></fromName></span>
|
|
<span style=color:#f92672><overrideRecipients></span><span style=color:#75715e><![CDATA[IPSC Test <eitch@eitchnet.ch>]]></span><span style=color:#f92672></overrideRecipients></span>
|
|
<span style=color:#f92672><recipientWhitelist></span>eitch@eitchnet.ch<span style=color:#f92672></recipientWhitelist></span>
|
|
<span style=color:#f92672><username></span>test<span style=color:#f92672></username></span>
|
|
<span style=color:#f92672><password></span>test<span style=color:#f92672></password></span>
|
|
<span style=color:#f92672><auth></span>true<span style=color:#f92672></auth></span>
|
|
<span style=color:#f92672><startTls></span>true<span style=color:#f92672></startTls></span>
|
|
<span style=color:#f92672><host></span>smtp.gmail.com<span style=color:#f92672></host></span>
|
|
<span style=color:#f92672><port></span>587<span style=color:#f92672></port></span>
|
|
<span style=color:#f92672></Properties></span>
|
|
<span style=color:#f92672></Component></span>
|
|
|
|
<span style=color:#f92672></env></span>
|
|
|
|
<span style=color:#f92672><env</span> <span style=color:#a6e22e>id=</span><span style=color:#e6db74>"dev"</span><span style=color:#f92672>></span>
|
|
<span style=color:#75715e><!-- overrides go here --></span>
|
|
<span style=color:#f92672></env></span>
|
|
|
|
<span style=color:#f92672></StrolchConfiguration></span>
|
|
</code></pre></div><p><strong>StrolchPolicies.xml</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-xml data-lang=xml><span style=color:#f92672><StrolchPolicies></span>
|
|
<span style=color:#f92672><PolicyType</span> <span style=color:#a6e22e>Type=</span><span style=color:#e6db74>"ExecutionPolicy"</span> <span style=color:#a6e22e>Api=</span><span style=color:#e6db74>"li.strolch.execution.policy.ExecutionPolicy"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>Key=</span><span style=color:#e6db74>"DurationExecution"</span> <span style=color:#a6e22e>Class=</span><span style=color:#e6db74>"li.strolch.execution.policy.DurationExecution"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>Key=</span><span style=color:#e6db74>"ReservationExection"</span> <span style=color:#a6e22e>Class=</span><span style=color:#e6db74>"li.strolch.execution.policy.ReservationExecution"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></PolicyType></span>
|
|
<span style=color:#f92672><PolicyType</span> <span style=color:#a6e22e>Type=</span><span style=color:#e6db74>"ConfirmationPolicy"</span> <span style=color:#a6e22e>Api=</span><span style=color:#e6db74>"li.strolch.execution.policy.ConfirmationPolicy"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>Key=</span><span style=color:#e6db74>"DefaultConfirmation"</span> <span style=color:#a6e22e>Class=</span><span style=color:#e6db74>"li.strolch.execution.policy.ConfirmationPolicy"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></PolicyType></span>
|
|
<span style=color:#f92672><PolicyType</span> <span style=color:#a6e22e>Type=</span><span style=color:#e6db74>"ActivityArchivalPolicy"</span> <span style=color:#a6e22e>Api=</span><span style=color:#e6db74>"li.strolch.execution.policy.ActivityArchivalPolicy"</span><span style=color:#f92672>></span>
|
|
<span style=color:#f92672><Policy</span> <span style=color:#a6e22e>Key=</span><span style=color:#e6db74>"DefaultActivityArchival"</span> <span style=color:#a6e22e>Class=</span><span style=color:#e6db74>"li.strolch.execution.policy.ActivityArchivalPolicy"</span> <span style=color:#f92672>/></span>
|
|
<span style=color:#f92672></PolicyType></span>
|
|
<span style=color:#f92672></StrolchPolicies></span>
|
|
</code></pre></div><p>A few notes on the configuration:</p><ul><li><p>Note how there are three users. Jill is a user with currently no privileges as
|
|
it’s role definition is empty. Admin can do everything, and the agent user is
|
|
a system user which can also do everything.</p></li><li><p>There is one realm defined in the <code>RealmHandler</code> component which references
|
|
the
|
|
<code>defaultModel.xml</code> file in the <code>data</code> directory. This file then includes the
|
|
currently still empty <code>templates.xml</code> file.</p></li><li><p>We have defined a <code>global</code> environment, but are using the <code>dev</code> environment.
|
|
The dev environment includes the definitions in the global environment.</p></li><li><p>In <code>PrivilegeConfig.xml</code> we have enabled persistence of sessions, so you will
|
|
be needing the unlimited JCE libraries for your JVM.</p><p>When you restart the server, you don’t need to log back in, if your session is
|
|
still alive.</p></li><li><p>In <code>PrivilegeRoles.xml</code> there seems to be a lot of boilerplate. One thing about
|
|
a highly configurable system is that sometimes the configuration is bigger. In
|
|
this case we have opted to have the configuration shown and not use default
|
|
values which you don’t see, so that privilege access is clearly seen.</p></li></ul><p>Your project is now ready to be imported into your favourite IDE. We have used
|
|
both IntelliJ and Eclipse so this is up to you.</p><p>Now that we have a configuration, it is time to have Strolch started when the
|
|
WAR is deployed and started. In your IDE create a new class as follows:</p><p><strong>StartupListener.java</strong></p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-java data-lang=java><span style=color:#f92672>package</span> li.strolch.bookshop.web<span style=color:#f92672>;</span>
|
|
|
|
<span style=color:#f92672>import</span> javax.servlet.ServletContextEvent<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> javax.servlet.ServletContextListener<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> javax.servlet.annotation.WebListener<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> java.io.InputStream<span style=color:#f92672>;</span>
|
|
|
|
<span style=color:#f92672>import</span> li.strolch.agent.api.StrolchAgent<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> li.strolch.agent.api.StrolchBootstrapper<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> li.strolch.utils.helper.StringHelper<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> org.slf4j.Logger<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>import</span> org.slf4j.LoggerFactory<span style=color:#f92672>;</span>
|
|
|
|
<span style=color:#a6e22e>@WebListener</span>
|
|
<span style=color:#66d9ef>public</span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>StartupListener</span> <span style=color:#66d9ef>implements</span> ServletContextListener <span style=color:#f92672>{</span>
|
|
|
|
<span style=color:#66d9ef>private</span> <span style=color:#66d9ef>static</span> <span style=color:#66d9ef>final</span> Logger logger <span style=color:#f92672>=</span> LoggerFactory<span style=color:#f92672>.</span><span style=color:#a6e22e>getLogger</span><span style=color:#f92672>(</span>StartupListener<span style=color:#f92672>.</span><span style=color:#a6e22e>class</span><span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>private</span> <span style=color:#66d9ef>static</span> <span style=color:#66d9ef>final</span> String APP_NAME <span style=color:#f92672>=</span> <span style=color:#e6db74>"Bookshop"</span><span style=color:#f92672>;</span>
|
|
|
|
<span style=color:#66d9ef>private</span> StrolchAgent agent<span style=color:#f92672>;</span>
|
|
|
|
<span style=color:#a6e22e>@Override</span>
|
|
<span style=color:#66d9ef>public</span> <span style=color:#66d9ef>void</span> <span style=color:#a6e22e>contextInitialized</span><span style=color:#f92672>(</span>ServletContextEvent sce<span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
|
|
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>info</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Starting "</span> <span style=color:#f92672>+</span> APP_NAME <span style=color:#f92672>+</span> <span style=color:#e6db74>"..."</span><span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>long</span> start <span style=color:#f92672>=</span> System<span style=color:#f92672>.</span><span style=color:#a6e22e>currentTimeMillis</span><span style=color:#f92672>();</span>
|
|
<span style=color:#66d9ef>try</span> <span style=color:#f92672>{</span>
|
|
String boostrapFileName <span style=color:#f92672>=</span> <span style=color:#e6db74>"/WEB-INF/"</span> <span style=color:#f92672>+</span> StrolchBootstrapper<span style=color:#f92672>.</span><span style=color:#a6e22e>FILE_BOOTSTRAP</span><span style=color:#f92672>;</span>
|
|
InputStream bootstrapFile <span style=color:#f92672>=</span> sce<span style=color:#f92672>.</span><span style=color:#a6e22e>getServletContext</span><span style=color:#f92672>().</span><span style=color:#a6e22e>getResourceAsStream</span><span style=color:#f92672>(</span>boostrapFileName<span style=color:#f92672>);</span>
|
|
StrolchBootstrapper bootstrapper <span style=color:#f92672>=</span> <span style=color:#66d9ef>new</span> StrolchBootstrapper<span style=color:#f92672>(</span>StartupListener<span style=color:#f92672>.</span><span style=color:#a6e22e>class</span><span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span> <span style=color:#f92672>=</span> bootstrapper<span style=color:#f92672>.</span><span style=color:#a6e22e>setupByBoostrapFile</span><span style=color:#f92672>(</span>StartupListener<span style=color:#f92672>.</span><span style=color:#a6e22e>class</span><span style=color:#f92672>,</span> bootstrapFile<span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span><span style=color:#f92672>.</span><span style=color:#a6e22e>initialize</span><span style=color:#f92672>();</span>
|
|
<span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span><span style=color:#f92672>.</span><span style=color:#a6e22e>start</span><span style=color:#f92672>();</span>
|
|
<span style=color:#f92672>}</span> <span style=color:#66d9ef>catch</span> <span style=color:#f92672>(</span>Throwable e<span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>error</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Failed to start "</span> <span style=color:#f92672>+</span> APP_NAME <span style=color:#f92672>+</span> <span style=color:#e6db74>" due to: "</span> <span style=color:#f92672>+</span> e<span style=color:#f92672>.</span><span style=color:#a6e22e>getMessage</span><span style=color:#f92672>(),</span> e<span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>throw</span> e<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>}</span>
|
|
|
|
<span style=color:#66d9ef>long</span> took <span style=color:#f92672>=</span> System<span style=color:#f92672>.</span><span style=color:#a6e22e>currentTimeMillis</span><span style=color:#f92672>()</span> <span style=color:#f92672>-</span> start<span style=color:#f92672>;</span>
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>info</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Started "</span> <span style=color:#f92672>+</span> APP_NAME <span style=color:#f92672>+</span> <span style=color:#e6db74>" in "</span> <span style=color:#f92672>+</span> <span style=color:#f92672>(</span>StringHelper<span style=color:#f92672>.</span><span style=color:#a6e22e>formatMillisecondsDuration</span><span style=color:#f92672>(</span>took<span style=color:#f92672>)));</span>
|
|
<span style=color:#f92672>}</span>
|
|
|
|
<span style=color:#a6e22e>@Override</span>
|
|
<span style=color:#66d9ef>public</span> <span style=color:#66d9ef>void</span> <span style=color:#a6e22e>contextDestroyed</span><span style=color:#f92672>(</span>ServletContextEvent sce<span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
|
|
<span style=color:#66d9ef>if</span> <span style=color:#f92672>(</span><span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span> <span style=color:#f92672>!=</span> <span style=color:#66d9ef>null</span><span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>info</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Destroying "</span> <span style=color:#f92672>+</span> APP_NAME <span style=color:#f92672>+</span> <span style=color:#e6db74>"..."</span><span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>try</span> <span style=color:#f92672>{</span>
|
|
<span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span><span style=color:#f92672>.</span><span style=color:#a6e22e>stop</span><span style=color:#f92672>();</span>
|
|
<span style=color:#66d9ef>this</span><span style=color:#f92672>.</span><span style=color:#a6e22e>agent</span><span style=color:#f92672>.</span><span style=color:#a6e22e>destroy</span><span style=color:#f92672>();</span>
|
|
<span style=color:#f92672>}</span> <span style=color:#66d9ef>catch</span> <span style=color:#f92672>(</span>Throwable e<span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>error</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Failed to stop "</span> <span style=color:#f92672>+</span> APP_NAME <span style=color:#f92672>+</span> <span style=color:#e6db74>" due to: "</span> <span style=color:#f92672>+</span> e<span style=color:#f92672>.</span><span style=color:#a6e22e>getMessage</span><span style=color:#f92672>(),</span> e<span style=color:#f92672>);</span>
|
|
<span style=color:#66d9ef>throw</span> e<span style=color:#f92672>;</span>
|
|
<span style=color:#f92672>}</span>
|
|
<span style=color:#f92672>}</span>
|
|
logger<span style=color:#f92672>.</span><span style=color:#a6e22e>info</span><span style=color:#f92672>(</span><span style=color:#e6db74>"Destroyed "</span> <span style=color:#f92672>+</span> APP_NAME<span style=color:#f92672>);</span>
|
|
<span style=color:#f92672>}</span>
|
|
<span style=color:#f92672>}</span>
|
|
</code></pre></div><p>Now configure your IDE to start the web project, and then once it has started,
|
|
you should see the following in the logs:</p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-text data-lang=text>Bookshop:dev All 8 Strolch Components started. Took 44ms. Strolch is now ready to be used. Have fun =))
|
|
</code></pre></div><p>This log tells us the name of the app as defined in the StrolchConfiguration.xml
|
|
file as well as which environment was loaded. Further we can see that 8
|
|
components were configured and started.</p><p>This concludes the initial setup of a new Strolch project. We can now go ahead
|
|
and start building the business logic.</p><footer class=footline></footer></div></div><div id=navigation><a class="nav nav-prev" href=/tutorial/ title=Tutorial><i class="fa fa-chevron-left"></i></a><a class="nav nav-next" href=/tutorial/model/ title=Model style=margin-right:0><i class="fa fa-chevron-right"></i></a></div></section><div style=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px><div style=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div></div><script src=/js/clipboard.min.js?1660681133></script><script src=/js/perfect-scrollbar.min.js?1660681133></script><script src=/js/perfect-scrollbar.jquery.min.js?1660681133></script><script src=/js/jquery.sticky.js?1660681133></script><script src=/js/featherlight.min.js?1660681133></script><script src=/js/highlight.pack.js?1660681133></script><script>hljs.initHighlightingOnLoad();</script><script src=/js/modernizr.custom-3.6.0.js?1660681133></script><script src=/js/learn.js?1660681133></script><script src=/js/hugo-learn.js?1660681133></script><script src=/mermaid/mermaid.js?1660681133></script><script>mermaid.initialize({startOnLoad:true});</script><script type=text/javascript>var _paq=window._paq=window._paq||[];_paq.push(["setDocumentTitle",document.domain+"/"+document.title]);_paq.push(["setCookieDomain","*.strolch.li"]);_paq.push(['trackPageView']);_paq.push(['enableLinkTracking']);(function(){var u="https://piwik.eitchnet.ch/";_paq.push(['setTrackerUrl',u+'matomo.php']);_paq.push(['setSiteId','2']);var d=document,g=d.createElement('script'),s=d.getElementsByTagName('script')[0];g.type='text/javascript';g.async=true;g.src=u+'matomo.js';s.parentNode.insertBefore(g,s);})();</script></body></html> |