Confluence Rest API - Return Pages sorted by position - cql

I am using the Confluence API to retrieve children of a parent. The following API call returns the children of a Page with Id 123456, ordered by last modified date.
rest/api/content/search?cql=parent=123456+order+by+last-modified
However, I would like to have the results sorted by the position of the children. Any ideas?

The following API call, addresses the above question. It returns children for a parent based on their position. The answer was addressed in the Confluence community.
rest/api/content/PARENTID/child?expand=page

Related

SharePoint 2010 REST top, skip fails on large lists

I created two lists in my SharePoint 2010 site. one has 10 items other has 10000 items.
On the small list I can say
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/SmallList?$top=1&$skip=1
no problem it works perfect.
when I say
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/LargeList?$top=1&$skip=1
it throws an error "An error occurred while processing this request"
The internet is full of confustion because most blogs/articles etc talk about "SP2013" where I guess there is a __next in the body of XML which you get from SP.
However I am using SP2010 and this is a PURE client side solution with NO server side object model at all.
Can anyone tell me how to paginate through large lists "specifically" on SP2010.
Please post some working URLs with rest commands.... which you have tested against a large list (please let me know if you need me to provide code which will create a large list of 10K items for you).
You could do it using JavaScript and the WebServices. With the JavaScript API library I created, called SharepointPlus, you'll have to do that (with version 3.0.7):
$SP().list("Name of your list").get({fields:"ID,Title",rowlimit:5000,paging:true},function(data) {
console.log(data.length)
})
You'll have all the items into the 'data' array. You can go thru the array and stop when you reach X elements in a JavaScript loop for example. Like that you should not have an error message due to the large size of your list.
$skip query option is not supported, but $top is.
Workaround, use a mix of $orderby on ID, $filter on ID and $top x items, and loop.
Your query becomes
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/LargeList()?$orderby=Id&$filter=Id gt {lastId}&$top=100
{lastId}=0 on the first run.
Loop the items found, keep track of the "Last Id" and pass it to the next query.
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/LargeList()?$orderby=Id&$filter=Id gt 0&$top=100
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/LargeList()?$orderby=Id&$filter=Id gt 123&$top=100
http://mysharepoint.com/sites/testsite/_vti_bin/listdata.svc/LargeList()?$orderby=Id&$filter=Id gt 345&$top=100
repeat.
Note 1: ID is a column that is always indexed, other
Note 2: This pattern also works with the REST API (LINQ query)

libspotify API: track index

Is there any way to get the track index in an album? or given a track URI, is it possible to know its index or offset in the album (assume the track belongs to an album) without walking through the whole album?
Thanks.
Yes he is referring to sp_track_index, wich is only accessible through a album browse.
see libspotify documentation for sp_track_index here
What you need to do is something along the lines of:
call sp_albumbrowse_create for the album of sp_track that you have
wait for the callback fired when created/loaded
get sp_track_index from that track. Preferably you put the specific track in userdata to be passed on to the callback to be used with comparison.
Note: getting sp_track_index outside of an browse, will always return 0.
See Browse example here
You have to do an album browse for the target album. Once you've done that, you can get the track's index.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Drupal views: limit results shown based on CCK field setting

I have a view that pulls in feed items (from various "Owner feeds" to use the feeds module lingo), then sorts them by date (very important). The owner feed has a CCK field for the type of feed (Twitter, Blog, etc.) and a CCK field theoretically to limit the number of feed items displayed in the view. (The reason for the limit is that Twitter dominates, but we want some blogs, etc., so I don't want to have to show 100 tweets before displaying my first blog.)
I'm guessing some sort of Views hook code is in order, but I'm not sure which one. Perhaps the hook that allows direct modification of the query...
Note that the Owner feed nid is being pulled into the view via a Relationship.
Thanks in advance!
Using the Arguments field in the view, you could first select the node type, then node post date.
In this way you could give priority to the blog type, before sorting by date.
You could also consider building two Views, for instance the top 5 blog items and the top 20 Twitter feeds...

Best way to implement <next>, <prev> element links from search list

In my web application I got a search results list (SR). The search is heavily parametrized. Each element on the list can be clicked and then the element's own page (EP) is displayed.
Now, the customer wants to have the ability to go to previous and next element from the search list that was used to enter the element page.
How would you implement this? I can either pass the search conditions to the EP and the element's index on the list, then prev/next would just mean to rerun the search query, get previous / next index and display it (still passing the conditions and new index).
Or is there a better approach?
How intensive is your search process? It sounds like something you don't want to execute anymore than necessary. What if you when you render the search results you also store in a list the unqiue EP IDs on the server. You can then navigate through that using indexes for prev/next and the unique ID of the EP element to load details? You can then also store the query term and repopulate the search results with a 'Back to Search' link?

Resources