Metadata-only asset creation

jimp38732070

24-10-2017

Can I create an metadata-only asset?  Basically an asset record with metadata, but no asset object exists yet. Then later we update that record/asset with the actual file.  The use case is I'd like to create asset records before that actual finished good asset is ready.  That way I have an AssetID of the asset before there is an asset.

Thanks!

Jim P

AEM Assets ver. 6.3

Message was edited by: Jim Presley - added AEM version

Answers (1)

Answers (1)

jimp38732070

25-10-2017

That appears to need to reference a file though.

Asset is created by AssetManager and can be retrieved either via AssetManager or by adapting a asset Resource to an Asset.

     eg: // to create an asset AssetManager assetManager = resolver.adaptTo(AssetManager.class); Asset newAsset = assetManager.createAsset("/path/to/asset/document.pdf"); 

I'm thinking the system can't create an asset record without a file object to refer to.  I can accomplish what I need to do by creating a small file with the known final asset filename and ingest beforehand, then update with the real asset when ready.

Is that not correct?

Thanks!

Jim P