Hi Antonio,
If you use a Router in default mode, you should have no problem:
Router router = new Router();
router.attach("/mail_list/{msg_ID}");
router.attach("/mail_list/{msg_ID}/attachment/{att_id}");
The router will match the best route, the one matching the largest number of
characters by default.
Did I misunderstood something?
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
-----Message d'origine-----
De : antoniojg [mailto:[email protected]]
Envoye : mercredi 17 decembre 2008 22:05
A : [email protected]
Objet : I can't figure out how to map urls in this case, please help me
Hello, I'm designing an application that retrieves some email messages from
a DB back end.
I'd like to use Rest to put and get messages on the db. A component is later
responsible of retrieving them from the DB and storing them on a PEC inboox
and for getting mails from the inboox and storing them on the DB. The DB
layer is essential for data maintenance since the inboox is constantly
cleared.
In my application each mail is identified by a msg_id and each mail can have
several attachments
So I have the following urls :
mail_list : get all the application related emails and post a new message
mail_list/{msg_ID} in order to get, update and delete a specific message
mail_list/{msg_ID}/attachment to get all the attachments and post a new one
mail_list/{msg_ID}/attachment/{att_id} to get, put and delete a specific
attachment
and so on.
My doubt is related to how to configure the urls in order to manage requests
for email specific attachments : mail_list/{msg_ID}/attachment/{att_id}
There are two parameters here {msg_ID} and {att_id} . I can attach the
resource mail list to the url /mail_list and the engine will be able to
manage the parameter msg_ID through the API.
However, how can I configure the mappings in order to reach the attachment
resource if the url always starts with mail_list/{msg_ID}/attachment......?
I' d be greatful isf someone may help me resolving this doubt.
Thanks.
Antonio.
--
View this message in context:
http://n2.nabble.com/I-can%27t-figure-out-how-to-map-urls-in-this-case%2C-please-help-me-tp1669818p1669818.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=986070
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=991681