if (l instanceof LayerInfo) {
LayerInfo info = (LayerInfo) l;
IO.layer(obj, info, req);
ResourceInfo r = info.getResource();
String wsName = r.getNamespace().getPrefix();
// obj.put("workspace", wsName);
// obj.put("name", info.getName());
obj.put("url",IO.url(req,"/layers/%s/%s",wsName,r.getName()));
// obj.put("title", IO.title(info));
// obj.put("description", IO.description(info));
// obj.put("type",IO.Type.of(info.getResource()).toString());
StoreInfo store = r.getStore();
obj.putObject("resource")
.put("name",r.getNativeName())
.put("workspace",wsName)
.put("store",store.getName())
.put("url",
IO.url(req, "/stores/%s/%s/%s", wsName, store.getName(),r.getNativeName())
);
} else if (l instanceof LayerGroupInfo) {
LayerGroupInfo group = (LayerGroupInfo) l;