Skip to content

Commit

Permalink
Merge branch 'release/7.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Nov 5, 2021
2 parents 73a02d0 + e940d27 commit 207c149
Show file tree
Hide file tree
Showing 20 changed files with 2,303 additions and 2,020 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ bin
.settings
.idea
*.iml
package-lock.json
node_modules
.classpath
.project
2 changes: 1 addition & 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.1
Bundle-Version: 7.4.0
Web-ContextPath: /liferay-dummy-factory
-dsannotations-options: inherit
-sources: true
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ dependencies {
compile "com.liferay:com.liferay.blogs.api"

compile "com.liferay:com.liferay.portal.settings.api"
compile "com.liferay:com.liferay.portal.settings.lang"

compile "com.liferay:com.liferay.journal.api"
compile "com.liferay:com.liferay.journal.service"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Wed Apr 08 16:42:57 JST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "liferay-dummy-factory",
"version": "1.0.0",
"dependencies": {
"jquery": "^3.5.1",
"lodash": "^4.17.20"
"jquery": "^3.6.0",
"lodash": "^4.17.21"
},
"devDependencies": {
"@liferay/npm-scripts": "^34.0.1",
"liferay-npm-bundler": "^2.20.0"
"@liferay/npm-scripts": "^45.0.0",
"liferay-npm-bundler": "^2.24.3"
},
"scripts": {
"build": "liferay-npm-bundler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ protected void exec(ActionRequest request, CompanyContext paramContext)
paramContext.isActive());

_portalInstancesLocalService.initializePortalInstance(
paramContext.getServletContext(), company.getWebId());
company.getCompanyId(), company.getWebId(),
paramContext.getServletContext());

} catch (Exception e) {
//Finish progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public String buildFields(long groupId, String[] locales, String baseArticle) th
locales,
LocaleUtil.getDefault());

return _journalConverter.getContent(ddmStructure, fields);
return _journalConverter.getContent(ddmStructure, fields, groupId);
}

/**
Expand All @@ -79,7 +79,7 @@ public String buildFields(long groupId, DDMStructure ddmStructure, String[] loca
locales,
LocaleUtil.getDefault());

return _journalConverter.getContent(ddmStructure, fields);
return _journalConverter.getContent(ddmStructure, fields, groupId);
}

@Reference
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/liferay/support/tools/utils/JqueryResolver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.liferay.support.tools.utils;

import com.liferay.frontend.js.loader.modules.extender.npm.JSPackage;
import com.liferay.frontend.js.loader.modules.extender.npm.NPMResolver;

import javax.portlet.RenderRequest;

public class JqueryResolver {
static public void exec(RenderRequest renderRequest, NPMResolver npmResolver) {
JSPackage jsPackage = npmResolver.getDependencyJSPackage("jquery");
renderRequest.setAttribute("jqueryResolver", jsPackage.getResolvedId());
}
}
247 changes: 134 additions & 113 deletions src/main/resources/META-INF/resources/blogs.jsp
Original file line number Diff line number Diff line change
@@ -1,131 +1,152 @@

<%@ include file="/init.jsp"%>
<%@ include file="/init.jsp" %>

<clay:navigation-bar
inverted="<%= true %>"
navigationItems='<%= dummyFactoryDisplayContext.getNavigationBarItems("Blogs") %>'
inverted="<%= true %>"
navigationItems='<%= dummyFactoryDisplayContext.getNavigationBarItems("Blogs") %>'
/>

<div class="container-fluid-1280">

<aui:fieldset-group markupView="lexicon">
<aui:fieldset>

<liferay-ui:success key="success" message="Blogs created successfully" />
<%@ include file="/command_select.jspf"%>

<portlet:actionURL name="<%= LDFPortletKeys.BLOGS %>" var="blogsEditURL">
<portlet:param name="<%= LDFPortletKeys.MODE %>" value="<%=LDFPortletKeys.MODE_BLOGS %>" />
<portlet:param name="redirect" value="<%=portletURL.toString()%>" />
</portlet:actionURL>
<div class="entry-title form-group">
<h1>Create Blog posts&nbsp;&nbsp;
<a aria-expanded="false" class="collapse-icon collapsed icon-question-sign" data-toggle="collapse" href="#navPillsCollapse0">
</a>
</h1>
<aui:fieldset-group markupView="lexicon">
<aui:fieldset>

<liferay-ui:success key="success" message="Blogs created successfully"/>
<%@ include file="/command_select.jspf" %>

<portlet:actionURL name="<%= LDFPortletKeys.BLOGS %>" var="blogsEditURL">
<portlet:param name="<%= LDFPortletKeys.MODE %>" value="<%=LDFPortletKeys.MODE_BLOGS %>"/>
<portlet:param name="redirect" value="<%=portletURL.toString()%>"/>
</portlet:actionURL>

<div id="<portlet:namespace />Header0" role="tab">
<div aria-controls="<portlet:namespace />Collapse0" aria-expanded="false"
class="collapse-icon collapse-icon-middle panel-toggler" data-toggle="liferay-collapse"
href="#<portlet:namespace />Collapse0" role="button">
<h1>Create Blog posts <liferay-ui:icon-help message="usage" /></h1>
</div>
</div>

<div class="collapsed collapse" id="navPillsCollapse0" aria-expanded="false" >

<div aria-expanded="false" aria-labelledby="<portlet:namespace />Header0"
class="collapse panel-collapse" id="<portlet:namespace />Collapse0" role="tabpanel">
<blockquote class="blockquote-info">
<small>Example</small>
<p>if you enter the values <code>3</code> and <code>blog</code> the portlet will create three blog posts: <code>blog1</code>, <code>blog2</code>, and <code>blog3</code>.<p>
<p>if you enter the values <code>3</code> and <code>blog</code> the portlet will create three blog
posts: <code>blog1</code>, <code>blog2</code>, and <code>blog3</code>.
<p>
</blockquote>

<p>You must be signed in as an administrator in order to create blog posts</p>
<p>The counter always starts at <code>1</code></p>
<p>If no site is selected, the default site will be <code>liferay.com</code></p>
<p>If no site is selected, the default site will be <code>liferay.com</code></p>
</div>

<%
String numberOfPostsLabel= "Enter the number of blog posts you would like to create";
String groupLabel = "Group ID";
String baseTitleLabel= "Enter the base title";
String contentsLabel = "Enter the contents";
String userIdLabel = "User ID";
String defaultOption = "None";
String allowPingbacksLabel = "Arrow Pingbacks";
String allowTrackbacksLabel = "Please enter trackback address by comma separated strings";
List<User> users = UserLocalServiceUtil.getCompanyUsers(themeDisplay.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
final String groupName = GroupConstants.GUEST;
final long companyId = PortalUtil.getDefaultCompanyId();
final long guestGroupId = GroupLocalServiceUtil.getGroup(companyId, groupName).getGroupId();
List<Group> groups = GroupLocalServiceUtil.getGroups(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
%>

<aui:form action="<%= blogsEditURL %>" method="post" name="fm" onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "execCommand();" %>'>
<aui:input name="<%= LDFPortletKeys.COMMON_PROGRESS_ID %>" value="<%= progressId %>" type="hidden"/>
<aui:input name="numberOfPosts" label="<%= numberOfPostsLabel %>" >
<aui:validator name="digits" />
<aui:validator name="min">1</aui:validator>
<aui:validator name="required" />
</aui:input>
<aui:select name="groupId" label="<%= groupLabel %>" >
<aui:option label="<%= defaultOption %>" value="<%= guestGroupId %>" />
<%
for (Group group : groups) {
if (group.isSite()) {
%>
<aui:option label="<%= group.getDescriptiveName() %>" value="<%= group.getGroupId() %>"/>
<%
}
}
%>
</aui:select>

<aui:input name="baseTitle" label="<%= baseTitleLabel %>" cssClass="lfr-textarea-container" >
<aui:validator name="required" />
</aui:input>
<aui:input name="contents" label="<%= contentsLabel %>" cssClass="lfr-textarea-container" >
<aui:validator name="required" />
</aui:input>
<aui:select name="userId" label="<%= userIdLabel %>" multiple="<%= false %>" >
<aui:option label="<%= user.getFullName() %>" value="<%= user.getUserId() %>" selected="true"/>
<%
for (User listUser : users) {
if(listUser.getUserId() != user.getUserId()) {
%>
<aui:option label="<%= listUser.getFullName() %>" value="<%= listUser.getUserId() %>"/>
<%
}
}
%>
</aui:select>

<aui:a href="#inputOptions" cssClass="collapse-icon collapsed icon-angle-down" title="Option" aria-expanded="false" data-toggle="collapse" >&nbsp;&nbsp;option</aui:a>
<div class="collapsed collapse" id="inputOptions" aria-expanded="false" >

<div class="row">
<aui:fieldset cssClass="col-md-12">
<aui:input name="allowPingbacks" type="toggle-switch" label="<%= allowPingbacksLabel %>" value="<%= true %>"/>
<aui:input name="allowTrackbacks" label="<%= allowTrackbacksLabel %>" cssClass="lfr-textarea-container" rows="10" type="textarea" />
</aui:fieldset>
</div>
</div>
<aui:button-row>
<aui:button type="submit" value="Run" cssClass="btn-lg btn-block btn-primary" id="processStart"/>
</aui:button-row>
</aui:form>

<%
// Because of bug of lifeary-ui:upload-progress, you need to add the following parameter in the request.
String progressSessionKey = ProgressTracker.PERCENT + progressId;
request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
%>
<liferay-ui:upload-progress
id="<%= progressId %>"
message="creating..."
height="20"
/>

</aui:fieldset>
</aui:fieldset-group>
<%
String numberOfPostsLabel = "Enter the number of blog posts you would like to create";
String groupLabel = "Group ID";
String baseTitleLabel = "Enter the base title";
String contentsLabel = "Enter the contents";
String userIdLabel = "User ID";
String defaultOption = "None";
String allowPingbacksLabel = "Arrow Pingbacks";
String allowTrackbacksLabel = "Please enter trackback address by comma separated strings";
List<User> users = UserLocalServiceUtil.getCompanyUsers(themeDisplay.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
final String groupName = GroupConstants.GUEST;
final long companyId = PortalUtil.getDefaultCompanyId();
final long guestGroupId = GroupLocalServiceUtil.getGroup(companyId, groupName).getGroupId();
List<Group> groups = GroupLocalServiceUtil.getGroups(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
%>

<aui:form action="<%= blogsEditURL %>" method="post" name="fm"
onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "execCommand();" %>'>
<aui:input name="<%= LDFPortletKeys.COMMON_PROGRESS_ID %>" value="<%= progressId %>" type="hidden"/>
<aui:input name="numberOfPosts" label="<%= numberOfPostsLabel %>">
<aui:validator name="digits"/>
<aui:validator name="min">1</aui:validator>
<aui:validator name="required"/>
</aui:input>
<aui:select name="groupId" label="<%= groupLabel %>">
<aui:option label="<%= defaultOption %>" value="<%= guestGroupId %>"/>
<%
for (Group group : groups) {
if (group.isSite()) {
%>
<aui:option label="<%= group.getDescriptiveName() %>" value="<%= group.getGroupId() %>"/>
<%
}
}
%>
</aui:select>

<aui:input name="baseTitle" label="<%= baseTitleLabel %>" cssClass="lfr-textarea-container">
<aui:validator name="required"/>
</aui:input>
<aui:input name="contents" label="<%= contentsLabel %>" cssClass="lfr-textarea-container">
<aui:validator name="required"/>
</aui:input>
<aui:select name="userId" label="<%= userIdLabel %>" multiple="<%= false %>">
<aui:option label="<%= user.getFullName() %>" value="<%= user.getUserId() %>" selected="true"/>
<%
for (User listUser : users) {
if (listUser.getUserId() != user.getUserId()) {
%>
<aui:option label="<%= listUser.getFullName() %>" value="<%= listUser.getUserId() %>"/>
<%
}
}
%>
</aui:select>

<div class="panel panel-secondary">
<div class="panel-header panel-heading" id="<portlet:namespace />Header" role="tab">
<div class="panel-title">
<div aria-controls="<portlet:namespace />Collapse" aria-expanded="false"
class="collapse-icon collapse-icon-middle panel-toggler" data-toggle="liferay-collapse"
href="#<portlet:namespace />Collapse" role="button">
<span class="category-name text-truncate">Click here to show more options</span>
<aui:icon cssClass="collapse-icon-closed" image="angle-right" markupView="lexicon"/>
<aui:icon cssClass="collapse-icon-open" image="angle-down" markupView="lexicon"/>
</div>
</div>
</div>
</div>

<div aria-expanded="false" aria-labelledby="<portlet:namespace/>Header"
class="collapse panel-collapse" id="<portlet:namespace/>Collapse" role="tabpanel">
<div class="row">
<aui:fieldset cssClass="col-md-12">
<aui:input name="allowPingbacks" type="toggle-switch" label="<%= allowPingbacksLabel %>"
value="<%= true %>"/>
<aui:input name="allowTrackbacks" label="<%= allowTrackbacksLabel %>"
cssClass="lfr-textarea-container" rows="10" type="textarea"/>
</aui:fieldset>
</div>
</div>

<aui:button-row>
<aui:button type="submit" value="Run" cssClass="btn-lg btn-block btn-primary" id="processStart"/>
</aui:button-row>
</aui:form>

<%
// Because of bug of lifeary-ui:upload-progress, you need to add the following parameter in the request.
String progressSessionKey = ProgressTracker.PERCENT + progressId;
request.setAttribute("liferay-ui:progress:sessionKey", progressSessionKey);
%>
<liferay-ui:upload-progress
id="<%= progressId %>"
message="creating..."
height="20"
/>

</aui:fieldset>
</aui:fieldset-group>
</div>

<aui:script>
function <portlet:namespace />execCommand() {
<%= progressId %>.startProgress();
submitForm(document.<portlet:namespace />fm);
}
function <portlet:namespace/>execCommand() {
<%= progressId %>.startProgress();
submitForm(document.<portlet:namespace/>fm);
}
</aui:script>
Loading

0 comments on commit 207c149

Please sign in to comment.