use of com.agiletec.aps.util.SelectItem in project entando-core by entando.
the class BaseFilterAction method getFilterTypes.
/**
* Restituisce la lista di filtri possibili per il tipo di contenuto specificato.
* La lista comprende sempre la possibilità di filtrare per i metadati "Data Creazione" e "Data Ultima Modifica" e
* insieme a tutti gli attributi di contenuto (del tipo specificato) dichiarati ricercabili.
* La lista è e servizio dell'interfaccia di gestione del filtro.
* @return La lista di filtri possibili per il tipo di contenuto specificato.
*/
public List<SelectItem> getFilterTypes() {
List<SelectItem> types = new ArrayList<SelectItem>();
types.add(new SelectItem(METADATA_KEY_PREFIX + IContentManager.CONTENT_CREATION_DATE_FILTER_KEY, this.getText("label.creationDate")));
types.add(new SelectItem(METADATA_KEY_PREFIX + IContentManager.CONTENT_MODIFY_DATE_FILTER_KEY, this.getText("label.lastModifyDate")));
Content prototype = this.getContentManager().createContentType(this.getContentType());
List<AttributeInterface> contentAttributes = prototype.getAttributeList();
for (int i = 0; i < contentAttributes.size(); i++) {
AttributeInterface attribute = contentAttributes.get(i);
if (attribute.isSearchable()) {
types.add(new SelectItem(attribute.getName(), this.getText("label.attribute", new String[] { attribute.getName() })));
}
}
return types;
}
use of com.agiletec.aps.util.SelectItem in project entando-core by entando.
the class ContentListViewerWidgetAction method getAllowedUserFilterTypes.
public List<SelectItem> getAllowedUserFilterTypes() throws ApsSystemException {
List<SelectItem> types = new ArrayList<SelectItem>();
try {
types.add(new SelectItem(UserFilterOptionBean.KEY_FULLTEXT, this.getText("label.fulltext")));
types.add(new SelectItem(UserFilterOptionBean.KEY_CATEGORY, this.getText("label.category")));
String contentType = this.getWidget().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
Content prototype = this.getContentManager().createContentType(contentType);
List<AttributeInterface> contentAttributes = prototype.getAttributeList();
for (int i = 0; i < contentAttributes.size(); i++) {
AttributeInterface attribute = contentAttributes.get(i);
if (attribute.isSearchable()) {
types.add(new SelectItem(UserFilterOptionBean.TYPE_ATTRIBUTE + "_" + attribute.getName(), this.getText("label.attribute", new String[] { attribute.getName() })));
}
}
} catch (Throwable t) {
_logger.error("Error extracting allowed user filter types", t);
throw new ApsSystemException("Error extracting allowed user filter types", t);
}
return types;
}
use of com.agiletec.aps.util.SelectItem in project entando-core by entando.
the class AbstractPortalAction method addFlavourWidgetType.
protected void addFlavourWidgetType(String mapCode, WidgetType type, Map<String, List<SelectItem>> mapping) {
List<SelectItem> widgetTypes = mapping.get(mapCode);
if (null == widgetTypes) {
widgetTypes = new ArrayList<SelectItem>();
mapping.put(mapCode, widgetTypes);
}
String title = super.getTitle(type.getCode(), type.getTitles());
SelectItem item = new SelectItem(type.getCode(), title, mapCode);
widgetTypes.add(item);
}
use of com.agiletec.aps.util.SelectItem in project entando-core by entando.
the class AbstractPortalAction method addGroup.
private void addGroup(String code, Map<String, List<SelectItem>> mapping, List<List<SelectItem>> group) {
List<SelectItem> singleGroup = mapping.get(code);
if (null != singleGroup) {
BeanComparator comparator = new BeanComparator("value");
Collections.sort(singleGroup, comparator);
group.add(singleGroup);
}
}
use of com.agiletec.aps.util.SelectItem in project entando-core by entando.
the class AbstractApiAction method getPermissionAutorityOptions.
public List<SelectItem> getPermissionAutorityOptions() {
List<SelectItem> items = new ArrayList<SelectItem>();
try {
List<Permission> permissions = new ArrayList<Permission>();
permissions.addAll(this.getRoleManager().getPermissions());
BeanComparator comparator = new BeanComparator("description");
Collections.sort(permissions, comparator);
for (int i = 0; i < permissions.size(); i++) {
Permission permission = permissions.get(i);
items.add(new SelectItem(permission.getName(), this.getPermissionAutorityOptionPrefix() + permission.getDescription()));
}
} catch (Throwable t) {
_logger.error("Error extracting autority options", t);
}
return items;
}
Aggregations