/** * Constructs a new wrapper layer around an (already wrapped) CmsFlexRequest.<p> * * @param req the request to be wrapped * @param controller the controller to use * @param resource the target resource that has been requested */ CmsFlexRequest(HttpServletRequest req, CmsFlexController controller, String resource) { super(req); m_controller = controller; m_elementUri = CmsLinkManager.getAbsoluteUri(resource, m_controller.getCurrentRequest().getElementUri()); m_elementUriSiteRoot = m_controller.getCurrentRequest().m_elementUriSiteRoot; m_isOnline = m_controller.getCurrentRequest().isOnline(); m_canCache = m_controller.getCurrentRequest().isCacheable(); m_doRecompile = m_controller.getCurrentRequest().isDoRecompile(); m_includeCalls = m_controller.getCurrentRequest().getCmsIncludeCalls(); m_parameters = req.getParameterMap(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXREQUEST_REUSING_FLEX_REQUEST_1, m_elementUri)); } }
/** * Constructs a new wrapper layer around an (already wrapped) CmsFlexRequest.<p> * * @param req the request to be wrapped * @param controller the controller to use * @param resource the target resource that has been requested */ CmsFlexRequest(HttpServletRequest req, CmsFlexController controller, String resource) { super(req); m_controller = controller; m_elementUri = CmsLinkManager.getAbsoluteUri(resource, m_controller.getCurrentRequest().getElementUri()); m_elementUriSiteRoot = m_controller.getCurrentRequest().m_elementUriSiteRoot; m_isOnline = m_controller.getCurrentRequest().isOnline(); m_canCache = m_controller.getCurrentRequest().isCacheable(); m_doRecompile = m_controller.getCurrentRequest().isDoRecompile(); m_includeCalls = m_controller.getCurrentRequest().getCmsIncludeCalls(); m_parameters = CmsCollectionsGenericWrapper.map(req.getParameterMap()); m_attributes = CmsRequestUtil.getAtrributeMap(req); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXREQUEST_REUSING_FLEX_REQUEST_1, m_elementUri)); } }
/** * Allows requests to be dispatched to internal VFS resources or * external JSP pages, overloads the standard servlet API <code>getRequestDispatcher()</code> method.<p> * * @param target the target for the request dispatcher * * @return a special RequestDispatcher that allows access to VFS resources */ @Override public javax.servlet.RequestDispatcher getRequestDispatcher(String target) { String absolutUri = CmsLinkManager.getAbsoluteUri(target, m_controller.getCurrentRequest().getElementUri()); return new CmsFlexRequestDispatcher( m_controller.getTopRequest().getRequestDispatcher(absolutUri), absolutUri, null); }
/** * Allows requests to be dispatched to internal VFS resources or * external JSP pages, overloads the standard servlet API <code>getRequestDispatcher()</code> method.<p> * * @param target the target for the request dispatcher * * @return a special RequestDispatcher that allows access to VFS resources */ @Override public javax.servlet.RequestDispatcher getRequestDispatcher(String target) { String absolutUri = CmsLinkManager.getAbsoluteUri(target, m_controller.getCurrentRequest().getElementUri()); return new CmsFlexRequestDispatcher( m_controller.getTopRequest().getRequestDispatcher(absolutUri), absolutUri, null); }
/** * @see org.opencms.loader.I_CmsResourceLoader#service(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.ServletRequest, javax.servlet.ServletResponse) */ public void service(CmsObject cms, CmsResource resource, ServletRequest req, ServletResponse res) throws ServletException, IOException, CmsLoaderException { Lock lock = m_purgeLock.readLock(); try { lock.lock(); CmsFlexController controller = CmsFlexController.getController(req); // get JSP target name on "real" file system String target = updateJsp(resource, controller, new HashSet<String>(8)); // important: Indicate that all output must be buffered controller.getCurrentResponse().setOnlyBuffering(true); // initialize the standard contex bean to be available for all requests CmsJspStandardContextBean.getInstance(controller.getCurrentRequest()); // dispatch to external file controller.getCurrentRequest().getRequestDispatcherToExternal(cms.getSitePath(resource), target).include( req, res); } finally { lock.unlock(); } }
/** * Converts a relative URI in the OpenCms VFS to an absolute one based on * the location of the currently processed OpenCms URI.<p> * * @param target the relative URI to convert * @return the target URI converted to an absolute one */ public String toAbsolute(String target) { if (isNotInitialized()) { return getMessage(NOT_INITIALIZED); } return CmsLinkManager.getAbsoluteUri(target, getController().getCurrentRequest().getElementUri()); }
/** * Converts a relative URI in the OpenCms VFS to an absolute one based on * the location of the currently processed OpenCms URI.<p> * * @param target the relative URI to convert * @return the target URI converted to an absolute one */ public String toAbsolute(String target) { if (isNotInitialized()) { return getMessage(NOT_INITIALIZED); } return CmsLinkManager.getAbsoluteUri(target, getController().getCurrentRequest().getElementUri()); }
/** * @see org.opencms.loader.I_CmsResourceLoader#service(org.opencms.file.CmsObject, org.opencms.file.CmsResource, javax.servlet.ServletRequest, javax.servlet.ServletResponse) */ public void service(CmsObject cms, CmsResource resource, ServletRequest req, ServletResponse res) throws ServletException, IOException, CmsLoaderException { CmsFlexController controller = CmsFlexController.getController(req); // get JSP target name on "real" file system String target = updateJsp(resource, controller, new HashSet(8)); // important: Indicate that all output must be buffered controller.getCurrentResponse().setOnlyBuffering(true); // dispatch to external file controller.getCurrentRequest().getRequestDispatcherToExternal(cms.getSitePath(resource), target).include( req, res); }
controller.getCurrentRequest().getRequestDispatcher(target).include(req, res); } catch (ServletException e) {
controller.getCurrentRequest().getRequestDispatcher(target).include(req, res);
Messages.get().getBundle().key( Messages.LOG_UNSUPPORTED_ENC_1, controller.getCurrentRequest().getElementUri()), e); try {
case THIS: m_vfsUri = controller.getCurrentRequest().getElementUri(); break; case SEARCH_ELEMENT_URI: case SEARCH_THIS: m_vfsUri = controller.getCurrentRequest().getElementUri(); m_search = true; break; m_vfsUri = CmsLinkManager.getAbsoluteUri(action, controller.getCurrentRequest().getElementUri()); m_search = false;
Messages.LOG_WRONG_DEVICE_TYPE_2, selectedDevice, controller.getCurrentRequest().getElementUri()));
Messages.LOG_FLEXRESPONSE_REDIRECTWARNING_3, m_controller.getCmsResource().getRootPath(), m_controller.getCurrentRequest().getElementUri(), location));
I_CmsResourceLoader.PARAMETER_ELEMENT, value); controller.getCurrentRequest().addParameterMap(parameters); controller.getCurrentRequest().addAttributeMap(CmsRequestUtil.getAtrributeMap(req));
/** * Returns a link to a file in the OpenCms VFS * that has been adjusted according to the web application path and the * OpenCms static export rules.<p> * * Since OpenCms version 7.0.2, you can also use this method in case you are not sure * if the link is internal or external, as * {@link CmsLinkManager#substituteLinkForUnknownTarget(org.opencms.file.CmsObject, String)} * is used to calculate the link target.<p> * * Relative links are converted to absolute links, using the current element URI as base.<p> * * @param target the link that should be calculated, can be relative or absolute * @param req the current request * * @return the target link adjusted according to the web application path and the OpenCms static export rules * * @see org.opencms.staticexport.CmsLinkManager#substituteLinkForUnknownTarget(org.opencms.file.CmsObject, String) */ public static String linkTagAction(String target, ServletRequest req) { CmsFlexController controller = CmsFlexController.getController(req); return OpenCms.getLinkManager().substituteLinkForUnknownTarget( controller.getCmsObject(), CmsLinkManager.getAbsoluteUri(target, controller.getCurrentRequest().getElementUri())); }
String jspVfsName = CmsLinkManager.getAbsoluteUri(vfsName, controller.getCurrentRequest().getElementRootPath()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_UPDATE_JSP_1, jspVfsName));
String jspVfsName = CmsLinkManager.getAbsoluteUri(vfsName, controller.getCurrentRequest().getElementRootPath()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_UPDATE_JSP_1, jspVfsName));
controller.getCurrentRequest().addParameterMap(parameters);
String src = CmsLinkManager.getAbsoluteUri(m_src, controller.getCurrentRequest().getElementUri()); CmsUriSplitter splitSrc = new CmsUriSplitter(src);