RLiferayTool 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/r_liferay_lib/portlet_service_templates/ListItemLocalServiceImpl.java.erb +7 -7
- data/lib/r_liferay_lib/portlet_service_templates/ListItemServiceImpl.java.erb +7 -7
- data/lib/r_liferay_lib/portlet_service_templates/PortletController.java.erb +3 -3
- data/lib/r_liferay_lib/portlet_service_templates/add.jsp.erb +5 -1
- data/lib/r_liferay_lib/portlet_service_templates/init.jsp.erb +1 -1
- data/lib/r_liferay_lib/portlet_service_templates/portlet.xml.erb +1 -1
- data/lib/r_liferay_lib/portlet_service_templates/view.jsp.erb +1 -1
- data/lib/r_liferay_lib/prepare_portlet_service.rb +2 -2
- data/lib/r_liferay_lib/read_pom.rb +4 -3
- data/lib/r_liferay_tool.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTRkYjBmN2YzNDRiNmIzOGVjNmM3MTNkMzE2NmViOGIzNjFhMmNlMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmFlMzQwNjgxMzBjZTZjNjljYjcyN2U1YjcwOWExODIzNTVjZTJhOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjFmYjkxMDY1ZjU1ZmNiMDY2Y2QwNWEzY2JjYzhhYTVlYTkzODFjNTI4MDQw
|
10
|
+
N2I5MGI1Mzg2NzM2OWU1M2JhZmU4NzFkZDRlYmZkYjgzYjg0NTEyNDVjN2Zm
|
11
|
+
N2ZlZTMyNTlmODZkZWJiNDAyMTJhNmI5ZTkzMWEwZjI1NGMzYmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDhmODVhN2RhMGRlZWRlYTc3YzhhMDY1NjViMWFjZTU1ZDhiYTFmMDVlNWVk
|
14
|
+
MjJjZWIzZDdiOGYwNjUxODA5ZWM3ZTI3NDZmZDkwMmY2YTE5YjM5N2U3NDA5
|
15
|
+
MDIyNjI1OTc3NmE5Nzk4MWE4NjM5MGJiNWNmYTc4MmU1NDk2OTU=
|
@@ -1,30 +1,30 @@
|
|
1
|
-
package
|
1
|
+
package <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.impl;
|
2
2
|
|
3
3
|
import com.liferay.portal.kernel.exception.PortalException;
|
4
4
|
import com.liferay.portal.kernel.exception.SystemException;
|
5
5
|
import java.util.Date;
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.base.<%= template_variables['name']%>LocalServiceBaseImpl;
|
7
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.model.<%= template_variables['name']%>;
|
8
8
|
|
9
9
|
/**
|
10
10
|
* The implementation of the <%= template_variables['name']%> local service.
|
11
11
|
*
|
12
12
|
* <p>
|
13
|
-
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link
|
13
|
+
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.<%= template_variables['name']%>LocalService} interface.
|
14
14
|
*
|
15
15
|
* <p>
|
16
16
|
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
|
17
17
|
* </p>
|
18
18
|
*
|
19
19
|
* @author Brian Wing Shun Chan
|
20
|
-
* @see
|
21
|
-
* @see
|
20
|
+
* @see <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.base.<%= template_variables['name']%>LocalServiceBaseImpl
|
21
|
+
* @see <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.<%= template_variables['name']%>LocalServiceUtil
|
22
22
|
*/
|
23
23
|
public class <%= template_variables['name']%>LocalServiceImpl extends <%= template_variables['name']%>LocalServiceBaseImpl {
|
24
24
|
/*
|
25
25
|
* NOTE FOR DEVELOPERS:
|
26
26
|
*
|
27
|
-
* Never reference this interface directly. Always use {@link
|
27
|
+
* Never reference this interface directly. Always use {@link <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.<%= template_variables['name']%>LocalServiceUtil} to access the <%= template_variables['name']%> local service.
|
28
28
|
*/
|
29
29
|
public <%= template_variables['name']%> add<%= template_variables['name']%>(<% template_variables['columns'].each_with_index do |(column_name, column_object), index| %>
|
30
30
|
<%= column_object.column_type %> <%=column_name%><% if index < template_variables['columns'].size - 1 %>,<%end%><% end %>
|
@@ -1,30 +1,30 @@
|
|
1
|
-
package
|
1
|
+
package <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.impl;
|
2
2
|
|
3
3
|
import com.liferay.portal.kernel.exception.PortalException;
|
4
4
|
import com.liferay.portal.kernel.exception.SystemException;
|
5
5
|
import java.util.Date;
|
6
|
-
import
|
7
|
-
import
|
6
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.base.<%= template_variables['name']%>ServiceBaseImpl;
|
7
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.model.<%= template_variables['name']%>;
|
8
8
|
|
9
9
|
/**
|
10
10
|
* The implementation of the <%= template_variables['name']%> remote service.
|
11
11
|
*
|
12
12
|
* <p>
|
13
|
-
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link
|
13
|
+
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.<%= template_variables['name']%>Service} interface.
|
14
14
|
*
|
15
15
|
* <p>
|
16
16
|
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
|
17
17
|
* </p>
|
18
18
|
*
|
19
19
|
* @author Brian Wing Shun Chan
|
20
|
-
* @see
|
21
|
-
* @see
|
20
|
+
* @see <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.base.<%= template_variables['name']%>ServiceBaseImpl
|
21
|
+
* @see <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.<%= template_variables['name']%>ServiceUtil
|
22
22
|
*/
|
23
23
|
public class <%= template_variables['name']%>ServiceImpl extends <%= template_variables['name']%>ServiceBaseImpl {
|
24
24
|
/*
|
25
25
|
* NOTE FOR DEVELOPERS:
|
26
26
|
*
|
27
|
-
* Never reference this interface directly. Always use {@link
|
27
|
+
* Never reference this interface directly. Always use {@link <%= template_variables['project_package'] %>.<%= template_variables['project_name'] %>.service.<%= template_variables['name']%>ServiceUtil} to access the <%= template_variables['name']%> remote service.
|
28
28
|
*/
|
29
29
|
|
30
30
|
public <%= template_variables['name']%> add<%= template_variables['name']%>(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
package
|
1
|
+
package <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.portlet;
|
2
2
|
|
3
3
|
import com.liferay.portal.kernel.dao.orm.QueryUtil;
|
4
4
|
import com.liferay.portal.kernel.dao.search.SearchContainer;
|
@@ -20,8 +20,8 @@ import javax.portlet.PortletException;
|
|
20
20
|
import javax.portlet.PortletURL;
|
21
21
|
import javax.portlet.RenderRequest;
|
22
22
|
import javax.portlet.RenderResponse;
|
23
|
-
import
|
24
|
-
import
|
23
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.model.<%= template_variables['name']%>;
|
24
|
+
import <%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.<%= template_variables['name']%>LocalServiceUtil;
|
25
25
|
|
26
26
|
public class PortletController extends MVCPortlet {
|
27
27
|
|
@@ -4,9 +4,13 @@
|
|
4
4
|
</portlet:actionURL>
|
5
5
|
|
6
6
|
<aui:form action="${addItemURL}" method="post" name="newitemfm">
|
7
|
+
<jsp:useBean id="date" class="java.util.Date"/>
|
8
|
+
<fmt:formatDate value="${date}" pattern="MM" var="month"/>
|
9
|
+
<fmt:formatDate value="${date}" pattern="dd" var="day"/>
|
10
|
+
<fmt:formatDate value="${date}" pattern="yyyy" var="year" />
|
7
11
|
<%- template_variables['columns'].each do |column_name, column_object| -%>
|
8
12
|
<%- if column_object.getFormType == 'date' -%>
|
9
|
-
<liferay-ui:input-date dayParam="<%=column_name%>Day" monthParam="<%=column_name%>Month" yearParam="<%=column_name%>Year" />
|
13
|
+
<liferay-ui:input-date dayParam="<%=column_name%>Day" monthParam="<%=column_name%>Month" yearParam="<%=column_name%>Year" dayValue="${day}" monthValue="${month-1}" yearValue="${year}"/>
|
10
14
|
<%- else -%>
|
11
15
|
<aui:input type="<%= column_object.getFormType %>" name="<%= column_name %>" label="<%= column_name %>"></aui:input>
|
12
16
|
<%- end -%>
|
@@ -7,6 +7,6 @@
|
|
7
7
|
<%%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
|
8
8
|
<%%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
|
9
9
|
<%%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
|
10
|
-
<%%@ page import="
|
10
|
+
<%%@ page import="<%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.service.<%= template_variables['name']%>LocalServiceUtil" %>
|
11
11
|
|
12
12
|
<portlet:defineObjects />
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<portlet>
|
4
4
|
<portlet-name><%= template_variables['project_name'] %></portlet-name>
|
5
5
|
<display-name><%= template_variables['project_name'] %></display-name>
|
6
|
-
<portlet-class
|
6
|
+
<portlet-class><%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.portlet.PortletController</portlet-class>
|
7
7
|
<init-param>
|
8
8
|
<name>view-template</name>
|
9
9
|
<value>/html/view.jsp</value>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
/>
|
15
15
|
|
16
16
|
<liferay-ui:search-container-row
|
17
|
-
className="
|
17
|
+
className="<%= template_variables['project_package'] %>.<%= template_variables['project_name'].downcase %>.model.<%= template_variables['name'] %>"
|
18
18
|
keyProperty="<%= template_variables['primary_key'] %>"
|
19
19
|
modelVar="item"
|
20
20
|
>
|
@@ -6,7 +6,7 @@ module RLiferayLib
|
|
6
6
|
|
7
7
|
WEB_INF_DIR = '/src/main/webapp/WEB-INF'
|
8
8
|
JSP_DIR = '/src/main/webapp/html'
|
9
|
-
JAVA_DIR = 'src/main/java/
|
9
|
+
JAVA_DIR = '/src/main/java/'
|
10
10
|
PLUGIN_PACKAGE_NAME = 'liferay-plugin-package.properties'
|
11
11
|
PORTLET_XML_NAME = 'portlet.xml'
|
12
12
|
CONTROLLER_NAME = 'PortletController.java'
|
@@ -90,7 +90,7 @@ module RLiferayLib
|
|
90
90
|
|
91
91
|
|
92
92
|
def generate_java_files
|
93
|
-
target_directory = self.target_directory + '/' + JAVA_DIR + "/#{self.template_variables['project_name'].downcase}"
|
93
|
+
target_directory = self.target_directory + '/' + JAVA_DIR + self.template_variables['project_package'].gsub('.' ,'/' )+ "/#{self.template_variables['project_name'].downcase}"
|
94
94
|
prepare_directory(target_directory)
|
95
95
|
generate_controller(target_directory)
|
96
96
|
generate_local_impl(target_directory)
|
@@ -3,7 +3,7 @@ require_relative 'xml_utility'
|
|
3
3
|
|
4
4
|
module RLiferayLib
|
5
5
|
class ReadPOM
|
6
|
-
attr_reader :pom_xml_file, :version
|
6
|
+
attr_reader :pom_xml_file, :version, :package
|
7
7
|
|
8
8
|
def initialize(pom_xml_file)
|
9
9
|
self.pom_xml_file=pom_xml_file
|
@@ -13,11 +13,12 @@ module RLiferayLib
|
|
13
13
|
|
14
14
|
|
15
15
|
private
|
16
|
-
attr_writer :pom_xml_file, :version
|
16
|
+
attr_writer :pom_xml_file, :version, :package
|
17
17
|
|
18
18
|
def read_xml
|
19
19
|
xml_utility = XMLUtility.new(self.pom_xml_file)
|
20
|
-
self.version = xml_utility.xml_content.at_xpath('/project/version').to_s
|
20
|
+
self.version = xml_utility.xml_content.at_xpath('/project/version').text.to_s
|
21
|
+
self.package = xml_utility.xml_content.at_xpath('/project/groupId').text.to_s
|
21
22
|
end
|
22
23
|
|
23
24
|
|
data/lib/r_liferay_tool.rb
CHANGED
@@ -53,6 +53,7 @@ class RLiferayTool < Thor
|
|
53
53
|
template_variables = read_service.entities[read_service.entities.keys[0]]
|
54
54
|
template_variables['project_name'] = project_name
|
55
55
|
template_variables['project_version'] = read_pom.version
|
56
|
+
template_variables['project_package'] = read_pom.package
|
56
57
|
prepare_portlet_service = RLiferayLib::PreparePortletService.new(template_directory, target_directory, template_variables)
|
57
58
|
end
|
58
59
|
end
|