001
014
015 package com.liferay.portal.verify;
016
017 import com.liferay.portal.kernel.dao.jdbc.DataAccess;
018 import com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil;
019
020 import java.sql.Connection;
021 import java.sql.PreparedStatement;
022 import java.sql.ResultSet;
023
024
027 public class VerifyAsset extends VerifyProcess {
028
029 @Override
030 protected void doVerify() throws Exception {
031 rebuildTree();
032 }
033
034 protected void rebuildTree() throws Exception {
035 Connection con = null;
036 PreparedStatement ps = null;
037 ResultSet rs = null;
038
039 try {
040 con = DataAccess.getUpgradeOptimizedConnection();
041
042 ps = con.prepareStatement(
043 "select distinct groupId from AssetCategory where " +
044 "(leftCategoryId is null) or (rightCategoryId is null)");
045
046 rs = ps.executeQuery();
047
048 while (rs.next()) {
049 long groupId = rs.getLong("groupId");
050
051 AssetCategoryLocalServiceUtil.rebuildTree(groupId, true);
052 }
053 }
054 finally {
055 DataAccess.cleanUp(con, ps, rs);
056 }
057 }
058
059 }