Skip to content

Instantly share code, notes, and snippets.

View marcosblandim's full-sized avatar

marcosblandim

View GitHub Profile
@pedroblandim
pedroblandim / dev-docker-compose.yaml
Last active September 5, 2024 19:42
Liferay docker compose
version: "3.8"
services:
liferay:
image: liferay/portal:7.4.3.19-ga19
container_name: tomcat
networks:
- fs72sp1
depends_on:
- postgres
environment:
@pedroblandim
pedroblandim / Notícia Completa com data no topo - Web Content Template (sem os campos adicionados).ftl
Last active September 17, 2023 21:35
Simplify Liferay - Vídeo: Entendendo conteúdo web em 10 minutos
<style>
.container {
display: flex;
flex-direction: column;
border-radius: 15px;
padding: 25px;
align-items: flex-start;
}
.content-text {
@pedroblandim
pedroblandim / Web Content DDM Structure - Notícia.json
Last active June 10, 2022 16:51
Simplify Liferay - Vídeo: Publicador de Conteúdos e Mídias
{
"availableLanguageIds": [
"pt_BR"
],
"contentType": "journal",
"dataDefinitionFields": [
{
"customProperties": {
"labelAtStructureLevel": true,
"confirmationErrorMessage": {
@pedroblandim
pedroblandim / getDDMFieldValue.groovy
Created May 10, 2022 22:50
Liferay: Get Journal Article's DDM Field value
import com.liferay.journal.service.JournalArticleLocalServiceUtil
import com.liferay.asset.kernel.service.AssetEntryLocalServiceUtil
import com.liferay.journal.model.JournalArticle
import com.liferay.portal.kernel.util.LocaleUtil
def fieldName = "field name"
def ja = JournalArticleLocalServiceUtil.fetchJournalArticle(id);
def entry = AssetEntryLocalServiceUtil.fetchEntry(JournalArticle.class.getName(), ja.getResourcePrimKey())
@pedroblandim
pedroblandim / getDLFilePreviewURL.java
Created May 10, 2022 22:04
Liferay get DL File preview URL
import com.liferay.document.library.kernel.service.DLAppLocalServiceUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.document.library.util.DLURLHelperUtil;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.exception.PortalException;
public static String getDLEntryFileURL(long fileEntryId, ThemeDisplay themeDisplay)
throws PortalException {
@pedroblandim
pedroblandim / liferay.desktop
Created May 5, 2022 04:32
liferay.desktop file example
[Desktop Entry]
Type=Application
Name=Liferay IDE
Comment=Liferay Developer Studio
Icon=/path/to/icon.xpm
Exec=/path/to/DeveloperStudio
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Liferay IDE
@evaldeslacasa
evaldeslacasa / addParameterLiferay.java
Created February 21, 2020 22:43
Method to add parameters in URLs for Liferay
protected static String addParameterWithPortletNamespace(
String url, String name, String value) {
String portletId = HttpUtil.getParameter(url, "p_p_id", false);
if (Validator.isNotNull(portletId)) {
name = PortalUtil.getPortletNamespace(portletId) + name;
}
return HttpUtil.addParameter(url, name, value);
}
@baxtheman
baxtheman / web-content-template.ftl
Last active May 30, 2022 09:52
Liferay 7, web content template freemarker context variables
<#assign TITLE = .vars['reserved-article-title'].data />
<#assign DISPLAYDATE = .vars['reserved-article-display-date'].data?date('EEE, dd MMM yyyy HH:mm:ss Z') />
${DISPLAYDATE?string["dd MMMM yyyy"]}
<button type="button" class="btn btn-secondary btn-sm">
<@liferay_ui["message"] key="read-more"/>
</button>
@TheMatt2
TheMatt2 / walklevel.py
Last active June 26, 2025 18:14
A python function to do an os.walk(), but only to a certain depth. A negative depth indicates full depth.
# MIT License
#
# Copyright (c) 2021 Matthew Schweiss
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 20, 2026 11:30
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example