Vault Application

Hello,

We are developing an M-Files application that needs to include:

  • A Vault Application Framework 22.12 server component (C# class VaultApplication : ConfigurableVaultApplicationBase<T>), and
  • A User Interface Extensibility Framework client component (ShellUI module with right-pane dashboards and custom commands).

We would like to deploy this as a single application package.

We attempted to merge the two by updating appdef.xml like this:

 

<application type="both" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

             xsi:noNamespaceSchemaLocation="http://www.m-files.com/schemas/appdef-Server-v5.xsd">

  <guid>eb1ec555-b326-46df-899b-8ece191a08bd</guid>

  <name>My Company</name>

  <version>1.0</version>

  <required-mfiles-version>22.3.0.0</required-mfiles-version>

 

  <extension-objects>

    <extension-object>

      <name>GCG.Vault.Hybrid</name>

      <assembly>GCG.Vault.Hybrid.dll</assembly>

      <class>GCG.Vault.Hybrid.VaultApplication</class>

      <installation-method>Install</installation-method>

      <uninstallation-method>Uninstall</uninstallation-method>

      <initialization-method>Initialize</initialization-method>

      <uninitialization-method>Uninitialize</uninitialization-method>

      <start-operations-method>StartOperations</start-operations-method>

    </extension-object>

  </extension-objects>

 

  <modules>

    <module environment="shellui" fast-browsing-compatible="true">

      <file>Client/main.js</file>

    </module>

  </modules>

 

  <dashboards>

    <dashboard id="eforms-dashboard">

      <content>Client/eforms.html</content>

      <allow-selection>true</allow-selection>

    </dashboard>

  </dashboards>

</application>

 

 

We tried appdef-Server-v5.xsd as well as appdef -v5.xsd

 

When we install this application:

  • If we use appdef-server-v5.xsd, the server component loads, but the dashboard never appears.
  • If we use appdef-v5.xsd with type="both", I get an error:

The structure of the application is invalid. (Unrecognized application definition schema or application structure.)

 

So, my questions are:

  1. Does M-Files 22.12 fully support hybrid applications (type="both") with both server extension objects and client dashboards?
  2. Which schema (appdef-server-v5.xsd or appdef-v5.xsd) is correct for hybrid apps?
  3. Is there an official example or template for packaging Vault Application Framework + UIX into one app?

We have installed M-Files extension for VS-2022

Parents
  • You have asked this question in multiple places.  Please do not do that as it duplicates effort.  Your question has been answered in the Developer group: (+) VAF Application - Developer Forum - Developers - M-Files Community by  who pointed you at the documentation here: https://developer.m-files.com/Frameworks/Vault-Application-Framework/Distributing-Child-Applications/.

  • Apology for multiple posts for the question, however, I have tried and it is not working the way it is advised.
    1. I have used the server app guid in client.
    2. compiled the client app and created .mfappx.
    3. using this .mfappx in server application with below code

     

    public override void Initialize(MFilesAPI.Vault vaultSrc)
    {
    try
    {
    SysUtils.ReportToEventLog($"The application path is {Directory.GetCurrentDirectory()}", System.Diagnostics.EventLogEntryType.Information);
    string appPath = "app.mfappx";

    if (File.Exists(appPath))
    {
    vaultSrc.CustomApplicationManagementOperations.InstallCustomApplication(appPath);
    }
    else
    {
    SysUtils.ReportErrorToEventLog("File: " + appPath + " does not exist");
    }
    }
    catch (Exception ex)
    {
    if (!MFUtils.IsMFilesAlreadyExistsError(ex))
    SysUtils.ReportErrorToEventLog(ex.Message);
    }

    base.Initialize(vaultSrc);
    }

    it says in event logs
    The system cannot find the file specified. (app.mfappx)
    please note that app.mfappx is also installed as an application

  • I built an application using this today so it does work as described.

    Did you remember to embed your client app in the server app, and have you validated the paths?

  • Thank you  this is how i have embedded the client application.  

    and this is the status from M-Files server

    GCG.EForms(Advance Types) is the client application at server

    GCG.Vault.Hybrid is the application which is supposed to be server Vault application, which requires using EForms application.

    Please advise

  • If the application is being installed correctly but it's not "nested" in the listing then it's because you have not correctly specified the master application GUID in the client application's appdef.xml.

  • Thanks for the response  ,

    Just to reconfirm please note the steps i followed,

    • i created client app
    • i created the server app
    • now i replaced the guid of client app with the one in server app
    • i compiled  client application and installed
    • now when i compile the server app it fails. i tried explicitly installed from the created GCG.Vault.Hybrid-1.0.mfappx it failed with the error like "DlgClientApplications.cpp, 552, The structure of the application is invalid. (Server application type must not be changed.) (0x800408E2)"

    below is the appdef.xml of client app

    <?xml version="1.0"?>
    <application xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xsi:noNamespaceSchemaLocation="">www.m-files.com/.../appdef-client-v5.xsd">
    <!--<guid>ab2da4f7-90bf-45e3-9ab2-7b12eed4dc67</guid>-->
    <guid>eb1ec555-b326-46df-899b-8ece191a08bd</guid>
    <name>GCG.EForms (Advance Types)</name>
    <version>1.0</version>
    <description>Advance Control</description>
    <publisher>Muhammad Irfan</publisher>
    <copyright>GCG</copyright>
    <required-mfiles-version>20.12.0.0</required-mfiles-version>
    <optional>true</optional>
    <enabled-by-default>true</enabled-by-default>
    <modules>
    <module environment="shellui" fast-browsing-compatible="true">
    <file>Client/main.js</file>
    <!--<file>Client2/main.js</file>-->
    </module>
    </modules>
    <dashboards>
    <dashboard id="eforms-dashboard">
    <content>Client/eforms.html</content>
    <allow-selection>true</allow-selection>
    </dashboard>
    <dashboard id="advance-dashboard">
    <content>Client2/index.html</content>
    <allow-selection>true</allow-selection>
    </dashboard>
    </dashboards>
    </application>

    this is the server app appdef.xml

    <?xml version="1.0" encoding="utf-8" ?>
    <application
    type="both"
    xmlns:xsi="">www.w3.org/.../XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="">www.m-files.com/.../appdef-server-v5.xsd">
    <guid>eb1ec555-b326-46df-899b-8ece191a08bd</guid>
    <name>GCG.Vault.Hybrid</name>
    <description></description>
    <publisher></publisher>
    <version>1.0</version>
    <copyright></copyright>
    <required-mfiles-version>22.3.0.0</required-mfiles-version>
    <multi-server-compatible>false</multi-server-compatible>
    <extension-objects>
    <extension-object>
    <name>GCG.Vault.Hybrid</name>
    <assembly>GCG.Vault.Hybrid.dll</assembly>
    <class>GCG.Vault.Hybrid.VaultApplication</class>
    <installation-method>Install</installation-method>
    <uninstallation-method>Uninstall</uninstallation-method>
    <initialization-method>Initialize</initialization-method>
    <uninitialization-method>Uninitialize</uninitialization-method>
    <start-operations-method>StartOperations</start-operations-method>
    </extension-object>
    </extension-objects>

    </application>

    Please note that either of the application is installed first the subsequent one throws the above exception.

Reply
  • Thanks for the response  ,

    Just to reconfirm please note the steps i followed,

    • i created client app
    • i created the server app
    • now i replaced the guid of client app with the one in server app
    • i compiled  client application and installed
    • now when i compile the server app it fails. i tried explicitly installed from the created GCG.Vault.Hybrid-1.0.mfappx it failed with the error like "DlgClientApplications.cpp, 552, The structure of the application is invalid. (Server application type must not be changed.) (0x800408E2)"

    below is the appdef.xml of client app

    <?xml version="1.0"?>
    <application xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xsi:noNamespaceSchemaLocation="">www.m-files.com/.../appdef-client-v5.xsd">
    <!--<guid>ab2da4f7-90bf-45e3-9ab2-7b12eed4dc67</guid>-->
    <guid>eb1ec555-b326-46df-899b-8ece191a08bd</guid>
    <name>GCG.EForms (Advance Types)</name>
    <version>1.0</version>
    <description>Advance Control</description>
    <publisher>Muhammad Irfan</publisher>
    <copyright>GCG</copyright>
    <required-mfiles-version>20.12.0.0</required-mfiles-version>
    <optional>true</optional>
    <enabled-by-default>true</enabled-by-default>
    <modules>
    <module environment="shellui" fast-browsing-compatible="true">
    <file>Client/main.js</file>
    <!--<file>Client2/main.js</file>-->
    </module>
    </modules>
    <dashboards>
    <dashboard id="eforms-dashboard">
    <content>Client/eforms.html</content>
    <allow-selection>true</allow-selection>
    </dashboard>
    <dashboard id="advance-dashboard">
    <content>Client2/index.html</content>
    <allow-selection>true</allow-selection>
    </dashboard>
    </dashboards>
    </application>

    this is the server app appdef.xml

    <?xml version="1.0" encoding="utf-8" ?>
    <application
    type="both"
    xmlns:xsi="">www.w3.org/.../XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="">www.m-files.com/.../appdef-server-v5.xsd">
    <guid>eb1ec555-b326-46df-899b-8ece191a08bd</guid>
    <name>GCG.Vault.Hybrid</name>
    <description></description>
    <publisher></publisher>
    <version>1.0</version>
    <copyright></copyright>
    <required-mfiles-version>22.3.0.0</required-mfiles-version>
    <multi-server-compatible>false</multi-server-compatible>
    <extension-objects>
    <extension-object>
    <name>GCG.Vault.Hybrid</name>
    <assembly>GCG.Vault.Hybrid.dll</assembly>
    <class>GCG.Vault.Hybrid.VaultApplication</class>
    <installation-method>Install</installation-method>
    <uninstallation-method>Uninstall</uninstallation-method>
    <initialization-method>Initialize</initialization-method>
    <uninitialization-method>Uninitialize</uninitialization-method>
    <start-operations-method>StartOperations</start-operations-method>
    </extension-object>
    </extension-objects>

    </application>

    Please note that either of the application is installed first the subsequent one throws the above exception.

Children