`aem.events_osgi_mapping` enrich xdm Asset to add DamAsset metadata
- Ngôn ngữ chính
- Java
- Star
- 7
- Fork
- 22
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
The challenge would be in white-listing the metadata, as it can be too large.
it could be like this:
```
package package com.adobe.aio.aem.event.xdm.aem;
import com.adobe.xdm.assets.Asset;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.apache.sling.api.resource.ValueMap;
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class DamAsset extends Asset {
Map metadatas;
@JsonIgnore
public void setMetadata(ValueMap valueMap) {
if (valueMap != null) {
metadatas = new HashMap<>();
for (String entry : valueMap.keySet()) {
Object value = valueMap.get(entry);
if (value != null && !entry.startsWith("jcr:") && !(value instanceof GregorianCalendar)
&& !(value.getClass().isArray())) {
metadatas.put(entry, value.toString());
//TODO better filtering with metadata whitelist configuration
}
}
}
}
@JsonProperty("xdmAsset:metadatas")
public Map getMetadata() {
return metadatas;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
DamAsset damAsset = (DamAsset) o;
return Objects.equals(metadatas, damAsset.metadatas);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), metadatas);
}
@Override
public String toString() {
return "DamAsset{id='" + this.id + '\'' + ", type='" + this.type + '\'' + ", assetId='"
+ this.getAssetId() + '\'' + ", assetName='" + this.getAssetName() + '\''
+ ", etag='" + this.getEtag()
+ '\'' + ", path='" + this.getPath() + '\'' + ", format='" + this.getFormat() + '\''
+ "metadatas=" + metadatas +
'}';
}
}
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng việc xác định phần triển khai aem.events_osgi_mapping và điểm vào hiện có của ánh xạ XDM Asset. Xem lại cách lấy siêu dữ liệu của asset AEM, sau đó xác định whitelist siêu dữ liệu và ánh xạ DamAsset được mô tả trong issue. Hoàn thành khi XDM asset bao gồm siêu dữ liệu DamAsset được phép mà không bao gồm các giá trị quá lớn hoặc bị loại trừ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100