当前位置: 首页>>代码示例>>Java>>正文


Java WebSiteWorker.getWebSiteId方法代码示例

本文整理汇总了Java中org.ofbiz.webapp.website.WebSiteWorker.getWebSiteId方法的典型用法代码示例。如果您正苦于以下问题:Java WebSiteWorker.getWebSiteId方法的具体用法?Java WebSiteWorker.getWebSiteId怎么用?Java WebSiteWorker.getWebSiteId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ofbiz.webapp.website.WebSiteWorker的用法示例。


在下文中一共展示了WebSiteWorker.getWebSiteId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDescriptors

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
public static Map<String, Object> getDescriptors(DispatchContext dctx, Map<String, ?> context) {
    Map<String, Object> result = ServiceUtil.returnSuccess();
    Delegator delegator = dctx.getDelegator();
    
    String webSiteId = WebSiteWorker.getWebSiteId((ServletRequest) context.get("request"));
    List<CmsPageTemplate> pageTemplates = CmsPageTemplate.getWorker().findAll(delegator, UtilMisc.toMap("webSiteId", webSiteId), 
            UtilMisc.toList("templateName ASC"), false);
    result.put("pageTemplates", pageTemplates);
    List<CmsAssetTemplate> assetTemplates = CmsAssetTemplate.getWorker().findAll(delegator, UtilMisc.toMap("webSiteId", webSiteId), 
            UtilMisc.toList("templateName ASC"), false);
    result.put("assetTemplates", assetTemplates);
    List<CmsPage> pages = CmsPage.getWorker().findAll(delegator, UtilMisc.toMap("webSiteId", webSiteId), UtilMisc.toList("pageName ASC"), false);
    result.put("pages", pages);

    return result;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:17,代码来源:CmsServices.java

示例2: getProductConfigWrapper

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
public static ProductConfigWrapper getProductConfigWrapper(String productId, String currencyUomId, HttpServletRequest request) {
    ProductConfigWrapper configWrapper = null;
    String catalogId = CatalogWorker.getCurrentCatalogId(request);
    String webSiteId = WebSiteWorker.getWebSiteId(request);
    String productStoreId = ProductStoreWorker.getProductStoreId(request);
    GenericValue autoUserLogin = (GenericValue)request.getSession().getAttribute("autoUserLogin");
    try {
        /* caching: there is one cache created, "product.config"  Each product's config wrapper is cached with a key of
         * productId::catalogId::webSiteId::currencyUomId, or whatever the SEPARATOR is defined above to be.
         */
        String cacheKey = productId + SEPARATOR + productStoreId + SEPARATOR + catalogId + SEPARATOR + webSiteId + SEPARATOR + currencyUomId;
        configWrapper = productConfigCache.get(cacheKey);
        if (configWrapper == null) {
            configWrapper = new ProductConfigWrapper((Delegator)request.getAttribute("delegator"),
                                                     (LocalDispatcher)request.getAttribute("dispatcher"),
                                                     productId, productStoreId, catalogId, webSiteId,
                                                     currencyUomId, UtilHttp.getLocale(request),
                                                     autoUserLogin);
            configWrapper = productConfigCache.putIfAbsentAndGet(cacheKey, new ProductConfigWrapper(configWrapper));
        } else {
            configWrapper = new ProductConfigWrapper(configWrapper);
        }
    } catch (ProductConfigWrapperException we) {
        configWrapper = null;
    } catch (Exception e) {
        Debug.logWarning(e.getMessage(), module);
    }
    return configWrapper;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:30,代码来源:ProductConfigWorker.java

示例3: WebShoppingCart

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
public WebShoppingCart(HttpServletRequest request, Locale locale, String currencyUom) {
    // for purchase orders, bill to customer partyId must be set - otherwise, no way to know who we're purchasing for.  supplierPartyId is furnished
    // by order manager for PO entry.
    // TODO: refactor constructor and the getCartObject method which calls them to multiple constructors for different types of orders
    super((Delegator)request.getAttribute("delegator"), ProductStoreWorker.getProductStoreId(request),
            WebSiteWorker.getWebSiteId(request), (locale != null ? locale : ProductStoreWorker.getStoreLocale(request)),
            (currencyUom != null ? currencyUom : ProductStoreWorker.getStoreCurrencyUomId(request)),
            request.getParameter("billToCustomerPartyId"),
            (request.getParameter("supplierPartyId") != null ? request.getParameter("supplierPartyId") : request.getParameter("billFromVendorPartyId")));

    HttpSession session = request.getSession(true);
    this.userLogin = (GenericValue) session.getAttribute("userLogin");
    this.autoUserLogin = (GenericValue) session.getAttribute("autoUserLogin");
    this.orderPartyId = (String) session.getAttribute("orderPartyId");
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:16,代码来源:WebShoppingCart.java

示例4: getWebSiteIdForControl

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
/**
 * Special webSiteId lookup for filters which may run early in a chain; in this case, 
 * WebSiteWorker.getWebSiteId(request) may not return a value.
 * May also be useful elsewhere (view handler, just in case).
 */
public static String getWebSiteIdForControl(HttpServletRequest request, ServletContext servletContext) {
    // Try WebSiteWorker first
    String webSiteId = WebSiteWorker.getWebSiteId(request);
    if (UtilValidate.isEmpty(webSiteId) && servletContext != null) {
        webSiteId = (String) servletContext.getAttribute("webSiteId");
    }
    return webSiteId;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:14,代码来源:CmsControlUtil.java

示例5: makeFromRequestContext

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
private static CmsPageContext makeFromRequestContext(Map<String, ?> context, RendererType rendererType) {
    HttpServletRequest request = (HttpServletRequest) context.get("request");
    HttpServletResponse response = (HttpServletResponse) context.get("response");
    ServletContext servletContext = request.getServletContext();
    boolean preview = Boolean.TRUE.equals(context.get("cmsIsPreview"));
    String webSiteId = WebSiteWorker.getWebSiteId(request);
    return new CmsPageContext(request, response, servletContext, webSiteId, preview, rendererType);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:9,代码来源:CmsPageContext.java

示例6: getWebSiteId

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
/**
 * @deprecated - Use WebSiteWorker.getWebSiteId(ServletRequest) instead
 */
@Deprecated
public static String getWebSiteId(ServletRequest request) {
    return WebSiteWorker.getWebSiteId(request);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:CatalogWorker.java

示例7: createOrder

import org.ofbiz.webapp.website.WebSiteWorker; //导入方法依赖的package包/类
public static String createOrder(HttpServletRequest request, HttpServletResponse response) {
    HttpSession session = request.getSession();
    ShoppingCart cart = ShoppingCartEvents.getCartObject(request);
    LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
    Delegator delegator = (Delegator) request.getAttribute("delegator");
    GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
    CheckOutHelper checkOutHelper = new CheckOutHelper(dispatcher, delegator, cart);
    Map<String, Object> callResult;

    if (UtilValidate.isEmpty(userLogin)) {
        userLogin = cart.getUserLogin();
        session.setAttribute("userLogin", userLogin);
    }
    // remove this whenever creating an order so quick reorder cache will refresh/recalc
    session.removeAttribute("_QUICK_REORDER_PRODUCTS_");

    boolean areOrderItemsExploded = explodeOrderItems(delegator, cart);

    //get the TrackingCodeOrder List
    List<GenericValue> trackingCodeOrders = TrackingCodeEvents.makeTrackingCodeOrders(request);
    String distributorId = (String) session.getAttribute("_DISTRIBUTOR_ID_");
    String affiliateId = (String) session.getAttribute("_AFFILIATE_ID_");
    String visitId = VisitHandler.getVisitId(session);
    String webSiteId = WebSiteWorker.getWebSiteId(request);

    callResult = checkOutHelper.createOrder(userLogin, distributorId, affiliateId, trackingCodeOrders, areOrderItemsExploded, visitId, webSiteId);
    if (callResult != null) {
        ServiceUtil.getMessages(request, callResult, null);
        if (ServiceUtil.isError(callResult)) {
            // messages already setup with the getMessages call, just return the error response code
            return "error";
        }
        if (callResult.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_SUCCESS)) {
            // set the orderId for use by chained events
            String orderId = cart.getOrderId();
            request.setAttribute("orderId", orderId);
            request.setAttribute("orderAdditionalEmails", cart.getOrderAdditionalEmails());
        }
    }
    
    String issuerId = request.getParameter("issuerId");
    if (UtilValidate.isNotEmpty(issuerId)) {
        request.setAttribute("issuerId", issuerId);
    }
    

    return cart.getOrderType().toLowerCase();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:49,代码来源:CheckOutEvents.java


注:本文中的org.ofbiz.webapp.website.WebSiteWorker.getWebSiteId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。