Search in sources :

Example 46 with Widget

use of com.agiletec.aps.system.services.page.Widget in project entando-core by entando.

the class TestDataObjectListHelper method getShowletForTest.

private Widget getShowletForTest(String showletTypeCode, ApsProperties config) throws Throwable {
    WidgetType type = this._showletTypeManager.getWidgetType(showletTypeCode);
    Widget widget = new Widget();
    widget.setType(type);
    if (null != config) {
        widget.setConfig(config);
    }
    return widget;
}
Also used : Widget(com.agiletec.aps.system.services.page.Widget) WidgetType(org.entando.entando.aps.system.services.widgettype.WidgetType)

Example 47 with Widget

use of com.agiletec.aps.system.services.page.Widget in project entando-core by entando.

the class DataObjectMapperCacheWrapperTest method createMockPage.

private IPage createMockPage() {
    Page root = new Page();
    root.setCode("root_code");
    root.setModel(this.createMockPageModel());
    root.setGroup(Group.FREE_GROUP_NAME);
    Widget[] widgets = new Widget[] { this.createMockWidget() };
    root.setWidgets(widgets);
    root.setChildrenCodes(new String[] {});
    return root;
}
Also used : Widget(com.agiletec.aps.system.services.page.Widget) Page(com.agiletec.aps.system.services.page.Page) IPage(com.agiletec.aps.system.services.page.IPage)

Example 48 with Widget

use of com.agiletec.aps.system.services.page.Widget 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 49 with Widget

use of com.agiletec.aps.system.services.page.Widget in project entando-core by entando.

the class AbstractWidgetExecutorService method buildWidgetsOutput.

protected void buildWidgetsOutput(RequestContext reqCtx, IPage page, String[] widgetOutput) throws ApsSystemException {
    try {
        List<IFrameDecoratorContainer> decorators = this.extractDecorators(reqCtx);
        Widget[] widgets = page.getWidgets();
        for (int frame = 0; frame < widgets.length; frame++) {
            reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME, new Integer(frame));
            Widget widget = widgets[frame];
            widgetOutput[frame] = this.buildWidgetOutput(reqCtx, widget, decorators);
        }
    } catch (Throwable t) {
        String msg = "Error detected during widget preprocessing";
        _logger.error(msg, t);
        throw new ApsSystemException(msg, t);
    }
}
Also used : IFrameDecoratorContainer(com.agiletec.aps.tags.util.IFrameDecoratorContainer) Widget(com.agiletec.aps.system.services.page.Widget) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException)

Example 50 with Widget

use of com.agiletec.aps.system.services.page.Widget in project entando-core by entando.

the class PreviewRequestValidator method getDesiredPage.

private Page getDesiredPage(String pageCode) {
    Page page = null;
    IPage currentPage = this.getPageManager().getDraftPage(pageCode);
    if (null != currentPage) {
        page = new Page();
        page.setCode(currentPage.getCode());
        page.setParent(currentPage.getParent());
        page.setParentCode(currentPage.getParentCode());
        page.setGroup(currentPage.getGroup());
        PageMetadata metadata = currentPage.getMetadata();
        page.setMetadata(metadata);
        String[] children = currentPage.getChildrenCodes();
        page.setChildrenCodes(children);
        Widget[] widgets = currentPage.getWidgets();
        page.setWidgets(widgets);
    }
    return page;
}
Also used : PageMetadata(com.agiletec.aps.system.services.page.PageMetadata) IPage(com.agiletec.aps.system.services.page.IPage) Widget(com.agiletec.aps.system.services.page.Widget) Page(com.agiletec.aps.system.services.page.Page) IPage(com.agiletec.aps.system.services.page.IPage)

Aggregations

Widget (com.agiletec.aps.system.services.page.Widget)117 ApsProperties (com.agiletec.aps.util.ApsProperties)60 IPage (com.agiletec.aps.system.services.page.IPage)41 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)20 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)17 HashMap (java.util.HashMap)12 Lang (com.agiletec.aps.system.services.lang.Lang)10 Page (com.agiletec.aps.system.services.page.Page)7 PageModel (com.agiletec.aps.system.services.pagemodel.PageModel)7 ArrayList (java.util.ArrayList)7 PageMetadata (com.agiletec.aps.system.services.page.PageMetadata)6 NavigatorExpression (com.agiletec.aps.system.services.page.widget.NavigatorExpression)6 Properties (java.util.Properties)6 RequestContext (com.agiletec.aps.system.RequestContext)5 ActionSupport (com.opensymphony.xwork2.ActionSupport)4 JspException (javax.servlet.jsp.JspException)4 WidgetTypeParameter (org.entando.entando.aps.system.services.widgettype.WidgetTypeParameter)4 List (java.util.List)3 ServletRequest (javax.servlet.ServletRequest)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3