Skip to content

Instantly share code, notes, and snippets.

View lahiponeja's full-sized avatar
🎯
Focusing

PAULA VERONICA RESTREPO lahiponeja

🎯
Focusing
  • Madrid. Spain
View GitHub Profile
@lahiponeja
lahiponeja / SassMeister-input-HTML.html
Created June 20, 2016 16:39 — forked from jdlehman/SassMeister-input-HTML.html
Generated by SassMeister.com.
<div class="Table">
<div class="Table-row Table-header">
<div class="Table-row-item">Header1</div>
<div class="Table-row-item">Header2</div>
<div class="Table-row-item">Header3</div>
<div class="Table-row-item">Header4</div>
</div>
<div class="Table-row">
<div class="Table-row-item" data-header="Header1">row1 col1</div>
<div class="Table-row-item" data-header="Header2">row1 col2</div>
@lahiponeja
lahiponeja / Multiselect2Field.vue
Created November 23, 2018 13:06 — forked from SebastienTainon/Multiselect2Field.vue
Vue-form-generator multiselect field with asynchronous behaviour. You have to return a promise in the search query
<template>
<multiselect
:id="selectOptions.id"
:options="options"
:value="value"
:multiple="selectOptions.multiple"
:track-by="selectOptions.trackBy || null"
:label="selectOptions.label || null"
:searchable="selectOptions.searchable"
:clear-on-select="selectOptions.clearOnSelect"
@lahiponeja
lahiponeja / lr62-delete-WC-Versions-wDQ.groovy
Created February 20, 2020 10:22 — forked from datyger/lr62-delete-WC-Versions-wDQ.groovy
Script to delete all old versions of web content besides the latest version.
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
import com.liferay.portal.kernel.exception.PortalException
import com.liferay.portal.kernel.exception.SystemException
import com.liferay.portal.util.PropsValues
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil
import com.liferay.portal.kernel.dao.orm.DynamicQuery
import com.liferay.portal.kernel.dao.orm.Conjunction
import com.liferay.portlet.journal.service.persistence.JournalArticleResourceActionableDynamicQuery
import com.liferay.portlet.journal.service.JournalArticleServiceUtil
@lahiponeja
lahiponeja / lr62-delete-web-content-versions.groovy
Created February 20, 2020 10:22 — forked from datyger/lr62-delete-web-content-versions.groovy
This runs through any / all web content resource objects and cycles through the historical versions of each, deleting any that are not the latest.
import com.liferay.portal.service.ServiceContext
import com.liferay.portlet.journal.service.JournalArticleServiceUtil
import com.liferay.portlet.journal.service.JournalArticleResourceLocalServiceUtil
import java.util.List
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
import com.liferay.portal.kernel.exception.PortalException
import com.liferay.portal.kernel.exception.SystemException
import com.liferay.portal.util.PropsValues
@lahiponeja
lahiponeja / lr62-delete-specific-files.groovy
Created February 20, 2020 10:23 — forked from datyger/lr62-delete-specific-files.groovy
In our case, there were 45 legacy / lost dlfileentries in our system with no corresponding dlfileversion record. Gather a list of the offending fileEntryIds and use this script to remove them. This script needs to be run before the mass document version cleanup can occur.
// Delete files that have no dlfileversion record...
// Use this query to find them...:
// select fileEntryId from dlfileentry where fileEntryId NOT IN
// (select dlfe.fileEntryId from dlfileentry dlfe, dlfileversion dlfv where dlfe.fileEntryId=dlfv.fileEntryId and dlfv.version=dlfe.version);
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
import java.util.List;
import com.liferay.portal.kernel.repository.model.FileEntry;
@lahiponeja
lahiponeja / lr62-delete-old-docs-all-docs.groovy
Created February 20, 2020 10:23 — forked from datyger/lr62-delete-old-docs-all-docs.groovy
Liferay 6.2 script to remove all old document versions except the latest version. This version cleans out all document versions.
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery
import com.liferay.portal.kernel.exception.PortalException
import com.liferay.portal.kernel.exception.SystemException
import com.liferay.portal.util.PropsValues
import com.liferay.portlet.documentlibrary.model.DLFileEntry
import com.liferay.portlet.documentlibrary.model.DLFileVersion
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil
import com.liferay.portlet.documentlibrary.service.DLFileVersionLocalServiceUtil
import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryActionableDynamicQuery
import com.liferay.portlet.documentlibrary.service.persistence.DLFileVersionActionableDynamicQuery
@lahiponeja
lahiponeja / lr62-delete-old-docs-per-site.groovy
Created February 20, 2020 10:24 — forked from datyger/lr62-delete-old-docs-per-site.groovy
Liferay 6.2 script to remove all old document versions except the latest version. This version can be tasked per-site and /or specific site's folder.
// Find and delete old versions of docs per site...
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
import java.util.List;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.FileVersion;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;