[nobug]: Continuing release of the first-cut of the ModuleCore API. Commited for MDE.
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ArtifactEdit.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ArtifactEdit.java
index 8d042fd..4d873a3 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ArtifactEdit.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ArtifactEdit.java
@@ -11,50 +11,208 @@
 package org.eclipse.wst.common.modulecore;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
 
 /**
  * <p>
+ * Provides a Facade pattern for accessing content models for Web Tools Platform flexible modules.
+ * </p>
+ * <p>
+ * ArtifactEdit hides the management of accessing edit models ({@see ArtifactEditModel})
+ * correctly. Each project may have multiple ({@see ArtifactEditModel})s depending on the number
+ * of modules contained by the project. Clients should use ArtifactEdit or an appropriate 
+ * subclass when working with the content models of WTP modules. 
+ * </p>
+ * 
+ * <p>
+ * Each ArtifactEdit instance facade is designed to manage the Edit Model lifecycle for clients.
+ * However, while each ArtifactEdit is designed to be passed around as needed, clients must enforce
+ * the ArtifactEdit lifecycle. The most common method of acquiring a ArtifactEdit instance facade is to
+ * use {@see #getArtifactEditForRead(WorkbenchModule)}or {@see #getModuleEditModelForWrite(WorkbenchModule, Object)}.
+ * </p>
+ * <p>
+ * When clients have concluded their use of the instance, <b>clients must call {@see #dispose()}
+ * </b>.
+ * </p>
+ * 
+ * <p>
  * The following class is experimental until fully documented.
  * </p>
+ * 
+ * @see ModuleCoreNature
+ * @see ArtifactEditModel
  */
-public class ArtifactEdit {
+public class ArtifactEdit implements IEditModelHandler {
 
 	public static final Class ADAPTER_TYPE = ArtifactEdit.class;
-	public static final String TYPE_ID = "ARTIFACT_EDIT_TYPE"; //$NON-NLS-1$ 
-	private ArtifactEditModel artifactEditModel;
+	private final ArtifactEditModel artifactEditModel;
+	private boolean isReadOnly;
+	private boolean isArtifactEditModelSelfManaged;
+
+	/**
+	 * <p>
+	 * Returns an instance facade to manage the underlying edit model for the given
+	 * {@see WorkbenchModule}. Instances of ArtifactEdit that are returned through this method must be 
+	 * {@see #dispose()}ed of when no longer in use.
+	 * </p>
+	 * <p>
+	 * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchModule}that will not be
+	 * used for editing. Invocations of any save*() API on an instance returned from this method
+	 * will throw exceptions.
+	 * </p>
+	 * <p>
+	 * <b>The following method may return null. </b>
+	 * </p>
+	 * 
+	 * @param aModule
+	 *            A valid {@see WorkbenchModule}with a handle that resolves to an accessible
+	 *            project in the workspace
+	 * @return An instance of ArtifactEdit that may only be used to read the underlying content model
+	 */
+	public static ArtifactEdit getArtifactEditForRead(WorkbenchModule aModule) {
+		try {
+			IProject project = ModuleCore.getContainingProject(aModule.getHandle());
+			if (project.isAccessible()) {
+				ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
+				return new ArtifactEdit(nature, aModule, true);
+			}
+		} catch (UnresolveableURIException uue) {
+		}
+		return null;
+	}
+
+	/**
+	 * <p>
+	 * Returns an instance facade to manage the underlying edit model for the given
+	 * {@see WorkbenchModule}. Instances of ArtifactEdit that are returned through this method must be 
+	 * {@see #dispose()}ed of when no longer in use.
+	 * </p>
+	 * <p>
+	 * Use to acquire an ArtifactEdit facade for a specific {@see WorkbenchModule}that will be
+	 * used for editing. 
+	 * </p>
+	 * <p>
+	 * <b>The following method may return null. </b>
+	 * </p>
+	 * 
+	 * @param aModule
+	 *            A valid {@see WorkbenchModule}with a handle that resolves to an accessible
+	 *            project in the workspace 
+	 * @return An instance of ArtifactEdit that may be used to modify and persist changes to the underlying content model
+	 */	
+	public static ArtifactEdit getArtifactEditForWrite(WorkbenchModule aModule) {
+		try {
+			IProject project = ModuleCore.getContainingProject(aModule.getHandle());
+			if (project.isAccessible()) {
+				ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
+				return new ArtifactEdit(nature, aModule, false);
+			}
+		} catch (UnresolveableURIException uue) {
+		}
+		return null;
+	}
+	
+
+	/**
+	 * <p>
+	 * Creates an instance facade for the given {@see ArtifactEditModel}
+	 * </p>
+	 * 
+	 * @param anArtifactEditModel
+	 */
+	public ArtifactEdit(ArtifactEditModel anArtifactEditModel) {
+		artifactEditModel = anArtifactEditModel;
+		isReadOnly = artifactEditModel.isReadOnly();
+		isArtifactEditModelSelfManaged = false;
+	}
+
+	/**
+	 * <p>
+	 * Creates an instance facade for the given {@see ArtifactEditModel}
+	 * </p>
+	 * 
+	 * @param aNature
+	 *            A non-null {@see ModuleCoreNature}for an accessible project
+	 * @param aModule
+	 *            A non-null {@see WorkbenchModule}pointing to a module from the given
+	 *            {@see ModuleCoreNature}
+	 */
+	public ArtifactEdit(ModuleCoreNature aNature, WorkbenchModule aModule, boolean toAccessAsReadOnly) {
+		if(toAccessAsReadOnly)
+			artifactEditModel = aNature.getArtifactEditModelForRead(aModule.getHandle(), this);
+		else 
+			artifactEditModel = aNature.getArtifactEditModelForWrite(aModule.getHandle(), this);
+		isReadOnly = toAccessAsReadOnly;
+		isArtifactEditModelSelfManaged = true;
+	}
+
 	
 	/**
-	 * @param model
+	 * <p>
+	 * Force a save of the underlying model. The following method should be used with care. Unless
+	 * required, use {@see #saveIfNecessary(IProgressMonitor) instead.
+	 * </p>
+	 * 
+	 * @see org.eclipse.wst.common.modulecore.IEditModelHandler#save()
+	 * @throws IllegalStateException
+	 *             If the ModuleCore object was created as read-only
 	 */
-	public ArtifactEdit(ArtifactEditModel model) {
-		
-		artifactEditModel = model;
+	public void save(IProgressMonitor aMonitor) {
+		if (isReadOnly)
+			throwAttemptedReadOnlyModification();
+		artifactEditModel.save(aMonitor, this);
 	}
 
-	/*
-	 * Javadoc copied from interface.
+	/**
+	 * <p>
+	 * Save the underlying model only if no other clients are currently using the model. If the
+	 * model is not shared, it will be saved. If it is shared, the save will be deferred.
+	 * </p>
+	 * 
+	 * @see org.eclipse.wst.common.modulecore.IEditModelHandler#saveIfNecessary()
+	 * @throws IllegalStateException
+	 *             If the ModuleCore object was created as read-only
 	 */
-	public static ArtifactEditModel getModuleEditModelForRead(WorkbenchModule aModule, Object anAccessorKey) {
-		try {
-			IProject project = ModuleCore.getContainingProject(aModule.getHandle());
-			ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
-			return nature.getArtifactEditModelForRead(aModule.getHandle(), anAccessorKey);
-		} catch (UnresolveableURIException uue) {
-		}
-		return null;
+	public void saveIfNecessary(IProgressMonitor aMonitor) {
+		if (isReadOnly)
+			throwAttemptedReadOnlyModification();
+		artifactEditModel.saveIfNecessary(aMonitor, this);
 	}
 
-	public static ArtifactEditModel getModuleEditModelForWrite(WorkbenchModule aModule, Object anAccessorKey) {
-		try {
-			IProject project = ModuleCore.getContainingProject(aModule.getHandle());
-			ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
-			return nature.getArtifactEditModelForWrite(aModule.getHandle(), anAccessorKey);
-		} catch (UnresolveableURIException uue) {
-		}
-		return null;
-
+	/**
+	 * <p>
+	 * Clients must call the following method when they have finished using the model, even if the
+	 * ArtifactEdit instance facade was created as read-only.
+	 * </p>
+	 * 
+	 * @see org.eclipse.wst.common.modulecore.IEditModelHandler#dispose()
+	 */
+	public void dispose() {
+		if (isArtifactEditModelSelfManaged)
+			artifactEditModel.releaseAccess(this);
 	}
-	public ArtifactEditModel getArtifactEditModel() {
+
+	/**
+	 * <p>
+	 * Returns the root object for read or write access (depending on how the current ArtifactEdit was loaded).
+	 * </p>
+	 * 
+	 * @return The root object of the underlying model
+	 */
+	public EObject getContentModelRoot() {
+		return artifactEditModel.getPrimaryRootObject();
+	}
+
+	/**
+	 * 
+	 * @return The underlying managed edit model 
+	 */
+	protected ArtifactEditModel getArtifactEditModel() {
 		return artifactEditModel;
 	}
-}
+	
+	private void throwAttemptedReadOnlyModification() {
+		throw new IllegalStateException("Attempt to modify an ArtifactEdit instance facade that was loaded as read-only.");
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCore.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCore.java
index d7429fc..ba24e93 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCore.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCore.java
@@ -35,9 +35,9 @@
  * be used as a static utility or an instance adapter.
  * </p>
  * <p>
- * ModuleCore hides the management of accessing Edit models (
+ * ModuleCore hides the management of accessing edit models (
  * {@see org.eclipse.wst.common.modulecore.ModuleStructuralModel}) correctly. Each project has
- * exactly one ({@see org.eclipse.wst.common.modulecore.ModuleStructuralModel}) for read and one
+ * exactly one ({@see org.eclipse.wst.common.modulecore.ModuleStructuralModel}) for read and exactly one
  * for write. Each of these is shared among all clients and reference counted as necessary. Clients
  * should use ModuleCore when working with the WTP Modules Model. easier.
  * </p>
@@ -46,8 +46,10 @@
  * Each ModuleCore instance facade is designed to manage the Edit Model lifecycle for clients.
  * However, while each ModuleCore is designed to be passed around as needed, clients must enforce
  * the ModuleCore lifecycle. The most common method of acquiring a ModuleCore instance facade is to
- * use {@see #getModuleCoreForRead(IProject)}or {@see #getModuleCoreForWrite(IProject)}. When
- * clients have concluded their use of the instance, clients must call {@see #dispose()}.
+ * use {@see #getModuleCoreForRead(IProject)}or {@see #getModuleCoreForWrite(IProject)}.
+ * </p>
+ * <p>
+ * When clients have concluded their use of the instance, <b>clients must call {@see #dispose()}</b>.
  * </p>
  * 
  * <p>
@@ -56,7 +58,7 @@
  * 
  * @see org.eclipse.wst.common.modulecore.ModuleCoreNature
  * @see org.eclipse.wst.common.modulecore.ModuleStructuralModel
- */ 
+ */
 public class ModuleCore implements IEditModelHandler {
 
 	public static interface ModuleURI {
@@ -91,6 +93,8 @@
 	 * </p>
 	 * <p>
 	 * Use to acquire a ModuleCore facade for a specific project that will not be used for editing.
+	 * Invocations of any save*() API on an instance returned from this method will throw
+	 * exceptions.
 	 * </p>
 	 * 
 	 * @param aProject
@@ -145,23 +149,6 @@
 
 	/**
 	 * <p>
-	 * A fully-qualified module URI will contain enough information to determine the deployed name
-	 * of the module.
-	 * </p>
-	 * 
-	 * @param aModuleURI
-	 *            A valid, fully-qualified module URI
-	 * @return The deployed name of the {@see WorkbenchModule}referenced by the module URI
-	 * @throws UnresolveableURIException
-	 *             If the supplied module URI is invalid or unresolveable.
-	 */
-	public static String getDeployedNameForModule(URI aModuleURI) throws UnresolveableURIException {
-		ModuleURIUtil.ensureValidFullyQualifiedModuleURI(aModuleURI);
-		return aModuleURI.segment(ModuleCore.ModuleURI.MODULE_NAME_INDX);
-	}
-
-	/**
-	 * <p>
 	 * For {@see WorkbenchModule}s that are contained within a project, the containing project can
 	 * be determined with the {@see WorkbenchModule}'s fully-qualified module URI.
 	 * </p>
@@ -237,7 +224,7 @@
 		IProject project = null;
 		try {
 			project = getContainingProject(aWorkbenchModule.getHandle());
-		} catch (UnresolveableURIException e) { 
+		} catch (UnresolveableURIException e) {
 		}
 		if (project != null)
 			return project.getFolder(new Path(DEPLOYABLES_ROOT + aWorkbenchModule.getDeployedName()));
@@ -355,7 +342,7 @@
 
 	/**
 	 * <p>
-	 * When loaded for write, the current ModuleCore can return the root object, which can be used
+	 * When loaded for write, the current ModuleCore may return the root object, which can be used
 	 * to add or remove {@see WorkbenchModule}s. If a client needs to just read the existing
 	 * {@see WorkbenchModule}s, use {@see #getWorkbenchModules()}.
 	 * </p>
@@ -468,7 +455,7 @@
 	 *             If the supplied module URI is invalid or unresolveable.
 	 */
 	public WorkbenchModuleResource[] findWorkbenchModuleResourceByDeployPath(URI aModuleURI, URI aDeployedResourcePath) throws UnresolveableURIException {
-		WorkbenchModule module = findWorkbenchModuleByDeployName(getDeployedNameForModule(aModuleURI));
+		WorkbenchModule module = findWorkbenchModuleByDeployName(ModuleURIUtil.getDeployedName(aModuleURI));
 		return module.findWorkbenchModuleResourceByDeployPath(aDeployedResourcePath);
 	}
 
@@ -491,7 +478,7 @@
 		ModuleURIUtil.ensureValidFullyQualifiedModuleURI(aModuleResourcePath);
 		URI moduleURI = aModuleResourcePath.trimSegments(aModuleResourcePath.segmentCount() - 3);
 		URI deployedPath = ModuleURIUtil.trimToDeployPathSegment(aModuleResourcePath);
-		WorkbenchModule module = findWorkbenchModuleByDeployName(getDeployedNameForModule(moduleURI));
+		WorkbenchModule module = findWorkbenchModuleByDeployName(ModuleURIUtil.getDeployedName(moduleURI));
 		return module.findWorkbenchModuleResourceByDeployPath(deployedPath);
 	}
 
@@ -641,11 +628,8 @@
 		return dependentCore;
 	}
 
-	/**
-	 * 
-	 */
 	private void throwAttemptedReadOnlyModification() {
 		throw new IllegalStateException("Attempt to modify a ModuleCore instance facade that was loaded as read-only.");
 	}
 
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCoreNature.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCoreNature.java
index 5501ca4..a9d2641 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCoreNature.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleCoreNature.java
@@ -20,7 +20,7 @@
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.wst.common.internal.emfworkbench.CompatibilityWorkbenchURIConverterImpl;
 import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelNature;
-import org.eclipse.wst.common.modulecore.internal.impl.ModuleEditModelFactory;
+import org.eclipse.wst.common.modulecore.internal.impl.ArtifactEditModelFactory;
 import org.eclipse.wst.common.modulecore.internal.impl.ModuleStructuralModelFactory;
 import org.eclipse.wst.common.modulecore.internal.impl.WTPResourceFactoryRegistry;
 import org.eclipse.wst.common.modulecore.internal.util.IModuleConstants;
@@ -106,13 +106,13 @@
  
 	public ArtifactEditModel getArtifactEditModelForRead(URI aModuleURI, Object anAccessorKey) {
 		Map params = new HashMap();
-		params.put(ModuleEditModelFactory.PARAM_MODULE_URI, aModuleURI);
+		params.put(ArtifactEditModelFactory.PARAM_MODULE_URI, aModuleURI);
 		return (ArtifactEditModel) getEditModelForRead(getArtifactEditModelId(aModuleURI), anAccessorKey, params);
 	}
 	 
 	public ArtifactEditModel getArtifactEditModelForWrite(URI aModuleURI, Object anAccessorKey) {
 		Map params = new HashMap();
-		params.put(ModuleEditModelFactory.PARAM_MODULE_URI, aModuleURI);
+		params.put(ArtifactEditModelFactory.PARAM_MODULE_URI, aModuleURI);
 		return (ArtifactEditModel) getEditModelForWrite(getArtifactEditModelId(aModuleURI), anAccessorKey, params);
 	}
 	
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleURIUtil.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleURIUtil.java
index 589505e..60945f3 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleURIUtil.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/ModuleURIUtil.java
@@ -23,6 +23,18 @@
 	public static final String PLATFORM_SCHEME = "platform"; //$NON-NLS-1$
 	public static final String RESOURCE_PROTOCOL = "resource"; //$NON-NLS-1$
 
+	/**
+	 * <p>
+	 * A fully-qualified module URI will contain enough information to determine the deployed name
+	 * of the module.
+	 * </p>
+	 * 
+	 * @param aModuleURI
+	 *            A valid, fully-qualified module URI
+	 * @return The deployed name of the {@see WorkbenchModule}referenced by the module URI
+	 * @throws UnresolveableURIException
+	 *             If the supplied module URI is invalid or unresolveable.
+	 */ 
 	public static String getDeployedName(URI aModuleURI) throws UnresolveableURIException {
 		ensureValidFullyQualifiedModuleURI(aModuleURI);
 		return aModuleURI.segment(ModuleCore.ModuleURI.MODULE_NAME_INDX);
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ModuleEditModelFactory.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ArtifactEditModelFactory.java
similarity index 97%
rename from plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ModuleEditModelFactory.java
rename to plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ArtifactEditModelFactory.java
index 2b4ac09..aebdd38 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ModuleEditModelFactory.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/impl/ArtifactEditModelFactory.java
@@ -23,7 +23,7 @@
  * The following class is experimental until fully documented.
  * </p>
  */
-public class ModuleEditModelFactory extends EditModelFactory {
+public class ArtifactEditModelFactory extends EditModelFactory {
 	
 	public static final String MODULE_EDIT_MODEL_ID = "org.eclipse.wst.modulecore.editModel"; //$NON-NLS-1$
 	
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/ArtifactEditAdapterFactory.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/ArtifactEditAdapterFactory.java
index 6e04125..a1c6b40 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/ArtifactEditAdapterFactory.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/ArtifactEditAdapterFactory.java
@@ -1,50 +1,55 @@
-/*
- * Created on Feb 7, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
+/*******************************************************************************
+ * Copyright (c) 2003, 2004 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 API and implementation
+ *******************************************************************************/
 package org.eclipse.wst.common.modulecore.internal.util;
 
 import org.eclipse.core.runtime.IAdapterFactory;
 import org.eclipse.wst.common.modulecore.ArtifactEdit;
 import org.eclipse.wst.common.modulecore.ArtifactEditModel;
+import org.eclipse.wst.common.modulecore.internal.ModulecorePlugin;
 
 /**
- * @author cbridgha
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ * <p>
+ * The following class is not intended to be used by clients.
+ * </p>
+ * <p>
+ * Adapts {@see ArtifactEditModel} to an {@see ArtifactEdit) 
+ * instance facade, if possible. The following class is 
+ * registered with the Platform Adapter Manager in 
+ * {@see ModulecorePlugin#start(BundleContext)}
+ * </p>
+ * @see ModulecorePlugin
  */
 public class ArtifactEditAdapterFactory implements IAdapterFactory {
-	/**
-	 * 
-	 */
-	public ArtifactEditAdapterFactory() {
-		super();
-		// TODO Auto-generated constructor stub
-	}
 
-	/* (non-Javadoc)
+	private static final Class ARTIFACT_EDIT_MODEL_CLASS = ArtifactEditModel.class;
+	
+	/**
+	 * <p>
+	 * Returns an instance facade for the given anAdaptableObject, if possible.
+	 * </p> 
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
 	 */
-	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		ArtifactEditModel editModel = (ArtifactEditModel)adaptableObject;
-		if (editModel.getModuleType().equals(ArtifactEdit.TYPE_ID))
-			return new ArtifactEdit((ArtifactEditModel)adaptableObject);
-		else
-			return null;
-		
-		
+	public Object getAdapter(Object anAdaptableObject, Class anAdapterType) {
+		if (anAdapterType == ArtifactEdit.ADAPTER_TYPE) {
+			if (anAdaptableObject instanceof ArtifactEditModel)
+				return new ArtifactEdit((ArtifactEditModel) anAdaptableObject);
+		}
+		return null;
 	}
 
-
-	/* (non-Javadoc)
+	/**  
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
 	 */
 	public Class[] getAdapterList() {
-		
-		return new Class[] { ArtifactEditModel.class };
+		return new Class[]{ARTIFACT_EDIT_MODEL_CLASS};
 	}
 
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/WTPModulesXmlMapperI.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/WTPModulesXmlMapperI.java
index 6a8c044..57829ce 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/WTPModulesXmlMapperI.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/modulecore/internal/util/WTPModulesXmlMapperI.java
@@ -1,24 +1,17 @@
 package org.eclipse.wst.common.modulecore.internal.util;
 
 public interface WTPModulesXmlMapperI {
-	String PROJECT_MODULES = "project-modules";//$NON-NLS-1$
-	String MODULES = "modules"; //$NON-NLS-1$
-	String WBAPP = "wb-app";//$NON-NLS-1$
+	String PROJECT_MODULES = "project-modules";//$NON-NLS-1$  
 	String WBMODULE = "wb-module";//$NON-NLS-1$
-	String HANDLE = "handle";//$NON-NLS-1$
 	String DEPENDENT_MODULE = "dependent-module";//$NON-NLS-1$
-	String MODULE_TYPE = "module-type";//$NON-NLS-1$
-	String ROOT = "root";//$NON-NLS-1$
-	String META_RESOURCES = "meta-resources";//$NON-NLS-1$
-	String URI = "uri";//$NON-NLS-1$
-	String DEPENDENCY_TYPE = "dependency-type";//$NON-NLS-1$
 	String WBRESOURCE = "wb-resource"; //$NON-NLS-1$
+	String MODULE_TYPE = "module-type";//$NON-NLS-1$ 
+	String META_RESOURCES = "meta-resources";//$NON-NLS-1$ 
+	String HANDLE = "handle";//$NON-NLS-1$
+	String DEPENDENCY_TYPE = "dependency-type";//$NON-NLS-1$
 	String SOURCE_PATH = "source-path"; //$NON-NLS-1$
 	String DEPLOY_PATH = "deploy-path"; //$NON-NLS-1$
-	String EXCLUSIONS = "exclusions";//$NON-NLS-1$
-	String DEPLOY_SCHEME = "deploy-scheme"; //$NON-NLS-1$
-	String TYPE = "type"; //$NON-NLS-1$
-	String SERVER_TARGET = "server-target"; //$NON-NLS-1$
+	String EXCLUSIONS = "exclusions";//$NON-NLS-1$  
 	String MODULE_TYPE_ID = "module-type-id"; //$NON-NLS-1$
 	String DEPLOY_NAME = "deploy-name"; //$NON-NLS-1$
 	
diff --git a/plugins/org.eclipse.wst.common.modulecore/plugin.xml b/plugins/org.eclipse.wst.common.modulecore/plugin.xml
index f3c332c..0507a8c 100644
--- a/plugins/org.eclipse.wst.common.modulecore/plugin.xml
+++ b/plugins/org.eclipse.wst.common.modulecore/plugin.xml
@@ -49,7 +49,7 @@
          point="org.eclipse.wst.common.emfworkbench.integration.editModel">
       <editModel
             editModelID="org.eclipse.wst.modulecore.structuralModel"
-            factoryClass="org.eclipse.wst.common.modulecore.ModuleStructuralModelFactory">
+            factoryClass="org.eclipse.wst.common.modulecore.internal.impl.ModuleStructuralModelFactory">
          <editModelResource
                autoload="false"
                URI=".wtpmodules"/>
diff --git a/plugins/org.eclipse.wst.common.modulecore/schema/moduleCore.xsd b/plugins/org.eclipse.wst.common.modulecore/schema/moduleCore.xsd
new file mode 100644
index 0000000..0098bb9
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.modulecore/schema/moduleCore.xsd
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.ibm.com/moduleCore" xmlns:tns="http://www.ibm.com/moduleCore">
+	<element name="project-modules">
+		<complexType>
+			<sequence minOccurs="1" maxOccurs="unbounded">
+				<element name="wb-module">
+					<complexType>
+                        <sequence minOccurs="0" maxOccurs="1">
+                        	<element name="module-type">
+                        		<complexType>
+                        			<attribute name="module-type-id"
+                        				type="string">
+                        			</attribute>
+                        		</complexType>
+                        	</element>
+                        	<sequence minOccurs="0" maxOccurs="unbounded">
+                        		<element name="wb-resource">
+                                    <complexType>
+                                    	<attribute name="source-path"
+                                    		type="string" use="required">
+                                    	</attribute>
+                                    	<attribute name="deploy-path"
+                                    		type="string" use="required">
+                                    	</attribute>
+                                    </complexType>
+                        		</element>
+                        	</sequence>
+                        	<sequence minOccurs="0" maxOccurs="unbounded">
+                        		<element name="dependent-module">
+                                    <complexType>
+                                    	<attribute name="handle"
+                                    		type="string" use="required">
+                                    	</attribute>
+                                    	<attribute name="deploy-path"
+                                    		type="string" use="required">
+                                    	</attribute>
+                                    	<attribute name="dependency-type"
+                                    		type="string">
+                                    	</attribute>
+                                    </complexType>
+                        		</element>
+                        	</sequence>
+                        </sequence>
+                        <attribute name="deploy-name" type="string" use="required"></attribute>
+					</complexType>
+				</element>
+			</sequence>
+			<attribute name="id" type="string"></attribute>
+		</complexType>
+	</element>
+
+</schema>
\ No newline at end of file