Search in sources :

Example 1 with RightsType

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

the class ManifestMetadataBuilder method getRights.

public RightsType getRights(boolean create) {
    LomType lom = getLom(create);
    if (lom == null)
        return null;
    RightsType rights = lom.getRights();
    if (rights == null && create) {
        rights = mdObjectFactory.createRightsType();
        lom.setRights(rights);
    }
    return rights;
}
Also used : RightsType(org.olat.imsmd.xml.manifest.RightsType) LomType(org.olat.imsmd.xml.manifest.LomType)

Example 2 with RightsType

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

the class ManifestMetadataBuilder method setLicense.

public void setLicense(String license) {
    RightsType rights = getRights(true);
    CopyrightandotherrestrictionsType type = getFromAny(CopyrightandotherrestrictionsType.class, rights.getContent());
    if (type == null) {
        type = mdObjectFactory.createCopyrightandotherrestrictionsType();
        rights.getContent().add(mdObjectFactory.createCopyrightandotherrestrictions(type));
    }
    SourceType sourceType = mdObjectFactory.createSourceType();
    sourceType.setLangstring(createString("https://www.openolat.org", "en"));
    ValueType valueType = mdObjectFactory.createValueType();
    valueType.setLangstring(createString(license, "en"));
    type.setSource(sourceType);
    type.setValue(valueType);
}
Also used : CopyrightandotherrestrictionsType(org.olat.imsmd.xml.manifest.CopyrightandotherrestrictionsType) ValueType(org.olat.imsmd.xml.manifest.ValueType) RightsType(org.olat.imsmd.xml.manifest.RightsType) SourceType(org.olat.imsmd.xml.manifest.SourceType)

Example 3 with RightsType

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

the class ManifestMetadataBuilder method setLicense.

public void setLicense(String license) {
    RightsType rights = getRights(true);
    CopyrightandotherrestrictionsType type = getFromAny(CopyrightandotherrestrictionsType.class, rights.getContent());
    if (type == null) {
        type = mdObjectFactory.createCopyrightandotherrestrictionsType();
        rights.getContent().add(mdObjectFactory.createCopyrightandotherrestrictions(type));
    }
    SourceType sourceType = mdObjectFactory.createSourceType();
    sourceType.setLangstring(createString("https://www.openolat.org", "en"));
    ValueType valueType = mdObjectFactory.createValueType();
    valueType.setLangstring(createString(license, "en"));
    type.setSource(sourceType);
    type.setValue(valueType);
}
Also used : CopyrightandotherrestrictionsType(org.olat.imsmd.xml.manifest.CopyrightandotherrestrictionsType) ValueType(org.olat.imsmd.xml.manifest.ValueType) RightsType(org.olat.imsmd.xml.manifest.RightsType) SourceType(org.olat.imsmd.xml.manifest.SourceType)

Example 4 with RightsType

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

the class ManifestMetadataBuilder method getRights.

public RightsType getRights(boolean create) {
    LomType lom = getLom(create);
    if (lom == null)
        return null;
    RightsType rights = lom.getRights();
    if (rights == null && create) {
        rights = mdObjectFactory.createRightsType();
        lom.setRights(rights);
    }
    return rights;
}
Also used : RightsType(org.olat.imsmd.xml.manifest.RightsType) LomType(org.olat.imsmd.xml.manifest.LomType)

Aggregations

RightsType (org.olat.imsmd.xml.manifest.RightsType)4 CopyrightandotherrestrictionsType (org.olat.imsmd.xml.manifest.CopyrightandotherrestrictionsType)2 LomType (org.olat.imsmd.xml.manifest.LomType)2 SourceType (org.olat.imsmd.xml.manifest.SourceType)2 ValueType (org.olat.imsmd.xml.manifest.ValueType)2