Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

This page is about Magnolia 5.3+ / DAM 2.0+ The way assets are registered and used changed. If you work with Magnolia 5.2.x or earlier, see  DAM workspace structure 1.x.

Magnolia 5.3 (DAM 2.0) includes a single implementation of the  AssetProvider interface,  JcrAssetProvider , that facilitates working with Assets stored in the dam workspace: This page provides the details of this implementation.

Workspace structure and node definitions

Here is the hierarchical structure of the dam workspace:

  • mgnl:folder (nt:folder)
    • mgnl:asset (nt:file)
      description
      title
      ...
      • mgnl:resource (nt:resource)
        jcr:data (type="Binary")
        size
        ...
    • mgnl:asset (nt:file)
    • ...

(warning) Note!

  • mgnl:asset: Contains all Asset main properties and DublinCore properties.
  • mgnl:resource: Contains the binary and MagnoliaAssetMetadata properties.

Refer to AssetNodeTypes to access to the Asset property constant definition and utility methods. AssetNodeTypes should be used to refer to JCR Asset properties and node structure.

Asset to JCR node mapping

NodeProperty NameAsset GetterDescription
mgnl:asset

(not related to a property

node.getName())

Asset.getName()JCR Asset node name.
mgnl:assetlanguageAsset.getLanguage()String representation of local ISO 639. 
mgnl:asset

(not related to a property

CompositeAssetId)

Asset.getItemKey()Composite Id build using 
new ItemKey(DamConstants.DEFAULT_JCR_PROVIDER_ID, assetNode.getIdentifier());
mgnl:assettitleAsset.getTitle()Title of the Asset.
mgnl:assetsubjectAsset.getSubject()Subject of the Asset.
mgnl:assetdescriptionAsset.getDescription()Description of the Asset.
mgnl:assetcaptionAsset.getCaption()Caption of the Asset.
mgnl:assetcopyrightAsset.getCopyright()Copyright of the Asset.
mgnl:assetcommentAsset.getComment()Comment defined on the Asset.
mgnl:assetmgnl:lastModifiedAsset.getLastModified()Last modification date of the Asset.
jcr:contentjcr:mimeTypeAsset.getMimeType()Mime Type of the Asset. (red star)
jcr:contentextensionAsset.getFileExtension()File extension of the Asset(red star)
jcr:contentfileNameAsset.getFileName()File name of the Asset. This field includes the file extension 'me.tif'. (red star)
cr:contentsizeAsset.getFileSize()Size of the Asset in bytes. (red star)
jcr:contentjcr:dataAsset.getContentStream()Asset content returned as a java.io.InputStream.
mgnl:asset(not related to a property)Asset.getPath()Asset path.
assetNode.getPath()
mgnl:asset(not related to a property)Asset.getAssetProvider()The related AssetProvider.
mgnl:asset(not related to a property)Asset.getParent()Returns the parent Folder . Equivalent to node.getParent() 
mgnl:asset(not related to a property)Asset.isFolder()Returns false
mgnl:asset(not related to a property)Asset.isAsset()Returns true

(red star) These fields are required to be at this node level hierarchy (mgnl:asset.jcr:content) by the current implementation of the Imaging module. They will be moved under the mgnl:asset node level when the Imaging module is updated to work with Assets

Folder to JCR node mapping

NodeProperty NameAsset GetterDescription
mgnl:folder

(not related to a property

node.getName())

Folder.getName()JCR Folder node name.
mgnl:folder(not related to a property)Folder.getPath()Folder path.
folderNode.getPath()
mgnl:folder(not related to a property)Folder.getItemKey()Composite Id built using 
new ItemKey(DamConstants.DEFAULT_JCR_PROVIDER_ID, folderNode.getIdentifier());
mgnl:folder(not related to a property)Folder.getItem(String name)Returns the item directly under this folder with the given name.
mgnl:folder(not related to a property)Folder.getChildren()Returns an iterator over the direct elements under this folder. Returns both Asset and Folder.
mgnl:folder(not related to a property)Folder.isRoot()Returns true if the folderNode.getDepth()==0
mgnl:folder(not related to a property)Folder.getAssetProvider()Returns the related AssetProvider.
mgnl:folder(not related to a property)Folder.getParent()Returns the parent Folder. Equivalent to node.getParent() 
mgnl:folder(not related to a property)Folder.isFolder()Returns true
mgnl:folder(not related to a property)Folder.isAsset()Returns false

AssetMetadata to JCR node mapping

MagnoliaAssetMetadata

NodeProperty NameAsset GetterDescription
jcr:contentheightMagnoliaAssetMetadata.getHeight()File height of the Asset for image MediaType. (red star)
jcr:contentwidthMagnoliaAssetMetadata.getWidth()File width of the Asset for image MediaType. (red star)

DublinCore

For more Information see Dublin Core Metadata Element Set.

NodeProperty NameAsset GetterDescription
mgnl:assetlanguageDublinCore.getLanguage()The returned value is equivalent to Asset.getLanguage().
mgnl:assettitleDublinCore.getTitle()The returned value is equivalent to Asset.getTitle().
mgnl:assetsubjectDublinCore.getSubject()The returned value is equivalent to Asset.getSubject().
mgnl:assetdescriptionDublinCore.getDescription()The returned value is equivalent to Asset.getDescription().
mgnl:assetcopyrightDublinCore.getRight()The returned value is equivalent to Asset.getCopyright().
jcr:contentjcr:mimeTypeDublinCore.getFormat()The returned value is equivalent to Asset.getMimeType().
mgnl:asset

(not related to a property

CompositeAssetId)

DublinCore.getIdentifier()The returned value is equivalent to Asset.getIdentifier().
mgnl:assetcreatorDublinCore.getCreator()The entity primarily responsible for making the resource.
mgnl:assetmgnl:lastModifiedDublinCore.getDate()The returned value is equivalent to Asset.getLastModified().
mgnl:assetcontributorDublinCore.getContributor()The entity responsible for making contributing to the resource.
mgnl:assetcoverageDublinCore.getCoverage()

The spatial or temporal topic of the resource, the spatial applicability
of the resource, or the jurisdiction under which the resource is relevant.

mgnl:assetpublisherDublinCore.getPublisher()The entity responsible for making the resource available.
mgnl:assetrelationDublinCore.getRelation()A related resource.
mgnl:assetsourceDublinCore.getSource()A related resource from which the described resource is derived.
mgnl:assettypeDublinCore.getType()The returned value is equivalent to Asset.getMediaType()
The MediaType is defined based on the MimeType.