Getting the sender name in gmail contextual gadget - google-apps-marketplace

I’m developing a gmail contextual gadget to get name and email of sender’s email, but I have problem to get name of sender.I tried different ways:
1.Using Custom Extractor
It seems obsoleted and I can not find where I can upload my manifest.xml with custom extractor at “Google Apps Marketplace SDK”. Any Idea!!??
2. Using pre-canned extractors
I defined google.com:SenderEmailExtractor and select “Mail-Sender Address and Mail-Sender Name” scope.Unforthunatly, I just get sender’s email in google.contentmatch.getContentMatches() but there is nothing related to sender’s name! What am I missing?
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="DEV"
description="Gmail Gadget v2.0"
height="50"
author=""
author_email=""
author_location="Canada">
<!-- This one is not specific to Gmail contextual gadgets. -->
<Require feature="dynamic-height"/>
<Require feature="views" />
<Require feature="google.contentmatch">
<Param name="extractors">
google.com:MessageIDExtractor
</Param>
<Param name="extractors">
google.com:SenderEmailExtractor
</Param>
<Param name="extractors">
google.com:RawSubjectExtractor
</Param>
<Param name="extractors">
google.com:EmailTimeExtractor
</Param>
<Param name="extractors">
google.com:EmailAddressExtractor
</Param>
<Param name="extractors">
google.com:RecipientEmailExtractor
</Param>
<Param name="extractors">
google.com:RecipientToEmailExtractor
</Param>
</Require>
</ModulePrefs>
<!-- Define the content type and display location. The settings
"html" and "card" are required for all Gmail contextual gadgets. -->
<Content type="html" view="card">
<![CDATA[
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,900,900italic,700italic"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js"></script>
<script type="text/javascript">
function getSenderName() {
var matches = google.contentmatch.getContentMatches();
console.log("matches>>", JSON.stringify(matches));
try {
for (var match in matches)
for (var key in matches[match])
if (key == "sender_name") return matches[match][key];
}
catch (ex) {
console.error("getSenderName failed >>", ex);
}
return "no found";
}
function init(){
$("#content").text(getSenderName());
}
//gadgets.window.adjustHeight(50);
$(document).ready(function () {
console.log("Gmail Gadget Initializing ...");
gadgets.util.registerOnLoadHandler(init);
console.log("Gmail Gadget Initialized.");
});
</script>
Hello <span id="content"></span>
]]>
</Content>
</Module>

Related

PowerPoint add-in does not work in Slide Show (fullscreen) in PowerPoint Online

We're currently developing a PowerPoint add-in and we have trouble making it work in Slide Show (fullscreen) in PowerPoint Online, which recently caused it to be rejected from the Office Store.
Here is a minimal example which reproduces the bug, based on the How-To guide:
index.html
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. -->
<!-- See LICENSE in the project root for license information -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Office Add-in</title>
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js"></script>
<!-- LOCAL -->
<link rel="stylesheet" href="node_modules/office-ui-fabric-js/dist/css/fabric.min.css" />
</head>
<body class="ms-font-m ms-welcome">
<h1>Hello World</h1>
<script type="text/javascript" src="node_modules/core-js/client/core.js"></script>
<script type="text/javascript" src="node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="node_modules/office-ui-fabric-js/dist/js/fabric.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
app.js
"use strict";
(function() {
// The initialize function must be run each time a new page is loaded
Office.initialize = function(reason) {
$(document).ready(function() {
$("#run").click(run);
});
};
function run() {
return PowerPoint.run(function(context) {
/**
* Insert your PowerPoint code here
*/
return context.sync();
});
}
})();
counter-manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="ContentApp">
<Id>71a1a0ed-6cd0-4a6e-ad2d-015b8a8b43cb</Id>
<Version>1.0.0.0</Version>
<ProviderName>Test</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="DisplayName" />
<Description DefaultValue="Description"/>
<IconUrl DefaultValue="https://localhost:3004/assets/icon-32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3004/assets/hi-res-icon.png"/>
<AppDomains></AppDomains>
<Hosts>
<Host Name="Presentation" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3004/index.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides
xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Presentation"></Host>
</Hosts>
<Resources></Resources>
</VersionOverrides>
</OfficeApp>
We're serving our add-in using Browsersync as explained in the How-To guide. When I add it to a blank presentation in PowerPoint Online, it seems to work as expected (except for a different bug when refreshing described here) until I try to go into Slide Show (fullscreen) mode. I see a loading animation in fullscreen for a few seconds then I'm back to the previous editor mode.
Here are the errors displayed in the Chrome Developer Tools Console when trying to enter SlideShow mode:
Refused to get unsafe header "X-WacCluster"
Refused to get unsafe header "X-SupportSVGInWebGL"
Failed to load https://euc-powerpoint.officeapps.live.com/pods/RemoteUls.ashx: The 'Access-Control-Allow-Origin' header contains multiple values 'https://contentstorage.osi.office.net, https://contentstorage.osi.office.net', but only one is allowed. Origin 'https://contentstorage.osi.office.net' is therefore not allowed access.
Uncaught TypeError: Cannot read property '$37' of null
at PPTe.$22.$17a (VM3959 11b10a4995dd8c5f.js:10)
How can we ensure that our add-in works correctly in Slide Show mode?

isVid parameter in Brightcove

Good morning,
does anybody know anything about the purpose of the value: <param name="isVid" value="true" /> in the brightcove player-configuration?
on the website they just say that it's a bool-value and has to be set to "true". Nothing about what it's doing.
The parameter isVid is required when you embbed a video inside an HTML file,
<script language="JavaScript" type="text/javascript" src="
http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myPlayer" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="486" />
<param name="height" value="412" />
<param name="playerID" value="1234567890" />
<param name="playerKey" value="AQ~~,AAAAstMe5SE~,5vOZ123456789bOfHyhc1i" />
<param name="isVid" value="true" />
<param name="#videoPlayer" value="ref:myVid12345" />
</object>
I think is not well described on the docs...
isVid: Boolean Required to be true for all video players.
http://support.brightcove.com/en/video-cloud/docs/player-configuration-parameters

Brightcove Embedded Player not working in IE8

I am trying to get a Brightcove embedded video player to work in IE8. It is currently working in all other browsers >IE8.
I retrieved this code from this Brightcove example: http://files.brightcove.com/BCL_MediaAPI_example.html
<!DOCTYPE html>
<html>
<head>
<title>Media API Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Javascript Media API wrapper from opensource.brightcove.com -->
<script type="text/javascript" src="http://files.brightcove.com/bc-mapi.js"></script>
</head>
<body>
<h1>Media API Sample</h1>
<!-- Start of Brightcove Player -->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="921267190001" />
<param name="playerKey" value="AQ~~,AAAA1oy1bvE~,ALl2ezBj3WG3MLvDx9F9zkV06cNK00ey" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<!-- params for Universal Player API -->
<param name="includeAPI" value="true" />
<param name="templateReadyHandler" value="BCL.onTemplateReady" />
</object>
<script type="text/javascript">brightcove.createExperiences();</script>
<!-- End of Brightcove Player -->
<fieldset>
<legend>Videos</legend>
<div id="results"></div>
</fieldset><br>
<!-- This is the script to modify for the exercise -->
<script type="text/javascript">
// BCL Media API search maker -- adapted from JS-MAPI on opensource.brightcove.com
// namespace to keep all the "global" vars together
var BCL = {};
// placeholder - params for API call
BCL.params = {};
// Media API read token
BCMAPI.token = "WDGO_XdKqXVJRVGtrNuGLxCYDNoR-SvA5yUqX2eE6KjgefOxRzQilw..";
// set the callback for Media API calls
BCMAPI.callback = "BCL.onSearchResponse";
// set the filter
BCL.params.any = "tag:nature";
BCMAPI.search(BCL.params);
BCL.onSearchResponse = function(jsonData) {
var str = "";
for (var index in jsonData.items) {
str += "<a onclick=\"BCL.playVideo(" + jsonData.items[index].id + ")\" style=\"cursor:pointer\"><img src=\"" + jsonData.items[index].thumbnailURL + "\"/><br/><small>" + jsonData.items[index].name + "</<small></a><hr/>";
}
document.getElementById("results").innerHTML = str;
}
// Player API scripting
// event listener for the player being ready
BCL.onTemplateReady = function (event) {
BCL.player = brightcove.api.getExperience("myExperience");
// get a reference to the video player
BCL.videoPlayer = BCL.player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
}
// play video function
BCL.playVideo = function(videoID) {
BCL.videoPlayer.loadVideoByID(videoID);
}
</script>
</body>
</html>
Any help would be so appreciated!
Try removing the comment from within the opening and closing . I've seen this prevent IE8 working before. No idea why.

How to filter items in Outlook View Control

I'd like to show content of outlook inbox folder filtered to particular subject using Outlook View Control. I try different parameters to Filter and Restriction parameters (like "Subject"="Test", Subject:"Test" etc), but it don't work. All items are displayed. I'm testing it on Outlook 2010 32 bit.
Thanks for suggestions
Sample Code:
<html>
<head>
<title>Outlook view filter test</title>
</head>
<body topmargin=0 leftmargin=0 scroll=no>
<OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046 id=tasks height="30%" width="50%">
<param name="Folder" value="Inbox">
<param name="Namespace" value="MAPI">
<param name="Restriction" value="[subject]:'Test'">
<param name="Filter" value="[subject]:'Test'">
<param name="DeferUpdate" value="0">
</OBJECT>
</body>
</html>
You don't want to use Filter, as the documentation says:
represents the Distributed Authoring and Versioning (DAV) Searching and Locating (DASL) statement used to restrict the display to a specified subset of data. Read/write
Instead just use Restriction. With Restriction = means contains, see documentation: https://msdn.microsoft.com/EN-US/library/office/ff865641.aspx
<html>
<head>
<title>Outlook view filter test</title>
</head>
<body topmargin=0 leftmargin=0 scroll=no>
<OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046 id=tasks height="30%" width="50%">
<param name="Folder" value="Inbox">
<param name="Namespace" value="MAPI">
<param name="Restriction" value="[Subject]='Test'">
<param name="DeferUpdate" value="0">
</OBJECT>
</body>
</html>

Return metadata fields in Google Search Appliance result

I'm working with a Google Search Appliance machine using the feed type metadata-and-url.
I posted the feed to the GSA machine sucessfully, but when I do a search (using my appliance URL) to get the XML from the GSA machine, I cannot see the metadata in the returning XML. Should I use some querystring parameter?
Any idea?
This is the xml posted to the GSA machine:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" "">
<gsafeed>
<header>
<datasource>TestXMLFeed</datasource>
<feedtype>metadata-and-url</feedtype>
</header>
<group>
<record url="http://www.WHATEVERURL" action="add" mimetype="text/html" lock="true">
<metadata>
<meta name="Creator" content="testcreator"/>
<meta name="Project" content="testproject"/>
<meta name="TypeOfContent" content="testtypeofcontent"/>
</metadata>
</record>
</group>
</gsafeed>
This is what I get from the search:
<GSP VER="3.2">
<TM>0.010752</TM>
<Q>Test page</Q>
<PARAM name="q" value="testpage" original_value="testpage"/>
<PARAM name="site" value="test" original_value="test"/>
<PARAM name="sort" value="date:D:L:d1" original_value="date:D:L:d1"/>
<PARAM name="oe" value="UTF-8" original_value="UTF-8"/>
<PARAM name="ie" value="UTF-8" original_value="UTF-8"/>
<PARAM name="ud" value="0" original_value="0"/>
<PARAM name="ip" value="whateverip" original_value="whateverip"/>
<PARAM name="access" value="p" original_value="p"/>
<RES SN="1" EN="1">
<M>1</M>
<XT/>
<R N="1">
<U>http://www.WHATEVERURL</U>
<UE>http://www.WHATEVERURL</UE>
<T>Test title</T>
<RK>8</RK>
<CRAWLDATE>1 Feb 2011</CRAWLDATE>
<FS NAME="date" VALUE=""/>
<S>
Summary test
</S>
<LANG>es</LANG>
<HAS>
<L/>
<C SZ="5k" CID="o7iCf_ghuzAJ" ENC="UTF-8"/>
</HAS>
</R>
</RES>
</GSP>
Add the parameter &getfields=* to your google search appliance search url page.
And for filtering after on those metadata is necessary to add partialfields=Creator:testcreator in the querystring too.

Resources