Index: src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java =================================================================== --- src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java (revision 25451) +++ src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java (working copy) @@ -41,11 +41,11 @@ private boolean enabled = true; - private final String exporterId; + private final String exporterFactoryId; - public ExporterFactory(ExporterDefinition definition, String exporterId) { + public ExporterFactory(ExporterDefinition definition, String exporterFactoryId) { this.definition = definition; - this.exporterId = exporterId; + this.exporterFactoryId = exporterFactoryId; inputProperties = new HashMap(); } @@ -93,7 +93,7 @@ if(configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, (List)null)==null) { enabled = configuration.getAttribute( getId(), false ); } else { - enabled = configuration.getAttribute(ExporterAttributes.getLaunchAttributePrefix(getId()), false); + enabled = configuration.getAttribute(getId(), false); } } catch(CoreException ce) { // ignore; assume false @@ -109,7 +109,7 @@ if(oldSettings) { configuration.setAttribute( getId(), isEnabled() ); } else { - configuration.setAttribute(ExporterAttributes.getLaunchAttributePrefix(getId()), isEnabled()); + configuration.setAttribute(getId(), isEnabled()); } } @@ -134,7 +134,7 @@ } public String getId() { - return exporterId; + return exporterFactoryId; } public String getExporterTag() { @@ -180,14 +180,12 @@ */ public boolean collectOutputDirectories(String defOutDir, final Properties globalProps, Set outputDirs) throws CoreException { - Properties extract = new Properties(); Properties props = new Properties(); props.putAll(globalProps); props.putAll(getProperties()); - extractExporterProperties(exporterId, props, extract); String outputPath = defOutDir; - if (extract.containsKey(ExporterFactoryStrings.OUTPUTDIR)) { - outputPath = extract.getProperty(ExporterFactoryStrings.OUTPUTDIR); + if (props.containsKey(ExporterFactoryStrings.OUTPUTDIR)) { + outputPath = props.getProperty(ExporterFactoryStrings.OUTPUTDIR); } String resolvedOutputDir = resolve(outputPath); String loc = PathHelper.getLocationAsStringPath(resolvedOutputDir); @@ -216,7 +214,7 @@ exporter.setProperties(props); exporter.setArtifactCollector(collector); - extractExporterProperties(exporterId, props, extract); + extractExporterProperties(getExporterDefinitionId(), props, extract); String outputPath = defaultOutputDirectory; if (extract.containsKey(ExporterFactoryStrings.OUTPUTDIR)) { @@ -278,20 +276,20 @@ } exporter.setTemplatePath(templatePathList.toArray(new String[templatePathList.size()])); // special handling for GenericExporter (TODO: be delegated via plugin.xml) - if (exporterId.equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$ + if (getExporterDefinitionId().equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$ GenericExporter ge = (GenericExporter) exporter; ge.setFilePattern(extract.getProperty(ExporterFactoryStrings.FILE_PATTERN)); ge.setTemplateName(extract.getProperty(ExporterFactoryStrings.TEMPLATE_NAME)); ge.setForEach(extract.getProperty(ExporterFactoryStrings.FOR_EACH)); } // special handling for Hbm2DDLExporter - if (exporterId.equals("org.hibernate.tools.hbm2ddl")) { //$NON-NLS-1$ + if (getExporterDefinitionId().equals("org.hibernate.tools.hbm2ddl")) { //$NON-NLS-1$ Hbm2DDLExporter ddlExporter = (Hbm2DDLExporter) exporter; //avoid users to delete their databases with a single click ddlExporter.setExport(Boolean.getBoolean(extract.getProperty(ExporterFactoryStrings.EXPORTTODATABASE))); } // special handling for QueryExporter - if (exporterId.equals("org.hibernate.tools.query")) { //$NON-NLS-1$ + if (getExporterDefinitionId().equals("org.hibernate.tools.query")) { //$NON-NLS-1$ QueryExporter queryExporter = (QueryExporter) exporter; List queryStrings = new ArrayList(); queryStrings.add(extract.getProperty(ExporterFactoryStrings.QUERY_STRING)); @@ -310,7 +308,7 @@ * @throws CoreException */ public static void extractExporterProperties( - String exporterId, Properties props, Properties extract) throws CoreException { + String exporterDefId, Properties props, Properties extract) throws CoreException { if (props.containsKey(ExporterFactoryStrings.OUTPUTDIR)) { extract.put(ExporterFactoryStrings.OUTPUTDIR, resolve(props.getProperty(ExporterFactoryStrings.OUTPUTDIR))); // done to avoid validation check in hibernate tools templates @@ -321,7 +319,7 @@ // done to avoid validation check in hibernate tools templates props.remove(ExporterFactoryStrings.TEMPLATE_PATH); } - if (exporterId.equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$ + if (exporterDefId.equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$ String tmp; if (props.containsKey(ExporterFactoryStrings.FILE_PATTERN)) { tmp = props.getProperty(ExporterFactoryStrings.FILE_PATTERN, ""); //$NON-NLS-1$ @@ -340,12 +338,12 @@ } } // special handling for Hbm2DDLExporter - if (exporterId.equals("org.hibernate.tools.hbm2ddl")) { //$NON-NLS-1$ + if (exporterDefId.equals("org.hibernate.tools.hbm2ddl")) { //$NON-NLS-1$ extract.put(ExporterFactoryStrings.EXPORTTODATABASE, props.getProperty(ExporterFactoryStrings.EXPORTTODATABASE, Boolean.toString(false))); props.remove(ExporterFactoryStrings.EXPORTTODATABASE); } // special handling for QueryExporter - if (exporterId.equals("org.hibernate.tools.query")) { //$NON-NLS-1$ + if (exporterDefId.equals("org.hibernate.tools.query")) { //$NON-NLS-1$ String tmp; if (props.containsKey(ExporterFactoryStrings.QUERY_STRING)) { tmp = props.getProperty(ExporterFactoryStrings.QUERY_STRING, ""); //$NON-NLS-1$ Index: src/org/hibernate/eclipse/launch/ExporterAttributes.java =================================================================== --- src/org/hibernate/eclipse/launch/ExporterAttributes.java (revision 25451) +++ src/org/hibernate/eclipse/launch/ExporterAttributes.java (working copy) @@ -130,18 +130,18 @@ Map exDefinitions = ExtensionManager.findExporterDefinitionsAsMap(); List factories = new ArrayList(); - for (String exporterId : exporterNames) { - String extensionId = configuration.getAttribute(getLaunchAttributePrefix(exporterId) + ".extension_id", (String)null); //$NON-NLS-1$ + for (String exporterFactoryId : exporterNames) { + String extensionId = configuration.getAttribute(exporterFactoryId + ".extension_id", (String)null); //$NON-NLS-1$ ExporterDefinition expDef = exDefinitions.get(extensionId); if(expDef==null) { String out = NLS.bind(HibernateConsoleMessages.ExporterAttributes_could_not_locate_exporter_for_in, extensionId, configuration.getName()); throw new HibernateConsoleRuntimeException(out); } else { - ExporterFactory exporterFactory = new ExporterFactory( expDef, exporterId ); + ExporterFactory exporterFactory = new ExporterFactory( expDef, exporterFactoryId ); exporterFactory.isEnabled( configuration ); factories.add( exporterFactory ); - Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId()) + Map props = configuration.getAttribute( exporterFactory.getId() + ".properties", new HashMap() ); //$NON-NLS-1$ exporterFactory.setProperties( props ); } @@ -158,7 +158,7 @@ ExporterFactory exporterFactory = new ExporterFactory( expDef, expDef.getId() ); exporterFactory.isEnabled( configuration ); factories.add( exporterFactory ); - Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId()) + Map props = configuration.getAttribute( exporterFactory.getId() + ".properties", new HashMap() ); //$NON-NLS-1$ exporterFactory.setProperties( props ); } @@ -174,9 +174,9 @@ List names = new ArrayList(); for (ExporterFactory ef : exporterFactories) { - configuration.setAttribute(getLaunchAttributePrefix(ef.getId()) + ".extension_id", ef.getExporterDefinition().getId()); //$NON-NLS-1$ + configuration.setAttribute(ef.getId() + ".extension_id", ef.getExporterDefinition().getId()); //$NON-NLS-1$ boolean enabled = enabledExporters.contains( ef ); - String propertiesId = getLaunchAttributePrefix(ef.getId()) + ".properties"; //$NON-NLS-1$ + String propertiesId = ef.getId() + ".properties"; //$NON-NLS-1$ names.add(ef.getId()); ef.setEnabled( configuration, enabled, false ); Index: src/org/hibernate/eclipse/launch/ExporterSettingsTab.java =================================================================== --- src/org/hibernate/eclipse/launch/ExporterSettingsTab.java (revision 25451) +++ src/org/hibernate/eclipse/launch/ExporterSettingsTab.java (working copy) @@ -425,13 +425,13 @@ duplicate = false; initialCount++; for (ExporterFactory def : observableFactoryList.getList()) { - if(def.getId().equals(""+initialCount)) { //$NON-NLS-1$ + if(def.getId().equals(expDef.getId()+initialCount)) { duplicate = true; } } } while(duplicate); - String initialName = "" + initialCount; //$NON-NLS-1$ + String initialName = expDef.getId() + initialCount; ExporterFactory exporterFactory = new ExporterFactory( expDef, initialName ); observableFactoryList.add(exporterFactory);