/*******************************************************************************
 * Copyright (c) 2009 David A Carlson.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     David A Carlson (XMLmodeling.com) - initial API and implementation
 *     
 * $Id$
 *******************************************************************************/
package org.openhealthtools.mdht.uml.cda.dita;

import java.util.List;
import java.util.Vector;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.uml2.uml.Element;
import org.openhealthtools.mdht.uml.cda.dita.internal.Activator;

/**
 *
 */
public class DitaTransformerOptions {

	public static final String INCLUDE_VOCABULARY_CONSTRAINTS = "includeVocabularyConstraints";
	
	private IPath outputPath;
	private boolean includeVocabularyConstraints;
	
	// use Vector for a thread-safe synchronized List
	private List<Element> deletedElementList = new Vector<Element>();

	private List<String> documentList = new Vector<String>();
	private List<String> sectionList = new Vector<String>();
	private List<String> clinicalStatementList = new Vector<String>();
	private List<String> classList = new Vector<String>();
	
	public DitaTransformerOptions() {
		initializePreferences();
	}
	
	private void initializePreferences() {
		Preferences store = Activator.getDefault().getPluginPreferences();

		includeVocabularyConstraints = 
			store.getBoolean(INCLUDE_VOCABULARY_CONSTRAINTS);
	}

	public boolean isIncludeVocabularyConstraints() {
		return includeVocabularyConstraints;
	}

	public void setIncludeVocabularyConstraints(boolean includeVocabularyConstraints) {
		this.includeVocabularyConstraints = includeVocabularyConstraints;
	}

	public IPath getOutputPath() {
		return outputPath;
	}

	public void setOutputPath(IPath path) {
		this.outputPath = path;
		if (!outputPath.hasTrailingSeparator()) {
			outputPath = outputPath.addTrailingSeparator();
		}
	}

	protected List<Element> getDeletedElementList() {
		return deletedElementList;
	}

	protected List<String> getDocumentList() {
		return documentList;
	}

	protected List<String> getSectionList() {
		return sectionList;
	}

	protected List<String> getClinicalStatementList() {
		return clinicalStatementList;
	}

	protected List<String> getClassList() {
		return classList;
	}

}

@@ -751,16 +751,56 @@
 ences;%0D%0A
+import org.eclipse.emf.ecore.EPackage;%0D%0A
 import o
@@ -1125,16 +1125,77 @@
 aints;%0D%0A
+%09private List%3CEPackage%3E ePackages = new Vector%3CEPackage%3E();%0D%0A
 %09%0D%0A%09// u
@@ -2733,11 +2733,415 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09public List%3CEPackage%3E getEPackages() %7B%0D%0A%09%09return ePackages;%0D%0A%09%7D%0D%0A%09%0D%0A%09public void setEPackages(List%3CEPackage%3E packages) %7B%0D%0A%09%09this.ePackages = packages;%0D%0A%09%7D%0D%0A%0D%0A%09public void addEPackage(Class%3CEPackage%3E ePackageClass) %7B%0D%0A%09%09try %7B%0D%0A%09%09%09EPackage ePackage = (EPackage)ePackageClass.getField(%22eINSTANCE%22).get(null);%0D%0A%09%09%09ePackages.add(ePackage);%0D%0A%09%09%7D catch (Exception e) %7B%0D%0A%09%09%09// ignore, leave as null%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A
 %7D%0D%0A

Add DITA parameter for ePackages.