use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class PageService method updatePage.
@Override
public PageDto updatePage(String pageCode, PageRequest pageRequest) {
IPage oldPage = this.getPageManager().getDraftPage(pageCode);
if (null == oldPage) {
throw new RestRourceNotFoundException(null, "page", pageCode);
}
this.validateRequest(pageRequest);
try {
IPage newPage = this.updatePage(oldPage, pageRequest);
this.getPageManager().updatePage(newPage);
return this.getDtoBuilder().convert(newPage);
} catch (ApsSystemException e) {
logger.error("Error updating page {}", pageCode, e);
throw new RestServerError("error in update page", e);
}
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class CacheInfoManager method updateFromPageChanged.
@Override
public void updateFromPageChanged(PageChangedEvent event) {
IPage page = event.getPage();
if (null != page) {
String pageCacheGroupName = SystemConstants.PAGES_CACHE_GROUP_PREFIX + page.getCode();
this.flushGroup(DEFAULT_CACHE_NAME, pageCacheGroupName);
}
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class SystemInfoWrapper method getActionPathUrl.
public String getActionPathUrl(String actionPath) {
String url = null;
RequestContext reqCtx = this.getReqCtx();
IURLManager urlManager = (IURLManager) ApsWebApplicationUtils.getBean(SystemConstants.URL_MANAGER, reqCtx.getRequest());
try {
PageURL pageUrl = urlManager.createURL(reqCtx);
IPage currPage = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
Integer currentFrame = (Integer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME);
pageUrl.setPage(currPage);
pageUrl.addParam(InternalServletTag.REQUEST_PARAM_ACTIONPATH, actionPath);
pageUrl.addParam(InternalServletTag.REQUEST_PARAM_FRAMEDEST, currentFrame.toString());
url = pageUrl.getURL();
} catch (Throwable t) {
_logger.error("Error getting path for action path: {}", actionPath, t);
return null;
}
return url;
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class SystemInfoWrapper method getPageWithWidget.
public IPage getPageWithWidget(String widgetCode) {
IPage page = null;
try {
IPageManager pageManager = (IPageManager) ApsWebApplicationUtils.getBean(SystemConstants.PAGE_MANAGER, this.getReqCtx().getRequest());
List<IPage> pages = pageManager.getOnlineWidgetUtilizers(widgetCode);
if (null != pages && !pages.isEmpty()) {
page = pages.get(0);
}
return page;
} catch (Throwable t) {
_logger.error("Error getting page with widget: {}", widgetCode, t);
return null;
}
}
use of com.agiletec.aps.system.services.page.IPage in project entando-core by entando.
the class TestContentListHelper method valueRequestContext.
private RequestContext valueRequestContext(String pageCode, int frame) throws Throwable {
RequestContext reqCtx = this.getRequestContext();
try {
Widget widgetToAdd = this.getShowletForTest("content_viewer_list", null);
this.setPageWidgets(pageCode, frame, widgetToAdd);
IPage page = this._pageManager.getOnlinePage(pageCode);
reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE, page);
Widget widget = page.getWidgets()[frame];
reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, widget);
reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME, new Integer(frame));
} catch (Throwable t) {
this.setPageWidgets(pageCode, frame, null);
throw t;
}
return reqCtx;
}
Aggregations