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


Java UtilXml.makeEmptyXmlDocument方法代碼示例

本文整理匯總了Java中org.ofbiz.base.util.UtilXml.makeEmptyXmlDocument方法的典型用法代碼示例。如果您正苦於以下問題:Java UtilXml.makeEmptyXmlDocument方法的具體用法?Java UtilXml.makeEmptyXmlDocument怎麽用?Java UtilXml.makeEmptyXmlDocument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.ofbiz.base.util.UtilXml的用法示例。


在下文中一共展示了UtilXml.makeEmptyXmlDocument方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PcChargeApi

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public PcChargeApi(boolean isFile) {
    // initialize the document
    String initialElement = rootElement;
    if (!isFile) {
        initialElement = reqElement;
    }

    this.document = UtilXml.makeEmptyXmlDocument(initialElement);
    Element root = this.document.getDocumentElement();
    if (isFile) {
        root.setAttribute("xmlns", xschema);
        this.req = UtilXml.addChildElement(root, reqElement, document);
    } else {
        this.req = root;
    }
    this.mode = MODE_IN;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:18,代碼來源:PcChargeApi.java

示例2: createUspsRequestDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
private static Document createUspsRequestDocument(String rootElement, boolean passwordRequired, Delegator delegator, String shipmentGatewayConfigId, String resource) {
    Document requestDocument = UtilXml.makeEmptyXmlDocument(rootElement);
    Element requestElement = requestDocument.getDocumentElement();
    requestElement.setAttribute("USERID", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, 
            "accessUserId", resource, "shipment.usps.access.userid", ""));
    if (passwordRequired) {
        requestElement.setAttribute("PASSWORD", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, 
                "accessPassword", resource, "shipment.usps.access.password", ""));
    }
    return requestDocument;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:12,代碼來源:UspsServices.java

示例3: createAccessRequestDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static Document createAccessRequestDocument(Delegator delegator, String shipmentGatewayConfigId, 
        String serviceConfigProps) {
    Document accessRequestDocument = UtilXml.makeEmptyXmlDocument("AccessRequest");
    Element accessRequestElement = accessRequestDocument.getDocumentElement();
    String accessLicenseNumber = getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessLicenseNumber", serviceConfigProps, "shipment.ups.access.license.number", "");
    String userId = getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessUserId", serviceConfigProps, "shipment.ups.access.user.id", "");
    String password = getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessPassword", serviceConfigProps, "shipment.ups.access.password", "");
    UtilXml.addChildElementValue(accessRequestElement, "AccessLicenseNumber",accessLicenseNumber, accessRequestDocument);
    UtilXml.addChildElementValue(accessRequestElement, "UserId", userId, accessRequestDocument);
    UtilXml.addChildElementValue(accessRequestElement, "Password", password, accessRequestDocument);
    return accessRequestDocument;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:13,代碼來源:UpsServices.java

示例4: createAccessRequestDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static Document createAccessRequestDocument(Delegator delegator, String shipmentGatewayConfigId, String resource) {
    Document eCommerceRequestDocument = UtilXml.makeEmptyXmlDocument("eCommerce");
    Element eCommerceRequestElement = eCommerceRequestDocument.getDocumentElement();
    eCommerceRequestElement.setAttribute("version", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "headVersion", resource, "shipment.dhl.head.version"));
    eCommerceRequestElement.setAttribute("action", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "headAction", resource, "shipment.dhl.head.action"));
    Element requestorRequestElement = UtilXml.addChildElement(eCommerceRequestElement, "Requestor", eCommerceRequestDocument);
    UtilXml.addChildElementValue(requestorRequestElement, "ID", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessUserId", resource, "shipment.dhl.access.userid"),
            eCommerceRequestDocument);
    UtilXml.addChildElementValue(requestorRequestElement, "Password", getShipmentGatewayConfigValue(delegator, shipmentGatewayConfigId, "accessPassword", resource, "shipment.dhl.access.password"),
            eCommerceRequestDocument);
    return eCommerceRequestDocument;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:13,代碼來源:DhlServices.java

示例5: makeXmlDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static Document makeXmlDocument(Collection<GenericValue> values) {
    Document document = UtilXml.makeEmptyXmlDocument("entity-engine-xml");

    if (document == null) return null;

    addToXmlDocument(values, document);
    return document;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:9,代碼來源:GenericEntity.java

示例6: serialize

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static String serialize(Object object) throws SerializeException, FileNotFoundException, IOException {
    Document document = UtilXml.makeEmptyXmlDocument("ofbiz-ser");
    Element rootElement = document.getDocumentElement();

    rootElement.appendChild(serializeSingle(object, document));
    return UtilXml.writeXmlDocument(document);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:8,代碼來源:XmlSerializer.java

示例7: simpleTypeConvertTest

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static void simpleTypeConvertTest(String label, Object toConvert, String type, Object wanted) throws GeneralException {
    basicTest(label, toConvert);
    assertEquals(label + ":null target type", toConvert, simpleTypeConvert(toConvert, null, null, null, null, true));
    assertEquals(label + ":null source object", (Object) null, simpleTypeConvert(null, type, null, null, null, true));
    assertEquals(label, wanted, simpleTypeConvert(toConvert, type, null, null, null, true));
    if (toConvert instanceof String) {
        String str = (String) toConvert;
        Document doc = UtilXml.makeEmptyXmlDocument();
        assertEquals(label + ":text-node proxy", wanted, simpleTypeConvert(doc.createTextNode(str), type, null, null, null, true));
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:12,代碼來源:ObjectTypeTests.java

示例8: createRequestDocument

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
private static Document createRequestDocument(String paymentConfig, Delegator delegator) {

        // EngineDocList
        Document requestDocument = UtilXml.makeEmptyXmlDocument("EngineDocList");
        Element engineDocListElement = requestDocument.getDocumentElement();
        UtilXml.addChildElementValue(engineDocListElement, "DocVersion", "1.0", requestDocument);

        // EngineDocList.EngineDoc
        Element engineDocElement = UtilXml.addChildElement(engineDocListElement, "EngineDoc", requestDocument);
        UtilXml.addChildElementValue(engineDocElement, "ContentType", "OrderFormDoc", requestDocument);

        String sourceId = EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.sourceId", delegator);
        if (UtilValidate.isNotEmpty(sourceId)) {
            UtilXml.addChildElementValue(engineDocElement, "SourceId", sourceId, requestDocument);
        }

        String groupId = EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.groupId", delegator);
        if (UtilValidate.isNotEmpty(groupId)) {
            UtilXml.addChildElementValue(engineDocElement, "GroupId", groupId, requestDocument);
        }

        // EngineDocList.EngineDoc.User
        Element userElement = UtilXml.addChildElement(engineDocElement, "User", requestDocument);
        UtilXml.addChildElementValue(userElement, "Name",
                EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.username", "", delegator), requestDocument);
        UtilXml.addChildElementValue(userElement, "Password",
                EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.password", "", delegator), requestDocument);
        UtilXml.addChildElementValue(userElement, "Alias",
                EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.alias", "", delegator), requestDocument);

        String effectiveAlias = EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.effectiveAlias", delegator);
        if (UtilValidate.isNotEmpty(effectiveAlias)) {
            UtilXml.addChildElementValue(userElement, "EffectiveAlias", effectiveAlias, requestDocument);
        }

        // EngineDocList.EngineDoc.Instructions
        Element instructionsElement = UtilXml.addChildElement(engineDocElement, "Instructions", requestDocument);

        String pipeline = "PaymentNoFraud";
        if (EntityUtilProperties.propertyValueEqualsIgnoreCase(paymentConfig, "payment.clearcommerce.enableFraudShield", "Y", delegator)) {
            pipeline = "Payment";
        }
        UtilXml.addChildElementValue(instructionsElement, "Pipeline", pipeline, requestDocument);

        // EngineDocList.EngineDoc.OrderFormDoc
        Element orderFormDocElement = UtilXml.addChildElement(engineDocElement, "OrderFormDoc", requestDocument);

        // default to "P" for Production Mode
        String mode = EntityUtilProperties.getPropertyValue(paymentConfig, "payment.clearcommerce.processMode", "P", delegator);
        UtilXml.addChildElementValue(orderFormDocElement, "Mode", mode, requestDocument);

        return requestDocument;
    }
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:54,代碼來源:CCPaymentServices.java

示例9: getViewXml

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public String getViewXml(String entityName) throws IOException {
    Document doc = UtilXml.makeEmptyXmlDocument();
    Element viewElement = getViewElement(doc, entityName);
    return UtilXml.writeXmlDocument(viewElement);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:6,代碼來源:DynamicViewEntity.java

示例10: transform

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
@Deprecated
public static Document transform(Map<String, Object> context, Map<String, Object> params)
    throws GeneralException, IOException, TransformerConfigurationException, TransformerException {
    Document outputDocument = null;
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Templates translet = null;
    String templateName = (String)context.get("templateName");
    if (UtilValidate.isNotEmpty(templateName)) {
        translet = xslTemplatesCache.get(templateName);
    }

    if (translet == null) {
        String templateUrl = (String)context.get("templateUrl");
        String templateString = (String)context.get("templateString");
        Document templateDocument = (Document)context.get("templateDocument");
        Source templateSource = getSource(templateDocument, templateUrl, templateString);
        translet = tFactory.newTemplates(templateSource);
        if (UtilValidate.isNotEmpty(templateName)) {
            translet = xslTemplatesCache.putIfAbsentAndGet(templateName, translet);
        }
    }
    if (translet != null) {
        Transformer transformer = translet.newTransformer();
        if (params != null) {
            for (Map.Entry<String, Object> entry: params.entrySet()) {
                   String key = entry.getKey();
                Object val = entry.getValue();
                transformer.setParameter(key, val);
           }
        }

        DOMResult outputResult = new DOMResult(UtilXml.makeEmptyXmlDocument());

        String inputUrl = (String)context.get("inputUrl");
        String inputString = (String)context.get("inputString");
        Document inputDocument = (Document)context.get("inputDocument");
        Source inputSource = getSource(inputDocument, inputUrl, inputString);

        transformer.transform(inputSource, outputResult);
        Node nd = outputResult.getNode();
        outputDocument = (Document)nd;
    }

    return outputDocument;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:46,代碼來源:XslTransform.java

示例11: ResponseHelper

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public ResponseHelper() {
    this.responseDocument = UtilXml.makeEmptyXmlDocument();
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:4,代碼來源:ResponseHelper.java

示例12: serialize

import org.ofbiz.base.util.UtilXml; //導入方法依賴的package包/類
public static String serialize(Object object) throws SerializeException, FileNotFoundException, IOException {
    Document document = UtilXml.makeEmptyXmlDocument("ofbiz-ser");
    Element rootElement = document.getDocumentElement();
    rootElement.appendChild(XmlSerializer.serializeSingle(object, document));
    return UtilXml.writeXmlDocument(document);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:7,代碼來源:SoapSerializer.java


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