private void init(IFile file) throws AmlUIException {
    IProject project = file.getProject();
    File propertiesFile =
        org.eclipse.gmt.weaver.plugin.util.WeaverUtil.getPropertyFilePath(file).toFile();

    // Config file

    try {
      InputStream in = AmlUIResourceManager.getDefault().getAmlFile(project).getContents();
      IModel[] amlAndProblemModels = AmlCompiler.getDefault().injectAMLTextFile(in);
      IModel amlInjected = amlAndProblemModels[0];
      // TODO centralize the logging of aml file problems
      String metametamodel =
          (String) AmlModelUtils.getDefault().getMatchingMetametamodel(amlInjected);

      String resPath = AmlUIResourceManager.getDefault().getPath(file);
      EMFModel equalModel =
          AmlResourceManager.getDefault()
              .loadModel(resPath, AmlResourceManager.getDefault().getEqualMetamodel());
      WeaverXMLMetadata xml = new WeaverXMLMetadata(propertiesFile);
      xml.createXMLConfigFile(
          getModelInfos(equalModel, metametamodel, project.getName()),
          file.getFullPath().toString(),
          weavingPanel,
          EqualModelUtils.wmodel,
          Collections.EMPTY_LIST,
          Collections.EMPTY_LIST,
          ResourceUtils.getPathWithSeparator(
              project.getFullPath().toString(),
              AmlResourceManager.metamodelsFolderName,
              AmlResourceManager.equalMMName));
      IContainer fileContainer = file.getParent();
      fileContainer.refreshLocal(IResource.DEPTH_ONE, null);
    } catch (ATLCoreException e) {
      // TODO Auto-generated catch block
      throw new AmlUIException(IStatus.ERROR, "The equal model cannot be loaded");
    } catch (Exception e) {
      // TODO Auto-generated catch block
      throw new AmlUIException(IStatus.ERROR, e);
    }
  }