APISonar


org.ofbiz.base.util.Debug.log

> org > ofbiz > base > util > Debug > log
org APIs ofbiz APIs base APIs util APIs Debug APIs log APIs

Example 1
public int prepare(Xid xid) throws XAException {
        // overriding to log two phase commits
        Debug.log("ServiceXaWrapper#prepare() : " + xid.toString(), module);
        int rtn;
        try {
            rtn = super.prepare(xid);
        } catch (XAException e) {
            Debug.logError(e, module);
            throw e;
        }
        Debug.log("ServiceXaWrapper#prepare() : " + rtn + " / " + (rtn == XA_OK) , module);
        return rtn;
    }
Example 2
public String getInclude(Map args) {
        Object o = args.get("include");
        Debug.log("Include Object - " + o, module);
        String include = null;
        if (o != null) {
            if (o instanceof SimpleScalar) {
                SimpleScalar s = (SimpleScalar) o;
                include = s.getAsString();
                Debug.log("Include String - " + include, module);
            }
        }
        return include;
    }
Example 3
private void printALine(String s) {
        printerBuffer = printerBuffer.append(s);
        if ( s.indexOf(NullPosPrinter.PAPER_CUT) > 0 ) {
            Debug.log(printerBuffer.toString(), module);
            printerBuffer = new StringBuffer();
        }
    }
Example 4
public static Process getInstance(EntityPersistentMgr mgr, String processId) throws PersistenceException {
        Process proc = new Process(mgr, SharkContainer.getDelegator(), processId);
        if (proc.isLoaded()) {
            Debug.log("Returning loaded Process", module);
            return proc;
        }
        Debug.log("Returning null Process ID : " + processId, module);
        if (processId == null) Debug.log(new Exception(), module);
            return null;
    }
Example 5
public static Map<String, Object> displayXaDebugInfo(DispatchContext dctx, Map<String, ?> context) {
        if (TransactionUtil.debugResources) {
            if (UtilValidate.isNotEmpty(TransactionUtil.debugResMap)) {
                TransactionUtil.logRunningTx();
            } else {
                Debug.log("No running transaction to display.", module);
            }
        } else {
            Debug.log("Debug resources is disabled.", module);
        }

        return ServiceUtil.returnSuccess();
    }
Example 6
public void setOrderItemSeqId(String orderItemSeqId) {
        Debug.log("Setting orderItemSeqId - " + orderItemSeqId, module);
        this.orderItemSeqId = orderItemSeqId;
    }
Example 7
public void focusLost(FocusEvent event) {
        if (Debug.verboseOn()) {
            String to = event != null && event.getOppositeComponent() != null ? event.getOppositeComponent().getName() : "??";
            Debug.log(event.getSource() + " focus lost to " + to, module);
        }
    }
Example 8
public synchronized void processNoPayment(String paymentMethodTypeId) {
        try {
            BigDecimal amount = processAmount(null);
            Debug.log("Processing [" + paymentMethodTypeId + "] Amount : " + amount, module);

            // add the payment
            addPayment(paymentMethodTypeId, amount, null, null);
        } catch (GeneralException e) {
            // errors handled
        }
    }
Example 9
public void testUspsPriorityMailStandard() throws Exception {

        // run the service
        Map result = dispatcher.runSync("uspsPriorityMailStandard", UtilMisc.toMap("originZip", "4", "destinationZip", "4"));

        // verify the results
        String responseMessage = (String) result.get(ModelService.RESPONSE_MESSAGE);
        Debug.log("[testUspsPriorityMailStandard] responseMessage: " + responseMessage, module);
        assertEquals("Service result is success", ModelService.RESPOND_SUCCESS, responseMessage);

        String days = (String) result.get("days");
        Debug.log("[testUspsPriorityMailStandard] days: " + days, module);
        assertEquals("days is correct", "1", days);
    }
Example 10
private Map getAttributesAsMap(HttpServletRequest request) {
        Map attrMap = FastMap.newInstance();
        Enumeration en = request.getAttributeNames();
        while (en.hasMoreElements()) {
            String name = (String) en.nextElement();
            Object val = request.getAttribute(name);
            if (val instanceof String || val instanceof Number || val instanceof Map || val instanceof List) {
                Debug.log("Adding attribute to JSON output: " + name, module);
                attrMap.put(name, val);
            }
        }

        return attrMap;
    }
Example 11
public static void initReservedWords(TreeSet reservedWords) {
        //create extensive list of reserved words
        int asize = rwArray.length;
        Debug.log("[initReservedWords] array length=" + asize);
        for (int i = 0; i < asize; i++) {
            reservedWords.add(rwArray[i]);
        }
    }
Example 12
public void updateDefaultValues(Map context, String mode) {        
        List params = this.getModelParamList();
        if (params != null) {
            Iterator i = params.iterator();
            while (i.hasNext()) {
                ModelParam param = (ModelParam) i.next();
                if ("INOUT".equals(param.mode) || mode.equals(param.mode)) {
                    if (param.defaultValue != null && context.get(param.name) == null) {
                        context.put(param.name, param.defaultValue);
                        Debug.log("Set default value for parameter: " + param.name, module);
                    }
                }
            }
        }
    }
Example 13
public List restoreActivityHistory(String processId, String activityId, SharkTransaction trans) throws EventAuditException {
        if (Debug.verboseOn()) Debug.log(":: restoreActivityHistory ::", module);
        List activityHistory = new ArrayList();
        activityHistory.addAll(getAssignmentEvents(processId, activityId));
        activityHistory.addAll(getActivityDataEvents(processId, activityId));
        activityHistory.addAll(getActivityStateEvents(processId, activityId));
        if (Debug.verboseOn()) Debug.log(":: restoreActivityHistory :: " + activityHistory.size(), module);
        return activityHistory;
    }
Example 14
public static String httpClientTest(HttpServletRequest request, HttpServletResponse response) {
        try {
            HttpClient http = new HttpClient("http://ofbiz.apache.org/cgi-bin/http_test.pl");

            http.setHeader("Cookie", "name=value,value=name");
            http.setHeader("User-Agent", "Mozilla/4.0");
            http.setParameter("testId", "testing");
            Debug.log(http.post(), module);
        } catch (Exception e) {
            Debug.log(e, "HttpClientException Caught.", module);
        }
        return "success";
    }
Example 15
public void outputTraceMessage(MethodContext methodContext, String... messages) {
        String lineSep = System.getProperty("line.separator");
        StringBuilder buf = new StringBuilder(getSimpleMethod().getFileName());
        buf.append(", Line ").append(getLineNumber()).append(" <").append(getTagName()).append("> element: ");
        for (int i = 0; i < messages.length; i++) {
            buf.append(messages[i]);
            if (i < messages.length - 1 && messages.length > 1) {
                buf.append(lineSep);
            }
        }
        Debug.log(methodContext.getTraceLogLevel(), null, buf.toString(), module);
    }
Example 16
public void setText(String text) {
        if (this.output != null) {
            this.output.setText(text);
        } else if (this.closeBtn != null) {
            this.closeBtn.setText("<html><center>" + text + "</center></html>");
        } else {
            Debug.log("PosDialog output edit box is NULL!", module);
        }
    }
Example 17
public List getAllProcessesForMgr(String mgrName, SharkTransaction trans) throws PersistenceException {
        if (Debug.verboseOn()) Debug.log(":: getAllProcessesForMgr ::", module);
        return this.getProcessesForMgr(mgrName, null, trans);
    }
Example 18
public List restoreProcessHistory(String processId, SharkTransaction trans) throws EventAuditException {
        List processHistory = new ArrayList();
        processHistory.addAll(getCreateProcessEvents(processId));
        processHistory.addAll(getProcessDataEvents(processId));
        processHistory.addAll(getProcessStateEvents(processId));
        if (Debug.verboseOn()) Debug.log(":: restoreProcessHistory :: " + processHistory.size(), module);
        return processHistory;
    }
Example 19
public static Map<String, Object> simpleMapListTest(DispatchContext dctx, Map<String, ?> context) {
        List<String> listOfStrings = checkList(context.get("listOfStrings"), String.class);
        Map<String, String> mapOfStrings = checkMap(context.get("mapOfStrings"), String.class, String.class);

        for (String str: listOfStrings) {
            String v = (String) mapOfStrings.get(str);
            Debug.log("SimpleMapListTest: " + str + " -> " + v, module);
        }

        return ServiceUtil.returnSuccess();
    }
Example 20
public static Map<String, Object> shoppingCartRemoteTest(DispatchContext dctx, Map<String, ? extends Object> context) {
        ShoppingCart cart = (ShoppingCart) context.get("cart");
        Debug.log("Product ID : " + cart.findCartItem(0).getProductId(), module);
        return ServiceUtil.returnSuccess();
    }
Example 21
public void setProcessId(String procId) {
        assignment.set(org.ofbiz.shark.SharkConstants.processId, procId);
        Debug.log("Set processId on assignment : " + procId, module);
    }
Example 22
public void setResourceUsername(String username) {
        assignment.set(org.ofbiz.shark.SharkConstants.userName, username);
        Debug.log("Set userName on assignment : " + username, module);
    }
Example 23
public void receiveDialogCb(PosDialog dialog) {
        Debug.log("Dialog closed; refreshing screen", module);
        this.refresh();
    }
Example 24
public void deleteProcessMgr(String mgrName, SharkTransaction trans) throws PersistenceException {
        if (Debug.infoOn()) Debug.log(":: deleteProcessMgr ::", module);
        try {
            ((ProcessMgr) restoreProcessMgr(mgrName, trans)).remove();
        } catch (GenericEntityException e) {
            throw new PersistenceException(e);
        }
    }
Example 25
public static String test(HttpServletRequest request, HttpServletResponse response) {
        request.setAttribute("MESSAGE", "Test Event Ran Fine.");
        Debug.log("Test Event Ran Fine.", module);
        return "success";
    }