Skip to main content
summaryrefslogtreecommitdiffstats
blob: b17408013bbd12d96016e9ca5dbd85203794861f (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
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
/*******************************************************************************
 * 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.jst.j2ee.internal.web.archive.operations;


import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.jst.j2ee.commonarchivecore.internal.Archive;
import org.eclipse.jst.j2ee.commonarchivecore.internal.File;
import org.eclipse.jst.j2ee.commonarchivecore.internal.WARFile;
import org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException;
import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveConstants;
import org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.FileIterator;
import org.eclipse.jst.j2ee.commonarchivecore.internal.util.ArchiveUtil;
import org.eclipse.jst.j2ee.internal.archive.operations.J2EESaveStrategyImpl;
import org.eclipse.jst.j2ee.internal.plugin.LibCopyBuilder;
import org.eclipse.jst.j2ee.internal.web.operations.WebPropertiesUtil;

import org.eclipse.jem.util.emf.workbench.WorkbenchByteArrayOutputStream;
import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverter;
import org.eclipse.jem.util.emf.workbench.WorkbenchURIConverterImpl;

/**
 * @author: Kevin Bauer
 */
public class WTProjectSaveStrategyImpl extends J2EESaveStrategyImpl {
	HashMap filesToSave;

	//protected List libModules;
	// Need .websettings to determine which jars are actually WLP/utility jars
	//protected WebSettings webSettings;
	//protected HashMap createdProjectsMap;
	//protected boolean isNestedWAR = false;
	protected WebModuleImportDataModel dataModel;

	public static final String WEBSETTINGS_FILE_URI = ".websettings"; //$NON-NLS-1$

	/**
	 * WorkbenchSaveStrategyImpl constructor comment.
	 */
	public WTProjectSaveStrategyImpl(IProject project) {
		super(project);
	}

	/**
	 * Return the container that represents the root of this war file
	 */
	public IContainer getModuleServerRoot() {
		return WebPropertiesUtil.getModuleServerRoot(project);
	}

	/**
	 * Return an output stream for the input file.
	 */
	public OutputStream getOutputStream(String uri) throws Exception {
		return getURIConverter(uri).createOutputStream(URI.createURI(uri));
	}

	public IFile getSaveFile(String aURI) {
		String saveURI = (String) filesToSave.get(aURI);
		try {
			return getURIConverter(aURI).getFile(saveURI);
		} catch (Exception exc) {
			return null;
		}
	}

	public WorkbenchURIConverter getSourceURIConverter() {
		if (sourceURIConverter == null) {
			sourceURIConverter = new WorkbenchURIConverterImpl(getModuleServerRoot());
			sourceURIConverter.setForceSaveRelative(true);
		}
		return sourceURIConverter;
	}

	public WorkbenchURIConverter getURIConverter(String uri) throws Exception {
		return new WorkbenchURIConverterImpl(project);
	}

	/**
	 * Return the web nature for the war project.
	 */
//	public J2EEWebNatureRuntime getWebNature() {
//		return J2EEWebNatureRuntimeUtilities.getJ2EERuntime(project);
//	}

	protected void saveFiles(FileIterator iterator) throws SaveFailureException {
		while (iterator.hasNext()) {
			File aFile = iterator.next();
			if (shouldSave(aFile))
				save(aFile, iterator);
		}
	}

	//    private void setUpWLPs() {
	//        if (!(getLibModules().isEmpty())) {
	//            ILibModule[] libModArray = new ILibModule[libModules.size()];
	//            for (int i = 0; i < libModules.size(); i++) {
	//                libModArray[i] = (ILibModule) libModules.get(i);
	//            }
	//            try {
	//                getWebNature().setLibModules(libModArray);
	//            } catch (CoreException e) {
	//                Logger.getLogger().logError(e);
	//            }
	//        }
	//    }

	protected boolean shouldSave(String uri) {
		//if (uri.endsWith(WEBSETTINGS_FILE_URI)) {
		//	return false;
		//}
		if (isProjectMetaFile(uri))
			return includeProjectMetaFiles;
		boolean shouldSave = getFilter().shouldSave(uri, getArchive());
		if (shouldSave && overwriteHandler != null) {
			return (shouldOverwrite(uri));
		}
		return shouldSave;
	}

	protected boolean isProjectMetaFile(String uri) {
		return super.isProjectMetaFile(uri) || WEBSETTINGS_FILE_URI.equals(uri);
	}


	protected List getClassesFiles() {
		return ((WARFile) getArchive()).getClasses();
	}

	protected List getJarFiles() {
		return ((WARFile) getArchive()).getArchiveFiles();
	}

	protected String convertToImportedClassesURI(String uri) {
		IPath path = new Path(LibCopyBuilder.IMPORTED_CLASSES_PATH);
		path = path.append(WTProjectStrategyUtils.makeRelative(uri, ArchiveConstants.WEBAPP_CLASSES_URI));
		return path.toString();
	}

	protected String convertToSourceURI(String uri) {
		IFolder javaSource = (IFolder) WebPropertiesUtil.getJavaSourceFolder(project);
		IPath path = javaSource.getProjectRelativePath();
		path = path.append(uri);
		return path.toString();
	}

	protected String convertToContentURI(String uri) {
		if (isProjectMetaFile(uri))
			return uri;
		IPath path = WebPropertiesUtil.getModuleServerRoot(project).getProjectRelativePath();
		path = path.append(uri);
		return path.toString();
	}

	protected void saveFiles() throws SaveFailureException {
		WARFile warFile = (WARFile) getArchive();
		// First go through the classes in the WEB-INF/classes directory and try
		// to find a source file for each one file there. If a source file is found, copy
		// it to the source directory, if not, copy the .class file to the
		// imported_classes directory.
		List classesFiles = getClassesFiles();
		Iterator classesIterator = classesFiles.iterator();
		filesToSave = new HashMap();
		HashMap libModuleFiles = new HashMap();
		boolean hasSource = false;
		boolean hasClasses = false;
		while (classesIterator.hasNext()) {
			File classFile = (File) classesIterator.next();
			if (WTProjectStrategyUtils.isClassFile(classFile.getURI())) {
				hasClasses = true;
				File copyFile = warFile.getSourceFile(classFile);
				String saveURI = null;
				if (copyFile == null) {
					copyFile = classFile;
					saveURI = convertToImportedClassesURI(copyFile.getURI());
				} else {
					IPath sourcePath = new Path(copyFile.getURI());
					IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI));
					String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString();
					saveURI = convertToSourceURI(relSourceURI);
					hasSource = true;
				}
				filesToSave.put(classFile.getURI(), null);
				filesToSave.put(copyFile.getURI(), saveURI);
			}
		}
		// If there were no class files, then put any other resource in the classes
		// directory to the source folder.
		if (!hasClasses)
			hasSource = true;
		// Next go through the classes directory again saving all of the files that were
		// not previously saved. This handles the resource files.
		classesIterator = classesFiles.iterator();
		while (classesIterator.hasNext()) {
			File classFile = (File) classesIterator.next();
			if (!filesToSave.containsKey(classFile.getURI())) {
				File copyFile = warFile.getSourceFile(classFile);
				// If its a java file, put it into the source directory
				if (!hasSource && WTProjectStrategyUtils.isSourceFile(classFile.getURI()))
					hasSource = true;
				String saveURI = null;
				if (!hasSource) {
					saveURI = convertToImportedClassesURI(classFile.getURI());
				} else {
					IPath sourcePath = new Path(classFile.getURI());
					IPath relClassPath = new Path(WTProjectStrategyUtils.makeRelative(classFile.getURI(), ArchiveConstants.WEBAPP_CLASSES_URI));
					String relSourceURI = sourcePath.removeFirstSegments(sourcePath.segmentCount() - relClassPath.segmentCount()).toString();
					saveURI = convertToSourceURI(relSourceURI);
				}
				filesToSave.put(classFile.getURI(), saveURI);
				if (copyFile != null)
					filesToSave.put(copyFile.getURI(), null);
			}
		}
		//        if (isNestedWAR()) {
		//            if (!includeProjectMetaFiles) {
		//                if (checkCreateProjectOption())
		//                    createSourceProjectsForSelectJars(libModuleFiles);
		//                setUpWLPs();
		//            } else
		//                createProjectsToIncludeProjectMetaData(libModuleFiles);
		//        }
		// Finally, make a pass through all of the files now, saving them to the appropriate place
		// if they have not yet been saved.
		List allFiles = getArchive().getFiles();
		for (Iterator iter = allFiles.iterator(); iter.hasNext();) {
			File file = (File) iter.next();
			if (!filesToSave.containsKey(file.getURI())) {
				if (!libModuleFiles.containsKey(file.getURI())) {
					String saveURI = convertToContentURI(file.getURI());
					filesToSave.put(file.getURI(), saveURI);
				}
			}
		}
		super.saveFiles();
		//updateProjectClasspaths();
	}

	//    private void createProjectsToIncludeProjectMetaData(HashMap libModuleFiles) throws
	// SaveFailureException {
	//        // Next go through the jar files to determine if there are wlp files to
	//        // expand into binary projects. Only if webSettings file has been saved
	//        ILibModule[] libModules = getLooseLibsModules();
	//        List jarFiles = getJarFiles();
	//        if (libModules != null && jarFiles != null) {
	//
	//            Iterator jarIterator = jarFiles.iterator();
	//            while (jarIterator.hasNext()) {
	//                File jarFile = (File) jarIterator.next();
	//                for (int i = 0; i < libModules.length; i++) {
	//                    if (jarFile.getName().equals(libModules[i].getJarName())) {
	//                        saveArchiveAsJavaProject((Archive) jarFile, libModules[i]);
	//                        libModuleFiles.put(jarFile.getURI(), null);
	//                    }
	//                }
	//            }
	//        }
	//    }

	/**
	 *  
	 */
	//    private void createSourceProjectsForSelectJars(HashMap libModuleFiles) throws
	// SaveFailureException {
	//        List jarFiles = getJarFiles();
	//        Iterator jarIterator = jarFiles.iterator();
	//        while (jarIterator.hasNext()) {
	//            File jarFile = (File) jarIterator.next();
	//            if (checkCreateProjectOptions(jarFile)) {
	//                saveArchiveAsJavaProject((Archive) jarFile);
	//                libModuleFiles.put(jarFile.getURI(), null);
	//            }
	//
	//        }
	//    }
	/**
	 *  
	 */
	//    private void updateProjectClasspaths() {
	//        try {
	//            if (createdProjectsMap == null)
	//                return;
	//            List libModules = getJarFiles();
	//            for (int i = 0; i < libModules.size(); i++) {
	//                Archive module = (Archive) libModules.get(i);
	//                Object object = createdProjectsMap.get(module.getURI());
	//                if (object != null) {
	//                    IProject proj = (IProject) object;
	//                    IPath path = proj.getFullPath();
	//                    IClasspathEntry newEntry = JavaCore.newProjectEntry(path, false);
	//                    ProjectUtilities.appendJavaClassPath(project, newEntry);
	//                }
	//            }
	//        } catch (JavaModelException ex) {
	//            Logger.getLogger().logError(ex);
	//        }
	//    }
	//    /**
	//     * @return
	//     */
	//    private boolean checkCreateProjectOption() {
	//        return createWLProjectOptions != null && !createWLProjectOptions.isEmpty();
	//    }
	//
	//    /**
	//     * @return
	//     */
	//    private boolean checkCreateProjectOptions(File jarFile) {
	//        return createWLProjectOptions != null &&
	// createWLProjectOptions.containsKey(jarFile.getURI());
	//    }
	/**
	 * @see com.ibm.etools.archive.SaveStrategy
	 */
	public void save(File aFile, FileIterator iterator) throws SaveFailureException {
		if (aFile.isArchive() && dataModel.handlesArchive((Archive) aFile)) {
			return;
		}

		if (aFile.isArchive() && shouldIterateOver((Archive) aFile)) {
			save((Archive) aFile);
		} else {
			InputStream in = null;
			if (!aFile.isDirectoryEntry()) {
				try {
					in = iterator.getInputStream(aFile);
				} catch (IOException ex) {
					throw new SaveFailureException(aFile.getURI(), ex);
				}
			}
			String saveURI = (String) filesToSave.get(aFile.getURI());
			if (saveURI != null)
				save(saveURI, in);
		}
	}

	/**
	 * save method comment.
	 */
	public void save(String outputURI, InputStream in) throws SaveFailureException {
		getProgressMonitor().subTask(outputURI);
		try {
			WorkbenchURIConverter conv = getProjectMetaURIConverter();
			IFile aFile = conv.getOutputFileWithMappingApplied(outputURI);
			validateEdit(aFile);
			OutputStream out = new WorkbenchByteArrayOutputStream(aFile);
			ArchiveUtil.copy(in, out);
		} catch (Exception e) {
			throw new SaveFailureException(e.getMessage(), e);
		}
		worked(1);
	}

	//    protected ILibModule[] getLooseLibsModules() {
	//        try {
	//            File webSettingsFile = (((WARFile) getArchive()).getFile(WEBSETTINGS_FILE_URI));
	//
	//            ILibModule[] wlpModules;
	//            if (webSettingsFile != null) {
	//                WebSettings webSettings = new WebSettings(project, webSettingsFile);
	//                if (webSettings != null) {
	//                    wlpModules = webSettings.getLibModules();
	//                    return wlpModules;
	//                }
	//            }
	//        } catch (FileNotFoundException ex) {
	//            return new ILibModule[0];
	//        }
	//        return new ILibModule[0];
	//    }

	//    protected void saveArchiveAsJavaProject(Archive jarFile, ILibModule libModule) throws
	// SaveFailureException {
	//        IProject nestedProject = null;
	//        if (createdProjectsMap == null)
	//            createdProjectsMap = new HashMap();
	//        // Do overwrite protection
	//        if (shouldSaveWLProject(libModule)) {
	//            String projectName = createWLProjectOptions == null ? null : (String)
	// createWLProjectOptions.get(jarFile.getURI());
	//            if (projectName == null)
	//                projectName = libModule.getProjectName();
	//
	//            WebProjectCreationDataModel model = new WebProjectCreationDataModel();
	//            model.setProperty(WebProjectCreationDataModel.CREATE_DEFAULT_FILES, Boolean.FALSE);
	//            model.setProperty(WebProjectCreationDataModel.PROJECT_NAME, projectName);
	//            IHeadlessRunnableWithProgress projOp = new WebProjectCreationOperation(model);
	//            executeOperation(projOp);
	//            nestedProject = model.getProject();
	//            createdProjectsMap.put(jarFile.getURI(), nestedProject);
	//
	//            if (isBinary() || includeProjectMetaFiles) {
	//                saveBinaryProject(nestedProject, jarFile);
	//            } else {
	//                JavaProjectSaveStrategyImpl strat = new JavaProjectSaveStrategyImpl(nestedProject);
	//                strat.setIncludeProjectMetaFiles(includeProjectMetaFiles);
	//                strat.setShouldIncludeImportedClasses(true);
	//                strat.setProgressMonitor(new SubProgressMonitor(progressMonitor, 1));
	//                jarFile.save(strat);
	//
	//                if (includeProjectMetaFiles) {
	//                    try {
	//                        ProjectUtilities.forceClasspathReload(nestedProject);
	//                    } catch (JavaModelException ex) {
	//                        Logger.getLogger().logError(ex);
	//                    }
	//                }
	//            }
	//            // Keep list of Library modules to readd to websettings
	//            if (!includeProjectMetaFiles)
	//                getLibModules().add(libModule);
	//        }
	//
	//    }

	//    /**
	//     * @param object
	//     */
	//    private void executeOperation(IHeadlessRunnableWithProgress op) {
	//        try {
	//            op.run(new NullProgressMonitor());
	//        } catch (java.lang.reflect.InvocationTargetException e) {
	//            Logger.getLogger().logError(e);
	//        } catch (InterruptedException ex) {
	//            Logger.getLogger().logError(ex);
	//        }
	//    }

	//    protected IProject saveArchiveAsJavaProject(Archive jarFile) throws SaveFailureException {
	//        IProject nestedProject = null;
	//        if (createdProjectsMap == null)
	//            createdProjectsMap = new HashMap();
	//        // Do overwrite protection
	//        J2EEJavaProjectInfo javaProjectInfo = new J2EEJavaProjectInfo();
	//        String projectName = (String) createWLProjectOptions.get(jarFile.getURI());
	//        J2EEProjectCreationDataModel model = new J2EEProjectCreationDataModel();
	//        model.setProperty(J2EEProjectCreationDataModel.PROJECT_NAME, projectName);
	//        model.setProperty(J2EEProjectCreationDataModel.CREATE_DEFAULT_FILES, Boolean.FALSE);
	//        IHeadlessRunnableWithProgress op = new JavaUtilityJARProjectCreationOperation(model);
	//        nestedProject = model.getProject();
	//        createdProjectsMap.put(jarFile.getURI(), nestedProject);
	//        if (isBinary()) {
	//            saveBinaryProject(nestedProject, jarFile);
	//        } else {
	//            JavaProjectSaveStrategyImpl strat = new JavaProjectSaveStrategyImpl(nestedProject);
	//            strat.setIncludeProjectMetaFiles(includeProjectMetaFiles);
	//            strat.setShouldIncludeImportedClasses(true);
	//            strat.setProgressMonitor(new SubProgressMonitor(progressMonitor, 1));
	//            jarFile.save(strat);
	//            if (includeProjectMetaFiles) {
	//                try {
	//                    ProjectUtilities.forceClasspathReload(nestedProject);
	//                } catch (JavaModelException ex) {
	//                    Logger.getLogger().logError(ex);
	//                }
	//            }
	//        }
	//        return nestedProject;
	//    }
	//    protected void saveBinaryProject(IProject aProject, Archive nested) throws
	// SaveFailureException {
	//        saveJARInBinaryProject(aProject, nested);
	//        if (includeProjectMetaFiles) {
	//            try {
	//                ProjectUtilities.forceClasspathReload(aProject);
	//            } catch (JavaModelException ex) {
	//                Logger.getLogger().logError(ex);
	//            }
	//            // ensureBinary(nested, aProject);
	//        }
	//
	//        // try {
	//        // IPath path = aFile.getFullPath();
	//        // IClasspathEntry newEntry = JavaCore.newLibraryEntry(path, path, null, true);
	//        // ProjectUtilities.appendJavaClassPath(aProject, newEntry);
	//        // } catch (JavaModelException ex) {
	//        // Logger.getLogger().logError(ex);
	//        // }
	//
	//        J2EEModuleNature nature = (J2EEModuleNature) J2EENature.getRegisteredRuntime(aProject);
	//        if (nature != null)
	//            nature.recomputeBinaryProject();
	//    }

	//    protected IFile saveJARInBinaryProject(IProject project, Archive nested) throws
	// SaveFailureException {
	//        IFile savedArchive = null;
	//        try {
	//            // savedArchive = saveFile(nested, project);
	//            // Put directly in the root directory, remove the WEB-INF/lib segments
	//            IPath path = new Path(nested.getURI());
	//            path = path.removeFirstSegments(2);
	//            IFile iFile = project.getFile(path.toString());
	//            WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(iFile);
	//            ArchiveUtil.copy(nested.getInputStream(), out);
	//            savedArchive = iFile;
	//            if (includeProjectMetaFiles) {
	//                saveEnclosedFile(nested, project, CLASSPATH_FILE_URI);
	//                saveEnclosedFile(nested, project, PROJECT_FILE_URI);
	//            }
	//
	//            return savedArchive;
	//        } catch (IOException io) {
	//            throw new SaveFailureException(archive.getURI(), io);
	//        }
	//    }
	protected void saveEnclosedFile(Archive anArchive, IProject p, String uri) throws IOException {
		try {
			File aFile = anArchive.getFile(uri);
			saveFile(aFile, p);
		} catch (FileNotFoundException ignore) {
			//Ignore
		}
	}

	protected IFile saveFile(File aFile, IProject p) throws IOException {
		IFile iFile = p.getFile(aFile.getURI());
		WorkbenchByteArrayOutputStream out = new WorkbenchByteArrayOutputStream(iFile);
		ArchiveUtil.copy(aFile.getInputStream(), out);
		return iFile;
	}

	//    protected boolean shouldSaveWLProject(ILibModule libModule) {
	//        IProject wlProject = libModule.getProject();
	//        // Do overwrite protection
	//        if (wlProject != null && wlProject.exists()) {
	//            if (overwriteHandler != null) {
	//                return (overwriteHandler.shouldOverwriteWLProject(wlProject, libModule.getProjectName()));
	//            }
	//        }
	//        return true;
	//    }

	//    protected void initializeLibModules() {
	//        // Get the existing lib modules from the web nature
	//        ILibModule[] libModulesAry = getWebNature().getLibModules();
	//        libModules = new Vector(libModulesAry.length);
	//        for (int i = 0; i < libModulesAry.length; i++) {
	//            libModules.add(libModulesAry[i]);
	//        }
	//    }

	//    protected List getLibModules() {
	//        if (libModules == null)
	//            initializeLibModules();
	//        return libModules;
	//    }

	//    public void setNestedWAR(boolean isNested) {
	//        this.isNestedWAR = isNested;
	//    }
	//    public boolean isNestedWAR() {
	//        return isNestedWAR;
	//    }

	public void setDataModel(WebModuleImportDataModel model) {
		this.dataModel = model;
	}

}

Back to the top