Skip to content

Commit 15ee91b

Browse files
author
JelteMX
committed
Update 1.3.0
1 parent 4c9751e commit 15ee91b

18 files changed

+199
-19
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![Support](https://img.shields.io/badge/Support-Community%20(no%20active%20support)-orange.svg)](https://docs.mendix.com/developerportal/app-store/app-store-content-support)
2+
[![Studio](https://img.shields.io/badge/Studio%20version-8.0%2B-blue.svg)](https://appstore.home.mendix.com/link/modeler/)
3+
![GitHub release](https://img.shields.io/github/release/JelteMX/mendix-fake-data-module)
4+
![GitHub issues](https://img.shields.io/github/issues/JelteMX/mendix-fake-data-module)
5+
16
# Fake Data Module for Mendix
27

38
![Icon](/assets/FakeDataIcon.png)
@@ -6,6 +11,38 @@ Want to generate fake data in Mendix? The Fake Data Module for Mendix does this
611

712
![screenshot](/assets/FakeDataScreenshot1.png)
813

14+
## Java Actions
15+
16+
### Dates
17+
18+
- **GenerateDateBetween** - generate a date between two dates
19+
20+
### Numbers
21+
22+
- **GenerateDecimalBetween** - generate a decimal between two numbers
23+
- **GenerateNumberBetween** - generate an integer/long between two numbers
24+
- **GenerateNumberDigits** - generate an long number with an X amount of digits
25+
26+
### Objects
27+
28+
The following Entities can be created:
29+
30+
- App
31+
- Artist
32+
- Cat
33+
- Commerce
34+
- Name
35+
36+
Please have a look at the Domain Model in the module for all attributes that are set.
37+
38+
### Strings
39+
40+
- **GenerateFakeString** - generate a string from a predefined list of types, like hashes, quotes
41+
- **GenerateQuote** - generate a string that holds a quote from one of the predefined movies/characters
42+
- **GenerateRandomColorHex** - generate a color in HEX format
43+
- **GenerateRandomRegexString** - generate a string based on a Regex. More information can be found here: [https://github.com/mifmif/Generex](https://github.com/mifmif/Generex)
44+
- **GenerateRandomString** - generate a string based on a mask. This mask will replace any `?` with a letter and any `#` with a number.
45+
946
## Libraries used
1047

1148
- Apache Commons Lang

dist/FakeData.mpk

3.57 KB
Binary file not shown.

src/javasource/fakedata/actions/GenerateApp.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.core.Core;
1415
import com.mendix.systemwideinterfaces.core.IContext;
@@ -27,7 +28,8 @@ public GenerateApp(IContext context)
2728
public IMendixObject executeAction() throws Exception
2829
{
2930
// BEGIN USER CODE
30-
Faker faker = new Faker();
31+
Random random = new Random(this.getContext().getRequestStartTime());
32+
Faker faker = new Faker(random);
3133
com.github.javafaker.App app = faker.app();
3234

3335
IMendixObject object = Core.instantiate(getContext(), App.getType());

src/javasource/fakedata/actions/GenerateArtist.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.core.Core;
1415
import com.mendix.systemwideinterfaces.core.IContext;
@@ -27,7 +28,8 @@ public GenerateArtist(IContext context)
2728
public IMendixObject executeAction() throws Exception
2829
{
2930
// BEGIN USER CODE
30-
Faker faker = new Faker();
31+
Random random = new Random(this.getContext().getRequestStartTime());
32+
Faker faker = new Faker(random);
3133
com.github.javafaker.Artist artist = faker.artist();
3234

3335
IMendixObject object = Core.instantiate(getContext(), Artist.getType());

src/javasource/fakedata/actions/GenerateCat.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.core.Core;
1415
import com.mendix.systemwideinterfaces.core.IContext;
@@ -27,7 +28,8 @@ public GenerateCat(IContext context)
2728
public IMendixObject executeAction() throws Exception
2829
{
2930
// BEGIN USER CODE
30-
Faker faker = new Faker();
31+
Random random = new Random(this.getContext().getRequestStartTime());
32+
Faker faker = new Faker(random);
3133
com.github.javafaker.Cat cat = faker.cat();
3234

3335
IMendixObject object = Core.instantiate(getContext(), Cat.getType());

src/javasource/fakedata/actions/GenerateCommerce.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.core.Core;
1415
import com.mendix.systemwideinterfaces.core.IContext;
@@ -34,7 +35,8 @@ public GenerateCommerce(IContext context, java.math.BigDecimal MinPrice, java.ma
3435
public IMendixObject executeAction() throws Exception
3536
{
3637
// BEGIN USER CODE
37-
Faker faker = new Faker();
38+
Random random = new Random(this.getContext().getRequestStartTime());
39+
Faker faker = new Faker(random);
3840
com.github.javafaker.Commerce commerce = faker.commerce();
3941

4042
IMendixObject object = Core.instantiate(getContext(), Commerce.getType());

src/javasource/fakedata/actions/GenerateCountry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.core.Core;
1415
import com.mendix.systemwideinterfaces.core.IContext;
@@ -27,7 +28,8 @@ public GenerateCountry(IContext context)
2728
public IMendixObject executeAction() throws Exception
2829
{
2930
// BEGIN USER CODE
30-
Faker faker = new Faker();
31+
Random random = new Random(this.getContext().getRequestStartTime());
32+
Faker faker = new Faker(random);
3133
com.github.javafaker.Country country = faker.country();
3234

3335
IMendixObject object = Core.instantiate(getContext(), Country.getType());

src/javasource/fakedata/actions/GenerateDateBetween.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package fakedata.actions;
1111

1212
import java.util.Date;
13+
import java.util.Random;
1314
import com.github.javafaker.Faker;
1415
import com.mendix.systemwideinterfaces.core.IContext;
1516
import com.mendix.webui.CustomJavaAction;
@@ -30,7 +31,8 @@ public GenerateDateBetween(IContext context, java.util.Date BeginDate, java.util
3031
public java.util.Date executeAction() throws Exception
3132
{
3233
// BEGIN USER CODE
33-
Faker faker = new Faker();
34+
Random random = new Random(this.getContext().getRequestStartTime());
35+
Faker faker = new Faker(random);
3436
Date dateBetween = faker.date().between(this.BeginDate, this.EndDate);
3537
return dateBetween;
3638
// END USER CODE

src/javasource/fakedata/actions/GenerateDecimalBetween.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package fakedata.actions;
1111

1212
import java.math.BigDecimal;
13+
import java.util.Random;
1314
import com.github.javafaker.Faker;
1415
import com.mendix.systemwideinterfaces.core.IContext;
1516
import com.mendix.webui.CustomJavaAction;
@@ -32,7 +33,8 @@ public GenerateDecimalBetween(IContext context, java.lang.Long Min, java.lang.Lo
3233
public java.math.BigDecimal executeAction() throws Exception
3334
{
3435
// BEGIN USER CODE
35-
Faker faker = new Faker();
36+
Random random = new Random(this.getContext().getRequestStartTime());
37+
Faker faker = new Faker(random);
3638

3739
Long min = (this.Min > this.Max) ? this.Max : this.Min;
3840
Long max = (this.Max < this.Min) ? this.Min : this.Max;

src/javasource/fakedata/actions/GenerateFakeString.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package fakedata.actions;
1111

12+
import java.util.Random;
1213
import com.github.javafaker.Faker;
1314
import com.mendix.systemwideinterfaces.core.IContext;
1415
import com.mendix.webui.CustomJavaAction;
@@ -31,7 +32,8 @@ public GenerateFakeString(IContext context, java.lang.String Parameter)
3132
public java.lang.String executeAction() throws Exception
3233
{
3334
// BEGIN USER CODE
34-
Faker faker = new Faker();
35+
Random random = new Random(this.getContext().getRequestStartTime());
36+
Faker faker = new Faker(random);
3537

3638
if (this.Parameter == null) {
3739
return "";

0 commit comments

Comments
 (0)