private static CmsObject adjustSiteRootIfNecessary ( final CmsObject cms , final CmsModule module ) throws CmsException { CmsObject cmsClone ; if ( ( null == module . getSite ( ) ) || cms . getRequestContext ( ) . getSiteRoot ( ) . equals ( module . getSite ( ) ) ) { cmsClone = cms ; } else { cmsClone = OpenCms . initCmsObject ( cms ) ; cmsClone . getRequestContext ( ) . setSiteRoot ( module . getSite ( ) ) ; } return cmsClone ; }
Adjusts the site root and returns a cloned CmsObject iff the module has set an import site that differs from the site root of the CmsObject provided as argument . Otherwise returns the provided CmsObject unchanged .