Skip to content

Commit

Permalink
Merge branch 'release/7.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuyuki Takeo committed Nov 16, 2020
2 parents ba3157c + 17d79ac commit 73a02d0
Showing 22 changed files with 88 additions and 86 deletions.
41 changes: 15 additions & 26 deletions .npmbundlerrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
{
"verbose": true,
"sources": ["src"],
"packages": {
"is-object": {
"copy-plugins": ["exclude-imports"],
"plugins": ["replace-browser-modules"],
".babelrc:": {
"presets": ["liferay-standard"]
},
"post-plugins": [
"namespace-packages",
"inject-imports-dependencies",
"inject-peer-dependencies"
]
}
},
"rules": [{
"test": "\\.js$",
"exclude": "node_modules",
"use": [{
"loader": "babel-loader",
"options": {
"presets": ["env"]
}
}]
}]
"sources": ["src"],
"rules": [
{
"test": "\\.js$",
"exclude": "node_modules",
"use": [
{
"loader": "babel-loader",
"options": {
"presets": ["env"]
}
}
]
}
]
}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Dummy Factory generates dummy data for debugging use. Please don't use this for
## Required environment
* Java 1.8 or above
* Liferay 7.3 GA1 (Master / Develop branch)
* Liferay 7.2 GA1 / Liferay DXP 7.2 GA1 or above (Please see 7.2.x branch)
* Liferay 7.2 (Please see 7.2.x branch)
* Liferay 7.1 (Please see 7.1.x branch)
* Liferay 7.0 (Please see 7.0.x branch)

@@ -34,9 +34,11 @@ Dummy Factory generates dummy data for debugging use. Please don't use this for
| 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) |

1. Download jar file according to the version above and place it int `${liferay-home}/deploy `
2. Start Liferay bundle and login as an administrator.
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.
4. Now you are ready to create dummy data! Enjoy!
1. Start Liferay bundle and login as an administrator.
1. After the jar is properly installed, navigate to `Control Panel -> System Settings -> Platform -> Thrid party` and enable JQuery.
1. Reboot the bundle.
1. Navigate to `Control Panel`, under `Marketplace`, `Dummy Factory` will be found.
1. Now you are ready to create dummy data! Enjoy!

## How can I compile Dummy Factory on my own?
1. Create a Liferay Workspace for appropriate version (7.2.x branch is for 7.2, for example)
@@ -48,4 +50,4 @@ Dummy Factory generates dummy data for debugging use. Please don't use this for
Please create a issue on this repository.

## Known issues
- Wiki generator gets error and does not work due to denied access to JSON APIs before the initilization. Wiki looks like bing initialized at the first access to the Wiki Admin page in the control panel, right after spining up the Liferay bundle.
- Wiki generator gets error and does not work due to denied access to JSON APIs before the initialization. Wiki looks like bing initialized at the first access to the Wiki Admin page in the control panel, right after spinning up the Liferay bundle.
10 changes: 9 additions & 1 deletion bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bundle-Name: Liferay Dummy Factory Portlet
Bundle-SymbolicName: liferay.dummy.factory
Bundle-Version: 7.3.0
Bundle-Version: 7.3.1
Web-ContextPath: /liferay-dummy-factory
-dsannotations-options: inherit
-sources: true
@@ -12,6 +12,14 @@ Import-Package:\
!org.apache.commons.beanutils.*,\
!org.apache.commons.codec.*,\
!org.checkerframework.*,\
!com.linkedin.*,\
!de.malkusch.*,\
!com.machinepublishers.*,\
!javax.annotation.*,\
!net.sf.*,\
!net.spy.*,\
!org.openqa.*,\
!org.yaml.*,\
*

-includeresource:\
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -40,29 +40,29 @@ buildscript {
apply plugin: 'com.github.kt3k.coveralls'

dependencies {
compile 'biz.aQute.bnd:biz.aQute.bndlib:3.1.0'
compile 'com.google.errorprone:error_prone_annotations:2.0.19'
compile 'commons-digester:commons-digester:1.8.1'
compile "com.google.guava:guava:21.0"
compile 'biz.aQute.bnd:biz.aQute.bndlib:3.5.0'
compile 'com.google.errorprone:error_prone_annotations:2.3.1'
compile 'commons-digester:commons-digester:2.1'
compile "com.google.guava:guava:27.1-jre"
compile "commons-io:commons-io:2.5"
compile "commons-validator:commons-validator:1.6"
compile "org.apache.commons:commons-lang3:3.9"
compile "com.github.mifmif:generex:1.0.2"
compile "dk.brics.automaton:automaton:1.11-8"
compile "com.github.javafaker:javafaker:0.13"
compile("edu.uci.ics:crawler4j:4.4.0") {
compile "com.github.javafaker:javafaker:1.0.2"
compile("com.goikosoft.crawler4j:crawler4j:4.5.10") {
exclude module: 'tika-bundle'
exclude module: 'tika-core'
exclude module: 'tika-parsers'
}

compile group: 'com.sleepycat', name: 'je', version: '5.0.+'
compile group: 'com.sleepycat', name: 'je', version: '18.3.12'
compile "io.reactivex.rxjava2:rxjava:2.2.+"
compile group: 'org.apache.httpcomponents', name: 'httpcore-osgi', version: '4.4.+'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.+'
compile group: 'org.reactivestreams', name: 'reactive-streams', version: '1.0.+'
compile group: "commons-fileupload", name: "commons-fileupload", version: "1.3.3"
compile group: "org.apache.felix", name: "org.apache.felix.gogo.runtime", version: "0.10.0"
compile group: "org.apache.felix", name: "org.apache.felix.gogo.runtime", version: "1.1.+"

compile "com.liferay:com.liferay.application.list.api"
compile "com.liferay:com.liferay.frontend.taglib"
Binary file not shown.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -2,11 +2,12 @@
"name": "liferay-dummy-factory",
"version": "1.0.0",
"dependencies": {
"lodash": "^4.17.15"
"jquery": "^3.5.1",
"lodash": "^4.17.20"
},
"devDependencies": {
"liferay-npm-bundler": "^2.18.4",
"liferay-npm-scripts": "^29.0.0"
"@liferay/npm-scripts": "^34.0.1",
"liferay-npm-bundler": "^2.20.0"
},
"scripts": {
"build": "liferay-npm-bundler"
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ public class LDFPortletKeys {
public static final String EOL = System.getProperty("line.separator");

// Portlet Name
public static final String LIFERAY_DUMMY_FACTORY = "portlet_com_liferay_support_tools_portlet_LiferayDummyFactoryPortlet";
public static final String LIFERAY_DUMMY_FACTORY = "com_liferay_support_tools_portlet_LiferayDummyFactoryPortlet";

public static final String DUMMY_FACTORY_CONFIG = "com.liferay.support.tools.portlet.actions.DummyFactoryConfiguration";

Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import com.liferay.support.tools.constants.LDFPortletKeys;
import com.liferay.support.tools.portlet.actions.DummyFactoryConfiguration;
import com.liferay.support.tools.utils.JqueryResolver;
import com.liferay.support.tools.utils.LodashResolver;

import java.io.IOException;
@@ -62,6 +63,8 @@ public void doView(RenderRequest renderRequest, RenderResponse renderResponse)

//Loading Lodash
LodashResolver.exec(renderRequest, _npmResolver);
//Loading JQuery
JqueryResolver.exec(renderRequest, _npmResolver);

super.doView(renderRequest, renderResponse);
}
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
import com.liferay.support.tools.constants.LDFPortletKeys;
import com.liferay.support.tools.constants.LDFPortletWebKeys;
import com.liferay.support.tools.utils.CommonUtil;
import com.liferay.support.tools.utils.JqueryResolver;
import com.liferay.support.tools.utils.LodashResolver;
import com.liferay.support.tools.utils.WikiCommons;

@@ -67,7 +68,9 @@ public String render(RenderRequest renderRequest, RenderResponse renderResponse)

//Loading Lodash
LodashResolver.exec(renderRequest, _npmResolver);

//Loading JQuery
JqueryResolver.exec(renderRequest, _npmResolver);

return _commonUtil
.getPageFromMode()
.getOrDefault(mode, LDFPortletKeys.JSP_ORGANIZAION);
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.liferay.support.tools.portlet.actions;

import com.goikosoft.crawler4j.crawler.CrawlConfig;
import com.goikosoft.crawler4j.crawler.CrawlController;
import com.goikosoft.crawler4j.fetcher.PageFetcher;
import com.goikosoft.crawler4j.robotstxt.RobotstxtConfig;
import com.goikosoft.crawler4j.robotstxt.RobotstxtServer;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
import com.liferay.portal.kernel.json.JSONArray;
@@ -14,11 +19,6 @@
import com.liferay.portal.kernel.util.Portal;
import com.liferay.support.tools.constants.LDFPortletKeys;
import com.liferay.support.tools.utils.ImageCrawler;
import edu.uci.ics.crawler4j.crawler.CrawlConfig;
import edu.uci.ics.crawler4j.crawler.CrawlController;
import edu.uci.ics.crawler4j.fetcher.PageFetcher;
import edu.uci.ics.crawler4j.robotstxt.RobotstxtConfig;
import edu.uci.ics.crawler4j.robotstxt.RobotstxtServer;
import io.reactivex.Flowable;
import io.reactivex.schedulers.Schedulers;
import java.io.File;
11 changes: 1 addition & 10 deletions src/main/java/com/liferay/support/tools/utils/CommonUtil.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.liferay.support.tools.utils;

import com.github.javafaker.Faker;
import com.github.javafaker.service.LocaleDoesNotExistException;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
@@ -101,15 +100,7 @@ public Faker createFaker(String locale) {
Faker fakerTmp = new Faker(new Locale(locale));
faker = fakerTmp;
} catch (Exception e) {

// If the local is not available for Faker, generate Faker wit
// English locale

if (e instanceof LocaleDoesNotExistException) {
_log.error(locale + " doesn't valid for Faker. Use english instead.");
} else {
e.printStackTrace();
}
e.printStackTrace();
}

return faker;
10 changes: 5 additions & 5 deletions src/main/java/com/liferay/support/tools/utils/ImageCrawler.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.liferay.support.tools.utils;

import com.goikosoft.crawler4j.crawler.Page;
import com.goikosoft.crawler4j.crawler.WebCrawler;
import com.goikosoft.crawler4j.parser.BinaryParseData;
import com.goikosoft.crawler4j.url.WebURL;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import java.util.regex.Pattern;

import edu.uci.ics.crawler4j.crawler.Page;
import edu.uci.ics.crawler4j.crawler.WebCrawler;
import edu.uci.ics.crawler4j.parser.BinaryParseData;
import edu.uci.ics.crawler4j.url.WebURL;

/**
* Image Link Crawler
*
Original file line number Diff line number Diff line change
@@ -9,6 +9,6 @@ public class LodashResolver {

static public void exec(RenderRequest renderRequest, NPMResolver npmResolver) {
JSPackage jsPackage = npmResolver.getDependencyJSPackage("lodash");
renderRequest.setAttribute("bootstrapRequire", jsPackage.getResolvedId());
renderRequest.setAttribute("lodashResolver", jsPackage.getResolvedId());
}
}
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/resources/category.jsp
Original file line number Diff line number Diff line change
@@ -109,15 +109,15 @@
<aui:validator name="min">1</aui:validator>
<aui:validator name="required">
function() {
return (<%= String.valueOf(LDFPortletKeys.C_CATEGORY_CREATE) %> == AUI.$('#<portlet:namespace />createContentsType').val());
return (<%= String.valueOf(LDFPortletKeys.C_CATEGORY_CREATE) %> == $('#<portlet:namespace />createContentsType').val());
}
</aui:validator>

</aui:input>
<aui:input name="baseCategoryName" label="<%= baseCategoryNameLabel %>" >
<aui:validator name="required">
function() {
return (<%= String.valueOf(LDFPortletKeys.C_CATEGORY_CREATE) %> == AUI.$('#<portlet:namespace />createContentsType').val());
return (<%= String.valueOf(LDFPortletKeys.C_CATEGORY_CREATE) %> == $('#<portlet:namespace />createContentsType').val());
}
</aui:validator>
</aui:input>
@@ -217,7 +217,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

@@ -291,7 +291,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

2 changes: 1 addition & 1 deletion src/main/resources/META-INF/resources/documents.jsp
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
var data = dataIn;

//Load Template
Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

8 changes: 5 additions & 3 deletions src/main/resources/META-INF/resources/init.jsp
Original file line number Diff line number Diff line change
@@ -105,11 +105,13 @@
DummyFactoryDisplayContext dummyFactoryDisplayContext = new DummyFactoryDisplayContext(request, liferayPortletRequest, liferayPortletResponse, portletPreferences);
String bootstrapRequire =
(String)renderRequest.getAttribute("bootstrapRequire");
String lodashResolver =
(String)renderRequest.getAttribute("lodashResolver");
String jqueryResolver =
(String)renderRequest.getAttribute("jqueryResolver");
%>
<aui:script use="aui-base" sandbox="<%= true %>">
Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

4 changes: 2 additions & 2 deletions src/main/resources/META-INF/resources/mb.jsp
Original file line number Diff line number Diff line change
@@ -262,7 +262,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
success: function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

@@ -309,7 +309,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
success: function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

2 changes: 1 addition & 1 deletion src/main/resources/META-INF/resources/pages.jsp
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
success: function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

2 changes: 1 addition & 1 deletion src/main/resources/META-INF/resources/users.jsp
Original file line number Diff line number Diff line change
@@ -294,7 +294,7 @@ request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
success: function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

2 changes: 1 addition & 1 deletion src/main/resources/META-INF/resources/wcm.jsp
Original file line number Diff line number Diff line change
@@ -319,7 +319,7 @@ $(function() {
function(objIn) {
var obj = objIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
//(function() {
var _ = _lodash;

4 changes: 2 additions & 2 deletions src/main/resources/META-INF/resources/wiki.jsp
Original file line number Diff line number Diff line change
@@ -234,7 +234,7 @@ $(function() {
function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

@@ -299,7 +299,7 @@ $(function() {
function(dataIn) {
var data = dataIn;

Liferay.Loader.require("<%=bootstrapRequire %>", function(_lodash) {
Liferay.Loader.require("<%=lodashResolver %>", function(_lodash) {
(function() {
var _ = _lodash;

Loading

0 comments on commit 73a02d0

Please sign in to comment.