use of org.opencastproject.assetmanager.api.PropertyId in project opencast by opencast.
the class DuplicateEventWorkflowOperationHandler method copyProperties.
private void copyProperties(String namespace, MediaPackage source, MediaPackage destination) {
final AQueryBuilder q = assetManager.createQuery();
final AResult properties = q.select(q.propertiesOf(namespace)).where(q.mediaPackageId(source.getIdentifier().toString())).run();
if (properties.getRecords().head().isNone()) {
logger.info("No properties to copy for media package {}.", source.getIdentifier(), namespace);
return;
}
for (final Property p : properties.getRecords().head().get().getProperties()) {
final PropertyId newPropId = PropertyId.mk(destination.getIdentifier().toString(), namespace, p.getId().getName());
assetManager.setProperty(Property.mk(newPropId, p.getValue()));
}
}
Aggregations