use of org.olat.core.commons.modules.bc.meta.tagged.MetaTagged in project openolat by klemens.
the class GTANotifications method getAuthor.
private String getAuthor(File file, VFSContainer container) {
String author = null;
VFSItem item = container.resolve(file.getName());
if (item instanceof MetaTagged) {
MetaInfo info = ((MetaTagged) item).getMetaInfo();
if (info != null) {
String username = info.getAuthor();
if (username != null) {
author = userManager.getUserDisplayName(username);
}
}
}
return author == null ? "" : author;
}
use of org.olat.core.commons.modules.bc.meta.tagged.MetaTagged in project openolat by klemens.
the class ConvertToGTACourseNode method convertMetada.
private void convertMetada(VFSContainer source, VFSContainer target, String name, TaskDefinition taskDef, Solution solDef) {
VFSItem sourceItem = source.resolve(name);
VFSItem targetItem = target.resolve(name);
if (sourceItem instanceof MetaTagged && targetItem instanceof MetaTagged) {
MetaTagged taggedSource = (MetaTagged) sourceItem;
MetaInfo metaSource = taggedSource.getMetaInfo();
MetaTagged taggedTarget = (MetaTagged) targetItem;
MetaInfo metaTarget = taggedTarget.getMetaInfo();
if (metaSource != null) {
if (taskDef != null) {
if (StringHelper.containsNonWhitespace(metaSource.getTitle())) {
taskDef.setTitle(metaSource.getTitle());
}
taskDef.setDescription(metaSource.getComment());
}
if (solDef != null) {
if (StringHelper.containsNonWhitespace(metaSource.getTitle())) {
solDef.setTitle(metaSource.getTitle());
}
}
if (metaTarget != null) {
metaTarget.copyValues(metaSource);
metaTarget.write();
}
}
}
}
Aggregations