001
014
015 package com.liferay.portal.upgrade.v4_4_0;
016
017 import com.liferay.portal.kernel.upgrade.UpgradeProcess;
018 import com.liferay.portal.kernel.upgrade.util.BaseUpgradeColumnImpl;
019 import com.liferay.portal.kernel.upgrade.util.TempUpgradeColumnImpl;
020 import com.liferay.portal.kernel.upgrade.util.UpgradeColumn;
021 import com.liferay.portal.kernel.upgrade.util.UpgradeTable;
022 import com.liferay.portal.kernel.upgrade.util.UpgradeTableFactoryUtil;
023 import com.liferay.portal.upgrade.v4_4_0.util.DLFileEntryTable;
024 import com.liferay.portal.upgrade.v4_4_0.util.DLFileEntryTitleColumnImpl;
025 import com.liferay.portal.upgrade.v4_4_0.util.DLFolderNameColumnImpl;
026 import com.liferay.portal.upgrade.v4_4_0.util.DLFolderTable;
027
028 import java.util.Set;
029
030
033 public class UpgradeDocumentLibrary extends UpgradeProcess {
034
035 protected void doUpgrade() throws Exception {
036
037
038
039 UpgradeColumn groupIdColumn = new TempUpgradeColumnImpl("groupId");
040
041 UpgradeColumn parentFolderIdColumn = new TempUpgradeColumnImpl(
042 "parentFolderId");
043
044 DLFolderNameColumnImpl dlFolderNameColumn = new DLFolderNameColumnImpl(
045 groupIdColumn, parentFolderIdColumn);
046
047 UpgradeTable upgradeTable = UpgradeTableFactoryUtil.getUpgradeTable(
048 DLFolderTable.TABLE_NAME, DLFolderTable.TABLE_COLUMNS,
049 groupIdColumn, parentFolderIdColumn, dlFolderNameColumn);
050
051 upgradeTable.updateTable();
052
053 Set<String> distinctNames = dlFolderNameColumn.getDistintNames();
054
055
056
057 UpgradeColumn folderIdColumn = new TempUpgradeColumnImpl("folderId");
058
059 UpgradeColumn nameColumn = new TempUpgradeColumnImpl("name");
060
061 BaseUpgradeColumnImpl dlFileEntryTitleColumn =
062 new DLFileEntryTitleColumnImpl(
063 groupIdColumn, folderIdColumn, nameColumn, distinctNames);
064
065 upgradeTable = UpgradeTableFactoryUtil.getUpgradeTable(
066 DLFileEntryTable.TABLE_NAME, DLFileEntryTable.TABLE_COLUMNS,
067 folderIdColumn, nameColumn, dlFileEntryTitleColumn);
068
069 upgradeTable.updateTable();
070 }
071
072 }