Class ImportCockpitUtils


  • public class ImportCockpitUtils
    extends java.lang.Object
    Provides helper methods for the Import cockpit, especially for the mapping.
    • Constructor Detail

      • ImportCockpitUtils

        public ImportCockpitUtils()
    • Method Detail

      • getCatalogVersion

        public static CatalogVersionModel getCatalogVersion​(java.lang.String id,
                                                            java.lang.String version)
        Retrieves the catalog version with the specifies catalog id and version string.
        Parameters:
        id - catalog id
        version -
        Returns:
        the catalog version as a CatalogVersion object
      • isMappingLineForPartOfAttribute

        public static boolean isMappingLineForPartOfAttribute​(MappingLineModel mappingLineModel)
        Checks if the specified mapping mappingLineModel refers to a "part of" attribute. "Part of" attribute objects can exist only within their containing parent object, as a "part" of their parent object. So, such attribute values are not simply "referenced" but "contained". For example, the user's address is a "part of" attribute of the User object. When the User object is deleted, the address is deleted as well.
        Parameters:
        mappingLineModel -
        Returns:
        true if the mapping mappingLineModel refers to a "part of" attribute
      • getPropertyDescriptor

        public static PropertyDescriptor getPropertyDescriptor​(java.lang.String propertyQualifier)
        Parameters:
        propertyQualifier - as String
        Returns:
        PropertyDescriptor, use for generation of mapping mappingLineModel
      • readSecurelyFromXML

        public static <T> T readSecurelyFromXML​(java.io.Reader reader,
                                                java.lang.Class[] rootTypes)
                                         throws javax.xml.bind.JAXBException,
                                                javax.xml.stream.XMLStreamException
        Method allows to prevent XXE (XML External Entity Injection() attacks via xml.
        Type Parameters:
        T - required type of result
        Parameters:
        reader - original non-secured reader
        rootTypes - expected types
        Returns:
        the entity requested
        Throws:
        javax.xml.bind.JAXBException
        javax.xml.stream.XMLStreamException