本文整理汇总了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);
}