return result;
}
private PluginInfo buildPluginInfo(PluginIdentity plugin) {
PluginInfo result = new PluginInfo();
result.setStatus("ACTIVATED");
result.setVersion(plugin.getCoordinates().getVersion());
// TODO: populate with OSGi info?
// if (pluginResponse.getPluginDescriptor() != null) {
// result.setName(pluginResponse.getPluginDescriptor().getPluginMetadata().getName());
// result.setDescription(pluginResponse.getPluginDescriptor().getPluginMetadata().getDescription());
// result.setScmVersion(pluginResponse.getPluginDescriptor().getPluginMetadata().getScmVersion());
// result.setScmTimestamp(pluginResponse.getPluginDescriptor().getPluginMetadata().getScmTimestamp());
// result.setSite(pluginResponse.getPluginDescriptor().getPluginMetadata().getPluginSite());
// }
// else {
result.setName(plugin.getCoordinates().getGroupId() + ":"
+ plugin.getCoordinates().getArtifactId());
// }
Collection<DocumentationBundle> docs =
docBundles.get(plugin.getCoordinates().getArtifactId());
if (docs != null && !docs.isEmpty()) {
for (DocumentationBundle bundle : docs) {
// here, we (mis)use the documentation field, to store path segments only, the REST resource will create
// proper URLs out this these.
DocumentationLink link = new DocumentationLink();
link.setLabel(bundle.getDescription());
link.setUrl(bundle.getPluginId() + "/" + bundle.getPathPrefix());
result.addDocumentation(link);
}
}
// TODO: log/diagnose OSGi issues?
// if (!pluginResponse.isSuccessful()) {