This file contains 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.kernel.util.GetterUtil | |
import com.liferay.portal.kernel.util.Validator | |
import com.liferay.portal.kernel.xml.Document | |
import com.liferay.portal.kernel.xml.Element | |
import com.liferay.portal.kernel.xml.SAXReaderUtil | |
import com.liferay.portal.model.LayoutSet | |
import com.liferay.portal.model.Portlet | |
import com.liferay.portal.model.PortletPreferences | |
import com.liferay.portal.service.GroupLocalServiceUtil | |
import com.liferay.portal.service.LayoutSetLocalServiceUtil |
This file contains 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.kernel.util.DateUtil | |
import com.liferay.portal.kernel.util.GetterUtil | |
import com.liferay.portal.kernel.util.StringPool | |
import com.liferay.portal.kernel.util.Validator | |
import com.liferay.portal.kernel.xml.Document | |
import com.liferay.portal.kernel.xml.Element | |
import com.liferay.portal.kernel.xml.SAXReaderUtil | |
import com.liferay.portal.model.Layout | |
import com.liferay.portal.model.LayoutSet | |
import com.liferay.portal.model.Portlet |
This file contains 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 java.security.CodeSource | |
import com.liferay.portlet.dynamicdatamapping.storage.BaseStorageAdapter; | |
try { | |
// Change this to whatever class you want to inspect | |
Class clazz = BaseStorageAdapter.class; | |
CodeSource src = BaseStorageAdapter.class.getProtectionDomain().getCodeSource(); | |
if (src != null) { | |
println clazz.getSimpleName() + " is sourced here: "+ src | |
} |
This file contains 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
#set ($defaultSiteName = "ABC") | |
#set ($group = $groupLocalService.getGroup($company_id, $defaultSiteName)) | |
#set ($isSiteAdmin = ($userGroupRoleLocalService.hasUserGroupRole($user_id, $group.getGroupId(),"Site Administrator", true))) | |
#set ($isAbcSupport = ($roleLocalService.hasUserRole($user_id, $company_id, "ABC Support", true))) | |
#set($isAbcAdmin = ($roleLocalService.hasUserRole($user_id, $company_id, "ABC Admin", true))) |
This file contains 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.kernel.search.Indexer | |
import com.liferay.portal.kernel.search.IndexerPostProcessor | |
import com.liferay.portal.model.Portlet | |
import com.liferay.portal.service.CompanyLocalServiceUtil | |
import com.liferay.portal.service.PortletLocalServiceUtil | |
try { | |
String portletId = "20"; //Document Library | |
long companyId = CompanyLocalServiceUtil.getCompanies().get(0).getCompanyId(); | |
Portlet portlet = PortletLocalServiceUtil.getPortletById( |
This file contains 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.kernel.cluster.ClusterExecutorUtil | |
import com.liferay.portal.kernel.cluster.ClusterNode | |
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayInputStream | |
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream | |
import com.liferay.portal.kernel.util.DateUtil | |
import com.liferay.portal.kernel.util.GetterUtil | |
import com.liferay.portal.kernel.util.PropsUtil | |
import com.liferay.portal.kernel.util.StringBundler | |
import com.liferay.util.transport.DatagramHandler | |
import com.liferay.util.transport.MulticastDatagramHandler |
This file contains 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.service.RoleLocalServiceUtil | |
import com.liferay.portal.service.ResourcePermissionLocalServiceUtil | |
import com.liferay.portal.service.ResourceActionLocalServiceUtil | |
import com.liferay.portal.security.permission.ActionKeys | |
import com.liferay.portal.model.ResourceAction | |
import com.liferay.portal.util.PortletKeys | |
Map<String, String[]> portletSets = new TreeMap<String, String[]>(); | |
// Mobile Device Rules |
This file contains 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.model.Organization | |
import com.liferay.portal.model.Role | |
import com.liferay.portal.model.User | |
import com.liferay.portal.security.permission.PermissionChecker | |
import com.liferay.portal.security.permission.PermissionCheckerBag | |
import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil | |
import com.liferay.portal.service.OrganizationLocalServiceUtil | |
import com.liferay.portal.service.RoleLocalServiceUtil | |
import com.liferay.portal.service.UserLocalServiceUtil | |
import com.liferay.portal.service.permission.PortletPermissionUtil |
This file contains 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
drop index IX_3463D95B on JournalArticle; | |
create temporary table temp_ja | |
select * from ( | |
select groupId, articleId, uuid_, type_, max(version) as 'maxVersionId', count(id_) as 'countId' from JournalArticle ja | |
group by groupId, uuid_ | |
) temp | |
where temp.countId > 1; | |
delete ja from JournalArticle ja |
This file contains 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 java.lang.management.ManagementFactory | |
import javax.management.MBeanServer | |
import javax.management.ObjectName | |
import com.liferay.portal.kernel.util.StringUtil | |
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); | |
ObjectName objectName = new ObjectName("Catalina:type=Manager,context=/,host=localhost") | |
Object mbean = mbs.getMBeanInfo(objectName); | |
println "Found manager bean" | |
//println mbean.toString() |
NewerOlder