Skip to content

Commit

Permalink
LPD-33868 DEV Feature Flag for LPD-25230
Browse files Browse the repository at this point in the history
  • Loading branch information
gianmarcobrunialti committed Aug 16, 2024
1 parent 28b5f72 commit eb1eadb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.liferay.object.service.ObjectDefinitionLocalService;
import com.liferay.osgi.service.tracker.collections.list.ServiceTrackerList;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.feature.flag.FeatureFlagManagerUtil;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONUtil;
Expand Down Expand Up @@ -207,11 +208,13 @@ public String getFDSViewURL() {
public JSONArray getRESTApplicationResolvedSchemasJSONArray() {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

List<FDSAPIURLResolver> resolvers =
_fdsAPIURLResolverRegistry.getResolvers();
if (FeatureFlagManagerUtil.isEnabled("LPD-25230")) {
List<FDSAPIURLResolver> resolvers =
_fdsAPIURLResolverRegistry.getResolvers();

for (FDSAPIURLResolver resolver : resolvers) {
jsonArray.put(resolver.getSchema());
for (FDSAPIURLResolver resolver : resolvers) {
jsonArray.put(resolver.getSchema());
}
}

return jsonArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,20 +1085,22 @@ private String _resolveParameters(
String apiURL, String restApplication, String restSchema,
HttpServletRequest httpServletRequest) {

FDSAPIURLResolver
FDSAPIURLResolver =
if (FeatureFlagManagerUtil.isEnabled("LPD-25230")) {
FDSAPIURLResolver
FDSAPIURLResolver =
_fdsAPIURLResolverRegistry.getResolver(
restApplication, restSchema);

if (FDSAPIURLResolver != null) {
try {
return FDSAPIURLResolver.resolve(
apiURL, httpServletRequest);
}
catch (PortalException portalException) {
_log.error(portalException);
if (FDSAPIURLResolver != null) {
try {
return FDSAPIURLResolver.resolve(
apiURL, httpServletRequest);
}
catch (PortalException portalException) {
_log.error(portalException);

return apiURL;
return apiURL;
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions portal-impl/src/portal.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6508,6 +6508,11 @@
#
feature.flag.LPD-24498=false

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER2__NUMBER5__NUMBER2__NUMBER3__NUMBER0_
#
feature.flag.LPD-25230=false

#
# Env: LIFERAY_FEATURE_PERIOD_FLAG_PERIOD__UPPERCASEL__UPPERCASEP__UPPERCASED__MINUS__NUMBER2__NUMBER5__NUMBER7__NUMBER9__NUMBER9_
#
Expand Down

0 comments on commit eb1eadb

Please sign in to comment.