use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.
the class ManifestMetadataBuilder method setCoverage.
public void setCoverage(String coverage, String lang) {
GeneralType general = getGeneral(true);
if (general != null) {
CoverageType type = getFromAny(CoverageType.class, general.getContent());
if (type == null) {
type = mdObjectFactory.createCoverageType();
general.getContent().add(mdObjectFactory.createCoverage(type));
}
createOrUpdateFirstLangstring(type.getLangstring(), coverage, lang);
}
}
use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.
the class ManifestMetadataBuilder method setGeneralKeywords.
public void setGeneralKeywords(String keywords, String lang) {
GeneralType general = getGeneral(true);
if (general != null) {
clearFromAny(KeywordType.class, general.getContent());
for (StringTokenizer tokenizer = new StringTokenizer(keywords, " "); tokenizer.hasMoreTokens(); ) {
String keyword = tokenizer.nextToken();
KeywordType type = mdObjectFactory.createKeywordType();
general.getContent().add(mdObjectFactory.createKeyword(type));
createOrUpdateFirstLangstring(type.getLangstring(), keyword, lang);
}
}
}
use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.
the class ManifestMetadataBuilder method setLanguage.
public void setLanguage(String language, String lang) {
GeneralType general = getGeneral(true);
if (general != null) {
StringType type = getFromAny(StringType.class, general.getContent());
if (type == null) {
type = mdObjectFactory.createStringType();
QName languageQNAME = new QName("http://www.imsglobal.org/xsd/imsmd_v1p2", "context");
JAXBElement<StringType> typeEl = new JAXBElement<StringType>(languageQNAME, StringType.class, null, type);
general.getContent().add(typeEl);
}
type.setLang(lang);
type.setValue(language);
}
}
use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.
the class ManifestMetadataBuilder method getGeneral.
public GeneralType getGeneral(boolean create) {
LomType lom = getLom(create);
if (lom == null)
return null;
GeneralType general = lom.getGeneral();
if (general == null && create) {
general = mdObjectFactory.createGeneralType();
lom.setGeneral(general);
}
return general;
}
Aggregations