New plugin to import data from EPF Composer added
diff --git a/org.eclipse.opencert.lines/.classpath b/org.eclipse.opencert.lines/.classpath
new file mode 100644
index 0000000..b862a29
--- /dev/null
+++ b/org.eclipse.opencert.lines/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.opencert.lines/.gitignore b/org.eclipse.opencert.lines/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/org.eclipse.opencert.lines/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/org.eclipse.opencert.lines/.project b/org.eclipse.opencert.lines/.project
new file mode 100644
index 0000000..df575e6
--- /dev/null
+++ b/org.eclipse.opencert.lines/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.opencert.lines</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.opencert.lines/META-INF/MANIFEST.MF b/org.eclipse.opencert.lines/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..11b560e
--- /dev/null
+++ b/org.eclipse.opencert.lines/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Lines
+Bundle-SymbolicName: org.eclipse.opencert.lines;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.opencert.lines.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.epf.library.xmi;bundle-version="1.5.0",
+ org.eclipse.epf.library.ui;bundle-version="1.5.0",
+ org.eclipse.epf.common.ui;bundle-version="1.5.0",
+ org.eclipse.epf.publishing;bundle-version="1.5.0",
+ org.eclipse.epf.authoring.ui;bundle-version="1.5.0",
+ org.eclipse.epf.library.edit.ui;bundle-version="1.5.0",
+ org.eclipse.epf.export
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.opencert.lines/build.properties b/org.eclipse.opencert.lines/build.properties
new file mode 100644
index 0000000..4b8162a
--- /dev/null
+++ b/org.eclipse.opencert.lines/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
diff --git a/org.eclipse.opencert.lines/icons/Process.gif b/org.eclipse.opencert.lines/icons/Process.gif
new file mode 100644
index 0000000..0eac59f
--- /dev/null
+++ b/org.eclipse.opencert.lines/icons/Process.gif
Binary files differ
diff --git a/org.eclipse.opencert.lines/icons/Reporting.gif b/org.eclipse.opencert.lines/icons/Reporting.gif
new file mode 100644
index 0000000..a38cc8a
--- /dev/null
+++ b/org.eclipse.opencert.lines/icons/Reporting.gif
Binary files differ
diff --git a/org.eclipse.opencert.lines/icons/WebPublish.gif b/org.eclipse.opencert.lines/icons/WebPublish.gif
new file mode 100644
index 0000000..76dcf0f
--- /dev/null
+++ b/org.eclipse.opencert.lines/icons/WebPublish.gif
Binary files differ
diff --git a/org.eclipse.opencert.lines/icons/full/wizban/PublishConfiguration.gif b/org.eclipse.opencert.lines/icons/full/wizban/PublishConfiguration.gif
new file mode 100644
index 0000000..e249831
--- /dev/null
+++ b/org.eclipse.opencert.lines/icons/full/wizban/PublishConfiguration.gif
Binary files differ
diff --git a/org.eclipse.opencert.lines/plugin.xml b/org.eclipse.opencert.lines/plugin.xml
new file mode 100644
index 0000000..73767ec
--- /dev/null
+++ b/org.eclipse.opencert.lines/plugin.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ name="Sample Category"
+ id="org.eclipse.amass.lines.commands.category">
+ </category>
+ <command
+ name="Seamless Integration between EPF Composer and BVR Tool"
+ categoryId="org.eclipse.amass.lines.commands.category"
+ id="org.eclipse.amass.lines.commands.processCommand">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ commandId="org.eclipse.amass.lines.commands.processCommand"
+ class="org.eclipse.amass.lines.handlers.LinesHandler">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.amass.lines.commands.processCommand"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+Q">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:org.eclipse.ui.main.menu?after=additions">
+ <menu
+ label="Process Lines"
+ mnemonic="M"
+ id="org.eclipse.amass.lines.menus.sampleMenu">
+ <command
+ commandId="org.eclipse.amass.lines.commands.processCommand"
+ mnemonic="S"
+ icon="icons/Process.gif"
+ id="org.eclipse.amass.lines.menus.processCommand">
+ </command>
+ </menu>
+ </menuContribution>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Activator.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Activator.java
new file mode 100644
index 0000000..c2146f5
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Activator.java
@@ -0,0 +1,61 @@
+package org.eclipse.opencert.lines;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.amass.lines"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Resources.properties b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Resources.properties
new file mode 100644
index 0000000..1ff17af
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/Resources.properties
@@ -0,0 +1,22 @@
+# Open Method Library Wizard
+openLibraryWizard_title=Seamless Integration between EPF Composer and BVR Tool
+openLibraryWizardPage_title=The Wizard Performs Two Tasks: (i) Copies a Method Library; and \n(ii) Resolves Problems with the XMI Files
+
+openLibraryMainWizardPage_title=Specify a path containing a method library
+openLibraryMainWizardPage_title_2=Select a method library
+
+pathLabel_text=Path:
+nameLabel_text=Name:
+uriLabel_text=URI:
+openUnlistedLibraryCheckbox_text=Open a method library that is not listed above
+libraryTypeLabel_text=Type:
+libraryLabel_text=Library:
+browseButton_text=Browse...
+openLibraryDialog_newLibrary_text=No method library exists at ''{0}''.\nA new method library will be created and opened for you at the specified directory.\n\nClick OK to proceed or Cancel to specify another method library path.
+convertToSynProcessLib_msg=Convert to auto-synchronized library
+
+# Open Method Library Error Dialog
+openLibraryError_msg=IUPL0301E: Unable to create the method library.
+openLibraryInternlError_reason=An internal error has occurred.
+openLibraryError_reason4=The specified method library folder is a plug-in or configuration specification export folder.
+openLibraryError_advice=Select OK to specify another method library path.
\ No newline at end of file
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/UIResources.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/UIResources.java
new file mode 100644
index 0000000..10bd710
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/UIResources.java
@@ -0,0 +1,59 @@
+package org.eclipse.opencert.lines;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * UI resources.
+ *
+ */
+public class UIResources extends NLS {
+
+ private static String BUNDLE_NAME = UIResources.class.getPackage()
+ .getName()
+ + ".Resources"; //$NON-NLS-1$
+
+ public static String pathLabel_text;
+ public static String browseButton_text;
+
+ public static String openLibraryWizard_title;
+ public static String openLibraryWizardPage_title;
+ public static String openLibraryMainWizardPage_title;
+ public static String openLibraryMainWizardPage_title_2;
+ public static String openLibraryDialog_newLibrary_text;
+
+ public static String nameLabel_text;
+ public static String uriLabel_text;
+ public static String openUnlistedLibraryCheckbox_text;
+ public static String libraryTypeLabel_text;
+ public static String libraryLabel_text;
+
+ public static String openLibraryError_msg;
+ public static String versionMismatchDialog_text;
+ public static String versionMismatchDialog_text_unknown;
+
+ public static String openLibraryError_advice;
+ public static String openLibraryError_reason4;
+ public static String openLibraryInternlError_reason;
+
+ public static String convertToSynProcessLib_msg;
+ public static String upgradeLibraryDialog_text;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, UIResources.class);
+ }
+
+ /**
+ * Returns the localized string associated with a resource key and formatted
+ * with a given object.
+ *
+ * @param key
+ * A resource key.
+ * @param data
+ * An object.
+ * @return A formatted localized string.
+ */
+ public static String bind(String key, Object data) {
+ return NLS.bind(key, new Object[] { data });
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/actions/OpenLibraryAction.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/actions/OpenLibraryAction.java
new file mode 100644
index 0000000..7790a8b
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/actions/OpenLibraryAction.java
@@ -0,0 +1,57 @@
+package org.eclipse.opencert.lines.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.opencert.lines.wizards.OpenWizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Invokes the Publish Method Configuration wizard.
+ *
+ * @author Kelvin Low
+ * @author Jinhua Xi
+ * @since 1.0
+ */
+public class OpenLibraryAction implements IWorkbenchWindowActionDelegate {
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ try {
+ OpenWizard wizard = new OpenWizard();
+ wizard.init(PlatformUI.getWorkbench(), null);
+
+ // Instantiate the wizard container with the wizard and open it.
+ WizardDialog dialog = new WizardDialog(Display.getCurrent()
+ .getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+ } catch (Exception e) {
+
+ }
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ /**
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ }
+
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/handlers/LinesHandler.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/handlers/LinesHandler.java
new file mode 100644
index 0000000..be9405e
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/handlers/LinesHandler.java
@@ -0,0 +1,63 @@
+package org.eclipse.opencert.lines.handlers;
+
+import java.io.File;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.epf.export.services.PluginExportService;
+import org.eclipse.epf.library.LibraryService;
+import org.eclipse.epf.library.project.MethodLibraryProject;
+import org.eclipse.epf.uma.MethodLibrary;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.opencert.lines.resolving.DoResolve;
+import org.eclipse.opencert.lines.wizards.OpenWizard;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Our sample handler extends AbstractHandler, an IHandler base class.
+ * @see org.eclipse.core.commands.IHandler
+ * @see org.eclipse.core.commands.AbstractHandler
+ */
+public class LinesHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) {
+
+ OpenWizard wizard = new OpenWizard();
+ wizard.init(PlatformUI.getWorkbench(), null);
+
+ // Instantiate the wizard container with the wizard and open it.
+ WizardDialog dialog = new WizardDialog(Display.getCurrent()
+ .getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ MethodLibrary library = LibraryService.getInstance().getCurrentMethodLibrary();
+ String libPath = LibraryService.getInstance().getCurrentMethodLibraryLocation();
+ String copyPath = libPath+"\\"+"error_free_models";
+
+ File targetFile = new File(copyPath);
+ if(!targetFile.exists()){
+ PluginExportService.copyDir(new File(libPath), new File(copyPath));
+ try {
+ DoResolve.Resolve(copyPath);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ IProject project = MethodLibraryProject.findProject(library);
+ try {
+ project.refreshLocal(IResource.FOLDER, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/DoResolve.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/DoResolve.java
new file mode 100644
index 0000000..cda7880
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/DoResolve.java
@@ -0,0 +1,317 @@
+package org.eclipse.opencert.lines.resolving;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+
+import java.util.List;
+import java.util.Stack;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.Element;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.epf.common.utils.FileUtil;
+import org.eclipse.epf.common.utils.StrUtil;
+import org.eclipse.epf.common.utils.XMLUtil;
+import org.eclipse.epf.library.LibraryService;
+import org.eclipse.epf.library.project.MethodLibraryProject;
+import org.eclipse.epf.uma.MethodLibrary;
+import org.eclipse.opencert.lines.resolving.LibraryDocument;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.TransformerException;
+
+public class DoResolve {
+
+ public static final String libraryFile = "library.xmi";
+ final static Pattern p = Pattern.compile(
+ "uma://(.*?)#(.*?)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
+
+ protected static List<File> fileList = new ArrayList<File>();
+
+ protected static Document document;
+ protected static LibraryDocument libDocument;
+
+ private static Stack<File> xmiStack = new Stack<File>();
+ private static List<String> capabilitypatterns = new ArrayList<String>();
+ private static HashMap<String, String> idToUriMap = new HashMap<String, String>();
+ private static HashMap<String, String> platformResourcePath = new HashMap<String, String>();
+
+ public static void Resolve(String dirPath) throws Exception {
+
+ String filePath = dirPath + "/library.xmi";
+ GetAllXMIFiles(new File(dirPath), fileList, true);
+
+ if (!dirPath.equals(filePath)) {
+ libDocument = new LibraryDocument(new File(filePath));
+ libDocument.init();
+
+ NodeList nodes = libDocument.getResourceDescriptors();
+ ResourceDescriptors(filePath, nodes);
+
+ document = XMLUtil.loadXml(new File(filePath));
+ Element root = document.getDocumentElement();
+ Uris(filePath, root.getElementsByTagName("subManagers"));
+ Uris(filePath, root.getElementsByTagName("methodPlugins"));
+
+ }
+
+ while(!xmiStack.isEmpty()){
+ File xmiFile = xmiStack.pop();
+ document = XMLUtil.loadXml(xmiFile);
+
+ String path = xmiFile.getAbsolutePath();
+ Element root = document.getDocumentElement();
+
+ NodeList nodes = root.getElementsByTagName("resourceDescriptors");
+ ResourceDescriptors(path, nodes);
+
+ if(xmiFile.getName().matches("plugin.xmi")){
+ ResolvePluginReferences(path, root);
+ }else if(xmiFile.getName().matches("model.xmi")){
+ ResolveModelReferences(path, root);
+ }
+ }
+ ResolveConfigurationReferences(dirPath +"/configurations");
+ }
+
+ public static void ResolvePluginReferences(String path, Element root) throws Exception{
+
+ Uris(path, root.getElementsByTagName("subManagers"));
+ Uris(path, root.getElementsByTagName("presentation"));
+ Uris(path, root.getElementsByTagName("categorizedElements"));
+
+ ChildUris(path, root.getElementsByTagName("methodPackages"));
+
+ PlatformResourcePaths(path, root.getElementsByTagName("bases"));
+ PlatformResourcePaths(path, root.getElementsByTagName("activityReferences"));
+ PlatformResourcePaths(path, root.getElementsByTagName("variabilityBasedOnElement"));
+ }
+
+ public static void ResolveModelReferences(String path, Element root) throws Exception{
+ Uris(path, root.getElementsByTagName("presentation"));
+ Uris(path, root.getElementsByTagName("includesPatterns"));
+ Uris(path, root.getElementsByTagName("variabilityBasedOnElement"));
+ Uris(path, root.getElementsByTagName("includesPatterns"));
+
+ PlatformResourcePaths(path, root.getElementsByTagName("Task"));
+ PlatformResourcePaths(path, root.getElementsByTagName("Role"));
+ PlatformResourcePaths(path, root.getElementsByTagName("WorkProduct"));
+ PlatformResourcePaths(path, root.getElementsByTagName("toolmentor"));
+
+ PlatformResourcePaths(path, root.getElementsByTagName("selectedSteps"));
+ }
+
+ public static void ResolveConfigurationReferences(String configPath) throws Exception{
+ List<File> configs = new ArrayList<File>();
+ FileUtil.getAllFiles(new File(configPath), configs, true);
+
+ for(int i=0; i<configs.size(); i++){
+ document = XMLUtil.loadXml(configs.get(i));
+ String path = configs.get(i).getAbsolutePath();
+ Element root = document.getDocumentElement();
+
+ PlatformResourcePaths(path, root.getElementsByTagName("processViews"));
+ PlatformResourcePaths(path, root.getElementsByTagName("methodPluginSelection"));
+ PlatformResourcePaths(path, root.getElementsByTagName("methodPackageSelection"));
+ }
+ }
+
+ public static void ResourceDescriptors(String filePath, NodeList nodes) throws Exception{
+ String pathName = null;
+ for (int i = 0; i < nodes.getLength(); i++ ) {
+ Element node = (Element) nodes.item(i);
+
+ String normalizedPath = filePath.replace('\\', '/');
+ String id = node.getAttribute("id");
+ String uri = node.getAttribute("uri");
+
+ if (!uri.isEmpty()) {
+ idToUriMap.put(id, uri);
+
+ int pathIndex = normalizedPath.lastIndexOf("/"); //$NON-NLS-1$
+ if (pathIndex > 0) {
+ String dir = normalizedPath.substring(0, pathIndex);
+ pathName = StrUtil.replace(dir + "/"+uri+"", "%20", " ");
+
+ File xmiFile = new File(pathName);
+ xmiStack.push(xmiFile);
+
+ if (pathName.contains("capabilitypatterns")){
+ capabilitypatterns.add(pathName);
+ }
+ }
+ }
+ }
+ }
+
+ public static void Uris(String filePath, NodeList nodes){
+ for (int i = 0; i < nodes.getLength(); i++ ) {
+ Element node = (Element) nodes.item(i);
+
+ String href = node.getAttribute("href");
+
+ Matcher m = p.matcher(href);
+ if (m.find()) {
+ int index = href.indexOf("#");
+ if (index > 0) {
+ String uri = (String)idToUriMap.get(m.group(1));
+ String bindId = href.substring(index + 0);
+
+ if(uri.contains("%20")){
+ uri = StrUtil.replace(uri, "%20", " ");
+ }
+
+ if(uri.startsWith("capabilitypatterns")){
+ PlatformResourcePaths(filePath, nodes);
+ }else{
+ transform(filePath, node, uri+bindId);
+ }
+ }
+ }
+ }
+ }
+
+ public static void ChildUris(String filePath, NodeList nodes){
+ for (int i = 0; i < nodes.getLength(); i++ ) {
+ Element node = (Element) nodes.item(i);
+ NodeList childNodes = node.getElementsByTagName("childPackages");
+ for (int j = 0; j < childNodes.getLength(); j++ ) {
+ Element childNode = (Element) childNodes.item(j);
+ String href = childNode.getAttribute("href");
+
+ Matcher m = p.matcher(href);
+ if (m.find()) {
+ int index = href.indexOf("#");
+ if (index > 0) {
+ String uri = (String)idToUriMap.get(m.group(1));
+ String bindId = href.substring(index + 0);
+ transform(filePath, childNode, uri+bindId);
+ }
+ }
+
+ }
+ }
+ }
+
+ public static void PlatformResourcePaths(String filePath, NodeList nodes){
+ for (int i = 0; i < nodes.getLength(); i++ ) {
+ Element node = (Element) nodes.item(i);
+
+ String href = node.getAttribute("href");
+ Matcher m = p.matcher(href);
+ if (m.find()) {
+ int index = href.indexOf("#");
+ if (index > 0) {
+ String uri = (String)platformResourcePath.get(m.group(1));
+
+ String bindId = href.substring(index + 0);
+ if(uri.contains("%20")){
+ uri = StrUtil.replace(uri, "%20", " ");
+ }
+ transform(filePath, node, uri+bindId);
+ }
+ }
+ }
+ }
+
+ public static void transform(String filePath, Node node, String nodeValue) {
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer;
+
+ try {
+ transformer = factory.newTransformer();
+ for (int i = 0; i < node.getAttributes().getLength(); i++) {
+
+ Node item = node.getAttributes().item(i);
+ if(node.getAttributes().item(i).getNodeName().equals("href")){
+ item.setNodeValue(nodeValue);
+
+ OutputStreamWriter writer = new OutputStreamWriter(
+ new FileOutputStream(new File(filePath)), "utf-8");
+
+ transformer.setParameter("href", nodeValue);
+ Source input = new DOMSource(document);
+ Result output = new StreamResult(new File(filePath));
+
+ transformer.transform(input, output);
+
+ writer.flush();
+ writer.close();
+ }
+
+ }
+ } catch (IOException | TransformerException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void GetAllXMIFiles(File path, List<File> fileList,
+ boolean recursive) throws Exception {
+ if (path.isDirectory()) {
+ File[] files = path.listFiles();
+ if (files != null) {
+ for (int i = 0; i < files.length; i++) {
+ if (files[i].isFile()) {
+ String name = files[i].getName();
+ if (name.lastIndexOf(".") != -1)
+ if (name
+ .substring(name.lastIndexOf(".") + 1).matches("xmi")) {
+ fileList.add(files[i]);
+ GetResourcePaths(files[i], "org.eclipse.epf.uma:MethodPlugin");
+ GetResourcePaths(files[i], "org.eclipse.epf.uma:ProcessComponent");
+
+ String absPath = path.getAbsolutePath();
+ if(absPath.substring(absPath.lastIndexOf("\\") + 1).matches("tasks")){
+ GetResourcePaths(files[i], "org.eclipse.epf.uma:TaskDescription");
+ }
+ }
+ } else if (recursive) {
+ GetAllXMIFiles(files[i], fileList, recursive);
+ }
+ }
+ }
+ }
+ }
+
+ public static void GetResourcePaths(File file, String tag) throws Exception{
+ document = XMLUtil.loadXml(file);
+
+ MethodLibrary library = LibraryService.getInstance().getCurrentMethodLibrary();
+ IProject project = MethodLibraryProject.findProject(library);
+ IPath path = project.getFullPath();
+
+ Element root = document.getDocumentElement();
+ String filePath = file.getAbsolutePath();
+ String normalizedPath = filePath.replace('\\', '/');
+
+ int projIndex = normalizedPath.indexOf("/error_free_models");
+ String platformPath = "platform:/resource"+path.toString()+normalizedPath
+ .substring(projIndex + 0);
+
+ if (!root.toString().contains(tag)){
+ NodeList nodes = root.getElementsByTagName(tag);
+ for (int j = 0; j < nodes.getLength(); j++ ) {
+ Element node = (Element) nodes.item(j);
+ String processId = node.getAttribute("xmi:id");
+ platformResourcePath.put(processId, platformPath);
+ }
+ }else{
+ String processId = root.getAttribute("xmi:id");
+ platformResourcePath.put(processId, platformPath);
+ }
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/LibraryDocument.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/LibraryDocument.java
new file mode 100644
index 0000000..c83b8e2
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/resolving/LibraryDocument.java
@@ -0,0 +1,60 @@
+package org.eclipse.opencert.lines.resolving;
+
+import java.io.File;
+
+import org.eclipse.epf.common.utils.XMLUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * Encapsulates a method library using a DOM document.
+ *
+ * @author Jinhua Xi
+ * @author Weiping Lu
+ * @since 1.0
+ */
+public class LibraryDocument {
+
+ public static final String TAG_resourceDescriptors = "resourceDescriptors"; //$NON-NLS-1$
+
+ protected File libFile;
+
+ protected Document document;
+
+ protected Element libTag = null;
+
+ protected Element resTag = null;
+
+ /**
+ * Creates a new instance.
+ */
+ public LibraryDocument(File libFile) throws Exception {
+ this.libFile = libFile;
+ init();
+ }
+
+ protected void init() throws Exception {
+ this.document = XMLUtil.loadXml(libFile);
+
+ Element root = document.getDocumentElement();
+ NodeList nodes = root.getElementsByTagName("org.eclipse.epf.uma:MethodLibrary"); //$NON-NLS-1$
+ if (nodes != null && nodes.getLength() > 0) {
+ libTag = (Element) nodes.item(0);
+ }
+
+ nodes = root
+ .getElementsByTagName("org.eclipse.epf.uma.resourcemanager:ResourceManager"); //$NON-NLS-1$
+ if (nodes != null && nodes.getLength() > 0) {
+ resTag = (Element) nodes.item(0);
+ }
+ }
+
+ /**
+ * Returns resource descriptor node list
+ */
+ public NodeList getResourceDescriptors() {
+ return resTag.getElementsByTagName(TAG_resourceDescriptors);
+ }
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/MainPage.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/MainPage.java
new file mode 100644
index 0000000..e17ed49
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/MainPage.java
@@ -0,0 +1,180 @@
+package org.eclipse.opencert.lines.wizards;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.epf.common.utils.FileUtil;
+import org.eclipse.epf.library.ui.LibraryUIPlugin;
+import org.eclipse.epf.library.ui.preferences.LibraryUIPreferences;
+import org.eclipse.epf.ui.wizards.BaseWizardPage;
+import org.eclipse.opencert.lines.UIResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A wizard page that prompts the user to select a path to open a method
+ * library.
+ */
+public class MainPage extends BaseWizardPage {
+
+ /**
+ * The wizard page name.
+ */
+ public static final String PAGE_NAME = MainPage.class.getName();
+
+ protected static final String TYPE_ID = "typeId"; //$NON-NLS-1$
+
+ protected Shell shell;
+
+ protected Composite composite;
+
+ protected Label pathLabel;
+
+ protected Combo libraryPathCombo;
+
+ protected Button browseButton;
+
+ protected String libraryType;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param pageName
+ * the wizard page name
+ */
+ public MainPage(String pageName) {
+ super(pageName);
+ setTitle(UIResources.openLibraryWizardPage_title);
+ setDescription(UIResources.openLibraryMainWizardPage_title);
+ setImageDescriptor(LibraryUIPlugin.getDefault().getImageDescriptor(
+ "full/wizban/Open.gif")); //$NON-NLS-1$
+ }
+
+ /**
+ * Creates a new instance.
+ */
+ public MainPage() {
+ this(PAGE_NAME);
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ shell = parent.getShell();
+
+ composite = createGridLayoutComposite(parent, 3);
+
+ pathLabel = createLabel(composite, UIResources.pathLabel_text);
+
+ libraryPathCombo = createCombobox(composite);
+
+ browseButton = createButton(composite,
+ UIResources.browseButton_text);
+
+ initControls();
+
+ addListeners();
+
+ setControl(composite);
+ }
+
+ /**
+ * Initializes the wizard page controls with data.
+ */
+ protected void initControls() {
+ List<String> openLibraryPathsList = LibraryUIPreferences
+ .getOpenLibraryPathsList();
+ if (openLibraryPathsList.size() > 0) {
+ String[] openLibraryPaths = LibraryUIPreferences
+ .getOpenLibraryPaths();
+ libraryPathCombo.setItems(openLibraryPaths);
+ if (openLibraryPaths.length > 0) {
+ libraryPathCombo.setText(openLibraryPaths[0]);
+ }
+ } else {
+ String libraryPath = LibraryUIPreferences
+ .getDefaultLibraryPath() + FileUtil.FILE_SEP + "Library1"; //$NON-NLS-1$
+ openLibraryPathsList.add(0, libraryPath);
+ String[] openLibraryPaths = new String[openLibraryPathsList.size()];
+ openLibraryPathsList.toArray(openLibraryPaths);
+ libraryPathCombo.setItems(openLibraryPaths);
+ libraryPathCombo.setText(openLibraryPaths[0]);
+ }
+ }
+
+ /**
+ * Adds event listeners to the wizard page controls.
+ */
+ protected void addListeners() {
+ libraryPathCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(isPageComplete());
+ getWizard().getContainer().updateButtons();
+ }
+ });
+
+ libraryPathCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ setPageComplete(isPageComplete());
+ getWizard().getContainer().updateButtons();
+ }
+ });
+
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ DirectoryDialog dialog = new DirectoryDialog(shell, SWT.NONE);
+ dialog.setFilterPath(getLibraryPath());
+ String selectedDir = dialog.open();
+ if (selectedDir != null) {
+ libraryPathCombo.add(selectedDir, 0);
+ libraryPathCombo.setText(selectedDir);
+ }
+ }
+ });
+ }
+
+ /**
+ * @see org.eclipse.jface.wizard.WizardPage#isCompleted()
+ */
+ public boolean isPageComplete() {
+ return getLibraryName().length() > 0;
+ }
+
+ /**
+ * Gets the library name.
+ */
+ public String getLibraryName() {
+ String libPath = getLibraryPath();
+ String libName = new File(libPath).getName();
+ if (!libPath.equals(libName)) {
+ return libName;
+ } else {
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Gets the user specified library path.
+ */
+ public String getLibraryPath() {
+ return libraryPathCombo.getText().trim();
+ }
+
+ /**
+ * Gets the user specified method library type.
+ */
+ public String getLibraryType() {
+ return libraryType;
+ }
+
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizard.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizard.java
new file mode 100644
index 0000000..2959eac
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizard.java
@@ -0,0 +1,290 @@
+package org.eclipse.opencert.lines.wizards;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.epf.common.service.utils.CommandLineRunUtil;
+import org.eclipse.epf.common.service.versioning.VersionUtil;
+import org.eclipse.epf.common.ui.util.MsgDialog;
+import org.eclipse.epf.common.utils.FileUtil;
+import org.eclipse.epf.library.LibraryService;
+import org.eclipse.epf.library.edit.util.LibraryEditUtil;
+import org.eclipse.epf.library.ui.LibraryUIManager;
+import org.eclipse.epf.library.ui.LibraryUIPlugin;
+import org.eclipse.epf.library.ui.preferences.LibraryUIPreferences;
+import org.eclipse.epf.library.xmi.XMILibraryManager;
+import org.eclipse.epf.library.xmi.XMILibraryUtil;
+import org.eclipse.epf.persistence.migration.UpgradeCallerInfo;
+import org.eclipse.epf.ui.wizards.BaseWizard;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.opencert.lines.UIResources;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * A wizard that guides the user to open a method library.
+ */
+public class OpenWizard extends BaseWizard implements INewWizard {
+
+ /**
+ * The wizard ID.
+ */
+ public static final String WIZARD_ID = OpenWizard.class.getName();
+
+ /**
+ * The Open Library wizard extension point ID.
+ */
+ public static final String WIZARD_EXTENSION_POINT_ID = "org.eclipse.epf.library.ui.openLibraryWizard"; //$NON-NLS-1$
+
+ // The main wizard page.
+ protected MainPage mainPage;
+
+ /**
+ * Creates a new instance.
+ */
+ public OpenWizard() {
+ super();
+ }
+
+ /**
+ * @see org.eclipse.epf.ui.wizards.BaseWizard#init(IWorkbench,
+ * IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ super.init(workbench, selection);
+ setWindowTitle(UIResources.openLibraryWizard_title);
+ }
+
+ /**
+ * @see org.eclipse.epf.ui.wizards.BaseWizard#getWizardExtenderExtensionPointId()
+ */
+ public String getWizardExtenderExtensionPointId() {
+ return WIZARD_EXTENSION_POINT_ID;
+ }
+
+ /**
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ if (wizardExtender == null) {
+ mainPage = createMainPage();
+ super.addPage(mainPage);
+ } else {
+ List<IWizardPage> wizardPages = new ArrayList<IWizardPage>();
+
+ IWizardPage page = wizardExtender
+ .getReplaceWizardPage(MainPage.PAGE_NAME);
+ if (page != null) {
+ wizardPages.add(page);
+ } else {
+ mainPage = createMainPage();
+ wizardPages.add(mainPage);
+ }
+
+ super.getNewWizardPages(wizardPages);
+
+ for (Iterator it = wizardPages.iterator(); it.hasNext();) {
+ IWizardPage wizardPage = (IWizardPage) it.next();
+ super.addPage(wizardPage);
+ }
+
+ wizardExtender.initWizardPages(wizardPages);
+ }
+ }
+
+ /**
+ * Creates the main wizard page.
+ *
+ * @return the main wizard page
+ */
+ protected MainPage createMainPage() {
+ return new MainPage();
+ }
+
+ /**
+ * @see org.eclipse.jface.wizard.Wizard#createPageControls(Composite)
+ */
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls(pageContainer);
+ pageContainer.getShell().setImage(
+ LibraryUIPlugin.getDefault().getSharedImage(
+ "full/obj16/MethodLibrary.gif")); //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ boolean b = performFinish_();
+ if (b) {
+ FileUtil.getValidateEdit().sychnConneciton();
+ }
+ return b;
+ }
+ private boolean performFinish_() {
+ if (LibraryService.getInstance().getCurrentMethodConfiguration() != null) {
+ LibraryService.getInstance().setCurrentMethodConfiguration(null);
+ }
+ if (wizardExtender != null) {
+ return wizardExtender.doFinish();
+ } else {
+ return openMethodLibrary(mainPage.getLibraryPath(), "xmi"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Opens the method library at the user specified path.
+ *
+ * @param path
+ * the method library path
+ * @param type
+ * the method library type
+ */
+ public boolean openMethodLibrary(String path, String type) {
+ return openMethodLibrary(path, type, true);
+ }
+ public boolean openMethodLibrary(String path, String type, boolean addOpenLibraryPath) {
+ try {
+ Map<String, String> options = new HashMap<String, String>();
+ File libraryPath = new File(path);
+ options.put(XMILibraryManager.ARG_LIBRARY_PATH, libraryPath
+ .getAbsolutePath());
+
+ if (XMILibraryUtil.isValidLibrary(path, true) == Status.OK_STATUS) {
+ if (!handleToolVersion(path, null)) {
+ return false;
+ }
+ if (LibraryUIManager.getInstance().openLibrary(path)) {
+ if (addOpenLibraryPath) {
+ LibraryUIPreferences.addOpenLibraryPath(libraryPath
+ .getAbsolutePath());
+ }
+ return true;
+ }
+ } else if (XMILibraryUtil
+ .containsPluginOrConfigSpecExportFile(path)) {
+ throw new Exception(UIResources.openLibraryError_reason4);
+ } else {
+ MsgDialog msgDialog = LibraryUIPlugin.getDefault()
+ .getMsgDialog();
+ boolean rc = msgDialog
+ .displayConfirmation(
+ UIResources.openLibraryWizard_title,
+ NLS
+ .bind(
+ UIResources.openLibraryDialog_newLibrary_text,
+ new Object[] { path }));
+ if (!rc)
+ return false;
+ if (LibraryUIManager.getInstance().createLibrary(path)) {
+ LibraryUIPreferences.addOpenLibraryPath(libraryPath
+ .getAbsolutePath());
+ return true;
+ }
+ }
+
+ return true;
+ } catch (Exception e) {
+ String reason = e.getMessage();
+ if (reason == null) {
+ reason = UIResources.openLibraryInternlError_reason;
+ }
+ reason += "\n\n" + UIResources.openLibraryError_advice; //$NON-NLS-1$
+ if (e.getMessage() != null) {
+ LibraryUIPlugin.getDefault().getMsgDialog().displayError(
+ UIResources.openLibraryWizard_title,
+ UIResources.openLibraryError_msg, reason);
+ } else {
+ LibraryUIPlugin.getDefault().getMsgDialog().displayError(
+ UIResources.openLibraryWizard_title,
+ UIResources.openLibraryError_msg, reason, e);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check and handle tool version differences
+ */
+ public static boolean handleToolVersion(String path,
+ UpgradeCallerInfo callerInfo) {
+ if (callerInfo == null) {
+ callerInfo = new UpgradeCallerInfo(UpgradeCallerInfo.upgradeLibrary, null);
+ }
+
+ String libXmi = XMILibraryManager.LIBRARY_XMI;
+ if (callerInfo != null && callerInfo.getIsExportedPluginLib()) {
+ libXmi = XMILibraryManager.exportFile;
+ }
+ VersionUtil.VersionCheckInfo info = VersionUtil
+ .checkLibraryVersion(new File(path, libXmi));
+ if (info != null && info.result > 0) {
+ String message = ""; //$NON-NLS-1$
+ if (info.toolID.equals(VersionUtil.getPrimaryToolID())) {
+ message = NLS.bind(
+ UIResources.versionMismatchDialog_text,
+ new Object[] { Platform.getProduct().getName(),
+ info.toolVersion });
+ } else {
+ message = NLS.bind(
+ UIResources.versionMismatchDialog_text_unknown,
+ new Object[] { Platform.getProduct().getName() });
+ }
+ if (!isUpgradeLibrary(callerInfo)) {
+ callerInfo.setErrorMsg(message);
+ return false;
+ }
+ LibraryUIPlugin.getDefault().getMsgDialog().displayError(
+ UIResources.openLibraryWizard_title, message);
+ return false;
+ }
+ if (XMILibraryUtil.isMethodLibraryUpgradeRequired(path, libXmi, info)) {
+ int confirmationIx = 0;
+ if (!CommandLineRunUtil.getInstance().isNeedToRun()
+ && isUpgradeLibrary(callerInfo)) {
+ confirmationIx = LibraryUIPlugin.getDefault().getMsgDialog()
+ .displayConfirmationWithCheckBox(
+ UIResources.openLibraryWizard_title,
+ UIResources.upgradeLibraryDialog_text,
+ UIResources.convertToSynProcessLib_msg);
+ if (confirmationIx == 0) {
+ return false;
+ }
+ }
+
+ if (! LibraryEditUtil.getInstance().isJunitTest()) {
+ callerInfo.setConverToSynFree(confirmationIx == 1);
+ }
+
+ if (!isUpgradeLibrary(callerInfo)) {
+ callerInfo.copyLibrary();
+ if (callerInfo.getCopiedLibFile() != null) {
+ path = callerInfo.getCopiedLibFile().getParentFile()
+ .getAbsolutePath();
+ }
+ }
+ if (!LibraryUIManager.upgradeLibrary(path, callerInfo)) {
+ if (callerInfo != null) {
+ }
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static boolean isUpgradeLibrary(UpgradeCallerInfo callerInfo) {
+ return UpgradeCallerInfo.isUpgradeLibrary(callerInfo);
+ }
+
+
+}
diff --git a/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizardPage.java b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizardPage.java
new file mode 100644
index 0000000..40bc78c
--- /dev/null
+++ b/org.eclipse.opencert.lines/src/org/eclipse/opencert/lines/wizards/OpenWizardPage.java
@@ -0,0 +1,34 @@
+//------------------------------------------------------------------------------
+// Copyright (c) 2005, 2006 IBM Corporation and others.
+// 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:
+// IBM Corporation - initial implementation
+//------------------------------------------------------------------------------
+package org.eclipse.opencert.lines.wizards;
+
+import java.util.Map;
+
+import org.eclipse.epf.ui.wizards.BaseWizardPage;
+
+/**
+ * The abstract class for a Open Method Library wizard page.
+ */
+public abstract class OpenWizardPage extends BaseWizardPage {
+
+ /**
+ * Creates a new instance.
+ */
+ public OpenWizardPage(String name) {
+ super(name);
+ }
+
+ /**
+ * Returns the library specific user selections.
+ */
+ public abstract Map getSelections();
+
+}