-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Edit-In Excel] Improve metadata handling #1721
base: main
Are you sure you want to change the base?
Changes from 1 commit
564069f
c54ad88
4067ebc
78fcb87
7ca2187
bc47024
58e3a0b
15186a1
3b0677b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
namespace System.Integration.Excel; | ||
|
||
using System; | ||
using System.Integration; | ||
|
||
/// <summary> | ||
|
@@ -14,6 +15,42 @@ | |
{ | ||
Access = Public; | ||
|
||
procedure CreateMetadataWebRequest() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats with this procedure? |
||
var | ||
EnvironmentInfo: Codeunit "Environment Information"; | ||
Check failure on line 20 in src/System Application/App/Edit in Excel/src/EditInExcel.Codeunit.al GitHub Actions / Build System Application (Clean) / System Application (Clean)
Check failure on line 20 in src/System Application/App/Edit in Excel/src/EditInExcel.Codeunit.al GitHub Actions / Build System Application (Translated) / System Application (Translated)
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one should be name space using System.Environment; |
||
Token: Text; | ||
begin | ||
Token := 'herpderp'; | ||
|
||
|
||
end; | ||
|
||
procedure IsMetadataGeneratedForWebService(): Boolean | ||
var | ||
HttpClient: HttpClient; | ||
HttpResponseMessage: HttpResponseMessage; | ||
MetadataUrl: Text; | ||
EntitySetXml: Text; | ||
Document: DotNet XmlDocument; | ||
NodeList: DotNet XmlNodeList; | ||
NameSpaceManager: DotNet XmlNamespaceManager; | ||
EntitySetName: Text; | ||
begin | ||
MetadataUrl := 'https://metadatastoragexyz.blob.core.windows.net/metadata/metadata.xml?sp=r&st=2024-08-02T09:38:22Z&se=2024-08-02T17:38:22Z&spr=https&sv=2022-11-02&sr=b&sig=eP4pvx1m1OiiGVhYVD4haMIYvSgOAWIUysk3mD7h8Ds%3D'; | ||
EntitySetName := 'Company'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this necessary as variable, could be hardcoded with //edm:EntitySet[@name=" |
||
if HttpClient.Get(MetadataUrl, HttpResponseMessage) then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if HttpResponseMessage.IsSuccessStatusCode then begin | ||
HttpResponseMessage.Content().ReadAs(EntitySetXml); | ||
Document := Document.XmlDocument(); | ||
Document.LoadXml(EntitySetXml); | ||
NameSpaceManager := NameSpaceManager.XmlNamespaceManager(Document.NameTable()); | ||
NameSpaceManager.AddNamespace('edm', 'http://docs.oasis-open.org/odata/ns/edm'); | ||
NodeList := Document.SelectNodes('//edm:EntitySet[@Name="' + EntitySetName + '"]', NameSpaceManager); | ||
exit(NodeList.Count() > 0); | ||
end; | ||
exit(false); | ||
end; | ||
|
||
#if not CLEAN22 | ||
/// <summary> | ||
/// Creates web service for the specified page, and uses the web service to prepare and download an Excel file for the Edit in Excel functionality. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using System.Environment;