Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 309186
Collapse All | Expand All

(-)modulecore-src/org/eclipse/wst/common/componentcore/resources/IVirtualComponent.java (+1 lines)
Lines 44-49 Link Here
44
	public static final String HARD_REFERENCES = "HARD_REFERENCES";
44
	public static final String HARD_REFERENCES = "HARD_REFERENCES";
45
	public static final String NON_DERIVED_REFERENCES = "NON_DERIVED_REFERENCES";
45
	public static final String NON_DERIVED_REFERENCES = "NON_DERIVED_REFERENCES";
46
	public static final String DISPLAYABLE_REFERENCES = "DISPLAYABLE_REFERENCES";
46
	public static final String DISPLAYABLE_REFERENCES = "DISPLAYABLE_REFERENCES";
47
	public static final String FLATTENABLE_REFERENCES = "FLATTENABLE_REFERENCES";
47
		
48
		
48
	/**
49
	/**
49
	 * The name of the component must be unique within its enclosing project.
50
	 * The name of the component must be unique within its enclosing project.
(-)modulecore-src/org/eclipse/wst/common/componentcore/internal/flat/FlatVirtualComponent.java (-2 / +7 lines)
Lines 14-19 Link Here
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
import java.util.HashMap;
15
import java.util.HashMap;
16
import java.util.List;
16
import java.util.List;
17
import java.util.Map;
17
18
18
import org.eclipse.core.resources.IContainer;
19
import org.eclipse.core.resources.IContainer;
19
import org.eclipse.core.resources.IFile;
20
import org.eclipse.core.resources.IFile;
Lines 186-192 Link Here
186
	 */
187
	 */
187
	protected void addConsumedReferences(VirtualComponentFlattenUtility util, IVirtualComponent vc, IPath root) throws CoreException {
188
	protected void addConsumedReferences(VirtualComponentFlattenUtility util, IVirtualComponent vc, IPath root) throws CoreException {
188
		List consumableMembers = new ArrayList();
189
		List consumableMembers = new ArrayList();
189
		IVirtualReference[] refComponents = vc.getReferences();
190
		Map<String, Object> options = new HashMap<String, Object>();
191
		options.put(IVirtualComponent.REQUESTED_REFERENCE_TYPE, IVirtualComponent.FLATTENABLE_REFERENCES);
192
		IVirtualReference[] refComponents = vc.getReferences(options);
190
    	for (int i = 0; i < refComponents.length; i++) {
193
    	for (int i = 0; i < refComponents.length; i++) {
191
    		IVirtualReference reference = refComponents[i];
194
    		IVirtualReference reference = refComponents[i];
192
    		if (reference != null && reference.getDependencyType()==IVirtualReference.DEPENDENCY_TYPE_CONSUMES) {
195
    		if (reference != null && reference.getDependencyType()==IVirtualReference.DEPENDENCY_TYPE_CONSUMES) {
Lines 218-224 Link Here
218
	}
221
	}
219
222
220
	protected void addUsedReferences(VirtualComponentFlattenUtility util, IVirtualComponent vc, IPath root) throws CoreException {
223
	protected void addUsedReferences(VirtualComponentFlattenUtility util, IVirtualComponent vc, IPath root) throws CoreException {
221
		IVirtualReference[] allReferences = vc.getReferences();
224
		Map<String, Object> options = new HashMap<String, Object>();
225
		options.put(IVirtualComponent.REQUESTED_REFERENCE_TYPE, IVirtualComponent.FLATTENABLE_REFERENCES);
226
		IVirtualReference[] allReferences = vc.getReferences(options);
222
    	for (int i = 0; i < allReferences.length; i++) {
227
    	for (int i = 0; i < allReferences.length; i++) {
223
    		IVirtualReference reference = allReferences[i];
228
    		IVirtualReference reference = allReferences[i];
224
			IVirtualComponent virtualComp = reference.getReferencedComponent();
229
			IVirtualComponent virtualComp = reference.getReferencedComponent();
(-)j2eecreation/org/eclipse/jst/j2ee/componentcore/J2EEModuleVirtualComponent.java (+2 lines)
Lines 119-124 Link Here
119
		if( val != null ) {
119
		if( val != null ) {
120
			if( HARD_REFERENCES.equals(val) || NON_DERIVED_REFERENCES.equals(val) || DISPLAYABLE_REFERENCES.equals(val))
120
			if( HARD_REFERENCES.equals(val) || NON_DERIVED_REFERENCES.equals(val) || DISPLAYABLE_REFERENCES.equals(val))
121
				return getHardReferences();
121
				return getHardReferences();
122
			if( FLATTENABLE_REFERENCES.equals(val))
123
				return getNonManifestReferences();
122
		}
124
		}
123
		
125
		
124
		Boolean objGetJavaRefs = (Boolean)options.get(GET_JAVA_REFS);
126
		Boolean objGetJavaRefs = (Boolean)options.get(GET_JAVA_REFS);
(-)archiveops/org/eclipse/jst/j2ee/internal/archive/operations/JavaEEComponentExportOperation.java (-2 / +17 lines)
Lines 21-29 Link Here
21
import org.eclipse.jst.common.internal.modulecore.ReplaceManifestExportParticipant;
21
import org.eclipse.jst.common.internal.modulecore.ReplaceManifestExportParticipant;
22
import org.eclipse.jst.j2ee.internal.J2EEConstants;
22
import org.eclipse.jst.j2ee.internal.J2EEConstants;
23
import org.eclipse.jst.j2ee.internal.common.exportmodel.JavaEEComponentExportCallback;
23
import org.eclipse.jst.j2ee.internal.common.exportmodel.JavaEEComponentExportCallback;
24
import org.eclipse.jst.j2ee.internal.common.exportmodel.AddJavaEEReferencesParticipant;
24
import org.eclipse.wst.common.componentcore.internal.flat.AbstractFlattenParticipant;
25
import org.eclipse.wst.common.componentcore.internal.flat.FilterResourceParticipant;
25
import org.eclipse.wst.common.componentcore.internal.flat.FilterResourceParticipant;
26
import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
26
import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
27
import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
28
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
29
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
27
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
30
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
28
31
29
public class JavaEEComponentExportOperation extends ComponentExportOperation {
32
public class JavaEEComponentExportOperation extends ComponentExportOperation {
Lines 41-47 Link Here
41
		List<IFlattenParticipant> participants = new ArrayList<IFlattenParticipant>();
44
		List<IFlattenParticipant> participants = new ArrayList<IFlattenParticipant>();
42
		String[] filteredExtensions = getFilteredExtensions();
45
		String[] filteredExtensions = getFilteredExtensions();
43
		
46
		
44
		participants.add(new AddJavaEEReferencesParticipant());
47
		participants.add(createHierarchyParticipant());
45
		participants.add(new AddMappedOutputFoldersParticipant(filteredExtensions));
48
		participants.add(new AddMappedOutputFoldersParticipant(filteredExtensions));
46
		participants.add(FilterResourceParticipant.createSuffixFilterParticipant(filteredExtensions));
49
		participants.add(FilterResourceParticipant.createSuffixFilterParticipant(filteredExtensions));
47
		participants.add(new ReplaceManifestExportParticipant(new Path(J2EEConstants.MANIFEST_URI)));
50
		participants.add(new ReplaceManifestExportParticipant(new Path(J2EEConstants.MANIFEST_URI)));
Lines 51-56 Link Here
51
		return participants;
54
		return participants;
52
	}
55
	}
53
	
56
	
57
	protected IFlattenParticipant createHierarchyParticipant() {
58
		return new AbstractFlattenParticipant() {
59
			@Override
60
			public boolean isChildModule(IVirtualComponent rootComponent, IVirtualReference reference, FlatComponentTaskModel dataModel) {
61
				if (!reference.getReferencedComponent().isBinary()) {
62
					return true;
63
				}
64
				return false;
65
			}
66
		};
67
	}
68
54
	@Override
69
	@Override
55
	protected FlatComponentArchiver createFlatComponentArchiver(OutputStream out) {
70
	protected FlatComponentArchiver createFlatComponentArchiver(OutputStream out) {
56
		return new FlatComponentArchiver(getComponent(), out, getParticipants(), new JavaEEComponentExportCallback(isExportSource()));
71
		return new FlatComponentArchiver(getComponent(), out, getParticipants(), new JavaEEComponentExportCallback(isExportSource()));

Return to bug 309186