Skip to content

Commit

Permalink
Add support for Product Update-site names
Browse files Browse the repository at this point in the history
P2 part of #345
  • Loading branch information
HannesWell committed Oct 19, 2023
1 parent bc8eb82 commit 413c76a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2018 IBM Corporation and others.
* Copyright (c) 2005, 2023 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -1075,11 +1075,13 @@ private void processPluginConfiguration(Attributes attributes) {
private void processRepositoryInformation(Attributes attributes) {
try {
URI uri = URIUtil.fromString(attributes.getValue(ATTRIBUTE_LOCATION));
String name = attributes.getValue(ATTRIBUTE_NAME);
boolean enabled = Boolean.parseBoolean(attributes.getValue(ATTRIBUTE_ENABLED));
int options = enabled ? IRepository.ENABLED : IRepository.NONE;
// First add a metadata repository
repositories.add(new RepositoryReference(uri, null, IRepository.TYPE_METADATA, enabled ? IRepository.ENABLED : IRepository.NONE));
repositories.add(new RepositoryReference(uri, name, IRepository.TYPE_METADATA, options));
// Now a colocated artifact repository
repositories.add(new RepositoryReference(uri, null, IRepository.TYPE_ARTIFACT, enabled ? IRepository.ENABLED : IRepository.NONE));
repositories.add(new RepositoryReference(uri, name, IRepository.TYPE_ARTIFACT, options));
} catch (URISyntaxException e) {
// ignore malformed URI's. These should have already been caught by the UI
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ protected String[] getConfigurationStrings(Collection<IConfigAdvice> configAdvic
Map<String, String> parameters = new LinkedHashMap<>();
parameters.put("type", Integer.toString(repo.getType())); //$NON-NLS-1$
parameters.put("location", repo.getLocation().toString()); //$NON-NLS-1$
if (repo.getNickname() != null) {
parameters.put("name", repo.getNickname()); //$NON-NLS-1$
}
parameters.put("enabled", Boolean.toString((repo.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); //$NON-NLS-1$
configurationData += TouchpointInstruction.encodeAction("addRepository", parameters); //$NON-NLS-1$
parameters.remove("enabled"); //$NON-NLS-1$
Expand Down

0 comments on commit 413c76a

Please sign in to comment.