https://github.com/nonblocking/liferay-angularjs-portlet
AngularJS 1 Liferay Portlet
https://github.com/nonblocking/liferay-angularjs-portlet
Last synced: over 1 year ago
JSON representation
AngularJS 1 Liferay Portlet
- Host: GitHub
- URL: https://github.com/nonblocking/liferay-angularjs-portlet
- Owner: nonblocking
- License: apache-2.0
- Created: 2014-07-15T08:53:31.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-05-01T18:00:48.000Z (over 10 years ago)
- Last Synced: 2024-10-05T22:04:17.602Z (almost 2 years ago)
- Language: Java
- Homepage:
- Size: 487 KB
- Stars: 27
- Watchers: 9
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AngularJS Portlet Demo v3
=========================
A Liferay portlet that just list all users and shows how AngularJS and Spring Portlet MVC can be used to create single page HTML5 portlets.
The demonstrator consists of two parts:
1. A [Spring Portlet MVC](http://docs.spring.io/spring/docs/4.0.x/spring-framework-reference/html/portlet.html) backend that handles all AJAX requests as resource requests.
It leverages the [thymeleaf](http://www.thymeleaf.org/) HTML5 template engine to pass the resource URL and other parameters as JavaScript variables to the frontend.
2. An [AngularJS](https://angularjs.org/) frontend that can also be run **standalone with node.js**, which can greatly accelerate the development.
## Build
### Prerequisites
* [Maven](https://maven.apache.org/) build tool (should come with your favorite IDE)
* [node.js](http://nodejs.org/) and [Grunt](http://gruntjs.com/) to build and run the HTML5/JavaScript code
* [SASS](http://sass-lang.com/) to compile the Sassy CSS into CSS
### Create the WAR file
Just run **mvn package** on the command line.
## Run
### On a Liferay 6.2 Portal
Drop the generated _liferay-angularjs-portlet-*.war_ file in the_target_ directory into the *{liferay-home}/deploy* folder.
Alternatively execute on the command line: **mvn liferay:deploy -D\**
### Standalone
Run **npm install** and **grunt server** in the root directory of the project. The webapp will be available on *localhost:9000*.
## Notes
* To run the portlet on a Liferay 6.1 portal two files need to be changed:
1. In *liferay-portlet.xml* change the doctype from *6.2.0.dtd* to *6.0.0.dtd* and remove the line *<requires-namespaced-parameters>false</requires-namespaced-parameters>*
2. In *liferay-plugin-package.properties* change the *liferay-versions* property to *6.1.0+,6.1.2+*
* The AngularJS portlet in this demonstrator is **instanceable**, which means that you can place it multiple times on a single portal page
* In order to allow multiple angular based portlets on a page *angular-route* cannot be used
* If you plan to make a whole suite of AngularJS portlets you should put all JavaScript base libraries and base modules into your theme
(instead of shipping it with every single portlet).
* In the standalone version live-reload is activated, so whenever you change a SASS or JS file the browser will refresh automatically.
* In a real world app **don't forget Java and JavaScript unit tests**!
## Screenshots
### Liferay 6.2

### Standalone
