@Override
  public void prepareLocalizedFieldsForImport(Locale defaultImportLocale) throws LocaleException {

    super.prepareLocalizedFieldsForImport(defaultImportLocale);

    Locale ddmStructureDefaultLocale = LocaleUtil.fromLanguageId(getDefaultLanguageId());

    try {
      setXsd(
          DDMXMLUtil.updateXMLDefaultLocale(
              getXsd(), ddmStructureDefaultLocale, defaultImportLocale));
    } catch (Exception e) {
      throw new LocaleException(e);
    }
  }
  protected void addDDMStructures(
      long userId, long groupId, long classNameId, String fileName, ServiceContext serviceContext)
      throws Exception {

    List<Element> structureElements = getDDMStructures(fileName);

    for (Element structureElement : structureElements) {
      boolean dynamicStructure =
          GetterUtil.getBoolean(structureElement.elementText("dynamic-structure"));

      if (dynamicStructure) {
        continue;
      }

      String name = structureElement.elementText("name");

      String description = structureElement.elementText("description");

      String ddmStructureKey = name;

      DDMStructure ddmStructure =
          DDMStructureLocalServiceUtil.fetchStructure(groupId, ddmStructureKey);

      if (ddmStructure != null) {
        continue;
      }

      Element structureElementRootElement = structureElement.element("root");

      String xsd = structureElementRootElement.asXML();

      Map<Locale, String> nameMap = new HashMap<Locale, String>();

      nameMap.put(LocaleUtil.getDefault(), name);

      Map<Locale, String> descriptionMap = new HashMap<Locale, String>();

      descriptionMap.put(LocaleUtil.getDefault(), description);

      Attribute defaultLocaleAttribute = structureElementRootElement.attribute("default-locale");

      Locale ddmStructureDefaultLocale =
          LocaleUtil.fromLanguageId(defaultLocaleAttribute.getValue());

      xsd =
          DDMXMLUtil.updateXMLDefaultLocale(
              xsd, ddmStructureDefaultLocale, LocaleUtil.getDefault());

      DDMStructureLocalServiceUtil.addStructure(
          userId,
          groupId,
          classNameId,
          ddmStructureKey,
          nameMap,
          descriptionMap,
          xsd,
          "xml",
          DDMStructureConstants.TYPE_DEFAULT,
          serviceContext);
    }
  }