private IPortletDefinitionParameter postProcessIconUrlParameter(
            final IPortletDefinitionParameter iconUrl, WebRequest req) {
        if (!ICON_URL_PARAMETER_NAME.equals(iconUrl.getName())) {
            String msg =
                    "Only iconUrl should be processed this way;  parameter was:  "
                            + iconUrl.getName();
            throw new IllegalArgumentException(msg);
        }
        final String value = spELService.parseString(iconUrl.getValue(), req);
        return new IPortletDefinitionParameter() {
            @Override
            public String getName() {
                return ICON_URL_PARAMETER_NAME;
            }

            @Override
            public String getValue() {
                return value;
            }

            @Override
            public String getDescription() {
                return iconUrl.getDescription();
            }

            @Override
            public void setValue(String value) {
                throw new UnsupportedOperationException();
            }

            @Override
            public void setDescription(String descr) {
                throw new UnsupportedOperationException();
            }
        };
    }
private IPortletDefinitionParameter postProcessIconUrlParameter ( final IPortletDefinitionParameter iconUrl , WebRequest req ) { if ( ! ICON_URL_PARAMETER_NAME . equals ( iconUrl . getName ( ) ) ) { String msg = "Only iconUrl should be processed this way;  parameter was:  " + iconUrl . getName ( ) ; throw new IllegalArgumentException ( msg ) ; } final String value = spELService . parseString ( iconUrl . getValue ( ) , req ) ; return new IPortletDefinitionParameter ( ) { @ Override public String getName ( ) { return ICON_URL_PARAMETER_NAME ; } @ Override public String getValue ( ) { return value ; } @ Override public String getDescription ( ) { return iconUrl . getDescription ( ) ; } @ Override public void setValue ( String value ) { throw new UnsupportedOperationException ( ) ; } @ Override public void setDescription ( String descr ) { throw new UnsupportedOperationException ( ) ; } } ; }
TODO: Clean this mess up some day; there are a few portlet-definitions that start with
${request.contextPath} for the iconUrl parameter, presumably because uPortal can be deployed
to a context other than /uPortal. We should either...

<p>- Discontinue SpEL in publishing parameters entirely; or - Extend it to parameters beyond
'iconUrl'

<p>And if we continue using SpEL in parameters, we should evaluate it when they're read out
of the database (long before now).

<p>FWIW the /api/portlet/{fname}.json API does not process the SpEL and the
'${request.contextPath}' is included in the JSON output.