Developer forum

Forum » Dynamicweb 10 » Repository / query and DWAPI

Repository / query and DWAPI

Rene Poulsen
Rene Poulsen
Reply

Hi,

I've got a solution where certain pages (Events) are created as items. On these event pages there's a field called "Date". This field is in item relation list where items are created inline. The item (Date) contains fields like Date & time, Ticketlink, label etc. Some events has more dates with different data in the fields - that's why it's created as an item relation list.

I want fetch the event pages from the dwapi, but the only value I get in "Event_Date" is an integer. See attached screenshot. What is this id referring to? The field is not an item, so it's not the ID of an item. I'd really like to be able to get the values from the "Date" items in the item relation list field through a query from the DWAPI. Is this not possible without fetching from e.g. the /dwapi/content/pages/{id}? I'd really like to avoid that as it's too slow.

Btw. I'm using the /dwap/query as I want to fetch from indexed content: /dwapi/query?QueryName=All%20events&RepositoryName=Content

 

dwapi_query.jpg

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

408 is the id of the related item list. It is not a list of dates.

You cannot get pages from the query endpoint - you get lucene docs - you will have to query the page endpoint to get the actual document.

Votes for this answer: 1
 
Rene Poulsen
Rene Poulsen
Reply

So I'd have to fetch a page for each item in the request to the query? I think that's going to be to slow.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes. There are several potential things.

You would potentially get an entire graph out. Page 1 uses page 2 that uses page 3 etc. and the returned document could be really large.

Also you are using a generic endpoint that return lucene documents - it has 'nothing' to do with a page. You could as well have users or products coming from the same endpoint, so having a page does not fit this particular endpoint.

I can give you a version of /dwapi/content/pages that takes an array of pageids - so you can get it all in one fetch. But getting what you need in seperate fetches is not a problem per se (unless you do many, e.g. over 10) - you could lazy load content as they scroll into viewport and render a placeholder below the fold.

 
Rene Poulsen
Rene Poulsen
Reply

I actually build what I needed with the pages endpoint. But it's too slow. Using another ummentionable CMS ;-) we have an endpoint to fetch content from an indexed source. That's super fast. So just though it would be possible to do the same in DW. I'm not going to use the pages endpoint, so I guess we'll have to look into creating our own feed or extending the query endpoint if it's possible?

 

You must be logged in to post in the forum