Package org.restlet.example.ext.rdf.foaf.objects

Examples of org.restlet.example.ext.rdf.foaf.objects.Contact


        users.remove(user.getId());
    }

    @Override
    public Contact getContactById(String contactId) {
        Contact result = null;
        for (User user : users.values()) {
            for (Contact contact : user.getContacts()) {
                if (contactId.equals(contact.getId())) {
                    result = contact;
                    break;
View Full Code Here


     * Accept the representation of a new contact, and create it.
     */
    @Post
    public void acceptContact(Representation entity) throws ResourceException {
        final Form form = new Form(entity);
        Contact contact = new Contact();
        contact.setFirstName(form.getFirstValue("firstName"));
        contact.setLastName(form.getFirstValue("lastName"));
        contact.setImage(form.getFirstValue("image"));
        contact.setNickname(form.getFirstValue("nickname"));
        contact.setFoafUri(form.getFirstValue("foafUri"));

        contact = getObjectsFacade().createContact(this.user, contact);
        getResponse().redirectSeeOther(
                getChildReference(getRequest().getResourceRef(), contact
                        .getId()));
    }
View Full Code Here

TOP

Related Classes of org.restlet.example.ext.rdf.foaf.objects.Contact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.