/*
* Copyright 2015-Present Entando Inc. (http://www.entando.com) 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.agiletec.apsadmin.tags;
import org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager;
import org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter;
import com.agiletec.aps.system.SystemConstants;
import com.agiletec.aps.util.ApsWebApplicationUtils;
/**
* Returns a widget type (or one of its property) through the code.
* You can choose whether to return the entire object (leaving the attribute "property" empty) or a single property.
* The names of the available property of "WidgetType": "code", "titles" (map of titles indexed by the system languages), "parameters" (list of object {@link WidgetTypeParameter}),
* "action" (the code of the action used to manage the type), "pluginCode", "parentTypeCode",
* "config" (map of default parameter values indexed by the key), "locked".
* @author E.Santoboni
*/
public class WidgetTypeInfoTag extends AbstractObjectInfoTag {
@Override
protected Object getMasterObject(String keyValue) throws Throwable {
IWidgetTypeManager showletTypeManager = (IWidgetTypeManager) ApsWebApplicationUtils.getBean(SystemConstants.WIDGET_TYPE_MANAGER, this.pageContext);
return showletTypeManager.getWidgetType(keyValue);
}
}