[ 
https://issues.apache.org/jira/browse/OFBIZ-3022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12764448#action_12764448
 ] 

Patrick Antivackis commented on OFBIZ-3022:
-------------------------------------------

Bruno,
I defined error pages for CmsSite in CmsSiteDemoData.xml
So if you go to https://localhost:8443/cmssite/cms/CMSS_DEMO_PAGE15 (do not 
exist), you should get the content defined by contentId="CMSS_ERROR_404" as it 
is a TREE_CHILD mapped with key 404 from CMSS_ERROR_ROOT that is an ERROR_ROOT 
type.
If you drop the CMSS_ERROR_404 association with CMSS_ERROR_ROOT and reload the 
page you get the content defined by CMSS_ERROR_ROOT.
For both you can also see that the HTTP status code sent back by ofbiz is 404.
If you make obsolete the content CMSS_DEMO_PAGE1 (giving a thruDate that is 
overdue already), and load https://localhost:8443/cmssite/cms/CMSS_DEMO_PAGE1 
you shoudl get a HTTP status code 410 (page is gone) and the content of 
CMSS_ERROR_ROOT as i didn't defined a specific 410 error page for CmsSite.

If you drop CMSS_ERROR_ROOT in the WebSiteContent entity, and reload you should 
get the global catch all 410 or 404 page that are defined in 
ContentHttpErrorData.xml file.

> Addind Error Pages (404 - 410) possibilities for the Content app
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-3022
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3022
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: content
>    Affects Versions: SVN trunk
>            Reporter: Patrick Antivackis
>         Attachments: Patch-OFBIZ-3022-824037.txt, Patch-OFBIZ-3022.txt
>
>
> The idea is to allow CMS based sites to have 404 not found, 410 page is gone 
> and 403 Forbidden pages (not yet used).
> For this I first create global error pages  in Data Resources/Content (id = 
> CONTENT_ERROR_xxx). These pages will be catchall Error pages if nothing is 
> defined at the Website Level (see below). Of course, theses pages can be 
> localized through the ContentAssoc ALTERNATE_LOCALE type (see the seed file 
> for example).
> Then I added a ERROR_ROOT type in the WebSiteContentType entity.
> The Document declared as ERROR_ROOT for a CMS Website will become an Error 
> catch-all page for this site.
> Under this root, specific error pages (404, 410) can be added (just one 
> sublevel) in order to have a specific page per error code (status code = 
> mapKey)
> These documents can of course be localized too.
> I then updated the CmsEvent class in order to find a corresponding error page 
> (first look at the subcontent of ERROR_ROOT, or take ERROR_ROOT or take the 
> global CONTENT_ERROR page). Now the rendered content also received the status 
> code in its context, so a $[statusContent} in a ftl template can show the 
> statusCode (200/404/410)
> Also updated the WebSiteCMSNav.ftl and WebSitePublishPoint.groovy in order to 
> show error tree (and may be manage the pages later)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to