当前位置: 首页>>代码示例>>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;未经允许,请勿转载。