use of org.olat.imsmd.xml.manifest.EducationalType in project OpenOLAT by OpenOLAT.
the class ManifestMetadataBuilder method setEducationalContext.
public void setEducationalContext(String context, String lang) {
EducationalType educational = getEducational(true);
if (educational != null) {
ContextType type = getFromAny(ContextType.class, educational.getContent());
if (type == null) {
type = mdObjectFactory.createContextType();
educational.getContent().add(mdObjectFactory.createContext(type));
}
SourceType sourceType = mdObjectFactory.createSourceType();
sourceType.setLangstring(createString("https://www.openolat.org", lang));
ValueType valueType = mdObjectFactory.createValueType();
valueType.setLangstring(createString(context, lang));
type.setSource(sourceType);
type.setValue(valueType);
}
}
use of org.olat.imsmd.xml.manifest.EducationalType in project OpenOLAT by OpenOLAT.
the class ManifestMetadataBuilder method setEducationalLearningTime.
public void setEducationalLearningTime(String datetime) {
EducationalType educational = getEducational(true);
if (educational != null) {
TypicallearningtimeType type = getFromAny(TypicallearningtimeType.class, educational.getContent());
if (type == null) {
type = mdObjectFactory.createTypicallearningtimeType();
educational.getContent().add(mdObjectFactory.createTypicallearningtime(type));
}
type.setDatetime(datetime);
}
}
use of org.olat.imsmd.xml.manifest.EducationalType in project openolat by klemens.
the class ManifestMetadataBuilder method setEducationalLearningTime.
public void setEducationalLearningTime(String datetime) {
EducationalType educational = getEducational(true);
if (educational != null) {
TypicallearningtimeType type = getFromAny(TypicallearningtimeType.class, educational.getContent());
if (type == null) {
type = mdObjectFactory.createTypicallearningtimeType();
educational.getContent().add(mdObjectFactory.createTypicallearningtime(type));
}
type.setDatetime(datetime);
}
}
use of org.olat.imsmd.xml.manifest.EducationalType in project OpenOLAT by OpenOLAT.
the class ManifestMetadataBuilder method getEducational.
public EducationalType getEducational(boolean create) {
LomType lom = getLom(create);
if (lom == null)
return null;
EducationalType educational = lom.getEducational();
if (educational == null && create) {
educational = mdObjectFactory.createEducationalType();
lom.setEducational(educational);
}
return educational;
}
use of org.olat.imsmd.xml.manifest.EducationalType in project OpenOLAT by OpenOLAT.
the class ManifestMetadataBuilder method getEducationContext.
public String getEducationContext() {
EducationalType educational = getEducational(true);
StringBuilder sb = new StringBuilder();
if (educational != null) {
ContextType type = getFromAny(ContextType.class, educational.getContent());
if (type != null && type.getSource() != null && type.getSource().getLangstring() != null && type.getValue() != null && type.getValue().getLangstring() != null) {
String source = type.getSource().getLangstring().getValue();
String value = type.getValue().getLangstring().getValue();
if (StringHelper.containsNonWhitespace(source) && StringHelper.containsNonWhitespace(value)) {
sb.append(value);
}
}
}
return sb.length() == 0 ? null : sb.toString();
}
Aggregations