use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class I18nManagerIntegrationTest method testGetLabelGroup.
public void testGetLabelGroup() throws Throwable {
ApsProperties labelsProp = _i18nManager.getLabelGroup("PAGE_TITLE");
assertNotNull(labelsProp);
assertEquals(2, labelsProp.size());
assertTrue(labelsProp.containsKey("it"));
assertTrue(labelsProp.containsKey("en"));
labelsProp = _i18nManager.getLabelGroup("userprofile_PFL_fullname");
assertNotNull(labelsProp);
assertEquals(1, labelsProp.size());
assertTrue(labelsProp.containsKey("it"));
assertFalse(labelsProp.containsKey("en"));
labelsProp = _i18nManager.getLabelGroup("not-exists");
assertNull(labelsProp);
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class I18nManagerTest method testUpdateLabels.
@Test
public void testUpdateLabels() throws Throwable {
String key = "TEST_KEY";
ApsProperties labels = createLabel("prova", "test");
i18nManager.updateLabelGroup(key, labels);
Mockito.verify(cacheWrapper, Mockito.times(1)).updateLabelGroup(key, labels);
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class I18nManagerTest method createLabel.
public static ApsProperties createLabel(String it, String en) {
ApsProperties labelOne = new ApsProperties();
labelOne.put("it", it);
labelOne.put("en", en);
return labelOne;
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class I18nManagerTest method testAddLabelGroup.
@Test
public void testAddLabelGroup() throws Throwable {
String key = "TEST_KEY";
ApsProperties labels = createLabel("prova", "test");
i18nManager.addLabelGroup(key, labels);
Mockito.verify(cacheWrapper, Mockito.times(1)).addLabelGroup(key, labels);
}
use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.
the class DataObjectListHelper method extractContentsId.
protected List<String> extractContentsId(IDataObjectListTagBean bean, RequestContext reqCtx) throws ApsSystemException {
List<String> contentsId = null;
try {
List<UserFilterOptionBean> userFilters = bean.getUserFilterOptions();
Widget widget = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
ApsProperties config = (null != widget) ? widget.getConfig() : null;
if (null == bean.getDataType() && null != config) {
bean.setContentType(config.getProperty(WIDGET_PARAM_CONTENT_TYPE));
}
if (null == bean.getDataType()) {
throw new ApsSystemException("Tipo contenuto non definito");
}
if (null == bean.getCategory() && null != config && null != config.getProperty(SHOWLET_PARAM_CATEGORY)) {
bean.setCategory(config.getProperty(SHOWLET_PARAM_CATEGORY));
}
this.addWidgetFilters(bean, config, WIDGET_PARAM_FILTERS, reqCtx);
if (null != userFilters && userFilters.size() > 0) {
for (int i = 0; i < userFilters.size(); i++) {
UserFilterOptionBean userFilter = userFilters.get(i);
EntitySearchFilter filter = userFilter.getEntityFilter();
if (null != filter) {
bean.addFilter(filter);
}
}
}
String[] categories = this.getCategories(bean.getCategories(), config, userFilters);
Collection<String> userGroupCodes = this.getAllowedGroups(reqCtx);
boolean orCategoryFilterClause = this.extractOrCategoryFilterClause(config);
contentsId = this.getDataObjectManager().loadDataObjectsId(bean.getDataType(), categories, orCategoryFilterClause, bean.getFilters(), userGroupCodes);
} catch (Throwable t) {
_logger.error("Error extracting contents id", t);
throw new ApsSystemException("Error extracting contents id", t);
}
return contentsId;
}
Aggregations