X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcms%2Fdistribution%2FA2Distribution.java;fp=org.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcms%2Fdistribution%2FA2Distribution.java;h=435d2d6f5c29f86e807492461192994a55c96938;hb=67ac344052752622d4bd3e59c4f88c2bc9f6d3b6;hp=0000000000000000000000000000000000000000;hpb=82fcb6324dc57a36a8c9c4f4b0e564a1f4ef97de;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.runtime/src/org/argeo/slc/cms/distribution/A2Distribution.java b/org.argeo.slc.runtime/src/org/argeo/slc/cms/distribution/A2Distribution.java new file mode 100644 index 000000000..435d2d6f5 --- /dev/null +++ b/org.argeo.slc.runtime/src/org/argeo/slc/cms/distribution/A2Distribution.java @@ -0,0 +1,75 @@ +package org.argeo.slc.cms.distribution; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.argeo.api.a2.A2Branch; +import org.argeo.api.a2.A2Component; +import org.argeo.api.a2.A2Contribution; +import org.argeo.api.a2.A2Module; +import org.argeo.api.a2.A2Source; +import org.argeo.slc.CategoryNameVersion; +import org.argeo.slc.DefaultCategoryNameVersion; +import org.argeo.slc.NameVersion; +import org.argeo.slc.build.Distribution; +import org.argeo.slc.build.ModularDistribution; + +public class A2Distribution implements ModularDistribution { + private List a2Sources = new ArrayList<>(); + + @Override + public String getDistributionId() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getVersion() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Iterator nameVersions() { + List nameVersions = new ArrayList<>(); + for (A2Source a2Source : a2Sources) { + for (A2Contribution a2Contribution : a2Source.listContributions(null)) { + for (A2Component a2Component : a2Contribution.listComponents(null)) { + for (A2Branch a2Branch : a2Component.listBranches(null)) { + for (A2Module a2Module : a2Branch.listModules(null)) { + CategoryNameVersion nameVersion = new DefaultCategoryNameVersion(a2Contribution.getId(), + a2Component.getId(), a2Module.getVersion().toString()); + nameVersions.add(nameVersion); + } + } + } + } + } + return nameVersions.iterator(); + } + + @Override + public Distribution getModuleDistribution(String moduleName, String moduleVersion) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getModulesDescriptor(String descriptorType) { + // TODO Auto-generated method stub + return null; + } + + public List getA2Sources() { + return a2Sources; + } + + +}