DamLabeledResource.java
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.commons.JcrLabeledResource
* com.day.cq.dam.api.Asset
* javax.jcr.Node
* javax.jcr.RepositoryException
* org.apache.sling.api.resource.Resource
*/
package com.day.cq.dam.core.impl;
import com.day.cq.commons.JcrLabeledResource;
import com.day.cq.dam.api.Asset;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.sling.api.resource.Resource;
public class DamLabeledResource
extends JcrLabeledResource {
private final Asset asset;
public DamLabeledResource(Resource resource) throws RepositoryException {
super((Node)resource.adaptTo(Node.class));
this.asset = (Asset)resource.adaptTo(Asset.class);
}
public String getTitle() {
String title = super.getTitle();
if (this.asset != null && title == null) {
title = this.asset.getMetadataValue("dc:title");
}
return title;
}
public String getDescription() {
String description = super.getDescription();
if (this.asset != null && description == null) {
description = this.asset.getMetadataValue("dc:description");
}
return description;
}
}