com.liferay.youtube.web.internal.upgrade.YouTubeWebUpgrade Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.youtube.web.internal.upgrade;
import com.liferay.portal.kernel.module.framework.ModuleServiceLifecycle;
import com.liferay.portal.kernel.upgrade.DummyUpgradeStep;
import com.liferay.portal.kernel.upgrade.UpgradeException;
import com.liferay.portal.upgrade.registry.UpgradeStepRegistrator;
import com.liferay.portal.upgrade.release.BaseUpgradeWebModuleRelease;
import com.liferay.youtube.web.internal.upgrade.v1_0_0.UpgradePortletId;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* @author Peter Fellwock
*/
@Component(immediate = true, service = UpgradeStepRegistrator.class)
public class YouTubeWebUpgrade implements UpgradeStepRegistrator {
@Override
public void register(Registry registry) {
BaseUpgradeWebModuleRelease upgradeWebModuleRelease =
new BaseUpgradeWebModuleRelease() {
@Override
protected String getBundleSymbolicName() {
return "com.liferay.youtube.web";
}
@Override
protected String[] getPortletIds() {
return new String[] {"1_WAR_youtubeportlet"};
}
};
try {
upgradeWebModuleRelease.upgrade();
}
catch (UpgradeException upgradeException) {
throw new RuntimeException(upgradeException);
}
registry.register("0.0.0", "1.0.0", new DummyUpgradeStep());
registry.register("0.0.1", "1.0.0", new UpgradePortletId());
}
@Reference(target = ModuleServiceLifecycle.PORTAL_INITIALIZED, unbind = "-")
protected void setModuleServiceLifecycle(
ModuleServiceLifecycle moduleServiceLifecycle) {
}
}