Scripting Language Portlets
Developing using scripting languages is quite easy. You can use the sample portlets as reference, providing the developer the appropriated directory structure, that looks similar to
All the impotant files are under docroot/WEB-INF. There it can be found the usual files, including portlet.xml, which looks like this
<portlet-class>com.liferay.util.bridges.groovy.GroovyPortlet</portlet-class> <init-param> <name>view-file</name> <value>/WEB-INF/groovy/view.groovy</value> </init-param> <init-param> <name>action-file</name> <value>/WEB-INF/groovy/action.groovy</value> </init-param> <init-param> <name>global-files</name> <value>/WEB-INF/groovy/global/LiferayPortlet.groovy,/WEB-INF/groovy/global/Custom.groovy</value> </init-param>
The other files (info.groovy and java.groovy) represent different views your portlet may have, but they have to be linked from somewhere to be accessible. Remember to use the appropriated methods to create correct links inside the portal. For convenience, LiferayPortlet.groovy (or the appropriate one for the scripting language of your choice) includes some methods and examples about how to do that.
The way global files are handled is just by creating a large text structure made by concatenating the global files and the script to execute (view.groovy, java.groovy, ...). Consider this to properly write classes or modules qualified names.
From scripting files you can access the usual portlet objects, namely the request and response objects (actionRequest/actionResponse, renderRequest/renderResponse), portlet config (portletConfig), portlet context (portletContext), portlet preferences (portletPreferences) and user info (userInfo). They are Java objects, so they have all methods and properties you would expect if in a Java class.
TODO: Explain PHP portlets differences. They can be developed including only php files without the full structure and the jar file.