superdesk/superdesk-server — pull request #198 by amagdas (2014-08-08 14:32:28+00:00)
Title: feat(views) - show filtered items for a view, SD-550

In order the get the filtered views:
`http://localhost:5000/content_view/53e49d3a8e4eba390dc6981b/?embedded={"items":1}`

Response:
``` javascript
{
"_id":"53e4de068e4eba0db5f586af",
"_updated":"2014-08-08T14:26:14+0000",
"_created":"2014-08-08T14:26:14+0000",
"items":{
"_id":"53e4de068e4eba0db5f586ae",
"filter":{
"and":[
{
"terms":{
"type":[
"text",
"picture"
]
}
}
]
},
"location":"archive",
"view_items":[
{
"_updated":"2014-08-08T14:26:14+0000",
"_id":"53e4de068e4eba0db5f586a9",
"_created":"2014-08-08T14:26:14+0000",
"versioncreated":"2014-08-08T14:26:14+0000",
"media":{
"name":"add8c035ad2bf0dfc9b3ac977d4a9a0358f51bc4b4dde1dac542dcc52f901a1e",
"content_type":"image/jpeg",
"length":469900
},
"_latest_version":1,
"firstcreated":"2014-08-08T14:26:14+0000",
"_links":{
"self":{
"href":"/content_view/53e4de068e4eba0db5f586a9",
"title":"Archive"
}
},
"guid":"tag:localhost:2014:c614841b-120f-4307-bf93-393595063bc2",
"creator":"53e4de038e4eba0db5f58688",
"renditions":{
"original":{
"href":"http://localhost:5000/upload/53e4de068e4eba0db5f5869e/raw?_schema=http",
"mimetype":"image/jpeg",
"height":1600,
"width":1200,
"media":"53e4de068e4eba0db5f5869e"
},
"baseImage":{
"href":"http://localhost:5000/upload/53e4de068e4eba0db5f586a1/raw?_schema=http",
"mimetype":"image/jpeg",
"height":1400,
"width":1050,
"media":"53e4de068e4eba0db5f586a1"
},
"thumbnail":{
"href":"http://localhost:5000/upload/53e4de068e4eba0db5f586a4/raw?_schema=http",
"mimetype":"image/jpeg",
"height":120,
"width":90,
"media":"53e4de068e4eba0db5f586a4"
},
"viewImage":{
"href":"http://localhost:5000/upload/53e4de068e4eba0db5f586a6/raw?_schema=http",
"mimetype":"image/jpeg",
"height":640,
"width":480,
"media":"53e4de068e4eba0db5f586a6"
}
},
"version":1,
"type":"picture",
"mimetype":"image/jpeg",
"user":"53e4de038e4eba0db5f58688",
"filemeta":{
"datetimeoriginal":"2013:08:01 16:19:28",
"flash":0,
"exifimageheight":3264,
"xresolution":[
72,
1
],
"orientation":1,
"whitebalance":0,
"model":"GT-I9300",
"flashpixversion":"0100",
"focallength":[
37,
10
],
"resolutionunit":2,
"exposuretime":[
1,
2004
],
"scenecapturetype":0,
"meteringmode":2,
"imageuniqueid":"f3533c05daef2debe6257fd99e058eec",
"colorspace":1,
"datetimedigitized":"2013:08:01 16:19:28",
"exifoffset":216,
"componentsconfiguration":"0000",
"datetime":"2013:08:01 16:19:28",
"software":"Google",
"exifversion":"0220",
"yresolution":[
72,
1
],
"exposureprogram":3,
"ycbcrpositioning":1,
"length":469900,
"exposuremode":0,
"make":"SAMSUNG",
"exifimagewidth":2448,
"aperturevalue":[
276,
100
],
"fnumber":[
26,
10
],
"maxaperturevalue":[
276,
100
],
"imagewidth":3264,
"imagelength":2448,
"isospeedratings":80
},
"_version":1
},
{
"_updated":"2014-08-08T14:26:14+0000",
"_id":"urn:newsml:localhost:2014-08-08T17:26:14.568296:10bd2893-d991-4978-bdc4-06b7660b9948",
"_created":"2014-08-08T14:26:14+0000",
"_version":1,
"_latest_version":1,
"firstcreated":"2014-08-08T14:26:14+0000",
"_links":{
"self":{
"href":"/content_view/urn:newsml:localhost:2014-08-08T17:26:14.568296:10bd2893-d991-4978-bdc4-06b7660b9948",
"title":"Archive"
}
},
"guid":"urn:newsml:localhost:2014-08-08T17:26:14.568296:10bd2893-d991-4978-bdc4-06b7660b9948",
"type":"text",
"original_creator":"53e4de038e4eba0db5f58688",
"user":"53e4de038e4eba0db5f58688",
"versioncreated":"2014-08-08T14:26:14+0000"
}
]
},
"name":"show my content",
"filter":{
"and":[
{
"terms":{
"type":[
"text",
"picture"
]
}
}
]
},
"user":"53e4de038e4eba0db5f58688",
"description":"Show content items created by the current logged user",
"location":"archive",
"_links":{
"collection":{
"href":"/content_view",
"title":"content_view"
},
"parent":{
"href":"/",
"title":"home"
},
"self":{
"href":"/content_view/53e4de068e4eba0db5f586af",
"title":"Content_view"
}
}
}
```

One bug easy to spot is that the self.href for embedded items are wrong, this seems to be an Eve bug, will open an issue on upstream Eve against this if I don't have the time for a PR, the frontend can do a workaround if needed to call `/location/[embedded_id]`