Search in sources :

Example 6 with GeneralType

use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.

the class ManifestMetadataBuilder method setTitle.

public void setTitle(String title, String lang) {
    GeneralType general = getGeneral(true);
    if (general != null) {
        TitleType type = getFromAny(TitleType.class, general.getContent());
        if (type == null) {
            type = mdObjectFactory.createTitleType();
            general.getContent().add(mdObjectFactory.createTitle(type));
        }
        createOrUpdateFirstLangstring(type.getLangstring(), title, lang);
    }
}
Also used : TitleType(org.olat.imsmd.xml.manifest.TitleType) GeneralType(org.olat.imsmd.xml.manifest.GeneralType)

Example 7 with GeneralType

use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.

the class ManifestMetadataBuilder method setDescription.

public void setDescription(String description, String lang) {
    GeneralType general = getGeneral(true);
    if (general != null) {
        DescriptionType type = getFromAny(DescriptionType.class, general.getContent());
        if (type == null) {
            type = mdObjectFactory.createDescriptionType();
            general.getContent().add(mdObjectFactory.createDescription(type));
        }
        createOrUpdateFirstLangstring(type.getLangstring(), description, lang);
    }
}
Also used : DescriptionType(org.olat.imsmd.xml.manifest.DescriptionType) GeneralType(org.olat.imsmd.xml.manifest.GeneralType)

Example 8 with GeneralType

use of org.olat.imsmd.xml.manifest.GeneralType in project openolat by klemens.

the class ManifestMetadataBuilder method getGeneralKeywords.

public String getGeneralKeywords() {
    GeneralType general = getGeneral(false);
    if (general != null) {
        StringBuilder keywords = new StringBuilder();
        for (Object any : general.getContent()) {
            if (any instanceof JAXBElement<?> && ((JAXBElement<?>) any).getValue().getClass().equals(KeywordType.class)) {
                KeywordType keywordType = (KeywordType) ((JAXBElement<?>) any).getValue();
                List<LangstringType> langStrings = keywordType.getLangstring();
                for (LangstringType langString : langStrings) {
                    String keyword = langString.getValue();
                    if (keywords.length() > 0)
                        keywords.append(" ");
                    keywords.append(keyword);
                }
            }
        }
        return keywords.toString();
    }
    return null;
}
Also used : KeywordType(org.olat.imsmd.xml.manifest.KeywordType) LangstringType(org.olat.imsmd.xml.manifest.LangstringType) GeneralType(org.olat.imsmd.xml.manifest.GeneralType)

Example 9 with GeneralType

use of org.olat.imsmd.xml.manifest.GeneralType in project OpenOLAT by OpenOLAT.

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);
    }
}
Also used : CoverageType(org.olat.imsmd.xml.manifest.CoverageType) GeneralType(org.olat.imsmd.xml.manifest.GeneralType)

Example 10 with GeneralType

use of org.olat.imsmd.xml.manifest.GeneralType in project OpenOLAT by OpenOLAT.

the class ManifestMetadataBuilder method setTitle.

public void setTitle(String title, String lang) {
    GeneralType general = getGeneral(true);
    if (general != null) {
        TitleType type = getFromAny(TitleType.class, general.getContent());
        if (type == null) {
            type = mdObjectFactory.createTitleType();
            general.getContent().add(mdObjectFactory.createTitle(type));
        }
        createOrUpdateFirstLangstring(type.getLangstring(), title, lang);
    }
}
Also used : TitleType(org.olat.imsmd.xml.manifest.TitleType) GeneralType(org.olat.imsmd.xml.manifest.GeneralType)

Aggregations

GeneralType (org.olat.imsmd.xml.manifest.GeneralType)14 KeywordType (org.olat.imsmd.xml.manifest.KeywordType)4 StringTokenizer (java.util.StringTokenizer)2 JAXBElement (javax.xml.bind.JAXBElement)2 QName (javax.xml.namespace.QName)2 CoverageType (org.olat.imsmd.xml.manifest.CoverageType)2 DescriptionType (org.olat.imsmd.xml.manifest.DescriptionType)2 LangstringType (org.olat.imsmd.xml.manifest.LangstringType)2 LomType (org.olat.imsmd.xml.manifest.LomType)2 StringType (org.olat.imsmd.xml.manifest.StringType)2 TitleType (org.olat.imsmd.xml.manifest.TitleType)2