Expand my Community achievements bar.

SOLVED

Metadata-only asset creation

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Level 10
2 Replies

Avatar

Correct answer by
Level 10

Avatar

Level 3

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