|
Lines 108-116
Link Here
|
| 108 |
private void createRootAdvice() { |
108 |
private void createRootAdvice() { |
| 109 |
Collection list; |
109 |
Collection list; |
| 110 |
if (product.useFeatures()) |
110 |
if (product.useFeatures()) |
| 111 |
list = listElements(product.getFeatures(), ".feature.group"); //$NON-NLS-1$ |
111 |
// TODO: We need a real namespace here |
|
|
112 |
list = versionElements(listElements(product.getFeatures(), ".feature.group"), "namespace"); //$NON-NLS-1$ |
| 112 |
else |
113 |
else |
| 113 |
list = listElements(product.getBundles(true), null); |
114 |
//TODO: We need a real namespace here |
|
|
115 |
list = versionElements(listElements(product.getBundles(true), null), "namespace"); |
| 114 |
info.addAdvice(new RootIUAdvice(list)); |
116 |
info.addAdvice(new RootIUAdvice(list)); |
| 115 |
} |
117 |
} |
| 116 |
|
118 |
|
|
Lines 124-129
Link Here
|
| 124 |
info.addAdvice(new ProductFileAdvice(product, configSpecs[i])); |
126 |
info.addAdvice(new ProductFileAdvice(product, configSpecs[i])); |
| 125 |
} |
127 |
} |
| 126 |
|
128 |
|
|
|
129 |
private Collection versionElements(Collection elements, String namespace) { |
| 130 |
Collection versionAdvice = info.getAdvice(null, true, null, null, IVersionAdvice.class); |
| 131 |
List result = new ArrayList(); |
| 132 |
for (Iterator i = elements.iterator(); i.hasNext();) { |
| 133 |
VersionedName element = (VersionedName) i.next(); |
| 134 |
if (element.getVersion() == null || element.getVersion().equals(new Version("0.0.0"))) { //$NON-NLS-1$ |
| 135 |
Iterator advice = versionAdvice.iterator(); |
| 136 |
Version advizedVersion = null; |
| 137 |
while (advice.hasNext()) { |
| 138 |
advizedVersion = ((VersionAdvice) advice.next()).getVersion(namespace, element.getId()); |
| 139 |
break; |
| 140 |
} |
| 141 |
// TODO: What if this version is null? |
| 142 |
result.add(new VersionedName(element.getId(), advizedVersion)); |
| 143 |
} else |
| 144 |
result.add(element); |
| 145 |
} |
| 146 |
return result; |
| 147 |
} |
| 148 |
|
| 127 |
private Collection listElements(List elements, String suffix) { |
149 |
private Collection listElements(List elements, String suffix) { |
| 128 |
if (suffix == null || suffix.length() == 0) |
150 |
if (suffix == null || suffix.length() == 0) |
| 129 |
return elements; |
151 |
return elements; |