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;
}
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;
}
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;
}
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);
}
}
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;
}
Aggregations