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
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_name) INTO @tables | |
FROM information_schema.columns | |
WHERE table_schema = (SELECT DATABASE()) AND (LOWER(table_name) like 'x%' OR LOWER(table_name) like 'sm%' OR LOWER(table_name) like 'invites%' OR LOWER(table_name) like 'blockvendor%' ) AND column_name = 'id_'; | |
select REPLACE(@tables, ',', ' change id_ id int(11) ; alter table ') into @tables; | |
select CONCAT('alter table ', @tables) into @tables; |
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
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT DATABASE()); | |
SELECT IFNULL(@tables,'dummy') INTO @tables; | |
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables); | |
PREPARE stmt FROM @tables; |
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 liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] /> | |
<table> | |
<thead> | |
<tr> | |
<th> | |
Name | |
</th> | |
<th> | |
Value | |
</th> |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.airhacks</groupId> | |
<artifactId>javaee7-essentials-pom</artifactId> | |
<version>7.0</version> | |
<packaging>war</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>javax</groupId> |
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
#http://stackoverflow.com/questions/50159/show-all-libraries-used-by-executables-on-linux | |
find /bin -type f -perm /a+x -exec ldd {} \; \ | |
| grep so \ | |
| sed -e '/^[^\t]/ d' \ | |
| sed -e 's/\t//' \ | |
| sed -e 's/.*=..//' \ | |
| sed -e 's/ (0.*)//' \ |
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.portlet.usergroupsadmin.search.*; | |
import java.util.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.portal.model.*; | |
import com.liferay.portal.model.UserGroup; | |
List<Role> roles = RoleLocalServiceUtil.getRoles(0,999999999); | |
for (Role role : roles) { | |
long roleId = role.getRoleId(); | |
List<Group> roleGroups = GroupLocalServiceUtil.getRoleGroups(roleId); | |
for (Group roleGroup : roleGroups) { |
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
ev0 = Packages.com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getEvent(66582); | |
recur0 = Packages.com.liferay.portlet.calendar.service.ICalUtil.toICalRecurrence(ev0.getRecurrenceObj()) | |
dt0 = new Packages.net.fortuna.ical4j.model.Date(ev0.getStartDate()); | |
sc0 = new Packages.net.fortuna.ical4j.model.Date(Packages.java.util.Calendar.getInstance().getTime()); | |
no = recur0.getNextDate( dt0, sc0); | |
out.println("no: " + no); | |
/// | |
out.println("-----") | |
tz = Packages.com.liferay.portal.kernel.util.TimeZoneUtil.getDefault(); | |
ev = Packages.com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getEvent(66567); |
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
// ### Javascript Sample ### | |
companyId = 10153; | |
model = "com.liferay.portlet.calendar.model.CalEvent"; | |
portletId = "8"; | |
folder = Packages.com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getEvent(137535); | |
resource = Packages.com.liferay.portal.service.ResourceLocalServiceUtil.getResource(companyId, model, Packages.com.liferay.portal.model.ResourceConstants.SCOPE_INDIVIDUAL, folder.getPrimaryKey()); | |
resourceActions = Packages.com.liferay.portal.security.permission.ResourceActionsUtil.getResourceActions(portletId, model); | |
administrator = Packages.com.liferay.portal.service.RoleLocalServiceUtil.getRole(folder.getCompanyId(), Packages.com.liferay.portal.model.RoleConstants.ADMINISTRATOR); | |
roleTypes = [] |
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
// ### Javascript Sample ### | |
folder = Packages.com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil.fetchDLFolder(14083); | |
resource = Packages.com.liferay.portal.service.ResourceLocalServiceUtil.getResource(folder.getCompanyId(), "com.liferay.portlet.documentlibrary.model.DLFolder", Packages.com.liferay.portal.model.ResourceConstants.SCOPE_INDIVIDUAL, folder.getPrimaryKey()); | |
folderExpandoBridge = folder.getExpandoBridge().hasAttribute("hiddenFolderProperties"); | |
resourceActions = Packages.com.liferay.portal.security.permission.ResourceActionsUtil.getResourceActions("20", "com.liferay.portlet.documentlibrary.model.DLFolder"); | |
administrator = Packages.com.liferay.portal.service.RoleLocalServiceUtil.getRole(folder.getCompanyId(), Packages.com.liferay.portal.model.RoleConstants.ADMINISTRATOR); | |
roleTypes = [] |
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
// Description: Liferay scripts - check every page permission in default Group to see which roles have VIEW access. It can also give the VIEW action permission to the Site Member role. | |
// Usage: Modify settings under "##CHANGE THESE##" section. Paste this script in the Control Panel->Server Administration->Script console and click "Execute" | |
// | |
// ## CHANGE THESE ## | |
var groupName = "Guest"; // this is the main group name | |
var showPublic = false; // set to true if public pages should be listed too. default behavior is that only private pages are considered when looking for VIEW action permission for Site Member role | |
var givePermission = false; // set to true to give VIEW action permission for Site Member role to all pages. Optionally apply this permission to a subset of pages by providing regular experssion to filter pages. See givePermissionRegex property below. | |
var givePermissionRegex = ".*"; // provide regular expression to filter Page Names | |
// ## No need to change below ## |