From 0b96e34c101a9ef52d54174d2eda4627f27c88e6 Mon Sep 17 00:00:00 2001 From: Shivika Gupta Date: Fri, 6 Sep 2024 17:50:39 +0530 Subject: [PATCH] Introducing interfaces & class strucuture --- .../portal-metadata-context/Interfaces.ts | 104 ++++++++++++++++++ .../PortalMetadataContext.ts | 37 +++++++ 2 files changed, 141 insertions(+) create mode 100644 src/common/portal-metadata-context/Interfaces.ts create mode 100644 src/common/portal-metadata-context/PortalMetadataContext.ts diff --git a/src/common/portal-metadata-context/Interfaces.ts b/src/common/portal-metadata-context/Interfaces.ts new file mode 100644 index 00000000..ea03518a --- /dev/null +++ b/src/common/portal-metadata-context/Interfaces.ts @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + */ + + +import * as vscode from 'vscode'; + +export interface IPortalMetadata { + webpages?: IWebpage[]; + contentSnippets?: IContentSnippet[]; + webTemplates?: IWebTemplate[]; + webFiles?: IWebFile[]; + entityLists?: IEntityList[]; + entityForms?: IEntityForm[]; + webForms?: IWebForm[]; + website?: IWebsite; + pageTemplates?: IPageTemplate[]; +} + +export interface IWebsite { + adx_name: string; + adx_defaultlanguage: string; + adx_headerwebtemplateid?: string; + adx_websiteid: string; + adx_website_language: number; + adx_footerwebtemplateid?: string; +} + +export interface IPageTemplate { + adx_webtemplateid?: string; + adx_name: string; + adx_type?: number; + adx_pagetemplateid: string; +} + +export interface IWebFile { + adx_name: string; + adx_parentpageid?: string; + adx_webfileid: string; +} + +export interface IContentSnippet { + adx_value?: string; + adx_name: string; + adx_contentsnippetlanguageid?: string; + adx_contentsnippetid: string; +} + +export interface IWebTemplate { + adx_source?: string; + adx_webtemplateid: string; + adx_name: string; +} + +export interface IWebpage { + adx_customcss?: string; + adx_entityform?: string; + adx_webpagelanguageid?: string; + adx_image?: string; + adx_webform?: string; + adx_customjavascript?: string; + adx_isroot: boolean; + adx_summary?: string; + adx_parentpageid?: string; + adx_entitylist?: string; + adx_name: string; + adx_pagetemplateid: string; + adx_copy?: string; + adx_rootwebpageid?: string; + adx_webpageid: string; +} + + +export interface IEntityList { + adx_registerstartupscript?: string; + adx_entitylistid: string; + adx_name: string; +} + +export interface IWebForm { + adx_name: string; + adx_webformid: string; + adx_startstep?: string; +} + +export interface IEntityForm { + adx_entityformid: string; + adx_name: string; + adx_registerstartupscript?: string; +} + +export interface IContextItem { + label: string; + title: string; + id: string; + isFile: boolean; + content: string; + path?: vscode.Uri; + component: string; + children: IContextItem[]; + error: string; + parentList: IContextItem[]; +} \ No newline at end of file diff --git a/src/common/portal-metadata-context/PortalMetadataContext.ts b/src/common/portal-metadata-context/PortalMetadataContext.ts new file mode 100644 index 00000000..c9476507 --- /dev/null +++ b/src/common/portal-metadata-context/PortalMetadataContext.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + */ + +import { IContextItem, IPortalMetadata } from "./Interfaces"; + +export class PortalMetadataContext { + + private portalMetadata: IPortalMetadata; + private portalMetadataContext: IContextItem; + + + public getPortalMetadataContext() { + // returns portalMetadataContext + } + + public onFileUpdate() { + // updates metadatacontext when file updates + } + + private updatePortalMetadataContext() { + // updates portalMetadataContext + } + + private updatePortalMetadata() { + // updates portalMetadata + } + + private createPortalMetadataContext() { + // creates portalMetadataContext + } + + private createPortalMetadata() { + // creates portalMetadata + } +} \ No newline at end of file