/**
* This will build the package - preparePackage would have been called first.
* This will always prioritise DRL before other assets.
*/
private void buildPackage() {
AssetSelector selector = SelectorManager.getInstance().getSelector(
selectorConfigName);
if (selector == null) {
this.errors.add(new ContentAssemblyError(this.pkg,
"The selector named " + selectorConfigName
+ " is not available."));
return;
}
Iterator<AssetItem> drls = pkg.listAssetsByFormat(new String[]{AssetFormats.DRL});
while (drls.hasNext()) {
AssetItem asset = (AssetItem) drls.next();
if (!asset.isArchived() && (selector.isAssetAllowed(asset))) {
buildAsset(asset);
}
}
Iterator<AssetItem> it = pkg.getAssets();
while (it.hasNext()) {
AssetItem asset = (AssetItem) it.next();
if (!asset.getFormat().equals(AssetFormats.DRL) && !asset.isArchived() && (selector.isAssetAllowed(asset))) {
buildAsset(asset);
}
}
}