Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
blob: efc4e76836fba0535639e6811ab9930250a0185a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
/***************************************************************************************************
 * 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
 **************************************************************************************************/
/*
 * Created on Nov 5, 2003
 * 
 * To change the template for this generated file go to Window>Preferences>Java>Code
 * Generation>Code and Comments
 */
package org.eclipse.jst.j2ee.application.operations;

import java.util.ArrayList;

import org.eclipse.core.internal.localstore.CoreFileSystemLibrary;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.jst.common.jdt.internal.integration.JavaProjectCreationDataModel;
import org.eclipse.jst.j2ee.commonarchivecore.internal.EARFile;
import org.eclipse.jst.j2ee.internal.earcreation.EARCreationResourceHandler;
import org.eclipse.jst.j2ee.internal.earcreation.EARNatureRuntime;
import org.eclipse.jst.j2ee.internal.earcreation.IEARNatureConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
import org.eclipse.jst.j2ee.internal.servertarget.ServerTargetDataModel;
import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModel;
import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelListener;
import org.eclipse.wst.common.frameworks.internal.operations.WTPPropertyDescriptor;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonMessages;
import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;

/**
 * This dataModel is a common super class used for to create J2EE Modules.
 * 
 * This class (and all its fields and methods) is likely to change during the WTP 1.0 milestones as
 * the new project structures are adopted. Use at your own risk.
 * 
 * @since WTP 1.0
 */
public abstract class J2EEModuleCreationDataModel extends J2EEArtifactCreationDataModel implements IAnnotationsDataModel {

	/**
	 * type Integer
	 */
	public static final String J2EE_MODULE_VERSION = "J2EEModuleCreationDataModel.J2EE_MODULE_VERSION"; //$NON-NLS-1$

	/**
	 * This corresponds to the J2EE versions of 1.2, 1.3, 1.4, etc. Each subclass will convert this
	 * version to its corresponding highest module version supported by the J2EE version and set the
	 * J2EE_MODULE_VERSION property.
	 * 
	 * type Integer
	 */
	public static final String J2EE_VERSION = "J2EEModuleCreationDataModel.J2EE_VERSION"; //$NON-NLS-1$

	/**
	 * type Boolean, default false
	 */
	public static final String ADD_TO_EAR = "J2EEModuleCreationDataModel.ADD_TO_EAR"; //$NON-NLS-1$

	/**
	 * type String
	 */
	public static final String EAR_PROJECT_NAME = "J2EEModuleCreationDataModel.EAR_PROJECT_NAME"; //$NON-NLS-1$

	public static final String JAR_LIST = UpdateManifestDataModel.JAR_LIST;

	public static String JAR_LIST_TEXT_UI = UpdateManifestDataModel.JAR_LIST_TEXT_UI;

	private static final String NESTED_MODEL_APPLICATION_CREATION = "J2EEModuleCreationDataModel.NESTED_MODEL_APPLICATION_CREATION"; //$NON-NLS-1$

	private static final String NESTED_MODEL_ADD_TO_EAR = "J2EEModuleCreationDataModel.NESTED_MODEL_ADD_TO_EAR"; //$NON-NLS-1$

	private static final String NESTED_MODEL_JAR_DEPENDENCY = "J2EEModuleCreationDataModel.NESTED_MODEL_JAR_DEPENDENCY"; //$NON-NLS-1$

	/**
	 * type Boolean; default true, UI only
	 */
	public static final String UI_SHOW_EAR_SECTION = "J2EEModuleCreationDataModel.UI_SHOW_EAR_SECTION"; //$NON-NLS-1$

	private EnterpriseApplicationCreationDataModel applicationCreationDataModel;

	private AddModuleToEARDataModel addModuleToEARDataModel;

	private UpdateManifestDataModel jarDependencyDataModel;

	private String J2EENatureID;

	protected void init() {
		super.init();
		getJavaProjectCreationDataModel().setProperty(ProjectCreationDataModel.PROJECT_NATURES, new String[]{J2EENatureID});
		//set it so it pushes it down to ServerTargeting
		setProperty(J2EE_MODULE_VERSION, getDefaultProperty(J2EE_MODULE_VERSION));
		applicationCreationDataModel.addListener(this);
	}

	protected void initValidBaseProperties() {
		super.initValidBaseProperties();
		addValidBaseProperty(J2EE_MODULE_VERSION);
		addValidBaseProperty(J2EE_VERSION);
		addValidBaseProperty(EAR_PROJECT_NAME);
		addValidBaseProperty(ADD_TO_EAR);
		addValidBaseProperty(UI_SHOW_EAR_SECTION);
		addValidBaseProperty(USE_ANNOTATIONS);
		addValidBaseProperty(PROJECT_LOCATION);
	}

	protected void initNestedModels() {
		super.initNestedModels();
		applicationCreationDataModel = new EnterpriseApplicationCreationDataModel();
		addNestedModel(NESTED_MODEL_APPLICATION_CREATION, applicationCreationDataModel);
		addModuleToEARDataModel = createModuleNestedModel();
		if (addModuleToEARDataModel != null)
			addNestedModel(NESTED_MODEL_ADD_TO_EAR, addModuleToEARDataModel);
		jarDependencyDataModel = new UpdateManifestDataModel();
		addNestedModel(NESTED_MODEL_JAR_DEPENDENCY, jarDependencyDataModel);
	}

	protected AddModuleToEARDataModel createModuleNestedModel() {
		return new AddModuleToEARDataModel();
	}

	protected Object getDefaultProperty(String propertyName) {
		if (propertyName.equals(ADD_TO_EAR)) {
			return Boolean.FALSE;
		} else if (propertyName.equals(EAR_PROJECT_NAME)) {
			return getDefaultEARName(getStringProperty(PROJECT_NAME));
		} else if (propertyName.equals(UI_SHOW_EAR_SECTION)) {
			return Boolean.TRUE;
		} else if (propertyName.equals(USE_ANNOTATIONS)) {
			return Boolean.FALSE;
		} else if (propertyName.equals(J2EE_MODULE_VERSION)) {
			return getDefaultJ2EEModuleVersion();
		} else {
			return super.getDefaultProperty(propertyName);
		}
	}

	protected abstract Integer getDefaultJ2EEModuleVersion();

	private String getDefaultEARName(String baseName) {
		return baseName + "EAR"; //TODO //$NON-NLS-1$
	}

	public final void notifyUpdatedEARs() {
		String earProjectName = getStringProperty(EAR_PROJECT_NAME);
		notifyListeners(EAR_PROJECT_NAME, WTPOperationDataModelListener.VALID_VALUES_CHG, earProjectName, earProjectName);
	}

	protected boolean doSetProperty(String propertyName, Object propertyValue) {
		if (propertyName.equals(PROJECT_NAME)) {
			if (!isSet(EAR_PROJECT_NAME)) {
				boolean disableNotification = isNotificationEnabled();
				try {
					if (disableNotification) {
						setNotificationEnabled(false);
					}
					String earProjectName = getDefaultEARName((String) propertyValue);
					applicationCreationDataModel.setProperty(EnterpriseApplicationCreationDataModel.PROJECT_NAME, earProjectName);
					getAddModuleToApplicationDataModel().setProperty(AddModuleToEARDataModel.PROJECT_NAME, earProjectName);
				} finally {
					if (disableNotification) {
						setNotificationEnabled(true);
					}
				}
			}
		}
		boolean returnValue = super.doSetProperty(propertyName, propertyValue);
		if (propertyName.equals(J2EE_MODULE_VERSION)) {
			int j2eeVersion = getJ2EEVersion();
			boolean shouldModifyServerTarget = true;
			if (getBooleanProperty(J2EEModuleCreationDataModel.ADD_TO_EAR)) {
				String earProjectName = getStringProperty(J2EEModuleCreationDataModel.EAR_PROJECT_NAME);
				IProject earProject = getProjectHandleFromName(earProjectName);
				if (null != earProject && earProject.exists()) {
					shouldModifyServerTarget = false;
				}
			}
			if (shouldModifyServerTarget) {
				getServerTargetDataModel().setIntProperty(ServerTargetDataModel.J2EE_VERSION_ID, j2eeVersion);
				applicationCreationDataModel.setIntProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, j2eeVersion);
			}
			notifyUpdatedEARs();
			return true;
		}
		if (propertyName.equals(J2EE_VERSION)) {
			Integer modVersion = convertJ2EEVersionToModuleVersion((Integer) propertyValue);
			setProperty(J2EE_MODULE_VERSION, modVersion);
			return false;
		}
		if (propertyName.equals(EAR_PROJECT_NAME)) {
			if (checkForNewEARProjectName((String) propertyValue))
				applicationCreationDataModel.enableValidation();
			else
				applicationCreationDataModel.disableValidation();
			applicationCreationDataModel.setProperty(EnterpriseApplicationCreationDataModel.PROJECT_NAME, propertyValue);
			getAddModuleToApplicationDataModel().setProperty(AddModuleToEARDataModel.PROJECT_NAME, propertyValue);
		} else if (PROJECT_LOCATION.equals(propertyName)) {
			getProjectDataModel().setProperty(ProjectCreationDataModel.PROJECT_LOCATION, propertyValue);
		}


		if (propertyName.equals(PROJECT_NAME)) {
			IProject project = getTargetProject();
			getAddModuleToApplicationDataModel().setProperty(AddModuleToEARDataModel.ARCHIVE_PROJECT, project);
			if (!isSet(EAR_PROJECT_NAME)) {
				String earProjectName = getStringProperty(EAR_PROJECT_NAME);
				notifyListeners(EAR_PROJECT_NAME, earProjectName, earProjectName);
				synchUPServerTargetWithEAR();
			}
			jarDependencyDataModel.setProperty(UpdateManifestDataModel.PROJECT_NAME, propertyValue);
		}

		if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName)) {
			synchUPServerTargetWithEAR();
		}

		if (IS_ENABLED.equals(propertyName) || ADD_TO_EAR.equals(propertyName)) {
			notifyEnablementChange(ADD_TO_EAR);
		}

		return returnValue;
	}

	private boolean checkForNewEARProjectName(String projectName) {
		IProject project = getProjectHandleFromName(projectName);
		if (project != null && project.exists())
			return false;
		return true;
	}

	private void synchUPServerTargetWithEAR() {
		if (getBooleanProperty(J2EEModuleCreationDataModel.ADD_TO_EAR)) {
			String earProjectName = getStringProperty(J2EEModuleCreationDataModel.EAR_PROJECT_NAME);
			IProject earProject = getProjectHandleFromName(earProjectName);
			if (null != earProject && earProject.exists() && earProject.isAccessible()) {
				EARNatureRuntime earNature = EARNatureRuntime.getRuntime(earProject);
				if (earNature != null) {
					int j2eeVersion = earNature.getJ2EEVersion();
					getServerTargetDataModel().setIntProperty(ServerTargetDataModel.J2EE_VERSION_ID, j2eeVersion);
					applicationCreationDataModel.setIntProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, j2eeVersion);
					IRuntime target = ServerCore.getProjectProperties(earProject).getRuntimeTarget();
					if (null != target) {
						setProperty(SERVER_TARGET_ID, target.getId());
					}
				}
				notifyUpdatedEARs();

			} else {
				int j2eeVersion = getJ2EEVersion();
				getServerTargetDataModel().setIntProperty(ServerTargetDataModel.J2EE_VERSION_ID, j2eeVersion);
				applicationCreationDataModel.setIntProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, j2eeVersion);
				notifyUpdatedEARs();
			}
		} else {
			int j2eeVersion = getJ2EEVersion();
			getServerTargetDataModel().setIntProperty(ServerTargetDataModel.J2EE_VERSION_ID, j2eeVersion);
			applicationCreationDataModel.setIntProperty(EnterpriseApplicationCreationDataModel.APPLICATION_VERSION, j2eeVersion);
			notifyUpdatedEARs();
		}
		notifyEnablementChange(SERVER_TARGET_ID);
	}

	protected Boolean basicIsEnabled(String propertyName) {
		Boolean enabled = super.basicIsEnabled(propertyName);
		if (enabled.booleanValue()) {
			if (propertyName.equals(EAR_PROJECT_NAME)) {
				enabled = (Boolean) getProperty(ADD_TO_EAR);
			} else if (propertyName.equals(SERVER_TARGET_ID)) {
				if (!getBooleanProperty(J2EEModuleCreationDataModel.ADD_TO_EAR)) {
					return Boolean.TRUE;
				}
				String earProjectName = getStringProperty(J2EEModuleCreationDataModel.EAR_PROJECT_NAME);
				IProject earProject = getProjectHandleFromName(earProjectName);
				enabled = new Boolean(null == earProject || !earProject.exists());
			}
		}
		return enabled;
	}

	/**
	 * Subclasses should override to convert the j2eeVersion to a module version id. By default we
	 * return the j2eeVersion which is fine if no conversion is necessary.
	 * 
	 * @param integer
	 * @return
	 */
	protected Integer convertJ2EEVersionToModuleVersion(Integer j2eeVersion) {
		return j2eeVersion;
	}

	/**
	 * @return
	 */
	public final EnterpriseApplicationCreationDataModel getApplicationCreationDataModel() {
		return applicationCreationDataModel;
	}

	protected final AddModuleToEARDataModel getAddModuleToApplicationDataModel() {
		return addModuleToEARDataModel;
	}

	public final JavaProjectCreationDataModel getJavaProjectCreationDataModel() {
		return (JavaProjectCreationDataModel) getProjectDataModel();
	}

	protected void initProjectModel() {
		setProjectDataModel(new JavaProjectCreationDataModel());
	}


	protected final void setJ2EENatureID(String J2EENatureID) {
		this.J2EENatureID = J2EENatureID;
	}

	public final String getJ2EENatureID() {
		return J2EENatureID;
	}

	protected WTPPropertyDescriptor[] doGetValidPropertyDescriptors(String propertyName) {
		if (propertyName.equals(J2EE_MODULE_VERSION)) {
			return getValidJ2EEModuleVersionDescriptors();
		} else if (propertyName.equals(EAR_PROJECT_NAME)) {
			int j2eeVersion = getJ2EEVersion();
			IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
			ArrayList projectList = new ArrayList();
			int earVersion = 0;
			EARNatureRuntime earNature = null;
			for (int i = 0; i < projects.length; i++) {
				try {
					earNature = (EARNatureRuntime) projects[i].getNature(IEARNatureConstants.NATURE_ID);
					if (earNature != null) {
						earVersion = earNature.getJ2EEVersion();
						if (j2eeVersion <= earVersion) {
							projectList.add(projects[i].getName());
						}
					}
				} catch (CoreException e) {
				}
			}
			WTPPropertyDescriptor[] descriptors = new WTPPropertyDescriptor[projectList.size()];
			for (int i = 0; i < descriptors.length; i++) {
				descriptors[i] = new WTPPropertyDescriptor(projectList.get(i));
			}
			return descriptors;
		}
		return super.doGetValidPropertyDescriptors(propertyName);
	}

	public final int getJ2EEVersion() {
		return convertModuleVersionToJ2EEVersion(getIntProperty(J2EE_MODULE_VERSION));
	}

	protected IStatus doValidateProperty(String propertyName) {
		if (EAR_PROJECT_NAME.equals(propertyName) && getBooleanProperty(ADD_TO_EAR)) {
			return validateEARProjectNameProperty();
		} else if (J2EE_MODULE_VERSION.equals(propertyName)) {
			return validateJ2EEModuleVersionProperty();
		} else if (NESTED_MODEL_VALIDATION_HOOK.equals(propertyName)) {
			IStatus status = getServerTargetDataModel().validateProperty(ServerTargetDataModel.RUNTIME_TARGET_ID);
			if (!status.isOK()) {
				return status;
			}
			if (getBooleanProperty(ADD_TO_EAR)) {
				status = applicationCreationDataModel.validateProperty(ServerTargetDataModel.RUNTIME_TARGET_ID);
				if (!status.isOK() || getServerTargetDataModel().getRuntimeTarget() != applicationCreationDataModel.getServerTargetDataModel().getRuntimeTarget()) {
					return WTPCommonPlugin.createErrorStatus(EARCreationResourceHandler.getString(EARCreationResourceHandler.SERVER_TARGET_NOT_SUPPORT_EAR));
				}
			}
		}

		return super.doValidateProperty(propertyName);
	}

	private IStatus validateJ2EEModuleVersionProperty() {
		int j2eeVersion = getIntProperty(J2EE_MODULE_VERSION);
		if (j2eeVersion == -1)
			return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.J2EE_SPEC_LEVEL_NOT_FOUND));
		return OK_STATUS;
	}

	private IStatus validateEARProjectNameProperty() {
		IProject earProject = applicationCreationDataModel.getTargetProject();
		if (null != earProject && earProject.exists()) {
			if (earProject.isOpen()) {
				try {
					EARNatureRuntime earNature = (EARNatureRuntime) earProject.getNature(IEARNatureConstants.NATURE_ID);
					if (earNature == null) {
						return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.PROJECT_NOT_EAR, new Object[]{earProject.getName()}));
					} else if (earNature.getJ2EEVersion() < getJ2EEVersion()) {
						String earVersion = EnterpriseApplicationCreationDataModel.getVersionString(earNature.getJ2EEVersion());
						return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.INCOMPATABLE_J2EE_VERSIONS, new Object[]{earProject.getName(), earVersion}));
					}
					return OK_STATUS;
				} catch (CoreException e) {
					return new Status(IStatus.ERROR, J2EEPlugin.PLUGIN_ID, -1, null, e);
				}
			}
			return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.PROJECT_ClOSED, new Object[]{earProject.getName()}));
		} else if (null != earProject && null != getTargetProject()) {
			if (earProject.getName().equals(getTargetProject().getName())) {
				return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{earProject.getName()}));
			} else if (!CoreFileSystemLibrary.isCaseSensitive()) {
				if (earProject.getName().toLowerCase().equals(getTargetProject().getName().toLowerCase())) {
					return WTPCommonPlugin.createErrorStatus(WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{earProject.getName()}));
				}
			}
		}
		IStatus status = applicationCreationDataModel.validateProperty(EnterpriseApplicationCreationDataModel.PROJECT_NAME);
		if (status.isOK()) {
			status = applicationCreationDataModel.validateProperty(EnterpriseApplicationCreationDataModel.PROJECT_LOCATION);
		}
		return status;
	}

	protected abstract WTPPropertyDescriptor[] getValidJ2EEModuleVersionDescriptors();

	protected abstract int convertModuleVersionToJ2EEVersion(int moduleVersion);

	protected abstract EClass getModuleType();

	protected abstract String getModuleExtension();

	/**
	 * @return
	 */
	public final UpdateManifestDataModel getUpdateManifestDataModel() {
		return jarDependencyDataModel;
	}

	private ClassPathSelection cachedSelection;

	public final ClassPathSelection getClassPathSelection() {
		boolean createNew = false;
		if (null == cachedSelection || !getApplicationCreationDataModel().getTargetProject().getName().equals(cachedSelection.getEARFile().getURI())) {
			createNew = true;
		}
		// close an existing cachedSelection
		if (createNew && cachedSelection != null) {
			EARFile earFile = cachedSelection.getEARFile();
			if (earFile != null)
				earFile.close();
		}

		if (createNew && getTargetProject() != null) {
			cachedSelection = ClasspathSelectionHelper.createClasspathSelection(getTargetProject(), getModuleExtension(), getApplicationCreationDataModel().getTargetProject(), getModuleType());
		}
		return cachedSelection;
	}


	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModel#dispose()
	 */
	public void dispose() {
		if (cachedSelection != null)
			cachedSelection.getEARFile().close();
		super.dispose();
	}

	public void propertyChanged(WTPOperationDataModelEvent event) {
		super.propertyChanged(event);
		if (event.getDataModel() == getServerTargetDataModel() && event.getFlag() == WTPOperationDataModelEvent.PROPERTY_CHG && event.getPropertyName().equals(ServerTargetDataModel.RUNTIME_TARGET_ID)) {
			applicationCreationDataModel.setProperty(event.getPropertyName(), event.getNewValue());
			notifyListeners(NESTED_MODEL_VALIDATION_HOOK, null, null);
		} else if (event.getDataModel() == applicationCreationDataModel && event.getFlag() == WTPOperationDataModelEvent.PROPERTY_CHG && event.getPropertyName().equals(EnterpriseApplicationCreationDataModel.PROJECT_NAME)) {
			synchUPServerTargetWithEAR();
		} else if (event.getDataModel() == addModuleToEARDataModel && event.getFlag() == WTPOperationDataModelEvent.PROPERTY_CHG && event.getPropertyName().equals(AddModuleToEARDataModel.PROJECT_NAME)) {
			applicationCreationDataModel.setProperty(EnterpriseApplicationCreationDataModel.PROJECT_NAME, event.getNewValue());
		}
	}

}

Back to the top