Skip to content

Instantly share code, notes, and snippets.

@sammso
Last active April 16, 2018 06:57
Show Gist options
  • Save sammso/ea85d1efd5b07af5ed6c0c9d56ec5e6a to your computer and use it in GitHub Desktop.
Save sammso/ea85d1efd5b07af5ed6c0c9d56ec5e6a to your computer and use it in GitHub Desktop.
This file is for the students of Platform Developer at Leiden 9th April, 2018

Course links and extra.

Install the exercises for the team who has done the App Developer week earlier

Unzip lrurel-platform-developer-exercises-7.0.5.zip

Import snippets from com.liferay.training.platdev.snippets/snippets folder.

https://www.dropbox.com/s/ij166zs8hor5h2g/gradebook.tar.gz?dl=0

  • Do the page 40
  • Page 42 has instructions how to import snippets manually

Install Felix Web Console

install http://central.maven.org/maven2/org/apache/felix/org.apache.felix.webconsole/4.3.4/org.apache.felix.webconsole-4.3.4.jar

After the installation remember to start it. http://localhost:8080/o/system/console and User name is admin and password is admin

Example applicaiton for configuration

https://www.dropbox.com/s/wsspavxno4gesw4/supercoolmvc.zip?dl=0

	compile group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.0"

Product menu

Missing snippets https://www.dropbox.com/s/2bo8qjy2j3d6j1i/04.08-product-menu.xml?dl=0

Link: https://goo.gl/dd1h1g from page 220

MVC Hook

dependencies {
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.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: "osgi.cmpn", version: "6.0.0"
	compile project(":modules:gradebook:gradebook-web")
}
package com.liferay.training.space.gradebook.portlet.hook;

import com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand;
import com.liferay.training.space.gradebook.portlet.constants.GradebookPortletKeys;

import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component(
		immediate = true,
		property = {
			"javax.portlet.name=" + GradebookPortletKeys.PORTLET_NAME,
			"mvc.command.name=/gradebook/submissions/view",
			"service.ranking:Integer=1000"
	},
		service = MVCRenderCommand.class)
public class ViewSubmissionsMVCRenderCommandHook implements MVCRenderCommand {

	@Override
	public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
		// TODO Auto-generated method stub
		System.err.println("Success or not");
	
		return mvcRenderCommand.render(renderRequest, renderResponse);
	}
	
	@Reference(target="(component.name=com.liferay.training.space.gradebook.portlet.command.ViewSubmissionsMVCRenderCommand)")
	private MVCRenderCommand mvcRenderCommand;

}

ServiceWrapper

How to get form field values from service wrapper. Example captcha:

			System.err.println(serviceContext.getAttribute("captchaText"));

Messagebus

https://www.dropbox.com/s/3tj52w1ojh7vof9/messagebus-web.zip?dl=0

Service Access policies

curl http://localhost:8080/api/jsonws/foo.assignment/get-assignments-by-group-id -u [email protected]:test -d groupId=20143

curl http://localhost:8080/api/jsonws/foo.assignment/get-assignments-count-by-group-id  -u [email protected]:test -d groupId=20143

https://www.dropbox.com/s/kmcyvdyj929kebe/gradebook-sap.zip?dl=0

Search facet

https://www.dropbox.com/s/136baiwycyezcpq/12.05-search-facets.xml?dl=0

Extra slides

https://www.dropbox.com/s/7rp5r0mmtccrjy9/app-dev-extra.pdf?dl=0

Modern Sitebuilding with Liferay 7.1 M2

https://www.dropbox.com/s/rjpm7q3c8i65zyb/Modern%20site%20building%20at%207.1%20and%20beyond.pdf?dl=0

Community

https://github.com/dmarks2/liferay-plugin-intellij

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment