Skip to content

Commit

Permalink
Merge branch 'release/7.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuyuki Takeo committed Jun 11, 2019
2 parents 3d7d5f9 + 94069fc commit 407a64c
Show file tree
Hide file tree
Showing 38 changed files with 338 additions and 185 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist: precise
dist: xenial
language: java
jdk: oraclejdk8
jdk: openjdk8
env:
- CI=true
before_script:
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,35 @@ Dummy Factory generates dummy data for debugging use. Please don't use this for
* Category (Categories / Vocabularies)
* Wiki
* Blogs
* Company

## Required environment
* Java 1.8 or above
* Liferay 7.1 GA1 / Liferay DXP 7.1 GA1 or above
* Liferay 7.2 GA1 / Liferay DXP 7.2 GA1 or above (Master / Develop branch)
* Liferay 7.0 (Please see 7.0.x branch)
* Liferay 7.1 (Please see 7.1.x branch)

## Usage
### For 7.1
### For 7.2
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.
2. Start Liferay bundle and login as an administrator.
3. Dummy Factory uses lodash libraly and it's disabled for 7.2 by default. Please navigate `Control Panel → Configuration → System Settings → Third Party` and check Lodash to true.
4. 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.
5. Now you are ready to create dummy data! Enjoy!

### For 7.1
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.
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!

### For 7.0
Please download file from[here](https://github.com/yasuflatland-lf/liferay-dummy-factory/tree/7.0.x/latest) and follow the same steps above.

## How can I compile Dummy Factory on my own?
1. Create a Liferay Workspace for 7.1 (or 7.0 for 7.0.x branch)
2. Clone this repository to ```${liferay_workspace_home}/modules```. Please make sure you've already installed Gradle 3.0 or above and blade tool that Liferay provides.
3. At the root directory, run ```gradle clean assemble``` then ```liferay.dummy.factory-x.x.x.jar``` will be created under ```/build/libs/``` directory.
1. Create a Liferay Workspace for 7.2 (or 7.0 for 7.0.x branch and 7.1 for 7.1.x branch)
2. Clone this repository to ```${liferay_workspace_home}/modules```.
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.
4. To install onto your Liferay bundle, startup Liferay bundle on your local and run ```blade deploy```. Dummy Factory portlet will be deployed.

## Bug / Enhancement request
Expand Down
57 changes: 21 additions & 36 deletions bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
Bundle-Name: Liferay Dummy Factory Portlet
Bundle-SymbolicName: liferay.dummy.factory
Bundle-Version: 7.1.5
Bundle-Version: 7.2.0

Import-Package:\
!org.apache.commons.fileupload.*,\
!com.google.*,\
!com.sun.*,\
!org.apache.commons.*,\
!org.checkerframework.*,\
*

Bundle-ClassPath:\
.,\
lib/guava.jar,\
lib/error_prone_annotations.jar,\
lib/commons-digester.jar,\
lib/commons-validator.jar,\
lib/commons-io.jar,\
lib/commons-lang3.jar,\
lib/generex.jar,\
lib/automaton.jar,\
lib/javafaker.jar,\
lib/crawler4j.jar,\
lib/je.jar,\
lib/rxjava.jar,\
lib/httpcore-osgi.jar,\
lib/httpclient.jar,\
lib/reactive-streams.jar,\
lib/commons-fileupload.jar

-includeresource:\
lib/guava.jar=guava-[0-9]*.jar,\
lib/error_prone_annotations.jar=error_prone_annotations-[0-9]*.jar,\
lib/commons-digester.jar=commons-digester-[0-9]*.jar,\
lib/commons-validator.jar=commons-validator-[0-9]*.jar,\
lib/commons-io.jar=commons-io-[0-9]*.jar,\
lib/commons-lang3.jar=commons-lang[0-9]*.jar,\
lib/generex.jar=generex-[0-9]*.jar,\
lib/automaton.jar=automaton-[0-9]*.jar,\
lib/javafaker.jar=javafaker-[0-9]*.jar,\
lib/crawler4j.jar=crawler4j-[0-9]*.jar,\
lib/je.jar=je-[0-9]*.jar,\
lib/rxjava.jar=rxjava-[0-9]*.jar,\
lib/httpcore-osgi.jar=httpcore-osgi-[0-9]*.jar,\
lib/httpclient.jar=httpclient-[0-9]*.jar,\
lib/reactive-streams.jar=reactive-streams-[0-9]*.jar,\
lib/commons-fileupload.jar=commons-fileupload-[0-9]*.jar
@guava-*.jar,\
@error_prone_annotations-*.jar,\
@commons-digester-*.jar,\
@commons-validator-*.jar,\
@commons-io-*.jar,\
@commons-lang*.jar,\
@generex-*.jar,\
@automaton-*.jar,\
@javafaker-*.jar,\
@crawler4j-*.jar,\
@je-*.jar,\
@rxjava-*.jar,\
@httpcore-osgi-*.jar,\
@httpclient-*.jar,\
@reactive-streams-*.jar,\
@commons-fileupload-*.jar
57 changes: 31 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,34 +64,39 @@ dependencies {
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: "com.liferay", name: "com.liferay.application.list.api", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.frontend.taglib", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.frontend.taglib.clay", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.api", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.criteria.api", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.taglib", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.trash.taglib", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.portal.instances.api", version: "2.0.0"
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
compile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "3.0.0"
compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.application.list.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.frontend.taglib", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.frontend.taglib.clay", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.frontend.taglib.util", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.criteria.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.item.selector.taglib", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.trash.taglib", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.1.+"
compile group: "com.liferay", name: "com.liferay.portal.instances.api", version: "3.0.0"
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.0.0"
compile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "4.0.0"
compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.message.boards.api", version: "5.0.0"
compile group: "com.liferay", name: "com.liferay.message.boards.service", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.blogs.api", version: "5.0.0"

compile group: "com.liferay", name: "com.liferay.journal.api", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.journal.service", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.wiki.api", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.wiki.service", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.petra.string", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.journal.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.journal.service", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.wiki.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.wiki.service", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.petra.function", version: "3.0.0"

compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.service", version: "1.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.api", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.api", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.service", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.taglib", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.io", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.validator", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.0"
compileOnly group: "com.liferay", name: "com.liferay.portal.background.task.api", version: "2.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.service", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.lists.api", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.api", version: "5.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.service", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.taglib", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.io", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.dynamic.data.mapping.validator", version: "4.0.0"
compile group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.+"
compileOnly group: "com.liferay", name: "com.liferay.portal.background.task.api", version: "4.0.0"

compile group: "javax.portlet", name: "portlet-api", version: "3.0.0"
compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.liferay.support.tools.blogs;

import com.liferay.blogs.kernel.model.BlogsEntry;
import com.liferay.blogs.kernel.service.BlogsEntryLocalService;
import com.liferay.blogs.model.BlogsEntry;
import com.liferay.blogs.service.BlogsEntryLocalService;
import com.liferay.petra.string.StringBundler;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.log.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ public class LDFPortletKeys {
public static final int W_NODE = 0;
public static final int W_PAGE = 1;

// Progress Tracker parameter in request
public static final String COMMON_PROGRESS_ID = "commonProgressId";

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
import com.liferay.portal.kernel.portlet.PortalPreferences;
import com.liferay.portal.kernel.portlet.PortletPreferencesFactoryUtil;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.WebKeys;

import java.util.List;

Expand Down Expand Up @@ -50,9 +48,6 @@ public DummyFactoryDisplayContext(HttpServletRequest request,
* @return NavigationItem List
*/
public List<NavigationItem> getNavigationBarItems( String label ) {
ThemeDisplay themeDisplay = (ThemeDisplay) _request
.getAttribute( WebKeys.THEME_DISPLAY );

return new NavigationItemList() {
{
add( navigationItem -> {
Expand All @@ -63,7 +58,7 @@ public List<NavigationItem> getNavigationBarItems( String label ) {
);
navigationItem
.setLabel( LanguageUtil.get( _request, label ) );
} );
});
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.liferay.portal.kernel.lock.DuplicateLockException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.model.TrashedModel;
import com.liferay.portal.kernel.portlet.JSONPortletResponseUtil;
import com.liferay.portal.kernel.portlet.LiferayPortletURL;
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil;
Expand Down Expand Up @@ -66,14 +65,14 @@
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.support.tools.constants.LDFPortletKeys;
import com.liferay.trash.kernel.util.TrashUtil;

import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.MutableRenderParameters;
import javax.portlet.PortletConfig;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
Expand Down Expand Up @@ -142,7 +141,8 @@ protected void doProcessAction(ActionRequest actionRequest, ActionResponse actio

if (cmd.equals(Constants.ADD_TEMP) ||
cmd.equals(Constants.DELETE_TEMP)) {
actionResponse.setRenderParameter("mvcPath", "/null.jsp");
MutableRenderParameters mutableRenderParameters = actionResponse.getRenderParameters();
mutableRenderParameters.setValue("mvcPath", "/null.jsp");
} else {
String redirect = ParamUtil.getString(actionRequest, "redirect");
int workflowAction = ParamUtil.getInteger(actionRequest, "workflowAction",
Expand Down Expand Up @@ -182,16 +182,18 @@ protected String getSaveAndContinueRedirect(
actionRequest, portletConfig.getPortletName(), themeDisplay.getLayout(),
PortletRequest.RENDER_PHASE);

portletURL.setParameter(
MutableRenderParameters mutableRenderParameters = portletURL.getRenderParameters();

mutableRenderParameters.setValues(
"mvcRenderCommandName", "/df/document/edit_file_entry");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(fileEntry.getGroupId()), false);
portletURL.setParameter(
"fileEntryId", String.valueOf(fileEntry.getFileEntryId()), false);
portletURL.setParameter(
"version", String.valueOf(fileEntry.getVersion()), false);
mutableRenderParameters.setValues(Constants.CMD, Constants.UPDATE);
mutableRenderParameters.setValues("redirect", redirect);
mutableRenderParameters.setValues(
"groupId", String.valueOf(fileEntry.getGroupId()));
mutableRenderParameters.setValues(
"fileEntryId", String.valueOf(fileEntry.getFileEntryId()));
mutableRenderParameters.setValues(
"version", String.valueOf(fileEntry.getVersion()));
portletURL.setWindowState(actionRequest.getWindowState());

return portletURL.toString();
Expand Down Expand Up @@ -262,8 +264,6 @@ protected void deleteFileEntry(ActionRequest actionRequest, boolean moveToTrash)

if (fileEntry.isRepositoryCapabilityProvided(TrashCapability.class)) {
fileEntry = _dlTrashService.moveFileEntryToTrash(fileEntryId);

TrashUtil.addTrashSessionMessages(actionRequest, (TrashedModel) fileEntry.getModel());
}

hideDefaultSuccessMessage(actionRequest);
Expand Down Expand Up @@ -309,7 +309,7 @@ protected void addTempFileEntry(ActionRequest actionRequest, ActionResponse acti

JSONPortletResponseUtil.writeJSON(actionRequest, actionResponse, jsonObject);
} finally {
StreamUtil.cleanUp(inputStream);
StreamUtil.cleanUp(true, inputStream);
}
}

Expand Down Expand Up @@ -382,7 +382,7 @@ public FileEntry updateFileEntry(PortletConfig portletConfig, ActionRequest acti

return fileEntry;
} finally {
StreamUtil.cleanUp(inputStream);
StreamUtil.cleanUp(true,inputStream);
}
}

Expand Down Expand Up @@ -493,7 +493,8 @@ protected void handleUploadException(PortletConfig portletConfig, ActionRequest
SessionErrors.add(actionRequest, e.getClass());
}

actionResponse.setRenderParameter("mvcPath", "/error.jsp");
MutableRenderParameters mutableRenderParameters = actionResponse.getRenderParameters();
mutableRenderParameters.setValue("mvcPath", "/error.jsp");
} else {
Throwable cause = e.getCause();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.liferay.support.tools.messageboard;

import com.liferay.message.boards.kernel.service.MBCategoryLocalService;
import com.liferay.message.boards.service.MBCategoryLocalService;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.service.GroupLocalService;
import com.liferay.portal.kernel.util.StringBundler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.liferay.support.tools.messageboard;

import com.liferay.message.boards.kernel.model.MBCategoryConstants;
import com.liferay.message.boards.constants.MBCategoryConstants;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.ParamUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.liferay.support.tools.messageboard;

import com.liferay.message.boards.kernel.model.MBCategory;
import com.liferay.message.boards.kernel.model.MBCategoryConstants;
import com.liferay.message.boards.kernel.model.MBMessage;
import com.liferay.message.boards.kernel.model.MBThread;
import com.liferay.message.boards.kernel.service.MBCategoryLocalService;
import com.liferay.message.boards.kernel.service.MBMessageLocalService;
import com.liferay.message.boards.kernel.service.MBThreadLocalService;
import com.liferay.message.boards.constants.MBCategoryConstants;
import com.liferay.message.boards.model.MBCategory;
import com.liferay.message.boards.model.MBMessage;
import com.liferay.message.boards.model.MBThread;
import com.liferay.message.boards.service.MBCategoryLocalService;
import com.liferay.message.boards.service.MBMessageLocalService;
import com.liferay.message.boards.service.MBThreadLocalService;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.json.JSONArray;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.liferay.support.tools.messageboard;

import com.liferay.message.boards.kernel.model.MBMessageConstants;
import com.liferay.message.boards.kernel.model.MBThread;
import com.liferay.message.boards.kernel.service.MBMessageService;
import com.liferay.message.boards.kernel.service.MBThreadLocalService;
import com.liferay.message.boards.model.MBThread;
import com.liferay.message.boards.service.MBMessageService;
import com.liferay.message.boards.service.MBThreadLocalService;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.log.*;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.service.GroupLocalService;
import com.liferay.portal.kernel.util.*;
import com.liferay.portal.kernel.util.ObjectValuePair;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.support.tools.common.DummyGenerator;
import com.liferay.support.tools.utils.CommonUtil;
import com.liferay.support.tools.utils.ProgressManager;
Expand Down Expand Up @@ -80,7 +82,7 @@ protected void exec(ActionRequest request, MBContext paramContext) throws Portal
thread.getRootMessageId(), // parentMessageId
actualSubject.toString(), // subject,
paramContext.getBody(), // body,
MBMessageConstants.DEFAULT_FORMAT, // format,
paramContext.getFormat(), // format,
inputStreamOVPs, // inputStreamOVPs,
paramContext.isAnonymous(), // anonymous,
paramContext.getPriority(), // priority,
Expand Down
Loading

0 comments on commit 407a64c

Please sign in to comment.