Giter Site home page Giter Site logo

psvehla / portlet-property-demo Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 156 KB

A demo of a Liferay portlet that has preferences that can be configured with Options->Configuration->Setup.

License: GNU Lesser General Public License v3.0

Java 100.00% CSS 0.01% JavaScript 0.01%

portlet-property-demo's Introduction

Liferay Portlet Property Demo

A demo of a Liferay portlet that has preferences that can be configured with Options->Configuration->Setup.

  • Liferay EE 6.2 GA1 SP3
  • Java 1.7
  • Portlet 2.0
  • Spring Framework 4.0.6
  • Annotation-based controller configuration

Usage

$ git clone http://github.com/psvehla/portlet-property-demo.git
$ cd portlet-property-demo
$ mvn package

Deploy

If you're using Liferay Portal with Tomcat, copy the war to the deploy directory.

$ cp target/liferay-spring-mvc-portlet.war $LIFERAY_HOME/deploy/

Configuration

Default settings are Liferay EE 6.2.10.4, Java 1.7, Portlet 2.0, and Spring 4.0. All can be configured in pom.xml

	<properties>
		<liferay.version>6.2.10.4</liferay.version>
		<java-version>1.7</java-version>
		<portlet-api.version>2.0</portlet-api.version>
		<servlet-api.version>2.5</servlet-api.version>
		<jsp-api.version>2.2</jsp-api.version>
		<jstl.version>1.2</jstl.version>
		<org.springframework-version>4.0.6.RELEASE</org.springframework-version>
		<org.aspectj-version>1.8.1</org.aspectj-version>
		<org.slf4j-version>1.7.7</org.slf4j-version>
	</properties>

Important Points to Note When Adding Preferences to Your Own Portlet

  • Add your
<portlet-preferences/>

to your portlet.xml.

  • Add
<configuration-action-class>au.com.redbarn.liferay.portlet.property.ConfigurationActionImpl</configuration-action-class>

to liferay-portlet.xml.

  • Implement the ConfigurationAction.
  • Create a view for the Options->Configuration->Setup tab (configuration.jsp in this example).
  • Read the preferences in your own code with
request.getPreferences().getValue(Constants.MESSAGE_PARAM, Constants.DEFAULT_MESSAGE)

See HomeController for an example.

Licence

Copyright 2014 Red Barn Consulting

Licenced under the LGPL Licence, Version 3.0: http://www.gnu.org/licenses/lgpl.html

portlet-property-demo's People

Contributors

psvehla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.