This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
sitemap_friendly.py | |
Parse a sitemapindex XML (local file or remote URL), fetch each child sitemap (<urlset>), extract friendly page URLs from each <loc>, and optionally include the page <title>. | |
Supports optional HTTP(S) proxy, sanitizes unescaped ampersands, can ignore one or more specified language prefixes (e.g. /ast/, /en/), | |
ignores Liferay detail pages containing '/-/' in the path, | |
and include the source sitemap URL via --with-sitemap, page titles via --with-title, and output as tab-separated values. | |
""" | |
import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#assign image_info = jsonFactoryUtil.looseSerializeDeep(Image)?eval > | |
<code>${(image_info.attributes.alt)!}</code> | |
<#assign fileEntryId = (image_info.attributes.fileEntryId?number)! > | |
<#if fileEntryId?has_content > | |
<#assign fileEntry = _dlfels.getFileEntry(fileEntryId)> | |
<#assign file_entry_info = jsonFactoryUtil.looseSerializeDeep(fileEntry) > | |
<code>${file_entry_info}</code> | |
</#if> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'java' | |
id "com.liferay.js.transpiler" version "2.4.60" | |
} | |
group 'org.example' | |
version '1.0-SNAPSHOT' | |
repositories { | |
maven { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String languageId = LocaleUtil.toLanguageId(locale); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$themeDisplay.getPortletDisplay().getTitle() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.util.*; | |
import com.liferay.portal.model.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.portlet.journal.*; | |
try { | |
company = PortalUtil.getCompany(actionRequest) | |
companyId = company.getCompanyId() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function popUpUrl(id) { | |
var url = Liferay.PortletURL.createRenderURL(); | |
url.setPortletId("56"); // "Web Content Display" portlet ID | |
url.setWindowState('pop_up'); | |
url.setPortletMode('view'); | |
url.setParameter("groupId", Liferay.ThemeDisplay.getScopeGroupIdOrLiveGroupId()); | |
url.setParameter("articleId", id); // webcontent ID | |
return url; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void downloadFile(ResourceRequest resourceRequest, ResourceResponse resourceResponse, String siteName) { | |
try { | |
File file = new File("${filePath}"); | |
InputStream in = new FileInputStream(file); | |
HttpServletResponse httpRes = PortalUtil.getHttpServletResponse(resourceResponse); | |
HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(resourceRequest); | |
ServletResponseUtil.sendFile(httpReq, httpRes, file.getName(), in, "application/download"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aui:script> | |
function <portlet:namespace />filterCalendarBookings(calendarBooking) { | |
return <%= calendarBookingId %> !== calendarBooking.calendarBookingId; | |
} | |
function <portlet:namespace />getSuggestionsContent() { | |
return document.<portlet:namespace />fm.<portlet:namespace />title.value + ' ' + window.<portlet:namespace />description.getHTML(); | |
} | |
function <portlet:namespace />resolver(data) { |
NewerOlder