use of org.eclipse.mylyn.docs.epub.dc.Identifier in project mylyn.docs by eclipse.
the class Publication method addIdentifier.
/**
* Adds a new identifier to the publication.
*
* @param id
* the identifier id
* @param scheme
* the scheme used for representing the identifier
* @param value
* the identifier value
* @return the new identifier
*/
public Identifier addIdentifier(String id, String scheme, String value) {
if (value == null) {
// $NON-NLS-1$
throw new IllegalArgumentException("A value must be specified");
}
Identifier dc = DCFactory.eINSTANCE.createIdentifier();
dc.setId(id);
dc.setScheme(scheme);
FeatureMapUtil.addText(dc.getMixed(), value);
opfPackage.getMetadata().getIdentifiers().add(dc);
return dc;
}
use of org.eclipse.mylyn.docs.epub.dc.Identifier in project mylyn.docs by eclipse.
the class PublicationProxy method getIdentifier.
@SuppressWarnings("rawtypes")
public String getIdentifier() {
EList<Identifier> identifiers = publication.getPackage().getMetadata().getIdentifiers();
if (identifiers.size() > 0) {
FeatureMap fm = identifiers.get(0).getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
}
return EMPTY_STRING;
}
Aggregations