Where are the dummy collaborators in in-memory documents? - google-drive-realtime-api

The documentation suggests that there would be dummy data populating the results from calling getCollaborators, although it does not give any details about what the dummy data would look like.
My calls to getCollaborators return an empty list. It would be quite helpful to populate the list with one dummy collaborator which isMe so that I don't have to check document.isInGoogleDrive all the time.

This has been added to the API. It should be available in about a week.

Related

Datas studio community connector: getData is called twice and fields list = null

I've made a community connector getting my data from Bigquery, and in one specific case, the gatData function is called twice and one of the call does not send fields
This occured when in a dashboard :
I make a table chart: getData is called once, all is OK
And just toggle "Show summary row" to True: see my screenshot in attachment, getData is called twice and fields equals to null
here is my screenshot
Is anyone can explain me if it's a bug or if I'm doing something wrong.
With many thanks.
Elodie.
This is a known issue that stems from compatibility with connectors other than community connectors. Usually a separate getData call is made for Summary fields in those cases.
This issue should get resolved in future. For the time being, the recommendation is to return a blank data object for getData calls with a blank field list.

SuiteCommerce Advanced - Show a custom record on the PDP

I am looking to create a feature whereby a User can download any available documents related to the item from a tab on the PDP.
So far I have created a custom record called Documentation (customrecord_documentation) containing the following fields:
Related item : custrecord_documentation_related_item
Type : custrecord_documentation_type
Document : custrecord_documentation_document
Description : custrecord_documentation_description
Related Item ID : custrecord_documentation_related_item_id
The functionality works fine on the backend of NetSuite where I can assign documents to an Inventory item. The stumbling block is trying to fetch the data to the front end of the SCA webstore.
Any help on the above would be much appreciated.
I've come at this a number of ways.
One way is to create a Suitelet that returns JSON of the document names and urls. The urls can be the real Netsuite urls or they can be the urls of your suitelet where you set up the suitelet to return the doc when accessed with action=doc&id=_docid_ query params.
Add a target <div id="relatedDocs"></div> to the item_details.tpl
In your ItemDetailsView's init_Plugins add
$.getJSON('app/site/hosting/scriptlet.nl...?action=availabledoc').
then(function(data){
var asHtml = format(data); //however you like
$("#relatedDocs").html(asHtml);
});
You can also go the whole module route. If you created a third party module DocsView then you would add DocsView as a child view to ItemDetailsView.
That's a little more involved so try the option above first to see if it fits your needs. The nice thing is you can just about ignore Backbone with this approach. You can make this a little more portable by using a service.ss instead of the suitelet. You can create your own ssp app for the function so you don't have to deal with SCAs url structure.
It's been a while, but you should be able to access the JSON data from within the related Backbone View class. From there, within the return context, output the value you're wanting to the PDP. Hopefully you're extending the original class and not overwriting / altering the core code :P.
The model associated with the PDP should hold all the JSON data you're looking for. Model.get('...') sort of syntax.
I'd recommend against Suitelets for this, as that's extra execution time, and is a bit slower.
I'm sure you know, but you need to set the documents to be available as public as well.
Hope this helps, thanks.

GenericListCellRenderer example: add data to existing list?

I use the example GenericListCellRenderer
and cannot find to add a data object to the current list.
And the next were to delete a data from the list.
How may I do this?
First let me start by repeating our recommendation that you don't do that. There are better alternatives.
You need to use a model with map data as explained in the component section of the developer guide.

Unique AngularFire calls in Angular template functions

I'm using AngularFire and have an ng-repeat list with items that contain data specific to the "author" of that item (multiple users can add to the list), such as name, location, etc. I'm not writing that data into the array being iterated over by ng-repeat since it could change in the future. Instead, that author-specific data is store in a different location so the goal is that if the author changes their information, all of it is reflected in the list.
For a contrived example, imagine I'm iterating over a list of books from different authors. That list will contain the book-specific data (such as title, publish date, etc.) but I will also want to display the author's information in the list. Instead of including the author's information directly within the book data, I want to simply reference that author ID, and pull in whatever data is in their profile so if they change their name, it'll reflect the changes in all of their book listings.
That means I'm left to make async calls to Firebase to retrieve that information for each list item via a template function, such as {{getAuthorName(authorId)}}. The only problem is that they're async calls and the template function evaluates before the data is available.
I've looked into how to accomplish but have yet to find a solution that accommodates what I need. The answers here seem close, but they appear to no longer work in Angular >= 1.2.0 and they don't account for having to return different data for each template function call.
Update
Here is a JSFiddle with what I have now. I've made some progress, but all that's being returned now is the promise object as expected. I'm not sure how to implement .then in this scenario to get the actual value.
Any help would be great.
You can make use of $firebaseObject and then store that in an object to make sure it doesn't get hit again. like so:
var authors = {};
$scope.getAuthorName = function(authorId){
if(!authors[authorId]){
var authorRef = new Firebase(fburl + "/authors/" + authorId);
authors[authorId] = $firebaseObject(authorRef);
}
return authors[authorId];
};
You can see the working fiddle here: http://jsfiddle.net/0rcdpq47/

aws DynamoDb Boto adding a new item to a table

I am working to add items to a dynamodb database using python (boto api). I saw examples of people creating items and storing them using the table.new_item method.
Ex:
dynamoConn = boto.connect_dynamodb(aws_access_key_id, aws_secret_access_key)
dTable = dynamoConn.get_table(aws_dynamo_table)
....
item_data = {}
....
dTable.new_item(loc, theNewKey, item_data)
The code runs, I do not find any errors and when tracing through using debugger I do not see any reason why my item, a hash of keys and text values can't be stored.
I read: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html
However I think I may be missing an "update table" function. I'm not seeing one nor can I find an example of one online.
Any ideas?
The new_item method returns an Item object that is ready to be saved to DynamoDB but it doesn't actually save it for you. Once you are ready to save the item, you need to call the save (UpdateItem) or put (PutItem) method of the Item object.

Resources