/** * <p> * Returns the version of the provided asset: * </p> * <ol> * <li>first by selecting the version specified in the bundle definition</li> * <li>or by applying the active {@link AssetVersioningStrategy} if automatic * versioning is enabled</li> * <li>or finally a version called <code>UNDEFINED_VERSION</code> that * indicates the versioning information is missing</li> * </ol> * * @param asset * The asset to extract the version from. * @return the version of the asset. */ private String getVersion(Asset asset) { // First: manual versioning if specified, coming from the // AssetStorageUnit if (StringUtils.isNotBlank(asset.getVersion())) { return asset.getVersion(); } // If enabled, auto versioning takes precedence over manual one if (this.context.getConfiguration().isAssetAutoVersioningEnabled()) { AssetVersioningStrategy avs = this.context.getActiveVersioningStrategy(); return avs.getAssetVersion(asset); } // Finally, a clear version indicating some configuration is missing return "UNDEFINED_VERSION"; }
/** * <p> * Returns the version of the provided asset: * </p> * <ol> * <li>first by selecting the version specified in the bundle definition</li> * <li>or by applying the active {@link AssetVersioningStrategy} if automatic * versioning is enabled</li> * <li>or finally a version called <code>UNDEFINED_VERSION</code> that * indicates the versioning information is missing</li> * </ol> * * @param asset * The asset to extract the version from. * @return the version of the asset. */ private String getVersion(Asset asset) { // First: manual versioning if specified, coming from the // AssetStorageUnit if (StringUtils.isNotBlank(asset.getVersion())) { return asset.getVersion(); } // If enabled, auto versioning takes precedence over manual one if (this.context.getConfiguration().isAssetAutoVersioningEnabled()) { AssetVersioningStrategy avs = this.context.getActiveVersioningStrategy(); return avs.getAssetVersion(asset); } // Finally, a clear version indicating some configuration is missing return "UNDEFINED_VERSION"; }