本文整理匯總了Java中org.ofbiz.webapp.website.WebSiteWorker.getWebSite方法的典型用法代碼示例。如果您正苦於以下問題:Java WebSiteWorker.getWebSite方法的具體用法?Java WebSiteWorker.getWebSite怎麽用?Java WebSiteWorker.getWebSite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.ofbiz.webapp.website.WebSiteWorker
的用法示例。
在下文中一共展示了WebSiteWorker.getWebSite方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: appendContentPrefix
import org.ofbiz.webapp.website.WebSiteWorker; //導入方法依賴的package包/類
/**
* Appends content prefix to buffer.
* <p>
* SCIPIO: Modified to support an explicit webSiteId
*/
public static void appendContentPrefix(HttpServletRequest request, Appendable urlBuffer, String webSiteId) throws IOException {
if (request == null) {
Debug.logWarning("Request was null in appendContentPrefix; this probably means this was used where it shouldn't be, like using ofbizContentUrl in a screen rendered through a service; using best-bet behavior: standard prefix from url.properties (no WebSite or security setting known)", module);
String prefix = UtilProperties.getPropertyValue("url", "content.url.prefix.standard");
if (prefix != null) {
urlBuffer.append(prefix.trim());
}
return;
}
// SCIPIO: if webSiteId, get that specific one
//GenericValue webSite = WebSiteWorker.getWebSite(request);
GenericValue webSite;
if (webSiteId != null && webSiteId.length() > 0) {
webSite = WebSiteWorker.findWebSite((Delegator) request.getAttribute("delegator"), webSiteId);
} else {
webSite = WebSiteWorker.getWebSite(request);
}
// SCIPIO: 2017-11-18: Factored out dispersed secure checks into RequestLinkUtil:
appendContentPrefix(webSite, RequestLinkUtil.isEffectiveSecure(request), urlBuffer);
}
示例2: getProductStoreId
import org.ofbiz.webapp.website.WebSiteWorker; //導入方法依賴的package包/類
public static String getProductStoreId(ServletRequest request) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpSession session = httpRequest.getSession(false);
if (session != null && session.getAttribute("productStoreId") != null) {
return (String) session.getAttribute("productStoreId");
} else {
GenericValue webSite = WebSiteWorker.getWebSite(httpRequest);
if (webSite != null) {
String productStoreId = webSite.getString("productStoreId");
// might be nice to do this, but not needed and has a problem with dependencies: setSessionProductStore(productStoreId, httpRequest);
return productStoreId;
}
}
return null;
}
示例3: appendContentPrefix
import org.ofbiz.webapp.website.WebSiteWorker; //導入方法依賴的package包/類
public static void appendContentPrefix(HttpServletRequest request, Appendable urlBuffer) throws IOException {
if (request == null) {
Debug.logWarning("WARNING: request was null in appendContentPrefix; this probably means this was used where it shouldn't be, like using ofbizContentUrl in a screen rendered through a service; using best-bet behavior: standard prefix from url.properties (no WebSite or security setting known)", module);
String prefix = UtilProperties.getPropertyValue("url", "content.url.prefix.standard");
if (prefix != null) {
urlBuffer.append(prefix.trim());
}
return;
}
GenericValue webSite = WebSiteWorker.getWebSite(request);
String forwardedProto = request.getHeader("X-Forwarded-Proto");
boolean isForwardedSecure = UtilValidate.isNotEmpty(forwardedProto) && "HTTPS".equals(forwardedProto.toUpperCase());
boolean isSecure = request.isSecure() || isForwardedSecure;
appendContentPrefix(webSite, isSecure, urlBuffer);
}
示例4: getWebSite
import org.ofbiz.webapp.website.WebSiteWorker; //導入方法依賴的package包/類
/**
* @deprecated - Use WebSiteWorker.getWebSite(ServletRequest) instead
*/
@Deprecated
public static GenericValue getWebSite(ServletRequest request) {
return WebSiteWorker.getWebSite(request);
}