Search in sources :

Example 21 with Entry

use of org.apache.abdera.model.Entry in project ddf by codice.

the class AbstractTestCompositeGeometry method getSampleAtomEntry.

/**
 * Creates an Atom Entry with GeoRSS encoded in GML.
 *
 * @param composite
 * @return Atom entry as text
 * @throws org.locationtech.jts.io.ParseException
 * @throws IOException
 */
protected String getSampleAtomEntry(CompositeGeometry composite) throws IOException {
    List<Position> positions = composite.toGeoRssPositions();
    Entry sampleEntry = ABDERA.newEntry();
    for (Position pos : positions) {
        GeoHelper.addPosition(sampleEntry, pos, Encoding.GML);
    }
    StringWriter writer = new StringWriter();
    sampleEntry.writeTo(writer);
    return writer.toString();
}
Also used : Entry(org.apache.abdera.model.Entry) StringWriter(java.io.StringWriter) Position(org.apache.abdera.ext.geo.Position)

Example 22 with Entry

use of org.apache.abdera.model.Entry in project mycore by MyCoRe-Org.

the class MCRSwordMetadataProvider method provideListMetadata.

/**
 * @param id    the id of the MyCoReObject as String
 */
public Entry provideListMetadata(MCRObjectID id) throws SwordError {
    Entry feedEntry = Abdera.getInstance().newEntry();
    feedEntry.setId(id.toString());
    MCRSwordUtil.BuildLinkUtil.getEditMediaIRIStream(lifecycleConfiguration.getCollection(), id.toString()).forEach(feedEntry::addLink);
    feedEntry.addLink(MCRFrontendUtil.getBaseURL() + MCRSwordConstants.SWORD2_EDIT_IRI + lifecycleConfiguration.getCollection() + "/" + id, "edit");
    return feedEntry;
}
Also used : Entry(org.apache.abdera.model.Entry)

Aggregations

Entry (org.apache.abdera.model.Entry)22 Test (org.junit.Test)9 Feed (org.apache.abdera.model.Feed)7 ByteArrayInputStream (java.io.ByteArrayInputStream)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 StringWriter (java.io.StringWriter)4 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)3 WebApplicationException (javax.ws.rs.WebApplicationException)2 JAXBContext (javax.xml.bind.JAXBContext)2 Factory (org.apache.abdera.factory.Factory)2 FOMEntry (org.apache.abdera.parser.stax.FOMEntry)2 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)2 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)2 Metacard (ddf.catalog.data.Metacard)1 Dataset (edu.harvard.iq.dataverse.Dataset)1 Dataverse (edu.harvard.iq.dataverse.Dataverse)1 AuthenticatedUser (edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser)1 DataverseRequest (edu.harvard.iq.dataverse.engine.command.DataverseRequest)1 UpdateDatasetCommand (edu.harvard.iq.dataverse.engine.command.impl.UpdateDatasetCommand)1