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


Java Event类代码示例

本文整理汇总了Java中org.ofbiz.webapp.control.ConfigXMLReader.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于org.ofbiz.webapp.control.ConfigXMLReader包,在下文中一共展示了Event类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: acceptRoleAssignment

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/** Accept role assignment event */
public static String acceptRoleAssignment(HttpServletRequest request, HttpServletResponse response) {
    ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
    RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
    Locale locale = UtilHttp.getLocale(request);

    if (addToOrderRole(request)) {
        try {
            EventHandler eh = rh.getEventFactory().getEventHandler("service");
            eh.invoke(new Event("service", "", "wfAcceptRoleAssignment", true), null, request, response);
        } catch (EventHandlerException e) {
            Debug.logError(e, "Invocation error", module);
            request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderFailedToInvokeTheWfAcceptRoleAssignmentService", locale));
            return "error";
        }
        return "success";
    }
    return "error";
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:TaskEvents.java

示例2: delegateAndAcceptAssignment

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/** Delegate and accept assignment event */
public static String delegateAndAcceptAssignment(HttpServletRequest request, HttpServletResponse response) {
    ServletContext ctx = (ServletContext) request.getAttribute("servletContext");
    RequestHandler rh = (RequestHandler) ctx.getAttribute("_REQUEST_HANDLER_");
    Locale locale = UtilHttp.getLocale(request);

    if (addToOrderRole(request)) {
        try {
            EventHandler eh = rh.getEventFactory().getEventHandler("service");
            eh.invoke(new Event("service", "", "wfAcceptRoleAssignment", true), null, request, response);
        } catch (EventHandlerException e) {
            Debug.logError(e, "Invocation error", module);
            request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderFailedToInvokeTheWfDelegateAndAcceptAssignmentService", locale));
            return "error";
        }
        return "success";
    }
    return "error";
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:TaskEvents.java

示例3: invoke

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/**
 * @see org.ofbiz.webapp.event.EventHandler#invoke(ConfigXMLReader.Event, ConfigXMLReader.RequestMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {
    Class<?> eventClass = this.eventClassMap.get(event.path);

    if (eventClass == null) {
        synchronized (this) {
            eventClass = this.eventClassMap.get(event.path);
            if (eventClass == null) {
                try {
                    ClassLoader loader = Thread.currentThread().getContextClassLoader();
                    eventClass = loader.loadClass(event.path);
                } catch (ClassNotFoundException e) {
                    Debug.logError(e, "Error loading class with name: " + event.path + ", will not be able to run event...", module);
                }
                if (eventClass != null) {
                    eventClassMap.put(event.path, eventClass);
                }
            }
        }
    }
    if (Debug.verboseOn()) Debug.logVerbose("[Set path/method]: " + event.path + " / " + event.invoke, module);

    Class<?>[] paramTypes = new Class<?>[] {HttpServletRequest.class, HttpServletResponse.class};

    Debug.logVerbose("*[[Event invocation]]*", module);
    Object[] params = new Object[] {request, response};

    return invoke(event.path, event.invoke, eventClass, paramTypes, params, event); // SCIPIO: pass the event
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:32,代码来源:JavaEventHandler.java

示例4: invoke

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/**
 * @see org.ofbiz.webapp.event.EventHandler#invoke(ConfigXMLReader.Event, ConfigXMLReader.RequestMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {
    String xmlResource = event.path;
    String eventName = event.invoke;
    Locale locale = UtilHttp.getLocale(request);

    if (Debug.verboseOn()) Debug.logVerbose("[Set path/method]: " + xmlResource + " / " + eventName, module);

    if (xmlResource == null) {
        throw new EventHandlerException("XML Resource (eventPath) cannot be null");
    }
    if (eventName == null) {
        throw new EventHandlerException("Event Name (eventMethod) cannot be null");
    }

    Debug.logVerbose("[Processing]: SIMPLE Event", module);
    try {
        String eventReturn = SimpleMethod.runSimpleEvent(xmlResource, eventName, request, response);
        if (Debug.verboseOn()) Debug.logVerbose("[Event Return]: " + eventReturn, module);
        return eventReturn;
    } catch (MiniLangException e) {
        Debug.logError(e, module);
        String errMsg = UtilProperties.getMessage(SimpleEventHandler.err_resource, "simpleEventHandler.event_not_completed", (locale != null ? locale : Locale.getDefault())) + ": ";
        request.setAttribute("_ERROR_MESSAGE_", errMsg + e.getMessage());
        return "error";
    }
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:30,代码来源:SimpleEventHandler.java

示例5: invoke

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/**
 * @see org.ofbiz.webapp.event.EventHandler#invoke(ConfigXMLReader.Event, ConfigXMLReader.RequestMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {
    Class<?> eventClass = this.eventClassMap.get(event.path);

    if (eventClass == null) {
        synchronized (this) {
            eventClass = this.eventClassMap.get(event.path);
            if (eventClass == null) {
                try {
                    ClassLoader loader = Thread.currentThread().getContextClassLoader();
                    eventClass = loader.loadClass(event.path);
                } catch (ClassNotFoundException e) {
                    Debug.logError(e, "Error loading class with name: " + event.path + ", will not be able to run event...", module);
                }
                if (eventClass != null) {
                    eventClassMap.put(event.path, eventClass);
                }
            }
        }
    }
    if (Debug.verboseOn()) Debug.logVerbose("[Set path/method]: " + event.path + " / " + event.invoke, module);

    Class<?>[] paramTypes = new Class<?>[] {HttpServletRequest.class, HttpServletResponse.class};

    Debug.logVerbose("*[[Event invocation]]*", module);
    Object[] params = new Object[] {request, response};

    return invoke(event.path, event.invoke, eventClass, paramTypes, params);
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:32,代码来源:JavaEventHandler.java

示例6: invoke

import org.ofbiz.webapp.control.ConfigXMLReader.Event; //导入依赖的package包/类
/**
 * Invoke the web event
 * @param event Contains information about what to execute
 * @param requestMap Contains information about the request-map the event was called from
 * @param request The servlet request object
 * @param response The servlet response object
 *
 *@return String Result code
 *@throws EventHandlerException
 */
public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException;
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:12,代码来源:EventHandler.java


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