Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[External File Storage Connector]Local File System Connector (OnPrem) #27907

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.app
*.g.xlf
**/.vscode/*
**/.snapshots/*
**/.altestrunner/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

entitlement "Ext. Local File Connector"
{

ObjectEntitlements = "Ext. Local File - Objects";
Type = Implicit;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"id": "9587f70f-a76b-4bab-837e-85320e6cea82",
"name": "External File Storage - Local File System Connector (OnPrem)",
"publisher": "Microsoft",
"brief": "Enables file and folder operations on the local server filesystem via the External File Storage Module with Business Central.",
"description": "This app enables file and folder operations on the local server filesystem via the External File Storage Module with Business Central.",
"version": "26.0.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?linkid=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?linkid=2134520",
"url": "https://go.microsoft.com/fwlink/?linkid=724011",
"logo": "ExtensionLogo.png",
"internalsVisibleTo": [],
"dependencies": [ {
"id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f",
"name": "System Application",
"publisher": "Microsoft",
"version": "1.0.0.0"
}],
"screenshots": [],
"application": "26.0.0.0",
"platform": "26.0.0.0",
"idRanges": [
{
"from": 4820,
"to": 4829
}
],
"target": "OnPrem",
"resourceExposurePolicy": {
"allowDebugging": true,
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2134520",
"resourceFolders": ["data"]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionset 4822 "Ext. Local File - Edit"
{
Access = Public;
Assignable = false;
Caption = 'Local File - Edit';

IncludedPermissionSets = "Ext. Local File - Read";

Permissions =
tabledata "Ext. Local File Account" = imd;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionset 4820 "Ext. Local File - Objects"
{
Access = Public;
Assignable = false;
Caption = 'Local File - Objects';

Permissions =
table "Ext. Local File Account" = X,
page "Ext. Local File Account Wizard" = X,
page "Ext. Local File Account" = X;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionset 4821 "Ext. Local File - Read"
{
Access = Public;
Assignable = false;
Caption = 'Local File - Read';

IncludedPermissionSets = "Ext. Local File - Objects";

Permissions =
tabledata "Ext. Local File Account" = r;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionsetextension 4820 "File Storage - Admin - Ext. Local File" extends "File Storage - Admin"
{
IncludedPermissionSets = "Ext. Local File - Edit";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

permissionsetextension 4821 "File Storage - Edit - Ext. Local File" extends "File Storage - Edit"
{
IncludedPermissionSets = "Ext. Local File - Read";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

/// <summary>
/// Displays an account that was registered via the Local File connector.
/// </summary>
page 4820 "Ext. Local File Account"
{
ApplicationArea = All;
Caption = 'Local File Account';
DataCaptionExpression = Rec.Name;
Extensible = false;
InsertAllowed = false;
PageType = Card;
Permissions = tabledata "Ext. Local File Account" = rimd;
SourceTable = "Ext. Local File Account";
UsageCategory = None;

layout
{
area(Content)
{
field(NameField; Rec.Name)
{
Caption = 'Account Name';
NotBlank = true;
ShowMandatory = true;
ToolTip = 'Specifies the name of the storage account connection.';
}
field(BasePath; Rec."Base Path")
{
ApplicationArea = All;
Caption = 'Base Path';
NotBlank = true;
ShowMandatory = true;
ToolTip = 'Specifies the a base path of the account like D:\share\.';
}
}
}

trigger OnOpenPage()
begin
Rec.SetCurrentKey(Name);
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

/// <summary>
/// Holds the information for all file accounts that are registered via the Local File connector
/// </summary>
table 4820 "Ext. Local File Account"
{
Access = Internal;
Caption = 'Local File Account';
DataClassification = CustomerContent;

fields
{
field(1; "Id"; Guid)
{
Caption = 'Primary Key';
DataClassification = SystemMetadata;
}
field(2; Name; Text[250])
{
Caption = 'Account Name';
}
field(3; "Base Path"; Text[2048])
{
Caption = 'Base Path';

trigger OnValidate()
begin
if "Base Path" = '' then
exit;

if not "Base Path".EndsWith('\') then
"Base Path" += '\';
end;
}
}

keys
{
key(PK; Id)
{
Clustered = true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

Using System.Environment;

/// <summary>
/// Displays an account that is being registered via the Local File connector.
/// </summary>
page 4821 "Ext. Local File Account Wizard"
{
Caption = 'Setup Local File Account';
Editable = true;
Extensible = false;
PageType = NavigatePage;
Permissions = tabledata "Ext. Local File Account" = rimd;
SourceTable = "Ext. Local File Account";
SourceTableTemporary = true;

layout
{
area(Content)
{
group(TopBanner)
{
Editable = false;
ShowCaption = false;
Visible = TopBannerVisible;
field(NotDoneIcon; MediaResources."Media Reference")
{
ApplicationArea = All;
Editable = false;
ShowCaption = false;
ToolTip = ' ', Locked = true;
}
}
field(NameField; Rec.Name)
{
ApplicationArea = All;
NotBlank = true;
ShowMandatory = true;
ToolTip = 'Specifies the name of the Local File account.';

trigger OnValidate()
begin
IsNextEnabled := FileShareConnectorImpl.IsAccountValid(Rec);
end;
}
field(BasePath; Rec."Base Path")
{
ApplicationArea = All;
NotBlank = true;
ShowMandatory = true;
ToolTip = 'Specifies the a base path of the account like D:\share\.';

trigger OnValidate()
begin
IsNextEnabled := FileShareConnectorImpl.IsAccountValid(Rec);
end;
}
}
}

actions
{
area(processing)
{
action(Back)
{
ApplicationArea = All;
Caption = 'Back';
Image = Cancel;
InFooterBar = true;
ToolTip = 'Move to the previous step.';

trigger OnAction()
begin
CurrPage.Close();
end;
}

action(Next)
{
ApplicationArea = All;
Caption = 'Next';
Enabled = IsNextEnabled;
Image = NextRecord;
InFooterBar = true;
ToolTip = 'Move to the next step.';

trigger OnAction()
begin
FileShareConnectorImpl.CreateAccount(Rec, LocalFileAccount);
CurrPage.Close();
end;
}
}
}

var
LocalFileAccount: Record "File Account";
MediaResources: Record "Media Resources";
FileShareConnectorImpl: Codeunit "Ext. Local File Connector Impl";
IsNextEnabled: Boolean;
TopBannerVisible: Boolean;

trigger OnOpenPage()
var
AssistedSetupLogoTok: Label 'ASSISTEDSETUP-NOTEXT-400PX.PNG', Locked = true;
begin
Rec.Init();
Rec.Insert();

if MediaResources.Get(AssistedSetupLogoTok) and (CurrentClientType() = ClientType::Web) then
TopBannerVisible := MediaResources."Media Reference".HasValue();
end;

internal procedure GetAccount(var FileAccount: Record "File Account"): Boolean
begin
if IsNullGuid(LocalFileAccount."Account Id") then
exit(false);

FileAccount := LocalFileAccount;
exit(true);
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.ExternalFileStorage;

/// <summary>
/// Enum extension to register the Local File connector.
/// </summary>
enumextension 4820 "Ext. Local File Connector" extends "Ext. File Storage Connector"
{
/// <summary>
/// The Local File connector.
/// </summary>
value(4820; "Local File")
{
Caption = 'Local File';
Implementation = "External File Storage Connector" = "Ext. Local File Connector Impl";
}
}
Loading
Loading