Невозможно добавить домены приложений в Outlook при отправке манифестов надстроек - PullRequest
0 голосов
/ 24 апреля 2020

Я относительно новичок в разработке надстроек Outlook и столкнулся с проблемой разработки надстройки при отправке.

Я пытаюсь сделать ajax звонок изнутри моего отправить надстройку следующим образом:

$.ajax({
    url: "https://XXXXXXX.dev:9999/createMeeting",
    data: JSON.stringify(result),
    contentType: 'application/json',
    type: 'POST',
    dataType: 'json',
    error: function(xhr, status, error) {
        console.log("ERRROR", error)
    }
}).done(function(data) {
    console.log("DONE ", data)
});

Мой манифест выглядит следующим образом:

<?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:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="MailApp">

    <AppDomains>
        <AppDomain>DOMAIN1</AppDomain>
        <AppDomain>DOMAIN2</AppDomain>
    </AppDomains>

    <Id>XXXXXXXX-1a52-42a0-96bf-100d801a4ef7</Id>
    <Version>1.0</Version>
    <ProviderName>Contoso</ProviderName>
    <DefaultLocale>en-us</DefaultLocale>
    <DisplayName DefaultValue="Contoso Subject and CC Checker" />
    <Description DefaultValue="Contoso Subject and CC Checker" />

    <Requirements>
        <Sets DefaultMinVersion="1.1">
            <Set Name="Mailbox" />
        </Sets>
    </Requirements>



    <FormSettings>
        <Form xsi:type="ItemEdit">
            <DesktopSettings>
                <SourceLocation DefaultValue="https://XXXXXXXX.dev:3001/index.html" />
            </DesktopSettings>
        </Form>
    </FormSettings>

    <Permissions>ReadWriteMailbox</Permissions>

    <Rule xsi:type="RuleCollection" Mode="Or">
        <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit" />
        <Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Edit" />
    </Rule>

    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
        <!-- On Send requires VersionOverridesV1_1 -->
        <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
            <Description resid="residAppDescription" />
            <Requirements>
                <bt:Sets DefaultMinVersion="1.3">
                    <bt:Set Name="Mailbox" />
                </bt:Sets>
            </Requirements>

            <Hosts>
                <Host xsi:type="MailHost">
                    <DesktopFormFactor>
                        <!-- The functionfile and function name to call on message send.  -->
                        <!-- In this particular case the function validateSubjectAndCC will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
                        <FunctionFile resid="residUILessFunctionFileUrl" />
                        <ExtensionPoint xsi:type="Events">
                            <Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="validateSubjectAndCC" />
                        </ExtensionPoint>
                    </DesktopFormFactor>
                </Host>
            </Hosts>
            <Resources>
                <bt:Urls>
                    <!-- The JavaScript code is hosted on a secure and trusted web server. -->
                    <bt:Url id="residUILessFunctionFileUrl" DefaultValue="https://XXXXXXXX.dev:3001/index.html"></bt:Url>
                </bt:Urls>
            </Resources>
        </VersionOverrides>
    </VersionOverrides>

</OfficeApp>

Но я продолжаю получать эту ошибку, когда пытаюсь добавить надстройку

This app can't be installed. 
The manifest file doesn't conform to the schema definition. 
The element 'OfficeApp' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' has invalid child element 'AppDomains' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'. 
List of possible elements expected: 'Id' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'... 
The element 'OfficeApp' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1' has invalid child element 'AppDomains' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'. 
List of possible elements expected: 'Id' in namespace 'http://schemas.microsoft.com/office/appforoffice/1.1'.

Согласно документам , элемент AppDomains должен быть дочерним по отношению к элементу OfficeApp . Я делаю что-то неправильно?? Заранее спасибо!

РЕДАКТИРОВАТЬ: Это происходит в Outlook OWA (Интернет) и Windows приложения. Не проверено на других платформах.

1 Ответ

1 голос
/ 28 апреля 2020

Похоже, проблема вызвана тем, что вы добавляете элементы в манифест. Поскольку файл манифеста следует схеме xmlns = "http://schemas.microsoft.com/office/appforoffice/1.1", он ожидает элементы в определенном порядке, упомянутом здесь . Если вы следуете порядку элементов, упомянутых в примере manifest , он должен работать нормально.

Обновлены ссылки снова.

...