當前位置: 首頁>>代碼示例>>Java>>正文


Java WebSiteWorker.getWebSite方法代碼示例

本文整理匯總了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);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:26,代碼來源:ContentUrlTag.java

示例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;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:16,代碼來源:ProductStoreWorker.java

示例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);
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:16,代碼來源:ContentUrlTag.java

示例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);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:8,代碼來源:CatalogWorker.java


注:本文中的org.ofbiz.webapp.website.WebSiteWorker.getWebSite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。