///////////////////////////////////////////////////////////////
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
///////////////////////////////////////////////////////////////

[[library-restlet, Restlet Library]]
= Restlet Support =

[devstatus]
--------------
source=libraries/restlet/dev-status.xml
--------------

The Restlet Support Library has support to expose CRUD operations directly
as well as regular Rest resources.

include::../../build/docs/buildinfo/artifact.txt[]

This library leverages +restlet.org+ which has a very neat way to map resources
to URIs, and flexible ways to be served the requests. This library defines
all the plumbing needed to set up Restlet, map resources to URIs, convert
Polygene ValueComposites to resource representations (such as JSON) and
create a fully HATEOAS environment, with single bookmarkable URI.

To set up the Restlet Connectivity Module, it is recommended to use the provided
+Assembler+ for it;


[[library-restlet-resource-binding, Restlet Resource Binding]]
== Resource Binding ==
REST defines that all URLs are *resources* and that a known, small set of
operations can be done on those resources.



== CRUD Repository ==
This library provides a +CrudRepository+ which simplifies accessing entities
directly from the Rest module. This is implemented by using the
<<library-restlet-resource-binding, Resource Binding>> above.

It also requires that one or more Crud Modules are defined. These are typically
either in the domain layer directly, or in the layer above (some call that the
service layer). There is a RestletCrudModuleAssembler that helps set up such
module. Typical setup is like this;





