Search in sources :

Example 26 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class SoapkitFault method migrateFaultType.

private void migrateFaultType(Element element, MigrationReport report) {
    final Attribute faultType = element.getAttribute("faultType");
    if (faultType != null) {
        final String faultTypeValue = faultType.getValue();
        final String[] split = faultTypeValue.split("\\|\\|");
        if (split.length <= 0)
            throw new RuntimeException("Error parsing 'faultType' value");
        final String faultValue;
        final String operationValue;
        if (split.length == 1) {
            report.report(WARN, element, element.getParentElement(), "Cannot find value for 'operation'");
            operationValue = "";
            faultValue = split[0];
        } else {
            if (split.length > 2)
                report.report(WARN, element, element.getParentElement(), "fault type shouldn't have more than two partes '<Operation>||<FaultType>'. Some data could be lost after migration");
            operationValue = split[0];
            faultValue = split[1];
        }
        element.setAttribute("operation", operationValue);
        element.setAttribute("fault", faultValue);
        element.removeAttribute(faultType);
    }
}
Also used : Attribute(org.jdom2.Attribute)

Example 27 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class GatewayMigrationStep method removeSchemaLocationNamespace.

protected void removeSchemaLocationNamespace(Element root, String mule3Uri, String mule4Uri) {
    Attribute attr = getXSIAttribute(root);
    String uri = attr.getValue();
    if (uri.contains(mule4Uri)) {
        attr.setValue(uri.replace(mule3Uri, EMPTY));
    } else {
        attr.setValue(uri.replace(mule3Uri, mule4Uri));
    }
}
Also used : Attribute(org.jdom2.Attribute)

Example 28 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class GatewayMigrationStep method getXSIAttribute.

protected Attribute getXSIAttribute(Element element) {
    if (element == null) {
        return new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE);
    }
    if (element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE) == null) {
        Attribute attr = new Attribute(SCHEMA_LOCATION, MULE_4_XSI_SCHEMA_LOCATION_URI, XSI_NAMESPACE);
        element.setAttribute(attr);
        return attr;
    }
    return element.getAttribute(SCHEMA_LOCATION, XSI_NAMESPACE);
}
Also used : Attribute(org.jdom2.Attribute)

Example 29 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class GatewayMigrationStep method replaceSchemaLocationNamespace.

protected void replaceSchemaLocationNamespace(Element root, String mule3UriXsd, String mule4UriXsd, String mule3Uri, String mule4Uri) {
    Attribute attr = getXSIAttribute(root);
    setUriValue(attr, attr.getValue(), mule3UriXsd, mule4UriXsd);
    setUriValue(attr, attr.getValue(), mule3Uri, mule4Uri);
}
Also used : Attribute(org.jdom2.Attribute)

Example 30 with Attribute

use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.

the class PolicyMigrationStep method completeMule4Element.

private void completeMule4Element(Element element) {
    Element root = getRootElement(element);
    root.addNamespaceDeclaration(HTTP_POLICY_NAMESPACE);
    Attribute attr = getXSIAttribute(root);
    final String uri = attr.getValue();
    attr.setValue(new StringBuilder(uri).append(SPACE).append(HTTP_POLICY_XSI_URI).toString());
}
Also used : Attribute(org.jdom2.Attribute) Element(org.jdom2.Element)

Aggregations

Attribute (org.jdom2.Attribute)316 Element (org.jdom2.Element)210 Attribute (ucar.nc2.Attribute)65 IOException (java.io.IOException)55 ArrayList (java.util.ArrayList)51 Document (org.jdom2.Document)43 Variable (ucar.nc2.Variable)39 List (java.util.List)31 HashMap (java.util.HashMap)25 Namespace (org.jdom2.Namespace)24 File (java.io.File)21 Array (ucar.ma2.Array)21 DataConversionException (org.jdom2.DataConversionException)19 Test (org.junit.Test)19 Dimension (ucar.nc2.Dimension)19 Map (java.util.Map)17 JDOMException (org.jdom2.JDOMException)16 XmlDslUtils.addMigrationAttributeToElement (com.mulesoft.tools.migration.step.util.XmlDslUtils.addMigrationAttributeToElement)15 Editor (jmri.jmrit.display.Editor)15 NamedIcon (jmri.jmrit.catalog.NamedIcon)13