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
<? | |
// limitation is that this script only works for http right now; also, login forms may/not work | |
// this PHP script lets your apache server act as a proxy | |
// 1. simply add a .htaccess directive as follows | |
// ErrorDocument 404 /proxy.php | |
// 2. set the proxy_url and actual_url parameters belom | |
// proxy_url is the address to your PHP server, e.g. www.example.com | |
// actual_url is the address to your other server, e.g. 10.10.10.10 | |
error_reporting(E_ALL); |
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
git checkout -b upstream/master | |
git remote add upstream git://github.com/documentcloud/underscore.git | |
git pull upstream master | |
git checkout master // [my master branch] | |
git merge upstream/master | |
git push origin master | |
## Source : https://github.com/blog/266-fast-forward-your-fork |
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
export JAVA_HOME=/usr/java/jdk1.6.0_21 | |
export LIFERAY_HOME=/usr/liferay/liferay-portal-6.0.5/tomcat-6.0.26 | |
export PATH=$JAVA_HOME/bin:$LIFERAY_HOME/bin:$PATH |
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
// ## CHANGE THESE ## | |
var mainPath = "http://localdev.aha.org:8080"; | |
var largestLayoutId = 99999; | |
// ## get all layouts containing custom portlets (that is, ones whose ID is not numeric) and print their URLs | |
var layouts = Packages.com.liferay.portal.service.LayoutLocalServiceUtil.getLayouts(0,largestLayoutId); | |
number = layouts.size(); | |
var friendlyUrlArray = new Packages.java.util.ArrayList(); | |
var names = ""; | |
var output = ""; |
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
// ## CHANGE THESE ## | |
var largestLayoutId = 99999; | |
var groupName = "[group name]"; | |
var showPublic = false; | |
var companyId = 10153; | |
var siteMemberRoleId= 10169; | |
var className = "com.liferay.portal.model.Layout"; | |
//var groupId = Packages.com.liferay.portal.service.GroupLocalServiceUtil.getGroup(companyId, groupName).getGroupId(); | |
var groupId = 10179; |
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
// 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 ## |
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
// ### 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 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 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 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) { |
OlderNewer