use of org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager in project entando-core by entando.
the class TestContentViewerHelper method init.
private void init() throws Exception {
try {
_requestContext = this.getRequestContext();
Lang lang = new Lang();
lang.setCode("it");
lang.setDescr("italiano");
_requestContext.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);
Widget widget = new Widget();
IWidgetTypeManager showletTypeMan = (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
WidgetType showletType = showletTypeMan.getWidgetType("content_viewer");
widget.setType(showletType);
widget.setConfig(new ApsProperties());
_requestContext.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, widget);
this._helper = (IContentViewerHelper) this.getApplicationContext().getBean("jacmsContentViewerHelper");
} catch (Throwable t) {
throw new Exception(t);
}
}
use of org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager in project entando-core by entando.
the class TestPageModelDOM method testGetFrames.
public void testGetFrames() throws Throwable {
IWidgetTypeManager widgetTypeManager = (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
PageModelDOM pageModelDOM = new PageModelDOM(FRAMES_XML, widgetTypeManager);
Frame[] configuration = pageModelDOM.getConfiguration();
assertTrue(configuration[0].getDescription().equals("Box sinistra alto"));
assertEquals("login_form", configuration[1].getDefaultWidget().getType().getCode());
}
use of org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager in project entando-core by entando.
the class PageAction method setViewerPageAPI.
public String setViewerPageAPI() {
IPage page = null;
try {
page = this.getPage(this.getPageCode());
int mainFrame = page.getMetadata().getModel().getMainFrame();
if (mainFrame > -1) {
IWidgetTypeManager showletTypeManager = (IWidgetTypeManager) ApsWebApplicationUtils.getBean(SystemConstants.WIDGET_TYPE_MANAGER, this.getRequest());
Widget viewer = new Widget();
viewer.setConfig(new ApsProperties());
WidgetType type = showletTypeManager.getWidgetType(this.getViewerWidgetCode());
if (null == type) {
_logger.warn("No widget found for on-the-fly publishing config for page {}", page.getCode());
return SUCCESS;
}
viewer.setType(type);
Widget[] widgets = page.getWidgets();
widgets[mainFrame] = viewer;
}
this.getPageManager().updatePage(page);
} catch (Throwable t) {
_logger.error("Error setting on-the-fly publishing config to page {}", page.getCode(), t);
return FAILURE;
}
return SUCCESS;
}
use of org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager in project entando-core by entando.
the class TestApplicationContext method testGetServices.
public void testGetServices() {
ConfigInterface configManager = (ConfigInterface) this.getService(SystemConstants.BASE_CONFIG_MANAGER);
assertNotNull(configManager);
ICacheInfoManager cacheInfoManager = (ICacheInfoManager) this.getService(SystemConstants.CACHE_INFO_MANAGER);
assertNotNull(cacheInfoManager);
ILangManager langManager = (ILangManager) this.getService(SystemConstants.LANGUAGE_MANAGER);
assertNotNull(langManager);
IWidgetTypeManager showletTypeManager = (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
assertNotNull(showletTypeManager);
IPageModelManager pageModelManager = (IPageModelManager) this.getService(SystemConstants.PAGE_MODEL_MANAGER);
assertNotNull(pageModelManager);
IPageManager pageManager = (IPageManager) this.getService(SystemConstants.PAGE_MANAGER);
assertNotNull(pageManager);
IRoleManager roleManager = (IRoleManager) this.getService(SystemConstants.ROLE_MANAGER);
assertNotNull(roleManager);
IUserManager userManager = (IUserManager) this.getService(SystemConstants.USER_MANAGER);
assertNotNull(userManager);
IURLManager urlManager = (IURLManager) this.getService(SystemConstants.URL_MANAGER);
assertNotNull(urlManager);
II18nManager i18nManager = (II18nManager) this.getService(SystemConstants.I18N_MANAGER);
assertNotNull(i18nManager);
// ControllerManager controller = (ControllerManager) this.getService(SystemConstants.CONTROLLER_MANAGER);
// assertNotNull(controller);
IKeyGeneratorManager keyGeneratorManager = (IKeyGeneratorManager) this.getService(SystemConstants.KEY_GENERATOR_MANAGER);
assertNotNull(keyGeneratorManager);
ICategoryManager categoryManager = (ICategoryManager) this.getService(SystemConstants.CATEGORY_MANAGER);
assertNotNull(categoryManager);
}
use of org.entando.entando.aps.system.services.widgettype.IWidgetTypeManager in project entando-core by entando.
the class TestDataObjectViewerHelper method init.
private void init() throws Exception {
try {
_requestContext = this.getRequestContext();
Lang lang = new Lang();
lang.setCode("it");
lang.setDescr("italiano");
_requestContext.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);
Widget widget = new Widget();
IWidgetTypeManager showletTypeMan = (IWidgetTypeManager) this.getService(SystemConstants.WIDGET_TYPE_MANAGER);
WidgetType showletType = showletTypeMan.getWidgetType("content_viewer");
widget.setType(showletType);
widget.setConfig(new ApsProperties());
_requestContext.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, widget);
this._helper = (IDataObjectViewerHelper) this.getApplicationContext().getBean("DataObjectViewerHelper");
} catch (Throwable t) {
throw new Exception(t);
}
}
Aggregations