[
https://issues.apache.org/jira/browse/OFBIZ-7120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15350982#comment-15350982
]
Pranay Pandey edited comment on OFBIZ-7120 at 9/17/16 7:59 AM:
---
Attaching patches for this feature implemented in specialpurpose/cmssite
component.
_*OFBIZ-7120-1.patch*_
This patch is for implementation done to support the feature.
# Introduced 3 new fields in WebSite Entity
## hostedPathAlias - For WebSites hosted on webapp using the WebSiteFilter,
indicates the path this WebSite will be hosted on
## isDefault - If Y then it is default WebSite
## displayMaintenancePage - If set to Y, redirect user to site maintenance page
(When a specific website needs to brought down without interrupting any of the
other processes on the same instance)
# Updates in RequestHandler for handling requests from MULTI_SITE_ENABLED web
app and to append URLs with hostedPathAlias for the corresponding website.
# Removed webSiteEntry from cmssite webapp web.xml as now this app is going to
be MULTI_SITE_ENABLED and will serve as a sample for multi-site environment,
also updated ControlServlet mapping to /* from /cms/*.
# Added Filter and mapping for WebSiteFilter in web.xml.
# Updates in CmsEvents.cms event to handle case of showing maintenance page
when a specific site has brought down.
# WebSiteFilter class for filtering requests for multi-site-enabled webapp
having WebSiteFilter entry.
# Prepared class MultiSiteRequestWrapper and overridden getPathInfo() method of
HttpServletRequest class which is used to hide the hostPathAlias portion of the
URL from OFBiz.
_*OFBIZ-7120-2.patch*_
This patch contains supporting data for demonstration of multi-site setup.
Made the existing website the default one, so that user lands here whenever no
specific hostedPathAlias is supplied.
Introduced two more websites and added their URLs on default website home page
for reference. Anyone can refer the setup to setup the similar environment in
hot-deploy application.
Introduced the maintenance page content and associated it with all the 3 sites,
but in custom setup, every website can have it’s own.
Any website can be brought down easily by setting up value of
displayMaintenancePage to Y from here:
https://localhost:8443/content/control/EditWebSite?webSiteId=WebSite2
Clean build with data load is required prior to testing the feature.
Here are the URLs for accessing these directly-
# CmsSite(Default) = https://localhost:8443/cmssite/
# WebSite-1 = https://localhost:8443/cmssite/website-1
# WebSite-2 = https://localhost:8443/cmssite/website-2
A developer can simply have cmssite component available in specialpurpose and
do an entry of WebSiteFilter in hot-deploy webapp web.xml can leverage the
feature and can setup a multi-site enabled webapp.
Thanks [~lektran] for the design and implementation, thanks [~rehan.khan] for
providing the patch for trunk.
Feedback from the community is welcome, please review and suggest any
improvements you see.
was (Author: pandeypranay):
Attaching patches for this feature implemented in specialpurpose/cmssite
component.
_*OFBIZ-7120-1.patch*_
This patch is for implementation done to support the feature.
# Introduced 3 new fields in WebSite Entity
## hostedPathAlias - For WebSites hosted on webapp using the WebSiteFilter,
indicates the path this WebSite will be hosted on
## isDefault - If Y then it is default WebSite
## displayMaintenancePage - If set to Y, redirect user to site maintenance page
(When a specific website needs to brought down without interrupting any of the
other processes on the same instance)
# Entry for cmssite in specialpurpose build.xml for getting it compiled.
# Updates in RequestHandler for handling requests from MULTI_SITE_ENABLED web
app and to append URLs with hostedPathAlias for the corresponding website.
# Removed webSiteEntry from cmssite webapp web.xml as now this app is going to
be MULTI_SITE_ENABLED and will serve as a sample for multi-site environment,
also updated ControlServlet mapping to /* from /cms/*.
# Added Filter and mapping for WebSiteFilter in web.xml.
# Updates in CmsEvents.cms event to handle case of showing maintenance page
when a specific site has brought down.
# WebSiteFilter class for filtering requests for multi-site-enabled webapp
having WebSiteFilter entry.
# Prepared class MultiSiteRequestWrapper and overridden getPathInfo() method of
HttpServletRequest class which is used to hide the hostPathAlias portion of the
URL from OFBiz.
_*OFBIZ-7120-2.patch*_
This patch contains supporting data for demonstration of multi-site setup.
Made the existing website the default one, so that user lands here whenever no
specific hostedPathAlias is supplied.
Introduced two more websites and added their URLs on default website home page
for reference. Anyone can refer the setup to setup the similar environment in