Skip to content

Instantly share code, notes, and snippets.

View jverweijL's full-sized avatar
💭
🏴‍☠️

Jan Verweij jverweijL

💭
🏴‍☠️
View GitHub Profile
include-and-override=portal-developer.properties
#portal.instance.protocol=https
web.server.https.port=443
web.server.protocol=https
redirect.url.security.mode=domain
#
# The portal can authenticate users based on their email address, screen
# name, or user ID.
@jverweijL
jverweijL / steps.md
Last active January 16, 2019 10:03
How to configure Asset Publisher to use custom user profiles attributes
  1. Create Custom attribute for User (e.g. Location")
  2. Make sure to set permissions so that users can view the attribute
  3. Create Vocabulary ("Location") (Must be a global vocabulary!!!)
  4. Add categories to vocabulary (e.g. "Chicago")
  5. Set "Chicago" to location user attribute for User.
  6. Categorize content with "Chicago" from location vocabulary
  7. Add asset publisher and specify "Location" as the user profile attribute to personalize upon
@jverweijL
jverweijL / git-flow.md
Last active January 30, 2019 10:57
Typical git flow

First get a fresh clone
git clone [repo]

Or if you had the repo already local check the status
git status

Let's create new branch
git checkout -b [new-branch]

Add all you new stuff

@jverweijL
jverweijL / form-overview.adt
Created November 23, 2018 16:09
Example how you can get an overview of data filled into a form for a specific user.
<#assign companyId = themeDisplay.getCompanyId()/>
<#assign groupId = themeDisplay.getScopeGroupId()/>
<#assign userId = themeDisplay.getRealUserId() />
<#assign locale = themeDisplay.getLocale() />
<#assign ddlService = serviceLocator.findService('com.liferay.dynamic.data.lists.service.DDLRecordLocalService') />
${companyId}
${groupId}
${themeDisplay.getRealUserId()}
${locale}
@jverweijL
jverweijL / pinned.adt
Last active April 20, 2020 23:49
ADT's and Freemarker examples
<#-- https://gist.github.com/jverweijL/67b929d11465058654aacc48d6574c9b -->
<#if entries?has_content>
<#list entries as curEntry>
<#assign priority=curEntry.getPriority() >
<div class="float-left">
<a href="">${curEntry.getTitle(locale)}</a>
</div>
<div class="float-right">
<#if priority gt 0>
<svg class="lexicon-icon">
@jverweijL
jverweijL / bp.md
Last active October 9, 2018 10:09
Liferay Best Practices
  1. Set mysql to lowercase only
 --lower-case-table-names=1 
  1. Turn off Autogenerate Structure Key and Template Key
# Use your own keys instead:
GLOBAL.STRUCTURE.DISH
GLOBAL.TEMPLATE.MENU_LIST
@jverweijL
jverweijL / carousel.adt
Last active October 8, 2018 13:30
ADT Carousel

Get data from ADT to template

Sometimes you need get data from ADT to template (or the other way round)

We often need the viewURL to link to full content. You can add attributes to the request in the ADT:

${request.setAttribute("viewURL", viewURL )}

I found another trick to recreate the table

  1. uninstall the module
  2. stop liferay
  3. delete FROM ServiceComponent where buildNamespace='FOO';
  4. delete FROM Release_ WHERE servletContextName = 'com.acme.foo.sb.service';
  5. drop TABLE IF EXISTS 'namespace_entity';
  6. start liferay
sudo docker pull mysql:5.7
sudo docker run --name liferay-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7