Commit Graph

123 Commits

Author SHA1 Message Date
Robert von Burg b0e57d6425 [New] Added filtering to GenericReport 2017-03-21 07:51:13 +01:00
Robert von Burg 30ad0fcaa8 [New] Added new generic report creator
Create a Report as follows:

<Resource Id="stockReport" Name="Stock Report" Type="Report">

  <ParameterBag Id="parameters" Name="parameters" Type="Parameters">
    <Parameter Id="objectType" Name="Object Type" Type="String"
Interpretation="Resource-Ref" Uom="Slot" Value="Slot" />
  </ParameterBag>

  <ParameterBag Id="columns" Name="Display Columns" Type="Display">
    <Parameter Id="location" Name="Location" Type="String"
Interpretation="Resource-Ref" Uom="Location" Value="$name" />
    <Parameter Id="storage" Name="Storage" Type="String"
Interpretation="Resource-Ref" Uom="Storage" Value="$name" />
    <Parameter Id="section" Name="Section" Type="String"
Interpretation="Resource-Ref" Uom="Section" Value="$name" />
    <Parameter Id="slot" Name="Slot" Type="String"
Interpretation="Resource-Ref" Uom="Slot" Value="$name" />
    <Parameter Id="product" Name="Product" Type="String"
Interpretation="Resource-Ref" Uom="Product" Value="$name" />
    <Parameter Id="quantity" Name="Quantity" Type="String"
Interpretation="Resource-Ref" Uom="Slot"
Value="Bags/parameters/quantity" />
    <Parameter Id="maxQuantity" Name="Quantity" Type="String"
Interpretation="Resource-Ref" Uom="Slot"
Value="Bags/parameters/maxQuantity" />
  </ParameterBag>

  <ParameterBag Id="joins" Name="Joins" Type="Joins">
    <Parameter Id="Product" Name="Product" Type="String"
Interpretation="Resource-Ref" Uom="Product" Value="Slot" />
    <Parameter Id="Section" Name="Section" Type="String"
Interpretation="Resource-Ref" Uom="Section" Value="Slot" />
    <Parameter Id="Storage" Name="Storage" Type="String"
Interpretation="Resource-Ref" Uom="Storage" Value="Section" />
    <Parameter Id="Location" Name="Location" Type="String"
Interpretation="Resource-Ref" Uom="Location" Value="Storage" />
  </ParameterBag>

</Resource>

This creates a report for objects of type Slot, where a Join is done on
multiple objects:
  Slot
    -> Product
    -> Section
         -> Storage
               -> Location

Thus the columns can then be fetched from different joing objects. The
joing is done by searching for a Parameter on the joined object on the
ParameterBag "relations". See the example XML on how this is done.

Or ask eitch@eitchnet.ch to write a proper documentation =))

Filtering is missing, and will be added later
2017-03-20 19:27:59 +01:00
Robert von Burg e0149cc4b0 [Major] Removed many visitors and implemented proper visitor pattern... 2017-03-02 16:52:50 +01:00
Robert von Burg 89739717f2 [Major] Refactored LockHandler to use Locator
This is required because in certain instances it is important to lock
the object before retrieving it, otherwise if, for instance in
execution, we would need to fetch, lock and re-fetch to be sure we have
the latest object.

In moste of the Update*Commands this is not important as we perform a
list commit wins, where the client wants their version to be persisted.
Later a optimistic locking can be performed in that the given version
must be the latest, otherwise an exception would be thrown
2017-02-22 12:14:23 +01:00
Robert von Burg 111a75c034 [Fix] Lock activities during execution! 2017-02-21 18:48:24 +01:00
Robert von Burg 5c8ccabd7f [New] Added new ReservationExection to reserve resources 2017-02-20 17:32:44 +01:00
Robert von Burg 99989de8b4 [New] Added StringMapResult to use as a ServiceResult 2017-02-20 09:17:18 +01:00
Robert von Burg 757300e955 [Fix] Don't delete other user's files! 2017-02-17 22:52:49 +01:00
Robert von Burg 9041bf9fb5 [New] Added new StringMapArgument for StrolchServices 2017-02-16 11:15:08 +01:00
Robert von Burg a67e18af40 [New] Added RuntimeMock.doServiceAssertResult() 2017-02-16 11:14:41 +01:00
Robert von Burg 061436e7ee [Project] Refactoring tests 2017-01-31 14:20:47 +01:00
Robert von Burg de1d569efd [Minor] Moved PrivilegeAddUserService to command, added tests 2017-01-31 14:20:14 +01:00
Robert von Burg 5cdffcc450 [New] Implemented StrolchTransaction.setSuppressAuditsForAudits() 2017-01-31 11:24:27 +01:00
Robert von Burg 02a8f9d3ef [Minor] Added JavaDoc to execution policies 2017-01-23 16:44:14 +01:00
Robert von Burg 13a7c83d96 [New] Added new SimpleExecution and DurationExecution extends it 2017-01-20 10:23:47 +01:00
Robert von Burg 744c7614d3 Merge branch 'release/1.4.0' into develop 2016-11-03 13:35:58 +01:00
Robert von Burg e7cf9bad6d [Fix] Fixed undo logic for general commands
Should a command be undone, then some commands performed an undo,
although they didn't perform their work, this led to an inconsistent
data model. I.e. AddResourceCommand would fail because the resource
already existed and an undo would lead to the existing object being
removed
2016-11-03 13:35:29 +01:00
Robert von Burg df4d716c35 Merge branch 'release/1.4.0' into develop 2016-11-03 12:14:31 +01:00
Robert von Burg da41e2aeb9 [Project] Remove xmlpers as dependency from service project 2016-11-03 12:10:43 +01:00
Robert von Burg 905db8c297 [Project] Set new version 1.5.0-SNAPSHOT 2016-11-03 12:07:38 +01:00
Robert von Burg bff0215510 [Major] Refactored the DurationExecutionTimer to not be singleton
Once again it is clear how bad singletons are. One test killed the
timer, thus all other tests failed. Now the DelayedExecutionTimer is
retrieved from the ExecutionHandler and is called DelayedExecutionTimer
with a default implementation of SimpleDurationExecutionTimer
instantiated by the EventBasedExecutionHandler
2016-10-11 14:59:52 +02:00
Robert von Burg 3be7f9e905 [Fix] Fix timing in execution tests for CI 2016-10-06 21:16:00 +02:00
Robert von Burg 001717d987 [Fix] Fixed ToStock Execution due to changes in Strolch 1.4.x 2016-10-06 20:46:15 +02:00
Robert von Burg b775c00f4d [Major] Implemented ExecutionDuration and fixed deep execution
Using the DurationExecution:

<Activity Id="produceBicycle" Name="Activity" Type="ToStock" 
        TimeOrdering="Series">
  <ParameterBag Name="objectives" Id="Objectives" Type="Objectives">
    <Parameter Name="Duration" Id="duration" Value="PT0.01S" 
          Type="Duration" />
  </ParameterBag>
  <Action Id="produce" Name="Produce" ResourceId="bicycle" 
          ResourceType="Product" Type="Produce" />
</Activity>

IActivityElement now has a new method .findParameter() to search up the
activity hierarchy to find the element
2016-10-06 20:38:06 +02:00
Robert von Burg 811b71f543 [Major] Implemented EventBasedExecutionHandler
Now all Actions are executed, as long as Execution is done through the
ExecutionHandler
2016-09-30 16:35:16 +02:00
Robert von Burg 48caa84903 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 15:54:30 +02:00
Robert von Burg dd227c65d0 [Major] Refactored SystemAction in privileges
Simplified the API, removed the privileged user - now always use the
agent system user for running system actions. One method has no return
value and one has a return value. Now it is easy to perform a system
action using:

    runAsAgent(ctx -> {
      // do work			
    });

    String result = runAsAgentWithResult(ctx -> {
      // do work
      return "done";
    });

    // execute a SystemAction
    runAsAgent(action);

    // execute a SystemActionWithResult
    String result = runAsAgentWithResult(actionWithResult);
2016-09-29 12:26:27 +02:00
Robert von Burg aab5f0b22f [Major] Moved planning services to li.strolch.planning 2016-09-24 19:07:42 +02:00
Robert von Burg 65c02d2cc0 [Major] Implemented first version of Activity execution 2016-09-23 14:20:16 +02:00
Robert von Burg b4bc62d11c [Major] Implemented first version of Activity execution 2016-09-23 14:03:42 +02:00
Robert von Burg d86e23b58f [Fix] Fixed locator finding for Activity and Action 2016-09-23 13:29:02 +02:00
Robert von Burg d413794213 [Major] Added Activity.TimeOrdering and updated Model XSD 2016-09-23 10:53:37 +02:00
Robert von Burg 02e0110fc6 [Minor] Refactoring packages of tests 2016-09-22 21:59:40 +02:00
Robert von Burg 5cbbfebf06 [Major] Services now consider Arg realm or user realm 2016-09-22 21:52:36 +02:00
Robert von Burg b7b9d63e79 [Major] Refactored services to use generic Arguments were applicable 2016-09-22 21:06:57 +02:00
Robert von Burg c89a275452 [Major] Planning commands are in planning package 2016-09-22 21:05:13 +02:00
Robert von Burg dc0a34dc9d [Project] Set new snapshot version 1.4.0-SNAPSHOT 2016-09-22 11:33:15 +02:00
Robert von Burg bda16a0f80 [Project] Updated project for deployment to Maven Central 2016-09-22 09:37:55 +02:00
Robert von Burg f8165208b1 [New] Added CRUD Services and Commands for Activities 2016-09-21 12:40:23 +02:00
Robert von Burg 6286949506 [New] Added StrolchRootElement Service Argument and Result classes 2016-09-21 09:48:36 +02:00
Robert von Burg 7269a5f3b1 [New] Added StrolchRootElement Service Argument and Result classes 2016-09-21 09:45:27 +02:00
Robert von Burg 6339f7df93 [Minor] Don't allow to add TimedState if already exists 2016-09-19 21:46:52 +02:00
Robert von Burg 7de48c0d43 [Project] Mockito is only test dependency 2016-09-16 11:30:16 +02:00
Robert von Burg 9602313410 [New] Implemented a SmtpMailer and Strolch MailHandler component
SmtpMailer is a singleton and requires properties.

Configure the MailHandler as follows:
<Component>
    <name>MailHandler</name>
    <api>li.strolch.handler.mail.MailHandler</api>
    <impl>li.strolch.handler.mail.SmtpMailHandler</impl>
    <Properties>
        <fromAddr>relayer@eitchnet.ch</fromAddr>
        <fromName>Consilium</fromName>
        <overrideRecipientAddr>eitch@eitchnet.ch</overrideRecipientAddr>
        <overrideRecipientName>Consilium Test</overrideRecipientName>
        <username>relayer@eitchnet.ch</username>
        <password>M5ztAE4a1NWWZBHaUd2ey9aoH</password>
        <auth>true</auth>
        <startTls>true</startTls>
        <host>smtp.gmail.com</host>
        <port>587</port>
    </Properties>
</Component>
2016-09-08 11:19:10 +02:00
Robert von Burg bcc0bf4a10 [Major] Now users can reset their own passwords
- built in User Challenge feature (currently only console)
- extended REST API to allow user to initiate a challenge and then use
the challenge to authenticate for a one time change password session
2016-09-07 14:41:16 +02:00
Robert von Burg 8c4c8e539e [Major] Implemented opt-in versioning
- Implemented marshalling of Version
- Added further tests for marshalled version
- added version in deep equals
- fixing further tests
2016-08-07 17:47:52 +02:00
Robert von Burg 9dc09515e9 [Major] Implemented opt-in versioning
Now all root elements have a version, and if the realm has versioning
enabled, then actions through the ElementMap lead to new versions being
created. There are also methods to revert/undo changes to an object.

Some tests are still failing, this will be fixed later
2016-08-05 20:24:23 +02:00
Robert von Burg 612745098b [Project] Set new SNAPSHOT version 1.3.0-SNAPSHOT 2016-07-05 09:57:44 +02:00
Robert von Burg 611a7c670a [Project] Set new SNAPSHOT version 1.2.1-SNAPSHOT 2016-07-05 09:56:56 +02:00
Robert von Burg e15b93e690 [Project] Set version 1.2.0 2016-07-05 09:52:34 +02:00