Zum Hauptinhalt springen

AppBuilder Plugin erzeugen

Auch der AppBuilder kann um eigene PlugIns erweitert werden. Sie sollten dazu unbedingt gut und umfangreiche Programmierkenntnisse in C# haben wenn Sie diese tun möchten.

Ein Beispiel finden Sie auf NextCloud SoftwareRepository unter

SoftwareRepository/Extern/Software/MapEdit/Support/ApiSamples/MapEdit.AppBuilder.Plugin.Sample.zip

Folgende DLLS müssen referenziert werden. Diese finden Sie im MapEdit Cache Verzeichnis (siehe erstes Kapitel)

ControlzEx.dll
Fluent.dll
MapEdit.AppBuilder.PlugIn.dll
Mum.Geo.Client.Core.dll
System.Windows.Interactivity.dll
XSystem.dll

Desweiteren benötigen Sie Referenzen auf diese System DLLs die mit .NET mitgeliefert werden.

PresentationCore.dll
PresentationFramework.dll
System.dll
System.Core.dll
System.Xaml.dll
System.Xml.Linq.dll
System.Data.DataSetExtensions.dll
Microsoft.CSharp.dll
System.Data.dll
System.Net.Http.dll
System.Xml.dll
WindowsBase.dll

Das fertige AppBuilder Plugin muss auf dem MapEdit Server Rechner ins
Verzeichnis

C:\inetpub\wwwroot\MumGeoData\Repositories\Default\Plugins\AppBuilder\

kopiert werden und die die Endung ".dll" muss nach ".xap" umbenannt werden.

Each Plugin consist of a json file and a XAP File of the same name.

The json File looks like this

{
"CompanyName": "My Company", << Enter the Name of your Company
"CompanyId": "e9877c10-5eb1-4547-8682-24706c54206f", << create a new GUID with a GUID generator!!!
"ClassName": "MyCompany.AppBuilder.MyPlugIn", << Name of your Plugin Class (leave empty if you do not have one)
"Categories": [
{
"ClassName": "MyCompany.AppBuilder.MyCategory", << Name of your Category Class
"IconName": "Tag", << use AppBuilder Ribbon Designer to see all Avaiable Image Names or use XSystem.XImageNameModern Enumration )
"CaptionEN": "Sample PlugIn", << Name in English, this is the Name that is Displayed for your Plugin Category in the Tree
"CaptionDE": "Beispiel PlugIn", << Name in German
"CaptionFR": "Exemple PlugIn", << Name in French
"CaptionIT": "Esempio PlugIn" << Name in Italian
}
]
}

Plugin

The AppBuilderPlugIn (MyPlugin) is optional and loaded at the start of the AppBuilder. It has some funktions where you can add Button to the Window Title Bar of the AppBuilder and functions where you can add Buttons to existing Categories. If you use a AppBuilderPlugIn you need to enter the ClassName in the Root Entry of the json File.

Category

The Category Plugin is loaded when the Enduser clicks on the TreeItem Configured in the json File the first time. The Category Plugin is not loaded with the start of the AppBuilder!!

The Category is the Tree Node that Groups your Documents. The UI of the Category Control will be showen if the User clicks on the Category Tree Item.

Examples for existing Categories are "Database Connection", "Maps", "Searches" etc Categories equals the Folder in the Repository

C:\inetpub\wwwroot\MumGeoData\Repositories\Default

If you create a AppBuilder Plugin your Category must be stored under

C:\inetpub\wwwroot\MumGeoData\Repositories\Default\ThirdParty\YourCompany\YourCategory
Warnung

We will randomly delete your data if it is not stored under "ThirdParty" !!! Please enter the Name of your Company otherwise there will be colusions with Data of other Companies/Thirtparty developers

Document Preview

If you single click on a Document Tree Node you will see this UI Control. This is only shown if the Document is not opened yet. The UI Controls usually shows a "Open" Button to open the Document. You can add any other Buttons or UI Elements you want there. All of your Document Tree Nodes share the same UI Control.

Document

If you double click on a Document Tree Node you will see the Document UI Control. A Document is a Page/Window ob the Right side of the AppBuilder that shows the Data that you want to store

TreeItem (AppBuilderDocumentTreeItem)

Used to open and manage Documents and display them in the Tree on the left side of the AppBuilder.

In your Client Plugins you can access your Data the same way as you do in the AppBuilder. e.g.

Application.Repository.Storage.LoadJsonObject<MyData>(this.Filename)

All Filename are relative File name to the C:\inetpub\wwwroot\MumGeoData\Repositories\Default Folder.

Just like with regular Plugins, use the PostBuild Event but use "PublishAppBuilderPlugin"

"$(ProjectDir)..\..\CoreDLLs\PostBuildTool.exe" PublishAppBuilderPlugin $(TargetPath)

if you do not want to use the Postbuild Tool you can also manualy rename you DLL to XAP and copy the xap, pdb and the json file to:

C:\inetpub\wwwroot\MumGeoData\Repositories\Default\Plugins\AppBuilder

In the Properties of the MyCompany.AppBuilder.json file set: Copy to Output Directory = If Newer

Update to Version 23.1

If you create a AppBuilder Plugin with a Version before 23.1 then notice that the API has been completly changed and you need to redo your Plugin. The Sample Code above shows the correct usage.

Please Contact your MuM Hotline to contact a MuM Developer if you need help with the Update.

After Updating set "ApiVersion" : 2, in your JSON File.