Position Outlook Add-In button on the `AppointmentOrganizerCommandSurface` - reactjs

I am trying to add a button to the AppointmentOrganizerCommandSurface in Outlook just like Giphy is added in this image, but instead, my My Office Add-in is added to the menu.
I would like to add an action button with my custom icon next to the Giphy action.
I tried manipulating manifest.xml. I went through the documentation and followed the steps, but I was unable to figure out what is going on.
Here is the manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>61262617-dad8-4e84-a9e4-89b1bab3e6e7</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="My Office Add-In"/>
<Description DefaultValue="A template to get started."/>
<IconUrl DefaultValue="https://localhost:3000/assets/icon-64.png"/>
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-128.png"/>
<SupportUrl DefaultValue="https://www.contoso.com/help"/>
<AppDomains>
<AppDomain>https://www.contoso.com</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Mailbox"/>
</Hosts>
<Requirements>
<Sets>
<Set Name="Mailbox" MinVersion="1.1"/>
</Sets>
</Requirements>
<FormSettings>
<Form xsi:type="ItemRead">
<DesktopSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
<RequestedHeight>250</RequestedHeight>
</DesktopSettings>
</Form>
</FormSettings>
<Permissions>ReadWriteItem</Permissions>
<Rule xsi:type="RuleCollection" Mode="Or">
<Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
</Rule>
<DisableEntityHighlighting>false</DisableEntityHighlighting>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<Requirements>
<bt:Sets DefaultMinVersion="1.3">
<bt:Set Name="Mailbox"/>
</bt:Sets>
</Requirements>
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<FunctionFile resid="Commands.Url"/>
<ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">
<OfficeTab id="TabDefault">
<Group id="msgReadGroup">
<Label resid="GroupLabel"/>
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="TaskpaneButton.Label"/>
<Supertip>
<Title resid="TaskpaneButton.Label"/>
<Description resid="TaskpaneButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="Taskpane.Url"/>
</Action>
</Control>
<Control xsi:type="Button" id="ActionButton">
<Label resid="ActionButton.Label"/>
<Supertip>
<Title resid="ActionButton.Label"/>
<Description resid="ActionButton.Tooltip"/>
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16"/>
<bt:Image size="32" resid="Icon.32x32"/>
<bt:Image size="80" resid="Icon.80x80"/>
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>action</FunctionName>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/icon-16.png"/>
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/icon-32.png"/>
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
</bt:Images>
<bt:Urls>
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="Contoso Add-in"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="Show Taskpane"/>
<bt:String id="ActionButton.Label" DefaultValue="Perform an action"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Opens a pane displaying all available properties."/>
<bt:String id="ActionButton.Tooltip" DefaultValue="Perform an action when clicked."/>
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
Thank you in advance.

You need to pin your add-in in the outlook to acheive the same.
You can pin an add-in so it's easily available when you're composing an email message.
Select Settings> View all Outlook settings > Mail > Customize actions.
Select the check box for the add-in that you want to see when you’re composing a message.

Related

Using grxml instead of inline grammar in my VXML

I have written a VXML which for the most part works. I would like to use a grxml now instead of inline grammar.
I created icecream.grxml in the same exact directory AS MY vxml APP and i call it like this
<grammar src="icecream.grxml" type="application/srgs+xml"/>
for example
<form id="formIdicecream">
<grammar src="icecream.grxml" type="application/srgs+xml"/>
<field name="icecream"> <prompt> What is your favorite icecream? </prompt> </field>
<field name="confirm">
<prompt> Your favorite icecream is <value expr="icecream$.utterance"/> </prompt>
</field>
<block> <goto next="#formIddtmf"/> </block>
my icecream.grxml looks like below, when I run my code I get an error :
Grammar activation failed |MSG=error activating grammar|URI=icecream.grxml
#
<!--Header-->
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xml:lang="en-US"
root="icecream"
mode="voice">
<!--Rules-->
<rule id="icecream">
<one-of>
<item><ruleref
uri="#vanilla" /></item>
<item><ruleref
uri="#chocolate" /></item>
<item><ruleref
uri="#strawberry" /></item>
</one-of>
</rule>
<rule id="vanilla">
<one-of>
<item>vanilla</item>
<item>nilla</item>
</one-of>
</rule>
<rule id="chocolate">
<one-of>
<item>chocolate</item>
<item>colate</item>
</one-of>
</rule>
<rule id="strawberry">
<one-of>
<item>strawberry</item>
<item>straw</item>
</one-of>
</rule>
</grammar>

Log4j generate different files with the same content

I'm working with a Java application that integrates log4j. For a new development I would need that instead of generating a file I will generate two, one per country that is accessed from the application web. Both would have the same log records that are found throughout my application.
I configured the configuration using an .xml file:
<!-- Appenders -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="jeveris: %d{dd MMM yyyy HH:mm:ss,SSS} %-5p %c - %m%n" />
</layout>
</appender>
<appender name="One-Console" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="Console.log" />
<param name="Append" value="true" />
<param name="MaxFileSize" value="2MB" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %c - %m%n" />
</layout>
</appender>
<category name="com.example.one.web">
<level value="debug" />
<appender-ref ref="One-Console" />
</category>
<root>
<appender-ref ref="console" />
<level value="debug" />
</root>
</log4j:configuration>
Could someone guide me, tell me if it is possible or help me find the solution?
Thank you.
If you want 2+ log files that will print the same content, then you could fine 2 different files in your tag like so:
<configuration status="OFF">
<Properties>
<Property name="log-path">/your/file/path/</Property>
<Property name="log-country-name1">Country1</Property>
<Property name="log-country-name2">Country2</Property>
<!-- more if necessary -->
<Property name="log-pattern">%d{ISO8601} %-5p [%t|%c{1}] %m\n</Property>
<Property name="rollover-strategy-max">5</Property>
<Property name="rolling-size-based">10 MB</Property>
</Properties>
<appenders>
<!--uncomment following if want to print to console as well -->
<!-- <Console name="Console" target="SYSTEM_OUT">
<PatternLayout>
<pattern>${log-pattern}</pattern>
</PatternLayout>
</Console> -->
<RollingFile name="INFO" fileName="${log-path}/${log-country-name1}-logger.log" filePattern="${log-path}/${log-project-name}-debug-%d-%i.log.zip">
<PatternLayout>
<pattern>${log-pattern}</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="${rolling-size-based}" />
</Policies>
<DefaultRolloverStrategy max="${rollover-strategy-max}" />
</RollingFile>
<RollingFile name="INFO" fileName="${log-path}/UpdaterLocal-logger.log" filePattern="${log-path}/${log-country-name2}-debug-%d-%i.log.zip">
<PatternLayout>
<pattern>${log-pattern}</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="${rolling-size-based}" />
</Policies>
<DefaultRolloverStrategy max="${rollover-strategy-max}" />
</RollingFile>
</appenders>
<Loggers>
<logger name="io.switchfour" level="trace" additivity="false">
<AppenderRef ref="INFO" level="info" />
</logger>
</Loggers>
The above will create /your/file/path/Country1-logger.log and /your/file/path/Country2-logger.log and will write all entries that are INFO or higher to both files. Your log file should be identical.

Create dialog using json file

I have been working on watson dialog for few days now, and I am able to create a dialog using .xml file after following few tutorials.
<?xml version="1.0" encoding="UTF-8"?>
<dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<flow>
<folder label="Main">
<output>
<prompt selectionType="RANDOM">
<item>Hi, I'll show you the latest buzz around a topic of your choice. What topic are you interested in?</item>
</prompt>
<goto ref="getUserInput_2442994"/>
</output>
<output>
<prompt selectionType="RANDOM">
<item>Bye</item>
</prompt>
<getUserInput id="getUserInput_2442994">
<search ref="folder_2442998"/>
</getUserInput>
</output>
</folder>
<folder label="Library">
<folder label="Live Content" id="folder_2447777">
<output>
<prompt selectionType="RANDOM">
<item>Alright. Open this URL to see the tweets: http://insights-search.mybluemix.net/api/1/messages/search?q={Topic}%20AND%20posted%3A2015-07-01%20AND%20sentiment%3A{Sentiment}</item>
</prompt>
</output>
</folder>
<folder label="Live Content" id="folder_2442998">
<input>
<grammar>
<item>*</item>
</grammar>
<action varName="Topic" operator="SET_TO_USER_INPUT"/>
<output>
<prompt selectionType="SEQUENTIAL">
<item>Are you interested in positive or negative tweets?</item>
</prompt>
<getUserInput>
<input>
<grammar>
<item>positive</item>
</grammar>
<action varName="Sentiment" operator="SET_TO">positive</action>
<goto ref="folder_2447777"/>
</input>
<input>
<grammar>
<item>negative</item>
</grammar>
<action varName="Sentiment" operator="SET_TO">negative</action>
<goto ref="folder_2447777"/>
</input>
<input>
<grammar>
<item>*</item>
</grammar>
<action varName="Sentiment" operator="SET_TO">nothing</action>
<goto ref="folder_2442998"/>
</input>
</getUserInput>
</output>
</input>
</folder>
<folder label="Storage"/>
</folder>
<folder label="Global"/>
<folder label="Concepts">
<concept>
<grammar>
<item>positive</item>
<item>good</item>
</grammar>
</concept>
</folder>
</flow>
<entities>
</entities>
<constants>
</constants>
<variables>
<var_folder name="Home">
<var name="Topic" type="TEXT"/>
<var name="Sentiment" type="TEXT"/>
</var_folder>
</variables>
<settings>
</settings>
<specialSettings>
</specialSettings>
</dialog>
I am using nodeJs for my server and wish to switch to JSON instead of XML. As the API reference says,
The dialog template file. Valid extensions are .mct for encrypted
dialog files, .json, and .xml.
I dont find any JSON structure anywhere in the documentation for the dialog file.
Has anyone tried this before and succeeded in using JSON instead of XML? How?
The Dialog service only accepts XML and MCT files. I think you found an error in the documentation.
On the other hand, the service was deprecated on August 15, 2016. Existing instances of the service will continue to function until August 9, 2017. We are encouraging users to migrate to use the Conversation service.
The conversation service has a web tool that lets you create dialogs, you won't have to write XML. It also allows you to export the project as JSON.

Apptentive GCM notification behaving differently when app is not in focus

I integrated my android app with apptentive as per GCM instructions in https://docs.apptentive.com/android/integration/
When I reply to a message from apptentive web UI, I am observing two notification behaviors at app side.
When app is opened, my own GCM listener is getting called.
When app is not in opened state, my own GCM listener is not getting called, however I am seeing a notification with app's default icon, "You have a new message" " ".
I am not sure who is creating this new/unwanted notification.
It is causing problem because, clicking this new notification is taking user to my activity, but not opening message center.
Specs:
Sdk version is 2.1.3
Device running Android 5.1.1
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Used by apptentive to get email address automatically. This permission is optional. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- GCM permissions -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<application
android:name="DubaiGoldPriceApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="org.chittu.dubaigoldprices.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/filepaths" />
</provider>
<!-- The following is required -->
<!-- Include your App's API key from Apptentive at "Settings -> API & Development" -->
<meta-data
android:name="apptentive_api_key"
android:value="<APIKEY>" />
<activity
android:name="com.apptentive.android.sdk.ViewActivity"
android:theme="#style/ApptentiveTheme" />
<!-- FB integration -->
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<provider android:authorities="com.facebook.app.FacebookContentProvider<SDKID>"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<!-- [START gcm_receiver] -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="org.chittu.dubaigoldprices" />
</intent-filter>
</receiver>
<!-- [END gcm_receiver] -->
<!-- [START gcm_listener] -->
<service
android:name="org.chittu.dubaigoldprices.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!-- [END gcm_listener] -->
<!-- [START instanceId_listener] -->
<service
android:name="org.chittu.dubaigoldprices.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<!-- [END instanceId_listener] -->
<service
android:name="org.chittu.dubaigoldprices.RegistrationIntentService"
android:exported="false">
</service>
</application>

ant run target if file has specifc suffix

I pass a filename to ant script via
ant -Dfilepath=/foo/bar/foobar.suffix
I want to copy it to a destination and if it is a .js file generate a compiled version of it.
This works but currently the compile task runs on all files not just .js file.
How do I exclude non .js files in the "runjscompile" task?
In a fileset I would do this (but I don't get how to apply this on the task):
<fileset dir="${foo}" casesensitive="yes">
<exclude name="**/*.min.js" />
<include name="**/*.js" />
</fileset>
My build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="test" basedir="." default="build">
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="/home/bar/bin/compiler.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/usr/share/java/ant-contrib.jar" />
</classpath>
</taskdef>
<property name="serverRoot" value="/home/bar/server/public_html" />
<property name="foo" value="${serverRoot}/foo/" />
<property name="workspaceRoot"
value="/home/bar/Zend/workspaces/DefaultWorkspace/" />
<property name="foo_service" value="${workspaceRoot}/foo_service/" />
<property name="filepath" value="${filepath}" />
<target name="build" depends="transferFile, runjscompile" />
<target name="transferFile" description="overwrite old file">
<basename property="filename" file="${filepath}" />
<dirname property="path" file="${filepath}" />
<pathconvert property="path.fragment" pathsep="${line.separator}">
<propertyresource name="path" />
<mapper type="regexp" from="^/[^/]+/(.*)" to="\1" />
</pathconvert>
<echo message="copy ${workspaceRoot}${filepath} to ${foo}${path.fragment}${filename}" />
<copy file="${workspaceRoot}${filepath}" tofile="${foo}${path.fragment}${filename}"
overwrite="true" force="true" />
<property name="destFile" value="${foo}${path.fragment}${filename}" />
</target>
<target name="runjscompile">
<echo message="compile ${destFile}" />
<basename property="file" file="${destFile}" />
<basename property="prefix" file="${destFile}" suffix=".js" />
<dirname property="directory" file="${destFile}" />
<echo message="Compressing file ${file} to ${directory}/${prefix}.min.js" />
<jscomp compilationLevel="simple" debug="false" output="${directory}/${prefix}.min.js" forceRecompile="true">
<sources dir="${directory}">
<file name="${file}" />
</sources>
</jscomp>
</target>
</project>
Add another target which checks the file suffix with a <condition> and sets a property if it matches, then make the jscompile target conditional on that. Following your fileset example you probably want something like:
<target name="check.js">
<condition property="do.jscompile">
<!-- check for filepath that ends .js but not .min.js -->
<matches string="${filepath}" pattern=".*(?<!\.min)\.js$$" />
</condition>
</target>
<target name="build" depends="check.js, transferFile, runjscompile" />
<target name="runjscompile" if="do.jscompile">

Resources