use of org.talend.designer.components.exchange.model.RevisionInfo in project tdi-studio-se by Talend.
the class ComponentSearcher method getImportComponentExtensions.
public static List<ComponentExtension> getImportComponentExtensions(String version, ECodeLanguage language, String type) {
List<ComponentExtension> extensions = new ArrayList<ComponentExtension>();
try {
List<RevisionInfo> revisions = ExchangeUtils.getRevisionList(version, getLanguageId(language), type);
Map<String, ComponentExtension> extensionsMap = new HashMap<String, ComponentExtension>();
for (RevisionInfo revision : revisions) {
ComponentExtension extension = extensionsMap.get(revision.getExtension_id());
if (extension == null) {
extension = ExchangeFactory.eINSTANCE.createComponentExtension();
extension.setIdExtension(revision.getExtension_id() + "");
extension.setLabel(revision.getExtension_name());
extension.setAuthor(revision.getAuthor_name());
extension.setLanguage(Language.get(getLanguageId(language)));
extension.setDescription(revision.getExtension_description());
extension.setLinkDownload(revision.getDownload_url());
extension.setFilename(revision.getFilename());
extension.setVersionExtension(revision.getRevision_name());
extensionsMap.put(revision.getExtension_id() + "", extension);
extensions.add(extension);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
return extensions;
}
Aggregations