-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
sample-workspace/sample-liferay-workspace/modules/sample-soy/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.gradle/ | ||
build/ | ||
target/ |
5 changes: 5 additions & 0 deletions
5
sample-workspace/sample-liferay-workspace/modules/sample-soy/bnd.bnd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Bundle-Name: sample-soy | ||
Bundle-SymbolicName: sample.soy | ||
Bundle-Version: 1.0.0 | ||
Include-Resource: package.json | ||
Require-Capability: soy;filter:="(type=metal)" |
13 changes: 13 additions & 0 deletions
13
sample-workspace/sample-liferay-workspace/modules/sample-soy/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dependencies { | ||
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0" | ||
compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0" | ||
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0" | ||
compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1" | ||
compileOnly group: "jstl", name: "jstl", version: "1.2" | ||
compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0" | ||
compileOnly group: "com.liferay", name: "com.liferay.portal.portlet.bridge.soy", version: "3.0.0" | ||
} | ||
|
||
jar { | ||
from "/package.json" | ||
} |
12 changes: 12 additions & 0 deletions
12
sample-workspace/sample-liferay-workspace/modules/sample-soy/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"dependencies": { | ||
"metal-component": "^2.4.5", | ||
"metal-soy": "^2.4.5" | ||
}, | ||
"devDependencies": { | ||
"liferay-module-config-generator": "^1.1.10", | ||
"metal-cli": "^1.3.1" | ||
}, | ||
"name": "soy-sample", | ||
"version": "1.0.0" | ||
} |
58 changes: 58 additions & 0 deletions
58
...feray-workspace/modules/sample-soy/src/main/java/sample/soy/portlet/SampleSoyPortlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package sample.soy.portlet; | ||
|
||
import com.liferay.portal.portlet.bridge.soy.SoyPortlet; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.portlet.Portlet; | ||
import javax.portlet.PortletException; | ||
import javax.portlet.RenderRequest; | ||
import javax.portlet.RenderResponse; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
|
||
/** | ||
* | ||
* @author Neil Zhao Jin | ||
* | ||
*/ | ||
|
||
@Component( | ||
immediate = true, | ||
property = { | ||
"com.liferay.portlet.add-default-resource=true", | ||
"com.liferay.portlet.application-type=full-page-application", | ||
"com.liferay.portlet.application-type=widget", | ||
"com.liferay.portlet.css-class-wrapper=table-wrapper", | ||
"com.liferay.portlet.display-category=category.sample", | ||
"com.liferay.portlet.header-portlet-css=/SoySample.css", | ||
"com.liferay.portlet.layout-cacheable=true", | ||
"com.liferay.portlet.preferences-owned-by-group=true", | ||
"com.liferay.portlet.private-request-attributes=false", | ||
"com.liferay.portlet.private-session-attributes=false", | ||
"com.liferay.portlet.render-weight=50", | ||
"com.liferay.portlet.scopeable=true", | ||
"com.liferay.portlet.use-default-template=true", | ||
"javax.portlet.display-name=Soy Sample Portlet", | ||
"javax.portlet.expiration-cache=0", | ||
"javax.portlet.init-param.copy-request-parameters=true", | ||
"javax.portlet.init-param.template-path=/", | ||
"javax.portlet.init-param.view-template=SoySample", | ||
"javax.portlet.name=soy_sample_portlet", | ||
"javax.portlet.resource-bundle=content.Language", | ||
"javax.portlet.security-role-ref=guest,power-user,user", | ||
"javax.portlet.supports.mime-type=text/html" | ||
}, | ||
service = Portlet.class | ||
) | ||
public class SampleSoyPortlet extends SoyPortlet { | ||
@Override | ||
public void render( | ||
RenderRequest renderRequest, RenderResponse renderResponse) | ||
throws IOException, PortletException { | ||
|
||
template.put("msg", "Good Job!"); | ||
|
||
super.render(renderRequest, renderResponse); | ||
} | ||
} |
Empty file.
36 changes: 36 additions & 0 deletions
36
...-liferay-workspace/modules/sample-soy/src/main/resources/META-INF/resources/SoySample.soy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{namespace SoySample} | ||
|
||
/** | ||
* Show portlet message in the view. | ||
* @param id | ||
* @param msg | ||
*/ | ||
{template .render} | ||
<div id="{$id}"> | ||
<div class="form-group"> | ||
<div class="input-group"> | ||
<span class="input-group-addon" id="inputGroupAddon01">Message:</span> | ||
<input aria-describedby="inputGroupAddon01" class="form-control" value="{$msg}" type="text"> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="input-group"> | ||
<input aria-describedby="inputGroupAddon02" class="form-control" placeholder="Recipient's username, ex. neil.jin ;)" type="text"> | ||
<span class="input-group-addon" id="inputGroupAddon02">@liferay.com</span> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="input-group"> | ||
<span class="input-group-addon">$</span> | ||
<input aria-label="Amount" class="form-control" type="text"> | ||
<span class="input-group-addon">.00</span> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<button class="btn btn-default" type="button">Donate</button> | ||
</div> | ||
</div> | ||
{/template} |
17 changes: 17 additions & 0 deletions
17
...feray-workspace/modules/sample-soy/src/main/resources/META-INF/resources/SoySample.soy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This file was automatically generated from SoySample.soy. | ||
// Please don't edit this file by hand. | ||
|
||
/** | ||
* @fileoverview Templates in namespace SoySample. | ||
* @public | ||
*/ | ||
|
||
if (typeof SoySample == 'undefined') { var SoySample = {}; } | ||
|
||
|
||
SoySample.render = function(opt_data, opt_ignored) { | ||
return soydata.VERY_UNSAFE.ordainSanitizedHtml('<div id="' + soy.$$escapeHtmlAttribute(opt_data.id) + '"><div class="form-group"><div class="input-group"><span class="input-group-addon" id="inputGroupAddon01">Message:</span><input aria-describedby="inputGroupAddon01" class="form-control" value="' + soy.$$escapeHtmlAttribute(opt_data.msg) + '" type="text"></div></div><div class="form-group"><div class="input-group"><input aria-describedby="inputGroupAddon02" class="form-control" placeholder="Recipient\'s username, ex. neil.jin ;)" type="text"><span class="input-group-addon" id="inputGroupAddon02">@liferay.com</span></div></div><div class="form-group"><div class="input-group"><span class="input-group-addon">$</span><input aria-label="Amount" class="form-control" type="text"><span class="input-group-addon">.00</span></div></div><div class="form-group"><button class="btn btn-default" type="button">Donate</button></div></div>'); | ||
}; | ||
if (goog.DEBUG) { | ||
SoySample.render.soyTemplateName = 'SoySample.render'; | ||
} |
5 changes: 5 additions & 0 deletions
5
...ample-liferay-workspace/modules/sample-soy/src/main/resources/content/Language.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
javax.portlet.display-name.sample-soy=sample-soy JSP | ||
javax.portlet.keywords.sample-soy=sample-soy,jsp | ||
javax.portlet.short-title.sample-soy=sample-soy JSP | ||
javax.portlet.title.sample-soy=sample-soy JSP Portlet | ||
sample-soy.caption=Hello from sample-soy JSP! |