use of org.entando.entando.aps.system.services.widgettype.model.WidgetDetails in project entando-core by entando.
the class WidgetMockHelper method mockWidgetDetails.
/**
* @param pageCode
* @return
*/
public static WidgetDetails mockWidgetDetails(String pageCode) {
WidgetDetails widgetDetails = new WidgetDetails();
widgetDetails.setPageCode(pageCode);
return widgetDetails;
}
use of org.entando.entando.aps.system.services.widgettype.model.WidgetDetails in project entando-core by entando.
the class WidgetService method getWidgetDetails.
private WidgetDetails getWidgetDetails(IPage page, String widgetCode) {
List<Widget> list = Arrays.asList(page.getWidgets());
int index = list.indexOf(list.stream().filter(widget -> widget != null && widget.getType().getCode().equals(widgetCode)).findFirst().get());
WidgetDetails details = new WidgetDetails();
details.setFrameIndex(index);
details.setFrame(page.getModel().getFrames()[index]);
details.setPageCode(page.getCode());
details.setPageFullPath(page.getPath(this.getPageManager()));
return details;
}
Aggregations