forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPS-17211 Revert existing new values to the original
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...va/com/liferay/asset/publisher/web/internal/upgrade/v1_0_5/UpgradePortletPreferences.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
*/ | ||
|
||
package com.liferay.asset.publisher.web.internal.upgrade.v1_0_5; | ||
|
||
import com.liferay.asset.publisher.constants.AssetPublisherPortletKeys; | ||
import com.liferay.portal.kernel.portlet.PortletPreferencesFactoryUtil; | ||
import com.liferay.portal.kernel.upgrade.BasePortletPreferencesUpgradeProcess; | ||
|
||
import javax.portlet.PortletPreferences; | ||
|
||
/** | ||
* @author Balázs Sáfrány-Kovalik | ||
*/ | ||
public class UpgradePortletPreferences | ||
extends BasePortletPreferencesUpgradeProcess { | ||
|
||
@Override | ||
protected String[] getPortletIds() { | ||
return new String[] { | ||
AssetPublisherPortletKeys.ASSET_PUBLISHER + "_INSTANCE_%" | ||
}; | ||
} | ||
|
||
@Override | ||
protected String upgradePreferences( | ||
long companyId, long ownerId, int ownerType, long plid, | ||
String portletId, String xml) | ||
throws Exception { | ||
|
||
PortletPreferences portletPreferences = | ||
PortletPreferencesFactoryUtil.fromXML( | ||
companyId, ownerId, ownerType, plid, portletId, xml); | ||
|
||
String anyClassTypeDLFileEntryAssetRendererFactory = | ||
portletPreferences.getValue( | ||
"anyClassTypeDLFileEntryAssetRendererFactory", | ||
Boolean.TRUE.toString()); | ||
String anyClassTypeJournalArticleAssetRendererFactory = | ||
portletPreferences.getValue( | ||
"anyClassTypeJournalArticleAssetRendererFactory", | ||
Boolean.TRUE.toString()); | ||
|
||
if (anyClassTypeDLFileEntryAssetRendererFactory.equals( | ||
"select-more-than-one")) { | ||
|
||
portletPreferences.setValue( | ||
"anyClassTypeDLFileEntryAssetRendererFactory", "false"); | ||
} | ||
|
||
if (anyClassTypeJournalArticleAssetRendererFactory.equals( | ||
"select-more-than-one")) { | ||
|
||
portletPreferences.setValue( | ||
"anyClassTypeJournalArticleAssetRendererFactory", "false"); | ||
} | ||
|
||
return PortletPreferencesFactoryUtil.toXML(portletPreferences); | ||
} | ||
|
||
} |