Skip to content

Commit ba3157c

Browse files
author
Yasuyuki Takeo
committed
Merge branch 'release/7.3.0'
2 parents a2df3c1 + ec0e82a commit ba3157c

31 files changed

+765
-496
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,28 @@ Dummy Factory generates dummy data for debugging use. Please don't use this for
2020

2121
## Required environment
2222
* Java 1.8 or above
23-
* Liferay 7.2 GA1 / Liferay DXP 7.2 GA1 or above (Master / Develop branch)
24-
* Liferay 7.0 (Please see 7.0.x branch)
23+
* Liferay 7.3 GA1 (Master / Develop branch)
24+
* Liferay 7.2 GA1 / Liferay DXP 7.2 GA1 or above (Please see 7.2.x branch)
2525
* Liferay 7.1 (Please see 7.1.x branch)
26+
* Liferay 7.0 (Please see 7.0.x branch)
2627

2728
## Usage
28-
### For 7.2
29-
1. Download jar file from [here](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/master/latest) and place it in ${liferay-home}/deploy folder.
29+
| Version | Link |
30+
| ------------- |:------------- |
31+
| 7.3 | [https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/master/latest](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/master/latest) |
32+
| 7.2 | [https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.2.x/latest](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.2.x/latest) |
33+
| 7.1 | [https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.1.x/latest](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.1.x/latest) |
34+
| 7.0 | [https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.0.x/latest](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.0.x/latest) |
35+
36+
1. Download jar file according to the version above and place it int `${liferay-home}/deploy `
3037
2. Start Liferay bundle and login as an administrator.
3138
3. After the jar is properly installed, navigate to ```Control Panel``` in the left pane and under ```Apps``` folder, Dummy Factory portlet will be found. Please place that on a page.
3239
4. Now you are ready to create dummy data! Enjoy!
3340

34-
### For 7.1
35-
1. Download jar file from [here](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.1.x/latest) and place it in ${liferay-home}/deploy folder.
36-
2. Start Liferay bundle and login as an administrator.
37-
3. After the jar is properly installed, navigate to ```Control Panel``` in the left pane and under ```Apps``` folder, Dummy Factory portlet will be found. Please place that on a page.
38-
4. Now you are ready to create dummy data! Enjoy!
39-
40-
### For 7.0
41-
Please download file from[here](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.0.x/latest) and follow the same steps above.
42-
4341
## How can I compile Dummy Factory on my own?
44-
1. Create a Liferay Workspace for 7.2 (or 7.0 for 7.0.x branch and 7.1 for 7.1.x branch)
45-
2. Clone this repository to ```${liferay_workspace_home}/modules```.
46-
3. At the root directory, run ```../gradlew clean assemble``` or ```blade gw assemble``` if you've installed `blade` tool. ```liferay.dummy.factory-x.x.x.jar``` will be created under ```/build/libs/``` directory.
42+
1. Create a Liferay Workspace for appropriate version (7.2.x branch is for 7.2, for example)
43+
2. Clone this repository to `${liferay_workspace_home}/modules`.
44+
3. At the root directory, run `../gradlew clean assemble` or `blade gw assemble` if you've installed `blade` tool. ```liferay.dummy.factory-x.x.x.jar``` will be created under ```/build/libs/``` directory.
4745
4. To install onto your Liferay bundle, startup Liferay bundle on your local and run ```blade deploy```. Dummy Factory portlet will be deployed.
4846

4947
## Bug / Enhancement request

bnd.bnd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Bundle-Name: Liferay Dummy Factory Portlet
22
Bundle-SymbolicName: liferay.dummy.factory
3-
Bundle-Version: 7.2.3
3+
Bundle-Version: 7.3.0
44
Web-ContextPath: /liferay-dummy-factory
55
-dsannotations-options: inherit
66
-sources: true

build.gradle

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -64,46 +64,48 @@ dependencies {
6464
compile group: "commons-fileupload", name: "commons-fileupload", version: "1.3.3"
6565
compile group: "org.apache.felix", name: "org.apache.felix.gogo.runtime", version: "0.10.0"
6666

67-
compile group: "com.liferay", name: "com.liferay.application.list.api", version: "4.0.0"
68-
compile group: "com.liferay", name: "com.liferay.frontend.taglib", version: "4.0.0"
69-
compile group: "com.liferay", name: "com.liferay.frontend.taglib.clay", version: "2.0.0"
70-
compile group: "com.liferay", name: "com.liferay.frontend.taglib.util", version: "2.0.0"
71-
compile group: "com.liferay", name: "com.liferay.item.selector.api", version: "4.0.0"
72-
compile group: "com.liferay", name: "com.liferay.item.selector.criteria.api", version: "4.0.0"
73-
compile group: "com.liferay", name: "com.liferay.item.selector.taglib", version: "3.0.0"
74-
compile group: "com.liferay", name: "com.liferay.trash.taglib", version: "4.0.0"
75-
compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.1.+"
76-
compile group: "com.liferay", name: "com.liferay.portal.instances.api", version: "3.0.0"
67+
compile "com.liferay:com.liferay.application.list.api"
68+
compile "com.liferay:com.liferay.frontend.taglib"
69+
compile "com.liferay:com.liferay.frontend.taglib.clay"
70+
compile "com.liferay:com.liferay.frontend.taglib.util"
71+
compile "com.liferay:com.liferay.item.selector.api"
72+
compile "com.liferay:com.liferay.item.selector.criteria.api"
73+
compile "com.liferay:com.liferay.item.selector.taglib"
74+
compile "com.liferay:com.liferay.trash.taglib"
75+
compile "com.liferay:com.liferay.portal.spring.extender:2.1.+"
76+
compile "com.liferay:com.liferay.portal.instances.api"
7777

78-
compile group: "com.liferay", name: "com.liferay.frontend.js.loader.modules.extender.api", version: "3.0.0"
79-
80-
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.0.0"
81-
compile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "4.0.0"
82-
compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.0"
83-
compile group: "com.liferay", name: "com.liferay.message.boards.api", version: "5.0.0"
84-
compile group: "com.liferay", name: "com.liferay.message.boards.service", version: "3.0.0"
85-
compile group: "com.liferay", name: "com.liferay.blogs.api", version: "5.0.0"
86-
87-
compile group: "com.liferay", name: "com.liferay.portal.settings.api", version: "4.0.0"
88-
compile group: "com.liferay", name: "com.liferay.portal.settings.lang", version: "3.0.0"
89-
90-
compile group: "com.liferay", name: "com.liferay.journal.api", version: "4.0.0"
91-
compile group: "com.liferay", name: "com.liferay.journal.service", version: "4.0.0"
92-
compile group: "com.liferay", name: "com.liferay.wiki.api", version: "4.0.0"
93-
compile group: "com.liferay", name: "com.liferay.wiki.service", version: "3.0.0"
94-
compile group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
95-
compile group: "com.liferay", name: "com.liferay.petra.function", version: "3.0.0"
96-
97-
compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.service", version: "3.0.0"
98-
compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.api", version: "4.0.0"
99-
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.api", version: "5.0.0"
100-
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.service", version: "4.0.0"
101-
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.taglib", version: "4.0.0"
102-
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.io", version: "4.0.0"
103-
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.validator", version: "4.0.0"
104-
compile group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.+"
105-
compile group: "com.liferay", name: "com.liferay.portal.background.task.api", version: "4.0.0"
106-
compile group: "com.liferay", name: "com.liferay.document.library.api", version: "5.0.0"
78+
compile "com.liferay:com.liferay.frontend.js.loader.modules.extender.api"
79+
80+
compile "com.liferay.portal:com.liferay.portal.kernel"
81+
compile "com.liferay.portal:com.liferay.portal.impl"
82+
compile "com.liferay.portal:com.liferay.util.taglib"
83+
compile "com.liferay:com.liferay.message.boards.api"
84+
compile "com.liferay:com.liferay.message.boards.service"
85+
compile "com.liferay:com.liferay.blogs.api"
86+
87+
compile "com.liferay:com.liferay.portal.settings.api"
88+
compile "com.liferay:com.liferay.portal.settings.lang"
89+
90+
compile "com.liferay:com.liferay.journal.api"
91+
compile "com.liferay:com.liferay.journal.service"
92+
compile "com.liferay:com.liferay.wiki.api"
93+
compile "com.liferay:com.liferay.wiki.service"
94+
compile "com.liferay:com.liferay.wiki.web"
95+
96+
compile "com.liferay:com.liferay.petra.string"
97+
compile "com.liferay:com.liferay.petra.function"
98+
99+
compile "com.liferay:com.liferay.dynamic.data.lists.service"
100+
compile "com.liferay:com.liferay.dynamic.data.lists.api"
101+
compile "com.liferay:com.liferay.dynamic.data.mapping.api"
102+
compile "com.liferay:com.liferay.dynamic.data.mapping.service"
103+
compile "com.liferay:com.liferay.dynamic.data.mapping.taglib"
104+
compile "com.liferay:com.liferay.dynamic.data.mapping.io:4.0.+"
105+
compile "com.liferay:com.liferay.dynamic.data.mapping.validator"
106+
compile "com.liferay:com.liferay.portal.configuration.metatype:2.0.+"
107+
compile "com.liferay:com.liferay.portal.background.task.api"
108+
compile "com.liferay:com.liferay.document.library.api"
107109

108110
compile group: "javax.portlet", name: "portlet-api", version: "3.0.0"
109111
compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
@@ -114,8 +116,8 @@ dependencies {
114116
testCompile 'org.codehaus.groovy:groovy-all:2.5.+'
115117
testCompile group: 'cglib', name: 'cglib-nodep', version:'latest.integration'
116118
testCompile group: 'junit', name: 'junit', version:'4.12'
117-
testCompile group: 'org.apache.tika', name: 'tika-core', version: '1.19.1'
118-
testCompile group: 'org.apache.tika', name: 'tika-parsers', version: '1.19.1'
119+
testCompile group: 'org.apache.tika', name: 'tika-core', version: '1.22'
120+
testCompile group: 'org.apache.tika', name: 'tika-parsers', version: '1.22'
119121

120122
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version:'latest.integration'
121123
testCompile group: 'org.objenesis', name: 'objenesis', version:'latest.integration'
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed Apr 08 16:42:57 JST 2020
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
13
distributionBase=GRADLE_USER_HOME
24
distributionPath=wrapper/dists
3-
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
6+
zipStoreBase=GRADLE_USER_HOME

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"lodash": "^4.17.15"
66
},
77
"devDependencies": {
8-
"liferay-npm-bundler": "^2.13.2",
9-
"liferay-npm-scripts": "^9.5.0"
8+
"liferay-npm-bundler": "^2.18.4",
9+
"liferay-npm-scripts": "^29.0.0"
1010
},
1111
"scripts": {
1212
"build": "liferay-npm-bundler"

src/main/java/com/liferay/support/tools/common/DummyGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public void create(ActionRequest request) throws Exception {
4040

4141
TimeKeeper timeKeeper = new TimeKeeper();
4242
timeKeeper.start();
43-
43+
44+
// Execute creation process
4445
exec(request, paramContext);
4546

4647
timeKeeper.stop();

src/main/java/com/liferay/support/tools/company/CompanyDefaultDummyGenerator.java

Lines changed: 81 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -8,89 +8,92 @@
88
import com.liferay.portal.kernel.service.CompanyLocalService;
99
import com.liferay.support.tools.common.DummyGenerator;
1010
import com.liferay.support.tools.utils.ProgressManager;
11-
1211
import javax.portlet.ActionRequest;
13-
1412
import org.osgi.service.component.annotations.Component;
1513
import org.osgi.service.component.annotations.Reference;
1614

15+
/**
16+
* Company Generator
17+
*
18+
* @author Yasuyuki Takeo
19+
*/
1720
@Component(immediate = true, service = CompanyDefaultDummyGenerator.class)
1821
public class CompanyDefaultDummyGenerator extends DummyGenerator<CompanyContext> {
1922

20-
@Override
21-
protected CompanyContext getContext(ActionRequest request) throws Exception {
22-
return new CompanyContext(request);
23-
}
24-
25-
@Override
26-
protected void exec(ActionRequest request, CompanyContext paramContext)
27-
throws Exception {
28-
29-
//Tracking progress start
30-
ProgressManager progressManager = new ProgressManager();
31-
progressManager.start(request);
32-
33-
System.out.println("Starting to create " + paramContext.getNumberOfCompanies() + " companies");
34-
35-
for (long i = 1; i <= paramContext.getNumberOfCompanies(); i++) {
36-
//Update progress
37-
progressManager.trackProgress(i, paramContext.getNumberOfCompanies());
38-
39-
//Create company web id
40-
StringBundler webId = new StringBundler(2);
41-
webId.append(paramContext.getWebId());
42-
43-
//Create company Virtual Host Name
44-
StringBundler virtualHostname = new StringBundler(2);
45-
virtualHostname.append(paramContext.getVirtualHostname());
46-
47-
//Create company Mail Domain
48-
StringBundler mx = new StringBundler(2);
49-
mx.append(paramContext.getMx());
50-
51-
//Add number more then one company
52-
if(1 < paramContext.getNumberOfCompanies()) {
53-
webId.append(i);
54-
virtualHostname.append(i);
55-
mx.append(i);
56-
}
57-
58-
try {
59-
if(_log.isDebugEnabled()) {
60-
_log.debug("-----");
61-
}
62-
63-
Company company = _companyLocalService.addCompany(
64-
webId.toString(),
65-
virtualHostname.toString(),
66-
mx.toString(),
67-
paramContext.isSystem(),
68-
paramContext.getMaxUsers(),
69-
paramContext.isActive());
70-
71-
_portalInstancesLocalService.initializePortalInstance(
72-
paramContext.getServletContext(), company.getWebId());
73-
74-
} catch (Exception e) {
75-
//Finish progress
76-
progressManager.finish();
77-
throw e;
78-
}
79-
}
80-
81-
//Finish progress
82-
progressManager.finish();
83-
84-
System.out.println("Finished creating " + paramContext.getNumberOfCompanies() + " companies");
85-
86-
}
87-
88-
@Reference
89-
private CompanyLocalService _companyLocalService;
90-
91-
@Reference
92-
private PortalInstancesLocalService _portalInstancesLocalService;
93-
94-
private static final Log _log = LogFactoryUtil.getLog(CompanyDefaultDummyGenerator.class);
95-
23+
private static final Log _log = LogFactoryUtil.getLog(CompanyDefaultDummyGenerator.class);
24+
25+
@Reference
26+
private CompanyLocalService _companyLocalService;
27+
28+
@Reference
29+
private PortalInstancesLocalService _portalInstancesLocalService;
30+
31+
@Override
32+
protected CompanyContext getContext(ActionRequest request) throws Exception {
33+
return new CompanyContext(request);
34+
}
35+
36+
@Override
37+
protected void exec(ActionRequest request, CompanyContext paramContext)
38+
throws Exception {
39+
40+
//Tracking progress start
41+
ProgressManager progressManager = new ProgressManager();
42+
progressManager.start(request);
43+
44+
System.out.println("Starting to create " + paramContext.getNumberOfCompanies() + " companies");
45+
46+
for (long i = 1; i <= paramContext.getNumberOfCompanies(); i++) {
47+
//Update progress
48+
progressManager.trackProgress(i, paramContext.getNumberOfCompanies());
49+
50+
//Create company web id
51+
StringBundler webId = new StringBundler(2);
52+
webId.append(paramContext.getWebId());
53+
54+
//Create company Virtual Host Name
55+
StringBundler virtualHostname = new StringBundler(2);
56+
virtualHostname.append(paramContext.getVirtualHostname());
57+
58+
//Create company Mail Domain
59+
StringBundler mx = new StringBundler(2);
60+
mx.append(paramContext.getMx());
61+
62+
//Add number more then one company
63+
if (1 < paramContext.getNumberOfCompanies()) {
64+
webId.append(i);
65+
virtualHostname.append(i);
66+
mx.append(i);
67+
}
68+
69+
try {
70+
if (_log.isDebugEnabled()) {
71+
_log.debug("-----");
72+
}
73+
74+
Company company = _companyLocalService.addCompany(
75+
webId.toString(),
76+
virtualHostname.toString(),
77+
mx.toString(),
78+
paramContext.isSystem(),
79+
paramContext.getMaxUsers(),
80+
paramContext.isActive());
81+
82+
_portalInstancesLocalService.initializePortalInstance(
83+
paramContext.getServletContext(), company.getWebId());
84+
85+
} catch (Exception e) {
86+
//Finish progress
87+
progressManager.finish();
88+
throw e;
89+
}
90+
}
91+
92+
//Finish progress
93+
progressManager.finish();
94+
95+
System.out.println("Finished creating " + paramContext.getNumberOfCompanies() + " companies");
96+
97+
}
98+
9699
}

src/main/java/com/liferay/support/tools/messageboard/MBCategoryDummyGenerator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.liferay.message.boards.service.MBCategoryLocalService;
44
import com.liferay.portal.kernel.exception.PortalException;
55
import com.liferay.portal.kernel.service.GroupLocalService;
6+
import com.liferay.portal.kernel.service.ServiceContext;
67
import com.liferay.portal.kernel.util.StringBundler;
78
import com.liferay.support.tools.common.DummyGenerator;
89
import com.liferay.support.tools.utils.CommonUtil;
@@ -59,13 +60,18 @@ protected void exec(ActionRequest request, MBContext paramContext) throws Portal
5960

6061
try {
6162

63+
// Set current site scope ID to the Service Context
64+
ServiceContext serviceContext =
65+
paramContext.getServiceContext();
66+
serviceContext.setScopeGroupId(paramContext.getSiteGroupId());
67+
6268
// Generate category
6369
_MBCategoryLocalService.addCategory(
6470
paramContext.getServiceContext().getUserId(), // userId
6571
paramContext.getParentCategoryId(), // parentCategoryId
6672
actualName.toString(), // name
6773
paramContext.getDescription(), // description,
68-
paramContext.getServiceContext());
74+
serviceContext);
6975

7076
} catch (Throwable e) {
7177
// Finish progress

0 commit comments

Comments
 (0)