SAPUI5: ODatav4 add static data to data downloaded from API - odata

Let's say we have some list of items that are automatically downloaded from API
<ComboBox items="{'model>Users'}">
<c:Item
key="{model>Id}"
text="{model>FirstName} {model>LastName}"
/>
</ComboBox>
Works really well. But how can I now expand the data downloaded with oData by adding some more objects?
The things that I've tried:
Trying to find some sort of "onDownloadCompleate" function so that when the users are downloaded I can attach some more. I couldn't find such function in oData v4.
Getting the data from the model and attaching additional objects to it. I couldn't found how I can do this.
The only solution I see is to not use oData at all and just download the users using normal API call.

Related

Graph API - Get recent files from a particular site collection

I'm trying to fetch recent files from SharePoint Online using Microsoft Graph.
The API I'm using is :
https://graph.microsoft.com/v1.0/me/drive/recent
But the results include files from all site collection. I need to restrict the results to only a single site collection.
After some research, I found that there is no direct API to restrict the site collection.
I also tried using adding filter like :
$filter=sharepointIds/siteId eq 'site-id'
but it was also not working. It gave a `501 (Not implemented) error.
Update:
I found another API from Graph which is
https://graph.microsoft.com/beta/me/insights/used
which is inside insights(beta) named "items viewed and modified by me"
But it again returns data across tenant and I need to restrict it to a single site collection. I guess filter conditions are not yet implemented for this API in Graph.
Is there any method to get recent files from a particular site collection? Any help is appreciated.
One correction, /me/drive/recent isn't pulling from all site collections, it's pulling from the current user's OneDrive. This includes recent files held within their drive and any recent changes to files that have been shared with them.
As for finding Recent Files from a SharePoint Document Library, you need to make this request within the context of the drive you want to pull from. For example:
https://graph.microsoft.com/v1.0/sites/root/drives/{documentLibraryId}/recent

Making charts on phonegap using data from external website

so i need to develop an app using phonegap that creates a graphical display of solar wind data (exciting stuff i know...) from this website http://services.swpc.noaa.gov/text/ace-swepam.txt with a graph being made for 'ion temperature', 'bulk speed' and 'proton denisity' individually, however im clueless as to where to begin... im assuming i need to make use of the charts.js library or something similar, im assuming i can make a variable for the axis as the data will be changing over time but I'm more stuck on how to pull data from this website though to be included in my charts. Any info on this would be greatly appreciated!
Thanks,
Gerrit
Call the web service to get the data, then pass it to the charting library you're using. You'll use AJAX (XMLHTTPRequest) to get the data. There's all sorts of options out there for simplifying this (jQuery and other libraries make AJAX easy).
The service you're using is giving you the data as a text file - this can work, but you'll have to parse the data client-side which is not fun (or a good use of your phone's capabilities). Look for a service that returns the data as a JSON object, then you'll have the data in a format that can be more easily passed to the charting library.

JQX Grid server data response example

I'm trying to implement a jqxGrid, using sorting and paging on the server. I don't have access to the server itself. Taking an example from:
http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-grid-paging-and-sorting.htm
I implement the client-side and want to use a mock static file as a response. I can't manage to figure out what kind of JSON response format is meant to be returned.
How do I 'catch' and edit/format the JSON response from the server? (Where in the code?)
Is there anywhere a working example of a jqgrid with sorting done on the server, to be viewable online? (So I can observe the data structure returned).
What do you mean exactly? Do you want to edit the data itself or the view of the data? If it is the later one you can use cellsrendered. For a live demo look here. You can also change the value here since you have access to the value field but it is by column.
Yes, look here.
http://www.jqwidgets.com/jquery-widgets-documentation/
You can find there information about the datasource.
http://www.jqwidgets.com/jquery-widgets-documentation/
You can find there (right menu):
PHP Integration
ASP.NET Integration
You can find there what ever yo need (sorting filtering and so)

Setting the author field of the OData Provider Toolkit response

We are using the OData Provider Toolkit to expose custom data as an OData feed. We have noticed that the author field is always unset:
<entry>
<id>http://localhost/sample.svc/Entity</id>
<title type="text"/>
<updated>2013-01-30T01:02:28Z</updated>
<author>
<name/>
</author>
Is there a way to set the author programmatically using this toolkit? We haven't been able to find a way to access the SyndicationItems of the associated Atom feed that generates the result.
Depending on which version of WCF Data Services (ie System.Data.Services.DataService) you are using with that toolkit, you have two options here:
1) Use so-called 'Entity Property Mapping' to tell the system to put a specific property's value into the Author field. This functionality has been present since .NET 4.0 (and available through an update to 3.5SP1 as well). To turn this on, look into the ResourceType.AddEntityPropertyMappingAttribute API (http://msdn.microsoft.com/en-us/library/system.data.services.providers.resourcetype.addentitypropertymappingattribute.aspx).
2) Customize the instances of ODataEntry being written out using the recently added support for wrapping the ODataWriter being used by the data service. This is only available in versions 5.1 and later, which can be found at NuGet (http://nuget.org/packages/Microsoft.Data.Services/). To wrap the writer, you will need to hook up to the DataService.CreateODataWriter delegate property. You can see an example of how to use this here: http://odatasamples.codeplex.com/SourceControl/changeset/view/be77d3cacb2c#WcfDataServices101/WcfDataServices101.CustomizedEntityLinks/CustomizedEntityLinksService.svc.cs. Once you are in the WriteStart method, you can use the ODataEntry.Atom() extension method to get access to the atom-specific metadata like authors, contributors, etc.
Hope that helps, I can provide more exact code examples as needed.

Was it able to retrieve data from a external web site which does not provide a API using YQL?

I'd like to retrieve data from a web site ,which does not provide a API
Can I retrieve data using YQL?
ie: Can I custom the data parse in the target URI with YQL?
Yes, you can. This is one of the most popular use case of YQL. Here is a sample. But it is not working when trying to retrieve data from web-page which is dissallowed for spider access (via robots.txt, for example).
Without knowing what you're trying to do, the only reasonable answer here is…
Yes.

Resources