These scripts are created to test serialization through Liferay's Scripting console.
import java.io.FileInputStream;
/*** | |
* ehCache configuration parser | |
* | |
* This parses the configurations to be imported following table | |
CREATE TABLE CacheSettings ( | |
cacheType VARCHAR(12) NOT NULL, | |
bean VARCHAR(255) NOT NULL, | |
eternal VARCHAR(5) NOT NULL, | |
cacheSize INT NOT NULL, |
/*** | |
Example script that changes every user password at Liferay DB to qweqwea | |
*/ | |
var companyId = 20155; | |
var users = Packages.com.liferay.portal.service.UserServiceUtil.getCompanyUsers(companyId, -1, -1); | |
for ( var i = 0 ; i < users.size(); i++ ) { | |
var user = users.get(i); | |
Packages.com.liferay.portal.service.UserServiceUtil.updatePassword(user.getUserId(), "qweqwe", "qweqwe", false); |
import javax.ws.rs.ApplicationPath; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.Application; | |
import org.osgi.service.component.annotations.Component; | |
import org.osgi.service.component.annotations.Reference; | |
@ApplicationPath("/greeting") |
Fixed : https://filebin.ca/3Mdy63PxBLul/12.3SearchQueries.xml
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<snippets>
<category filters="*" id="category_1494770019104" initial_state="0" label="12.3 Search Queries" largeicon="" smallicon="">
<description/>
<item category="category_1494770019104" id="item_1494771428516" label="04-component-property">
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 |
Login Liferay 6.2 EE with administrative permissoins and make sure that you have been logged in to main portal instance. Then navigate to
Control panel
and under Configuration
section choose Server Administration
.
From Server Administration
choose Script
tag and choose language as choise Groovy
.
Copy paste following code script
field and click Execute
button.
import com.liferay.portal.kernel.util.*;
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import groovy.io.FileType; | |
if ( args.length < 1 ) { | |
println "Usage"; | |
println ""; | |
println "groovy ThreadDumpSplitter.groovy <directory>"; | |
return; | |
} |
With 7Zip unzip the jdk-u..exe
to some directory from there you find .rsrc\1033\JAVA_CAB10\111\tools.zip
file. Unzip that file to some folder like <tomcat-home>\winjdk
. Goto this <tomcat-home>\winjdk
folder and run
for /R %f in (.\*.pack) do @"%cd%\bin\unpack200" -r -v -l "" "%f" "%~pf%~nf.jar"
Original instruction.
Edit your ~/.bash_profile
file and add following line there after installing Java 8, where jdk1.8.0_112.jdk
is your JDK installation version.
alias use-java8='export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home"'