Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Nov 12, 2019
2 parents 05e69ed + 6c334cf commit 1429c19
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 87 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ The list of what Damascus automatically generate is as follows
* Multiple service builder portlets at once
* Exporting entities by xls file format
* 1..N Relations between models
* Template generation

### Required environment
* Liferay 7.0 CE GA4 and Liferay DXP SP3 or higher versions.
* Liferay 7.0 CE GA7 and Liferay DXP SP11 or higher versions.
* Liferay 7.1 CE GA1 and higher.
* Liferay 7.2 CE GA1 and higher.
* Java 1.8 or above
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jar {
manifest {
attributes(
"Bundle-SymbolicName": "com.liferay.damascus.cli",
"Bundle-Version": "1.1.0",
"Bundle-Version": "1.1.1",
"Bundle-Description": "Liferay extension tool for scaffolding service builder portlet",
"Main-Class": "com.liferay.damascus.cli.Damascus",
"JPM-Command": "damascus"
Expand Down
Binary file modified latest/damascus.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/com/liferay/damascus/cli/Damascus.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@Slf4j
public class Damascus {

public final static String VERSION = "1.1.0";// + "_" + LocalDateTime.now().toString();
public final static String VERSION = "1.1.1";// + "_" + LocalDateTime.now().toString();

/**
* Main
Expand Down
26 changes: 12 additions & 14 deletions src/main/resources/templates/7.0/Portlet_XXXXSVC_bnd.bnd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ ${packageName}.service.permission,\
${packageName}.service.util
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
-dsannotations-options: inherit

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
Import-Package:\
!com.google.*,\
!org.checkerframework.* ,\
!org.apache.commons.*,\
*

-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
@guava-*.jar,\
@error_prone_annotations-*.jar,\
@commons-digester-*.jar,\
@commons-validator-*.jar,\
@commons-io-*.jar,\
@commons-lang3-*.jar
28 changes: 13 additions & 15 deletions src/main/resources/templates/7.0/Portlet_XXXXWEB_bnd.bnd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@
Bundle-Name: ${dashcaseProjectName}-web
Bundle-SymbolicName: ${packageName}.web
Bundle-Version: 1.0.0

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

Export-Package:\
${packageName}.web.asset,\
${packageName}.web.social
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

-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
@guava-*.jar,\
@error_prone_annotations-*.jar,\
@commons-digester-*.jar,\
@commons-validator-*.jar,\
@commons-io-*.jar,\
@commons-lang3-*.jar

Web-ContextPath: /${dashcaseProjectName}-web

Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/templates/7.0/Portlet_XXXXWEB_edit.jsp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<#-- field loop ends -->
<#-- ---------------- -->

<#if ratings >
<#if ratings >
<%
if (${uncapFirstModel}.getPrimaryKey() != 0) {
%>
Expand Down Expand Up @@ -165,7 +165,7 @@
<%
}
%>
<aui:button-row>
<aui:button-row cssClass="pull-right">
<%
String publishButtonLabel = "submit";
%>
Expand All @@ -178,7 +178,7 @@
publishButtonLabel = "submit-for-publication";
}
%>
<aui:button cssClass="btn-lg" type="submit" primary="<%= false %>"
<aui:button primary="<%= true %>"
onClick='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveEditors();" %>'
value="<%=publishButtonLabel%>" />
<%
Expand All @@ -191,7 +191,7 @@
%>
</aui:button-row>
</aui:form>
<#if discussion >
<#if discussion >
<%
if (${uncapFirstModel}.getPrimaryKey() != 0 && false == fromAsset) {
%>
Expand All @@ -214,7 +214,7 @@
<%
}
%>
</#if>
</#if>
</div>

<#list application.fields as field >
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/7.0/service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<exceptions>
<#list damascus.applications as app >
<exception>NoSuch${app.model}</exception>
<exception>${app.model?cap_first}ValidateException</exception>
<exception>${app.model?cap_first}Validate</exception>
</#list>
</exceptions>

Expand Down
35 changes: 17 additions & 18 deletions src/main/resources/templates/7.1/Portlet_XXXXWEB_edit.jsp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -86,44 +86,44 @@
field.type?string == "com.liferay.damascus.cli.json.fields.Integer" ||
field.type?string == "com.liferay.damascus.cli.json.fields.Text"
>
<#if field.validation?? && field.validation.className??>
<#if field.validation?? && field.validation.className??>
<#assign capFirstValidationModel = "${field.validation.className?cap_first}">
<#assign uncapFirstValidationModel = "${field.validation.className?uncap_first}">
<#assign uppercaseValidationModel = "${field.validation.className?upper_case}">

<#assign fieldName = "PrimaryKey">
<#if field.validation.fieldName??>
<#assign fieldName = "${field.validation.fieldName?cap_first}">
</#if>

<#assign orderByField = "PrimaryKey">
<#if field.validation.orderByField??>
<#assign orderByField = "${field.validation.orderByField?uncap_first}">
</#if>
<%
${capFirstValidationModel}ViewHelper ${uncapFirstValidationModel}ViewHelper = (${capFirstValidationModel}ViewHelper) request
.getAttribute(${capFirstValidationModel}WebKeys.${uppercaseValidationModel}_VIEW_HELPER);

SearchContainerResults<${capFirstValidationModel}> ${uncapFirstValidationModel}Results = ${uncapFirstValidationModel}ViewHelper.getListFromDB(
renderRequest, -1, -1, "${orderByField?uncap_first}", "asc", new int[] {WorkflowConstants.STATUS_APPROVED});
%>
%>
<liferay-ui:error key="${lowercaseModel}-${field.name?lower_case}-not-found"
message="${lowercaseModel}-${field.name?lower_case}-not-found" />
<aui:select name="${field.name}"

<aui:select name="${field.name}"
label='<%=LanguageUtil.get(request, "${lowercaseModel}-${field.name?lower_case}")
+ requiredLabel%>'>
<aui:option value=""><%=LanguageUtil.get(request, "please-select") %></aui:option>
<% for(${capFirstValidationModel} ${uncapFirstValidationModel} : ${uncapFirstValidationModel}Results.getResults()) { %>
<aui:option value="<%= ${uncapFirstValidationModel}.get${fieldName}() %>"><%=${uncapFirstValidationModel}.get${orderByField?cap_first}() %></aui:option>
<% } %>
</aui:select>

<#else>
<aui:input name="${field.name}" disabled="false"
label='<%=LanguageUtil.get(request, "${lowercaseModel}-${field.name?lower_case}")
+ requiredLabel%>' />
</#if>
</#if>
</#if>
<#-- ---------------- -->
<#-- Document Library -->
Expand Down Expand Up @@ -157,7 +157,7 @@
<#-- field loop ends -->
<#-- ---------------- -->

<#if ratings >
<#if ratings >
<%
if (${uncapFirstModel}.getPrimaryKey() != 0) {
%>
Expand Down Expand Up @@ -200,7 +200,7 @@
<%
}
%>
<aui:button-row>
<aui:button-row cssClass="pull-right">
<%
String publishButtonLabel = "submit";
%>
Expand All @@ -213,20 +213,19 @@
publishButtonLabel = "submit-for-publication";
}
%>
<aui:button cssClass="btn-lg" type="submit" primary="<%= false %>"
onClick='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveEditors();" %>'
value="<%=publishButtonLabel%>" />
<%
if (!fromAsset) {
%>
&nbsp;&nbsp;&minus; <liferay-ui:message key="or"/> &minus;
<aui:button onClick="<%=redirect%>" type="cancel" />
<aui:button onClick="<%=redirect%>" type="cancel" />
<%
}
%>
<aui:button primary="<%= true %>"
onClick='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveEditors();" %>'
value="<%=publishButtonLabel%>" />
</aui:button-row>
</aui:form>
<#if discussion >
<#if discussion >
<%
if (${uncapFirstModel}.getPrimaryKey() != 0 && false == fromAsset) {
%>
Expand All @@ -249,7 +248,7 @@
<%
}
%>
</#if>
</#if>
</div>

<#list application.fields as field >
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/7.1/service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<exceptions>
<#list damascus.applications as app >
<exception>NoSuch${app.model}</exception>
<exception>${app.model?cap_first}ValidateException</exception>
<exception>${app.model?cap_first}Validate</exception>
</#list>
</exceptions>

Expand Down
29 changes: 14 additions & 15 deletions src/test/resources/templates/7.0/Portlet_XXXXSVC_bnd.bnd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
Bundle-Name: ${dashcaseProjectName}-service
Bundle-SymbolicName: ${packageName}.service
Bundle-Version: 1.0.0

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

Export-Package:\
${packageName}.service.permission,\
${packageName}.service.util
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true

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
-dsannotations-options: inherit

-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
@guava-*.jar,\
@error_prone_annotations-*.jar,\
@commons-digester-*.jar,\
@commons-validator-*.jar,\
@commons-io-*.jar,\
@commons-lang3-*.jar
29 changes: 14 additions & 15 deletions src/test/resources/templates/7.0/Portlet_XXXXWEB_bnd.bnd.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@
Bundle-Name: ${dashcaseProjectName}-web
Bundle-SymbolicName: ${packageName}.web
Bundle-Version: 1.0.0

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

Export-Package:\
${packageName}.web.asset,\
${packageName}.web.social
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


-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
@guava-*.jar,\
@error_prone_annotations-*.jar,\
@commons-digester-*.jar,\
@commons-validator-*.jar,\
@commons-io-*.jar,\
@commons-lang3-*.jar

Web-ContextPath: /${dashcaseProjectName}-web

Expand Down

0 comments on commit 1429c19

Please sign in to comment.