Search in sources :

Example 1 with IPage

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

the class ProtectedResourceProvider method executeLoginRedirect.

protected void executeLoginRedirect(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    try {
        StringBuilder targetUrl = new StringBuilder(request.getRequestURL());
        Map<String, String> params = new HashMap<String, String>();
        params.put("returnUrl", targetUrl.toString());
        String loginPageCode = this.getConfigManager().getParam(SystemConstants.CONFIG_PARAM_LOGIN_PAGE_CODE);
        IPage page = this.getPageManager().getOnlinePage(loginPageCode);
        Lang defaultLang = this.getLangManager().getDefaultLang();
        String url = this.getUrlManager().createURL(page, defaultLang, params);
        response.sendRedirect(url);
    } catch (Throwable t) {
        _logger.error("Error executing redirect login page", t);
        throw new ServletException("Error executing redirect login page", t);
    }
}
Also used : ServletException(javax.servlet.ServletException) IPage(com.agiletec.aps.system.services.page.IPage) HashMap(java.util.HashMap) Lang(com.agiletec.aps.system.services.lang.Lang)

Example 2 with IPage

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

the class CmsPageManagerWrapper method getContentUtilizers.

@Override
public List getContentUtilizers(String contentId) throws ApsSystemException {
    List<IPage> pages = new ArrayList<IPage>();
    try {
        IPage root = this.getPageManager().getOnlineRoot();
        this.searchContentUtilizers(root, pages, contentId);
    } catch (Throwable t) {
        _logger.error("Error loading referenced pages", t);
        throw new ApsSystemException("Error loading referenced pages with content " + contentId, t);
    }
    return pages;
}
Also used : IPage(com.agiletec.aps.system.services.page.IPage) ArrayList(java.util.ArrayList) ApsSystemException(com.agiletec.aps.system.exception.ApsSystemException)

Example 3 with IPage

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;
}
Also used : IPage(com.agiletec.aps.system.services.page.IPage) Widget(com.agiletec.aps.system.services.page.Widget) RequestContext(com.agiletec.aps.system.RequestContext)

Example 4 with IPage

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

the class RowContentListViewerWidgetAction method addPages.

private void addPages(IPage page, List<IPage> pages) {
    pages.add(page);
    String[] children = page.getChildrenCodes();
    for (int i = 0; i < children.length; i++) {
        IPage child = this.getPageManager().getOnlinePage(children[i]);
        this.addPages(child, pages);
    }
}
Also used : IPage(com.agiletec.aps.system.services.page.IPage)

Example 5 with IPage

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

the class RowContentListViewerWidgetAction method getPages.

public List<IPage> getPages() {
    if (this._pages == null) {
        this._pages = new ArrayList<IPage>();
        IPage root = this.getPageManager().getOnlineRoot();
        this.addPages(root, this._pages);
    }
    return this._pages;
}
Also used : IPage(com.agiletec.aps.system.services.page.IPage)

Aggregations

IPage (com.agiletec.aps.system.services.page.IPage)253 Widget (com.agiletec.aps.system.services.page.Widget)55 ArrayList (java.util.ArrayList)41 Page (com.agiletec.aps.system.services.page.Page)37 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)30 PageMetadata (com.agiletec.aps.system.services.page.PageMetadata)25 HashMap (java.util.HashMap)23 ApsProperties (com.agiletec.aps.util.ApsProperties)20 List (java.util.List)20 RestServerError (org.entando.entando.aps.system.exception.RestServerError)18 IPageManager (com.agiletec.aps.system.services.page.IPageManager)16 UserDetails (com.agiletec.aps.system.services.user.UserDetails)16 ResourceNotFoundException (org.entando.entando.aps.system.exception.ResourceNotFoundException)16 RequestContext (com.agiletec.aps.system.RequestContext)15 PageModel (com.agiletec.aps.system.services.pagemodel.PageModel)15 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)15 Test (org.junit.Test)14 BeanPropertyBindingResult (org.springframework.validation.BeanPropertyBindingResult)13 Lang (com.agiletec.aps.system.services.lang.Lang)12 ResultActions (org.springframework.test.web.servlet.ResultActions)12