Search in sources :

Example 11 with WidgetTypeParameter

use of org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter in project entando-core by entando.

the class SimpleWidgetConfigAction method createValuedShowlet.

protected void createValuedShowlet() throws Exception {
    Widget widget = this.createNewShowlet();
    List<WidgetTypeParameter> parameters = widget.getType().getTypeParameters();
    for (int i = 0; i < parameters.size(); i++) {
        WidgetTypeParameter param = parameters.get(i);
        String paramName = param.getName();
        String value = this.getRequest().getParameter(paramName);
        if (value != null && value.trim().length() > 0) {
            widget.getConfig().setProperty(paramName, value);
        }
    }
    this.setWidget(widget);
}
Also used : Widget(com.agiletec.aps.system.services.page.Widget) WidgetTypeParameter(org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter)

Aggregations

WidgetTypeParameter (org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter)11 ApsProperties (com.agiletec.aps.util.ApsProperties)5 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)5 Widget (com.agiletec.aps.system.services.page.Widget)4 WidgetTypeDOM (org.entando.entando.aps.system.services.widgettype.WidgetTypeDOM)2 IPage (com.agiletec.aps.system.services.page.IPage)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 RestServerError (org.entando.entando.aps.system.exception.RestServerError)1 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)1