Search in sources :

Example 66 with ApsProperties

use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.

the class DataObjectMapperCacheWrapperTest method createMockWidget.

private Widget createMockWidget() {
    Widget widget = new Widget();
    WidgetType type = new WidgetType();
    type.setCode("type");
    WidgetTypeParameter param1 = new WidgetTypeParameter();
    param1.setName("dataId");
    WidgetTypeParameter param2 = new WidgetTypeParameter();
    param2.setName("testParam");
    List<WidgetTypeParameter> params = Arrays.asList(new WidgetTypeParameter[] { param1, param2 });
    type.setTypeParameters(params);
    widget.setType(type);
    ApsProperties props = new ApsProperties();
    props.put("dataId", "id1");
    props.put("testParam", "test");
    widget.setConfig(props);
    return widget;
}
Also used : Widget(com.agiletec.aps.system.services.page.Widget) WidgetType(org.entando.entando.aps.system.services.widgettype.WidgetType) WidgetTypeParameter(org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter) ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 67 with ApsProperties

use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.

the class TestApiWidgetTypeInterface method addMockWidget.

private void addMockWidget(String widgetTypeCode) throws Throwable {
    WidgetType type = new WidgetType();
    type.setCode(widgetTypeCode);
    ApsProperties titles = new ApsProperties();
    titles.setProperty("en", "English title");
    titles.setProperty("it", "Italian title");
    type.setTitles(titles);
    this._widgetTypeManager.addWidgetType(type);
}
Also used : WidgetType(org.entando.entando.aps.system.services.widgettype.WidgetType) ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 68 with ApsProperties

use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.

the class TestApiWidgetTypeInterface method testUpdateJaxbWidgetType.

public void testUpdateJaxbWidgetType() throws Throwable {
    ApsProperties titles = new ApsProperties();
    titles.setProperty("en", "English title");
    titles.setProperty("it", "Italian title");
    this.testInvokeUpdateJaxbNoLogicWidgetType("login_form", titles, true, null, true);
    this.testInvokeUpdateJaxbNoLogicWidgetType("login_form", titles, true, "Gui of login_form", true);
    this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", null, false, null, false);
    this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, false, null, false);
    this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, true, null, true);
    this.testInvokeUpdateJaxbNoLogicWidgetType("content_viewer", titles, true, "new gui", true);
}
Also used : ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 69 with ApsProperties

use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.

the class TestCategoryManager method createCategory.

private Category createCategory() {
    Category cat = new Category();
    cat.setDefaultLang("it");
    cat.setCode("tempCode");
    Category parent = _categoryManager.getCategory("cat1");
    cat.setParent(parent);
    cat.setParentCode(parent.getCode());
    ApsProperties titles = new ApsProperties();
    titles.put("it", "Titolo in Italiano");
    titles.put("en", "Titolo in Inglese");
    cat.setTitles(titles);
    return cat;
}
Also used : ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 70 with ApsProperties

use of com.agiletec.aps.util.ApsProperties in project entando-core by entando.

the class I18nManagerIntegrationTest method testUpdateLabels.

public void testUpdateLabels() throws Throwable {
    String key = "TEST_KEY";
    ApsProperties labels = new ApsProperties();
    labels.put("it", "Testo Italiano");
    labels.put("en", "English Text");
    try {
        assertNull(_i18nManager.getLabelGroups().get(key));
        _i18nManager.addLabelGroup(key, labels);
        ApsProperties toUpdate = (ApsProperties) _i18nManager.getLabelGroups().get(key);
        assertNotNull(toUpdate);
        toUpdate.put("it", "Testo Italiano Modificato");
        toUpdate.put("en", "Modified English Text");
        _i18nManager.updateLabelGroup(key, toUpdate);
        ApsProperties extracted = (ApsProperties) _i18nManager.getLabelGroups().get(key);
        assertNotNull(extracted);
        assertEquals("Testo Italiano Modificato", extracted.getProperty("it"));
        assertEquals("Modified English Text", extracted.getProperty("en"));
    } catch (Throwable t) {
        throw t;
    } finally {
        _i18nManager.deleteLabelGroup(key);
        assertNull(_i18nManager.getLabelGroups().get(key));
    }
}
Also used : ApsProperties(com.agiletec.aps.util.ApsProperties)

Aggregations

ApsProperties (com.agiletec.aps.util.ApsProperties)146 Widget (com.agiletec.aps.system.services.page.Widget)62 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)34 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)29 HashMap (java.util.HashMap)17 IPage (com.agiletec.aps.system.services.page.IPage)16 Lang (com.agiletec.aps.system.services.lang.Lang)14 PageModel (com.agiletec.aps.system.services.pagemodel.PageModel)10 Properties (java.util.Properties)9 ApiException (org.entando.entando.aps.system.services.api.model.ApiException)9 List (java.util.List)8 RestServerError (org.entando.entando.aps.system.exception.RestServerError)8 BeanPropertyBindingResult (org.springframework.validation.BeanPropertyBindingResult)7 Page (com.agiletec.aps.system.services.page.Page)6 PageMetadata (com.agiletec.aps.system.services.page.PageMetadata)6 NavigatorExpression (com.agiletec.aps.system.services.page.widget.NavigatorExpression)6 ArrayList (java.util.ArrayList)6 RestRourceNotFoundException (org.entando.entando.aps.system.exception.RestRourceNotFoundException)6 IWidgetTypeManager (org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager)6 ValidationGenericException (org.entando.entando.web.common.exceptions.ValidationGenericException)6