Running SQL queries:
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.liferay.portal.kernel.dao.jdbc.DataAccess;
Connection con = null;
Running SQL queries:
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.liferay.portal.kernel.dao.jdbc.DataAccess;
Connection con = null;
| 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 |
| /** | |
| * ********************************************************************************************************* | |
| * | |
| * Usage: | |
| * | |
| * Run this Script Lifeay 6.2 's scripting console to trouble shot caches | |
| * | |
| * variable MIN_MISS_PERCENTAGE you can limit that itdoes not pring caches that fill rate is low. | |
| * variable PRINT_SQL set this true if you want to print SQL statement ready to be inserted | |
| * variable NODE_NAME is the node name for printSQL statement. |
| var MIN_MISS_PERCENTAGE = 10; | |
| var fields = [ "CacheType", ".Bean", "ObjectCount", "CacheHits", "CacheMisses", "CacheMissPercentage" ]; | |
| var padding30 = Array(30).join(' '), padding12 = Array(12).join(' '), padding20 = Array(20).join(' '); | |
| var platformMBeanServer = Packages.java.lang.management.ManagementFactory.getPlatformMBeanServer(); | |
| function printInColumns(values) { | |
| var beanName = values[1]; |