Gmail Apps Marketplace contextual gadget only HelloWorld extractor works - gmail

I'm developing a google contextual gadget for Apps Marketplace based on this resource https://developers.google.com/gmail/contextual_gadgets.
I've enabled all the necessary APIs, and after configuring the Apps Marketplace SDK and setting up the contextual gadget extractor to google.com:HelloWorld was able to see the gadget on an email containing "Hello World" in the subject and body.
The problem is that none of the other extractors make the gadget appear. I have tried different combinations of Extractor Urls, params and scopes. The gadget won't appear in the email.
The content of the test.xml
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="MessageID" description="" height="20" author="personal" author_email="..." author_location="local">
<Require feature="dynamic-height"/>
<Require feature="google.contentmatch">
<Param name="extractors">
google.com:MessageIDExtractor
</Param>
</Require>
</ModulePrefs>
<Content type="html" view="card">
<![CDATA[
<script type="text/javascript">
document.body.appendChild(document.createTextNode("messageId test"));
</script>
]]>
</Content>
</Module>
extractor configuration
Thanks.

I made to work other extractors, try to follow this pattern: gadget settings
Supported values for Extractor param name: from_email, to_email, cc_email, bcc_email, date_sent, date_received, subject, body, id, list_id, list_unsubscribe

Related

Sharepoint Online Edit Form Toolbar

I'm trying to create a custom action on the edit form on Sharepoint Online with a Sharepoint Add-in..
According to the documentation, I should be able to use EditFormToolbar location as follows:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="965225e0-662b-4089-acdc-78433528f646.TestMenuAction"
RegistrationType="List"
RegistrationId="{$ListId:Lists/Add-in List Test;}"
Location="EditFormToolbar"
Sequence="10"
Title="Test Button">
<!--
Update the Url below to the page you want the custom action to use.
Start the URL with the token ~remoteAppUrl if the page is in the
associated web project, use ~appWebUrl if page is in the app project.
-->
<UrlAction Url="~appWebUrl/Pages/LookupWebPart.aspx?{StandardTokens}&SPListItemId={ItemId}&SPListId={ListId}" />
</CustomAction>
</Elements>
But this fails to deploy with the following error:
#"Error 1
CorrelationId: 817f7325-e9bc-41da-ae9f-400b459ce1cf
ErrorDetail: There were problems with the app web definition in the package.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Deployment failed in host web https://<redacted>.sharepoint.com/sites/dev.addin for app <redacted>/ca27c77f-c56f-409d-a69d-7064091fdda4. Microsoft.SharePoint.SPException: Feature definition with Id ca27c77f-c56f-409d-a69d-7064091fdda5 failed validation, file '/elements33b5f3d1-0607-455b-b292-880b39ec127d.xml', line 6, character 17: The 'Location' attribute is invalid - The value 'NewFormToolbar' is invalid according to its datatype 'http://schemas.microsoft.com/sharepoint/:CustomActionLocations' - The Enumeration constraint failed.
The schema documentation instead suggests that only CommandUI.Ribbon and EditControlBlock are supported locations.
Does anyone know if it's possible to customise the Edit Toolbar in Sharepoint Online?

How to add social sharing button in phonegap

I am new to phonegap, I am creating a wishes/greeting app.I want to add a social button to share that greeting to people. The selected greeting should be share by Twitter, g+, WhatsApp and Facebook.
PhoneGap Social Sharing plugin for Android, iOS and Windows Phone:
I propose you to use the following plugin to add social sharing option. Its pretty simple and straight forward to use.
Social sharing link
Installation
Automatically (CLI / Plugman):
SocialSharing is compatible with Cordova Plugman, compatible with PhoneGap 3.0 CLI, here's how it works with the CLI:
$ phonegap local plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
or with Cordova CLI, from npm:
$ cordova plugin add cordova-plugin-x-socialsharing
$ cordova prepare
SocialSharing.js is brought in automatically. There is no need to change or add anything in your html.
Manually
Add the following xml to all the config.xml files you can find:
<!-- for iOS -->
<feature name="SocialSharing">
<param name="ios-package" value="SocialSharing" />
</feature>
<!-- for Android (you will find one in res/xml) -->
<feature name="SocialSharing">
<param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>
<!-- for Windows Phone -->
<feature name="SocialSharing">
<param name="wp-package" value="SocialSharing"/>
</feature>
For sharing remote images (or other files) on Android, the file needs to be stored locally first, so add this permission to AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
For iOS, you'll need to add the Social.framework and MessageUI.framework to your project. Click your project, Build Phases, Link Binary With Libraries, search for and add Social.framework and MessageUI.framework.
Grab a copy of SocialSharing.js, add it to your project and reference it in index.html:
<script type="text/javascript" src="js/SocialSharing.js"></script>
Download the source files for iOS and/or Android and copy them to your project.
iOS: Copy SocialSharing.h and SocialSharing.m to platforms/ios//Plugins
Android: Copy SocialSharing.java to platforms/android/src/nl/xservices/plugins (create the folders)
Window Phone: Copy SocialSharing.cs to platforms/wp8/Plugins/nl.x-services.plugins.socialsharing (create the folders)
PhoneGap Build
Just add the following xml to your config.xml to always use the latest version of this plugin (which is published to plugins.cordova.io these days):
<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />
or to use an older version, hosted at phonegap build:
<gap:plugin name="nl.x-services.plugins.socialsharing" version="4.3.16" />
SocialSharing.js is brought in automatically. Make sure though you include a reference to cordova.js in your index.html's head:
<script type="text/javascript" src="cordova.js"></script>
Using the share sheet
Here are some examples you can copy-paste to test the various combinations:
<button onclick="window.plugins.socialsharing.share('Message only')">message only</button>
<button onclick="window.plugins.socialsharing.share('Message and subject', 'The subject')">message and subject</button>
<button onclick="window.plugins.socialsharing.share(null, null, null, 'http://www.x-services.nl')">link only</button>
<button onclick="window.plugins.socialsharing.share('Message and link', null, null, 'http://www.x-services.nl')">message and link</button>
<button onclick="window.plugins.socialsharing.share(null, null, 'https://www.google.nl/images/srpr/logo4w.png', null)">image only</button>
// Beware: passing a base64 file as 'data:' is not supported on Android 2.x: https://code.google.com/p/android/issues/detail?id=7901#c43
// Hint: when sharing a base64 encoded file on Android you can set the filename by passing it as the subject (second param)
<button onclick="window.plugins.socialsharing.share(null, 'Android filename', 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>
// Hint: you can share multiple files by using an array as thirds param: ['file 1','file 2', ..], but beware of this Android Kitkat Facebook issue: [#164]
<button onclick="window.plugins.socialsharing.share('Message and image', null, 'https://www.google.nl/images/srpr/logo4w.png', null)">message and image</button>
<button onclick="window.plugins.socialsharing.share('Message, image and link', null, 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, image and link</button>
<button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, subject, image and link</button>
Sharing directly to..
Facebook
<button onclick="window.plugins.socialsharing.shareViaFacebook('Message via Facebook', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via Facebook (with errcallback)</button>
Twitter
<!-- unlike most apps Twitter doesn't like it when you use an array to pass multiple files as the second param -->
<button onclick="window.plugins.socialsharing.shareViaTwitter('Message via Twitter')">message via Twitter</button>
<button onclick="window.plugins.socialsharing.shareViaTwitter('Message and link via Twitter', null /* img */, 'http://www.x-services.nl')">msg and link via Twitter</button>
WhatsApp
Note that on iOS when sharing an image and text, only the image is shared - let's hope WhatsApp creates a proper iOS extension to fix this.
Before using this method you may want to use canShareVia('whatsapp'.. (see below).
<button onclick="window.plugins.socialsharing.shareViaWhatsApp('Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">msg via WhatsApp (with errcallback)</button>
If you want to know more please check the link..Social Sharing
If the answer helps you please Vote up. Cheers
Try to test it not using phonegap, but rather create platform version (for example: android) and then run it in Android Studio via your phone. I tried simulator but didn't work there as there is no WhatsApp or other social app in the simulator, that is why it will show you nothing.

Amazon: Product not showing in inventory list on seller central

Any one experienced with Amazon MWS might help me. I am trying to push a product through XML to my inventory in my seller central account. But it doesnot appear on there.
I am using sample file provided by Amazon.
<?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>merchant_id</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>56789</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B00AK3RCQM</Value>
</StandardProductID>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<DescriptionData>
<Title>Example Product Title</Title>
<Brand>Example Product Brand</Brand>
<Description>This is an example product description.</Description>
<BulletPoint>Example Bullet Point 1</BulletPoint>
<BulletPoint>Example Bullet Point 2</BulletPoint>
<MSRP currency="USD">25.19</MSRP>
<Manufacturer>Example Product Manufacturer</Manufacturer>
<ItemType>example-item-type</ItemType>
</DescriptionData>
<ProductData>
<Health>15
Amazon Marketplace Web Service Feeds API 15
Section Reference (API Version 2009-01-01)
15
<ProductType>
<HealthMisc>
<Ingredients>Example Ingredients</Ingredients>
<Directions>Example Directions</Directions>
</HealthMisc>
</ProductType>
</Health>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
Response looks like
FeedSubmissionId 7409597458
FeedType _POST_PRODUCT_DATA_
SubmittedDate 2013-06-25T12:24:45Z
FeedProcessingStatus _SUBMITTED_
You should use Amazon MWS Reports API to get the detailed report response, You just submit the FeedSubmissionId and wait for a response - the response will have the details why Amazon did not accept your file. here is a link to the documentation:
https://developer.amazonservices.com/gp/mws/api.html?ie=UTF8&section=reports&group=bde

How to use Google Apps Script to serve a Google Calendar/Email gadget?

I would like to develop a calendar/gmail gadget for our Google Apps for Business domain using Apps Script to leverage all of the benefits it affords.
When replicating the Hello World gadget example:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
Using a template XML doGet():
function doGet(e) {
var output = ContentService.createTextOutput();
var xml = '<?xml version="1.0" encoding="UTF-8" ?>\n<Module>\n<ModulePrefs title="Calendar Gadget" />\n<Content type="html"><![CDATA[\nHello, world!\n]]></Content>\n</Module>';
output.setContent(xml);
output.setMimeType(ContentService.MimeType.XML);
return output;
}
The resultant served content is identical to the example Gadget which installs fine, but served from GAS it isn't recognised as valid. Calendar ignores it and GMail declares it invalid.
Invalid gadget specification. Ensure that URL is correct and the gadget does not contain errors.
Is part of the requirement for a Google Apps Gadget that it be served using an *.xml filename?
doGet() does not return the XML (or HTML) verbatim. There is a difference in the exact content provided to the browser and the content returned by doGet().
So, the answer to your question is - yes, you need to have an XML file for a Google Gadget and cannot use Apps Script. What you can perhaps do is use Apps Script to write out the XML file.
The content served using the ContentService should be identical to the input provided. Please ensure that the web app is configured to allow anonymous access.

How do I create a SharePoint 2007 list from a template via web service?

I have a SharePoint 2007 custom list that I have saved as a list template. I am looking for a way to create a new list from the saved template via a web service call from an outside application.
I have already looked into the the basic web services available for SharePoint 2007 http://msdn.microsoft.com/en-us/library/bb862916(office.12).aspx but a call to that just creates a simple, empty custom list.
How do I instantiate a list from a specific template? How do I locate the Feature ID for the template?
You can use a HTTP debugger like fiddler2 to analyze the web service and remote procedure calls that SharePoint Designer makes to find this out.
For example, to get the available list templates, SPD makes an HTTP request using the DisplayPost RPC command, e.g.
POST http://[server]/[web]/_vti_bin/owssvr.dll?Cmd=DisplayPost
with an xml payload of:
<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return" Version="12.0.0.000">
<Method ID="0,GetProjSchema">
<SetVar Name="Cmd">GetProjSchema</SetVar>
</Method>
</ows:Batch>
SPD then parses the ListTemplates node in the response to obtain a list of template names, types, and feature IDs.
To create the list from a specific template type or feature ID, SPD uses the same DisplayPost command, this time with a message body similar to:
<?xml version="1.0" encoding="UTF-8"?>
<ows:Batch OnError="Return" Version="12.0.0.000">
<Method ID="0,NewList">
<SetVar Name="Cmd">NewList</SetVar>
<SetVar Name="ListTemplate">108</SetVar>
<SetVar Name="Title">Discussion Board</SetVar>
<SetVar Name="FeatureId">00bfea716a4943fab535d15c05500108</SetVar>
<SetVar Name="RootFolder" />
<SetVar Name="LangID">1033</SetVar>
</Method>
</ows:Batch>
For an example of how to use the RPC protocol see this post on uploading files to a SharePoint document library (it uses the author.dll rather than the owssvr.dll, but the technique is similar).

Resources