/** * Wraps the request URI, overloading the standard API.<p> * * This ensures that any wrapped request will use the "faked" * target parameters. Remember that for the real request, * a mixture of PathInfo and other request information is used to * identify the target.<p> * * @return a faked URI that will point to the wrapped target in the VFS * * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (m_requestUri != null) { return m_requestUri; } StringBuffer buf = new StringBuffer(128); buf.append(OpenCms.getSystemInfo().getOpenCmsContext()); buf.append(getElementUri()); m_requestUri = buf.toString(); return m_requestUri; }
/** * Wraps the request URI, overloading the standard API.<p> * * This ensures that any wrapped request will use the "faked" * target parameters. Remember that for the real request, * a mixture of PathInfo and other request information is used to * identify the target.<p> * * @return a faked URI that will point to the wrapped target in the VFS * * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (m_requestUri != null) { return m_requestUri; } StringBuffer buf = new StringBuffer(128); buf.append(OpenCms.getSystemInfo().getOpenCmsContext()); buf.append(getElementUri()); m_requestUri = buf.toString(); return m_requestUri; }
/** * 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); }
/** * 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()); }
controller.getCurrentRequest().getElementUri()), e); try { encoding = OpenCms.getSystemInfo().getDefaultEncoding();
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));
Messages.LOG_FLEXRESPONSE_REDIRECTWARNING_3, m_controller.getCmsResource().getRootPath(), m_controller.getCurrentRequest().getElementUri(), location));
/** * 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())); }
/** * 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)); } }
getController().getCurrentRequest().getElementUri(), false)); break; getController().getCurrentRequest().getElementUri(), true)); break;
break; case 6: // opencms.request.element.uri result = controller.getCurrentRequest().getElementUri(); break; case 7: // opencms.request.folder
break; case 6: // opencms.request.element.uri result = controller.getCurrentRequest().getElementUri(); break; case 7: // opencms.request.folder
String uri = CmsLinkManager.getAbsoluteUri(target, controller.getCurrentRequest().getElementUri()); CmsObject cms = controller.getCmsObject(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(baseUri) || (null != locale)) {
String src = CmsLinkManager.getAbsoluteUri(m_src, controller.getCurrentRequest().getElementUri()); CmsUriSplitter splitSrc = new CmsUriSplitter(src);