opfab / operatorfabric-core Goto Github PK
View Code? Open in Web Editor NEWMain operatorfabric program
Home Page: https://opfab.github.io
License: Mozilla Public License 2.0
Main operatorfabric program
Home Page: https://opfab.github.io
License: Mozilla Public License 2.0
Integrate sonar quality metrics with Travis build
See #2
The feed needs to be filtered, there is two kind of filters:
The latter needs specific server side behaviour for optimisation.
See #2.
See #2
This is a sub user story of #22.
When accessing the feed an Operator needs to it to be initiated with cards previously published. The loaded cards are limited to the actual selected time span.
Related tasks:
Templates are defined using Handlebars template syntax. The same template must be redefine for each languages supported by the Third Party Service.
Templates define html layout of a card detail, they are injected with data consisting of the card itself allowing its properties to be accessed in the template definition (See card model as defined in card swagger file.
In addition to the standard Handlebars helpers, operator-fabric provides some additionnal helpers:
formats a number parameter using Intl.NumberFormat.
The locale used is current user selected one, and options are passed as hash parameters (see Handlebars doc Literals section).
{{numberFormat data.price style="currency" currency="EUR"}}
formats the submitted parameters (millisecond since epoch) using mement.format.
The locale used is current user selected one, thr format is "format" hash parameter (see Handlebars doc Literals section).
{{dateFormat data.birthday format="MMMM Do YYYY, h:mm:ss a"}}
extracts a sub array from ann array
example:
<!--
{"array": ["foo","bar","baz"]}
-->
<ul>
{{#each (slice array 0 2)}}
<li>{{this}}</li>
{{/each}}
</ul>
outputs:
<ul>
<li>foo</li>
<li>bar</li>
</ul>
and
<!--
{"array": ["foo","bar","baz"]}
-->
<ul>
{{#each (slice array 1)}}
<li>{{this}}</li>
{{/each}}
</ul>
outputs:
<ul>
<li>bar</li>
<li>baz</li>
</ul>
Outputs current date as millisecond from epoch. the date is computed from application internal time service and thus may be different from the date that one can compute from javascript api which relies on the browsers' system time.
NB: Due to Handlebars limitation you must provide at least one argument to helpers otherwise, Handlebars will confuse a helper and a variable. In the bellow example, we simply pass an empty string.
example:
{{now ""}}
{{dateFormat (now "") format="MMMM Do YYYY, h:mm:ss a"}}
outputs
preserve space in parameter string to avoid html standard space trimming.
{{preserveSpace data.businessId}}
returns a boolean result value on an arithmetical operation (including object equality) or boolean operation.
arguments:
arithmetical operator:
boolean operators
examples:
{{#if (bool v1 '<' v2}}
v1 is strictly lower than v2
{{else}}
V2 is lower or equal to v1
{{/if}}
returns the result of a mathematical operation.
arguments:
arithmetical operator:
example:
{{math 1 '+' 2}}
splits a string into an array based on a split string
example:
<ul>
{{#each (split 'my.example.string' '.')]]
<li>{{this}}</li>
{{/each}}
</ul>
outputs
<ul>
<li>my</li>
<li>example</li>
<li>string</li>
</ul>
outputs a card action button whose card action id is the concatenation of an arbitrary number of helper arguments
{{{cardAction "PREREQUISITE_" id}}}
outputs a svg tag with lazy loading, and missing image replacement message. The image url is the concatenation of an arbitrary number of helper arguments
{{{svg baseUri scheduledOpId "/" substation "/before/" computationPhaseOrdinal}}}
outputs a i18n result from a key and parameters. There are two way of configuring
{{i18n data.i18nTitle}}
<!--
emergency.title=Emergency situation happened on {{date}}. Cause : {{cause}}.
-->
{{i18n "emergency.title" date="2018-06-14" cause="Broken Cofee Machine"}}
outputs
Emergency situation happened on 2018-06-14. Cause : Broken Cofee Machine
Sorts an array or object's properties (first argument) using an optional field name (second argument) to sort the collection on this fields natural order
if no field argument is provided :
* if the sorted structure is an array, the original order of the array is kept ;
* if the sorted structure is an object, the structure is sorted by objects field name.
<!--
users :
{"john": { "firstName": "John", "lastName": "Cleese"},
"graham": { "firstName": "Graham", "lastName": "Chapman"},
"terry": { "firstName": "Terry", "lastName": "Gilliam"},
"eric": { "firstName": "Eric", "lastName": "Idle"},
"terry": { "firstName": "Terry", "lastName": "Jones"},
"michael": { "firstName": "Michael", "lastName": "Palin"},
-->
<ul>
{{#each (sort users)}}
<li>{{this.firstName}} {{this.lastName}}</li>
{{/each}}
</ul>
outputs :
<ul>
<li>Eric Idle</li>
<li>Graham Chapman</li>
<li>John Cleese</li>
<li>Michael Pallin</li>
<li>Terry Gilliam</li>
<li>Terry Jones</li>
</ul>
and
<ul>
{{#each (sort users "lastName")}}
<li>{{this.firstName}} {{this.lastName</li>
{{/each}}
</ul>
outputs :
<ul>
<li>Graham Chapman</li>
<li>John Cleese</li>
<li>Terry Gilliam</li>
<li>Eric Idle</li>
<li>Terry Jones</li>
<li>Michael Pallin</li>
</ul>
This task relates to #22 user story.
Display the card in a feed on the left of the screen.
Angular application is automatically rerouted to /feed when basehref is different from /
The user logs in relying on an external authentication service.
On a technical note, the external autherization service must be Oauth2 compliant (By design or with a Facade)
When a feed card is selected by clicking on it, the following is displayed:
The details are a rendition of a template defined by the associated Third Party Service (the card publisher) templates are defined separately by the Third Party Services (See #44). The templates are injected with data consisting of the card itself allowing it properties to be accessed in the template definition (See #47).
Card are loaded throught a REST endpoint (See #32).
Integrate the client ui with the card-publication-business-service endpoint GET /cardOperations and display incomming cards. Requires :
Github analysis raised two alarms which must be solved before next release
Publication has to be available through a REST entry point, it allows to publish one or more cards.
Two publication mode are available:
See #34
Todo :
Complet ui doc and comment code
See #13
See #2
Initiate Travis config in repository, declare project in Travis
Part of #42 US
See #13
User data cannot be linearized anymore. Critical has many other services relies on it.
After cloning the project and building it, the compose up of the demo stack generates a lot of exceptions and the platform is not running correctly.
It looks that the registry and config containers are involved in a dead lock.
The registry failed to run because it is unable to connect the config container, but the config container is trying to connect the registry container.
From the registry container logs:
2019-01-21 16:06:14.146 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://config:8080
2019-01-21 16:06:14.161 INFO 1 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://config:8080. Will be trying the next url if available
2019-01-21 16:06:14.179 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:136) ~[spring-cloud-config-client-2.1.0.RC3.jar!/:2.1.0.RC3]
at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$$FastClassBySpringCGLIB$$fa44b2a.invoke(<
Form the config container logs:
2019-01-21 16:06:13.663 INFO 1 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2019-01-21 16:06:13.663 INFO 1 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2019-01-21 16:06:13.859 ERROR 1 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://registry:8080/eureka/}
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar!/:1.19.1]
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) ~[jersey-client-1.19.1.jar!/:1.19.1]
Full log files are attached to this issue (note that I ran the demo twice, but with the same effect).
config.log
registry.log
Best regards
Environment: Mac OS
Java 1.8 Gradle 4.7
Script
514 git clone https://github.com/opfab/operatorfabric-core.git
515 cd operatorfabric-core/
516 bin/build_all.sh
517 bin/setup_dockerized_environment.sh
518 cd src/main/docker/demo/
523 docker-compose up
524 docker-compose up
525 mkdir /tmp/opfab
526 docker logs registry /tmp/opfab/registry.log
527 docker logs registry >/tmp/opfab/registry.log
If a new user authenticate succesfully for the first time, an account is created identified by its login. This account is not associated to any group and can only receive card for which he is an explicit recipient.
See #2.
See #13
See #2.
Relates to #24 user story.
When oppeing SSE flow to get feed cards, the Flow must not only be fed with newly published cards but also be fed with already published cards persisted in database.
To avoid unwanted breaking of sinks for both persistance and notification, we need better error handling.
More specificaly we do not want a runtime to break the sink.
In html files the java headers were added instead of the html headers for licence disclaimer.
Once authenticated, an operator needs to access the card feed. The card feed provides the Operator with relevant card.
A "relevant card" is a card for which the operator is either:
A recipient is an Operator or Group which is concerned by the card
A main recipient is an Operator that is supposed the handle the card himself
NB: not all cards have main recipient but all cards accessible to an operator have recipient.
The following Tasks and user stories are sub task to this user story:
This first user story only focuses on a basic REST API based user management.
Other management means such as management throught UX and OAuth2 role base managment will be adressed by other user stories.
As an administrator, I want to add/remose users to/from group.
Complete javadoc and comment code
The Third Model class must be enhance with the following attribute:
MenuEntry is a class composed of the folowing attributes
Dear,
I am trying to build OperatorFabric from scratch on Mac OS X using the bin/build_all script but the build stopped by 'Failed to apply plugin [id 'cz.malohlava']'.
Note that I have to uncomment in the main build.gradle file the last lines because gradle complains about the fact that the wrapper task is defined several times.
Here follows the stack trace.
Thanks for your attention
Olivier Coussaert
Aprico Consultants
Build time: 2019-01-02 18:57:47 UTC
Revision: d09c2e354576ac41078c322815cc6db2b66d976e
Kotlin DSL: 1.1.0
Kotlin: 1.3.11
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 1.8.0_151 (Oracle Corporation 25.151-b12)
OS: Mac OS X 10.14 x86_64
NB/ realpath from Apple does not behave like the Linux realpath (but can be easily fixed by using brew).
Now the output of bin/build_all.sh :
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 29s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
Oliviers-MacBook-Pro:operatorfabric-core ocouss$ clear
Oliviers-MacBook-Pro:operatorfabric-core ocouss$ bin/build_all.sh
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
FAILURE: Build failed with an exception.
Where:
Build file '/Users/ocouss/operatorFabric/operatorfabric-core/services/services.gradle' line: 32
What went wrong:
A problem occurred evaluating project ':services'.
Failed to apply plugin [id 'cz.malohlava']
Could not create plugin of type 'VisTaskExecGraphPlugin'.
> org/gradle/execution/taskgraph/TaskInfo
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
The feed needs to be sorted on the start date of card. More accurate sort functionnalities will be defined in later user stories.
Create site in github io to host API pages, user documentation and other public documentation.
Keep deeper technical documentation, governance documentation etc. in github wiki.
Simplify oauth2 recative authentication configuration accordingly
Define the following resources
i18n entries may be used in:
Templates and style define the rendering of card data. Their may be multiple templates associated with cards, templates are internationnalized, service may provide one template for each language it supports.
Sound are media files played when a new card is first displayed in a user's feed.
Menu entries are additionnal menu items to display in Operator Fabric main menu.
Definition of those data relies on a bundle of configuration file compressed as a tar.gz file, the archive must comply with a specific structure.
bundle
└──css
│ └──tab.css
│ └──emergency.css
└──i18n
│ └──en.json
│ └──fr.json
└──media
│ └──en
│ └──sound.opus
│ └──sound.mp3
│ └──fr
│ └──sound.opus
│ └──sound.mp3
└──template
│ └──en
│ └──emergency.handlebars
│ └──fr
│ └──emergency.handlebars
└──config.json
{
"name": "sample",
"version": "0.1",
"defaultLocale": "fr",
"templates": [
"emergency"
],
"csses": [
"tab",
"emergency"
],
"medias": {
"sound": {
"name": "sound",
"files": [
"sound.opus",
"sound.mp3"
]
}
},
"locales": [
"fr",
"en"
]
}
An entry point must be available that accepts POST request and consumes multipart/form-data
Part of #52 user story.
Create an entry point to access archiveCard mongo collection.
The collection will be queried throught a Spring mongo reactive repository.
The Http routing to the controller is to be defined in ArchiveCardRouteConfig (see CardRouteConfig and CardOperationRoutesConfig as an example).
Different filters are to be implemented, a custom repository may be needed see CardRepository for deep repository customization.
This is the header task for the following travis configuration subtasks
Find a way to mix the cards loaded from mongo into the flux of cards issued from AMQP
See #13
Please,
In the README.md, provide the description of the users defined for the demo (login & password)
Provide more neutral users (TSO1, TSO2, TSO3, RSC1,...).
Thanks.
The Operator may access predefine webpages throught URLs referenced in a menu.
If a Third Party Service define one menu item, it is displayed as a first level operator fabric main menu item. Otherwise a first level menu item named by the name of the service unfold into a submenu listing all URL.
Each menu item is define by:
Related tickets:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.