[OTDev] Needed some help with restlet

surajit ray mr.surajit.ray at gmail.com
Mon Jan 25 13:56:33 CET 2010


Hi,
I was wondering what type of Representation to use for a Jena model (within
the Restlet framework ) ?

-- 
Surajit Ray
Partner
www.rareindianart.com


P.S.

the basic code

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.opentox.maxtox;

import org.restlet.Context;
.
.
.
import org.restlet.resource.Variant;

/**
 *
 * @author surajit
 */
public class MaxtoxWelcomeResource extends Resource {

    public MaxtoxWelcomeResource(Context context , Request request ,
Response response) {
        super(context, request, response);

        this.getVariants().add(new Variant(MediaType.TEXT_PLAIN));
    }

    @Override
    public Representation represent(Variant v) throws ResourceException {
        Representation representation = new StringRepresentation("This is
the Maxtox Server", MediaType.TEXT_PLAIN);
        return representation;
    }

}


This is using the default string resource - I was wondering what type of
Representation fits a Jena model best ?



More information about the Development mailing list