From 5b7c3b83dd40b955d65fca59c4e61e8ee731cb59 Mon Sep 17 00:00:00 2001 From: NicoleNG18 Date: Mon, 15 Sep 2025 13:44:35 +0300 Subject: [PATCH 1/2] rename product leaflet to product document --- codbex-products/codbex-products.edm | 12 +- codbex-products/codbex-products.gen | 55 ++++----- codbex-products/codbex-products.model | 41 +++---- ...etService.ts => ProductDocumentService.ts} | 33 +++--- .../codbex-products/codbex-products.openapi | 111 +++++++++--------- .../Products/ProductDocument.extensionpoint | 4 + ...sitory.ts => ProductDocumentRepository.ts} | 108 ++++++++--------- .../Products/ProductLeaflet.extensionpoint | 4 - .../schema/codbex-products.schema | 18 +-- .../controller.js | 93 +++++---------- .../dialog-filter/controller.js | 13 +- .../dialog-filter/index.html | 18 +-- .../dialog-filter/view.extension | 2 +- .../dialog-filter/view.js | 8 +- .../dialog-window/controller.js | 42 ++++--- .../dialog-window/index.html | 20 ++-- .../dialog-window/view.extension | 2 +- .../dialog-window/view.js | 8 +- .../index.html | 4 +- .../view.extension | 2 +- .../view.js | 8 +- .../en-US/codbex-products.model.json | 8 +- 22 files changed, 287 insertions(+), 327 deletions(-) rename codbex-products/gen/codbex-products/api/Products/{ProductLeafletService.ts => ProductDocumentService.ts} (75%) create mode 100644 codbex-products/gen/codbex-products/dao/Products/ProductDocument.extensionpoint rename codbex-products/gen/codbex-products/dao/Products/{ProductLeafletRepository.ts => ProductDocumentRepository.ts} (56%) delete mode 100644 codbex-products/gen/codbex-products/dao/Products/ProductLeaflet.extensionpoint rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/controller.js (71%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-filter/controller.js (78%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-filter/index.html (74%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-filter/view.extension (79%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-filter/view.js (70%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-window/controller.js (75%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-window/index.html (76%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-window/view.extension (79%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/dialog-window/view.js (64%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/index.html (96%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/view.extension (84%) rename codbex-products/gen/codbex-products/ui/Products/Product/{ProductLeaflet => ProductDocument}/view.js (70%) diff --git a/codbex-products/codbex-products.edm b/codbex-products/codbex-products.edm index 9a126bb..d470599 100644 --- a/codbex-products/codbex-products.edm +++ b/codbex-products/codbex-products.edm @@ -127,12 +127,12 @@ - - - - + + + + - + @@ -142,5 +142,5 @@ - + \ No newline at end of file diff --git a/codbex-products/codbex-products.gen b/codbex-products/codbex-products.gen index be2faca..f0d8629 100644 --- a/codbex-products/codbex-products.gen +++ b/codbex-products/codbex-products.gen @@ -63,7 +63,7 @@ "ProductPackaging", "ProductImage", "CampaignEntry", - "ProductLeaflet", + "ProductDocument", "Product-details", "Product-details", "Product-details", @@ -3379,7 +3379,7 @@ "properties": [ { "dataAutoIncrement": true, - "dataName": "PRODUCTLEAFLET_ID", + "dataName": "PRODUCTDOCUMENT_ID", "dataNullable": true, "dataPrimaryKey": true, "dataType": "INTEGER", @@ -3401,21 +3401,19 @@ "inputRule": "" }, { - "dataName": "PRODUCTLEAFLET_TITLE", + "dataName": "PRODUCTDOCUMENT_PRODUCT", "dataNullable": true, "dataType": "INTEGER", "description": "", - "name": "Title", + "name": "Product", "relationshipCardinality": "1_n", - "relationshipName": "ProductLeaflet_Product", + "relationshipName": "ProductDocument_Product", "relationshipType": "COMPOSITION", "tooltip": "", - "widgetDropDownKey": "Id", - "widgetDropDownValue": "Name", "widgetIsMajor": false, "widgetLength": "20", "widgetSize": "", - "widgetType": "DROPDOWN", + "widgetType": "TEXTBOX", "relationshipEntityName": "Product", "relationshipEntityPerspectiveName": "Products", "relationshipEntityPerspectiveLabel": "Entities", @@ -3425,55 +3423,53 @@ "dataUnique": false, "isRequiredProperty": false, "isCalculatedProperty": false, - "widgetLabel": "Title", - "widgetDropdownUrl": "/services/ts/codbex-products/gen/codbex-products/api/Products/ProductService.ts", + "widgetLabel": "Product", + "widgetDropdownUrl": "", "dataTypeJava": "int", "dataTypeTypescript": "number", "inputRule": "" }, { - "dataLength": "500", - "dataName": "PRODUCTLEAFLET_LEAFLETLINK", + "dataLength": "300", + "dataName": "PRODUCTDOCUMENT_LINK", "dataNullable": true, "dataType": "VARCHAR", "description": "", - "name": "LeafletLink", + "isRequiredProperty": true, + "name": "Link", "tooltip": "", "widgetIsMajor": true, - "widgetLength": "500", + "widgetLength": "300", "widgetSize": "", "widgetType": "URL", "dataNotNull": false, "dataAutoIncrement": false, "dataPrimaryKey": false, "dataUnique": false, - "isRequiredProperty": false, "isCalculatedProperty": false, - "widgetLabel": "LeafletLink", + "widgetLabel": "Link", "widgetDropdownUrl": "", "dataTypeJava": "string", "dataTypeTypescript": "string", "minLength": 0, - "maxLength": 500, + "maxLength": 300, "inputRule": "" } ], - "caption": "Manage entity ProductLeaflet", - "dataCount": "SELECT COUNT(*) AS COUNT FROM \"CODBEX_PRODUCTLEAFLET\"", - "dataName": "PRODUCTLEAFLET", + "caption": "Manage entity ProductDocument", + "dataCount": "SELECT COUNT(*) AS COUNT FROM \"CODBEX_PRODUCTDOCUMENT\"", + "dataName": "PRODUCTDOCUMENT", "dataQuery": "", - "description": "Manage entity ProductLeaflet", - "feedPassword": "YWRtaW4=", - "feedUsername": "YWRtaW4=", + "description": "Manage entity ProductDocument", "generateDefaultRoles": "false", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", "layoutType": "MANAGE_DETAILS", "menuIndex": "100", - "menuKey": "productleaflet", - "menuLabel": "ProductLeaflet", + "menuKey": "productdocument", + "menuLabel": "ProductDocument", "multilingual": "false", - "name": "ProductLeaflet", + "name": "ProductDocument", "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/cube.svg", "perspectiveLabel": "Products", @@ -3481,8 +3477,8 @@ "perspectiveNavId": "products-navigation-group", "perspectiveOrder": "100", "perspectiveRole": "", - "title": "ProductLeaflet", - "tooltip": "ProductLeaflet", + "title": "ProductDocument", + "tooltip": "ProductDocument", "type": "DEPENDENT", "dataSource": "DefaultDB", "referencedProjections": [], @@ -3491,8 +3487,7 @@ ], "primaryKeysString": "Id", "masterEntity": "Product", - "masterEntityId": "Title", - "hasDropdowns": true + "masterEntityId": "Product" } ] } \ No newline at end of file diff --git a/codbex-products/codbex-products.model b/codbex-products/codbex-products.model index 4a18d6d..6c09152 100644 --- a/codbex-products/codbex-products.model +++ b/codbex-products/codbex-products.model @@ -1521,7 +1521,7 @@ "properties": [ { "dataAutoIncrement": "true", - "dataName": "PRODUCTLEAFLET_ID", + "dataName": "PRODUCTDOCUMENT_ID", "dataNullable": "true", "dataPrimaryKey": "true", "dataType": "INTEGER", @@ -1534,55 +1534,52 @@ "widgetType": "TEXTBOX" }, { - "dataName": "PRODUCTLEAFLET_TITLE", + "dataName": "PRODUCTDOCUMENT_PRODUCT", "dataNullable": "true", "dataType": "INTEGER", "description": "", - "name": "Title", + "name": "Product", "relationshipCardinality": "1_n", - "relationshipName": "ProductLeaflet_Product", + "relationshipName": "ProductDocument_Product", "relationshipType": "COMPOSITION", "tooltip": "", - "widgetDropDownKey": "Id", - "widgetDropDownValue": "Name", "widgetIsMajor": "true", "widgetLength": "20", "widgetSize": "", - "widgetType": "DROPDOWN", + "widgetType": "TEXTBOX", "relationshipEntityName": "Product", "relationshipEntityPerspectiveName": "Products", "relationshipEntityPerspectiveLabel": "Entities" }, { - "dataLength": "500", - "dataName": "PRODUCTLEAFLET_LEAFLETLINK", + "dataLength": "300", + "dataName": "PRODUCTDOCUMENT_LINK", "dataNullable": "true", "dataType": "VARCHAR", "description": "", - "name": "LeafletLink", + "isRequiredProperty": "true", + "name": "Link", "tooltip": "", "widgetIsMajor": "true", - "widgetLength": "500", + "widgetLength": "300", "widgetSize": "", "widgetType": "URL" } ], - "caption": "Manage entity ProductLeaflet", - "dataCount": "SELECT COUNT(*) AS COUNT FROM \"${tablePrefix}PRODUCTLEAFLET\"", - "dataName": "PRODUCTLEAFLET", + "caption": "Manage entity ProductDocument", + "dataCount": "SELECT COUNT(*) AS COUNT FROM \"${tablePrefix}PRODUCTDOCUMENT\"", + "dataName": "PRODUCTDOCUMENT", "dataQuery": "", - "description": "Manage entity ProductLeaflet", - "feedPassword": "YWRtaW4=", - "feedUsername": "YWRtaW4=", + "description": "Manage entity ProductDocument", "generateDefaultRoles": "false", "generateReport": "false", "icon": "/services/web/resources/unicons/file.svg", "layoutType": "MANAGE_DETAILS", "menuIndex": "100", - "menuKey": "productleaflet", - "menuLabel": "ProductLeaflet", + "menuKey": "productdocument", + "menuLabel": "ProductDocument", "multilingual": "false", - "name": "ProductLeaflet", + "name": "ProductDocument", "perspectiveHeader": "", "perspectiveIcon": "/services/web/resources/unicons/cube.svg", "perspectiveLabel": "Products", @@ -1590,8 +1587,8 @@ "perspectiveNavId": "products-navigation-group", "perspectiveOrder": "100", "perspectiveRole": "", - "title": "ProductLeaflet", - "tooltip": "ProductLeaflet", + "title": "ProductDocument", + "tooltip": "ProductDocument", "type": "DEPENDENT" } ], diff --git a/codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts b/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts similarity index 75% rename from codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts rename to codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts index a46fe82..fed831d 100644 --- a/codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts +++ b/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts @@ -1,32 +1,32 @@ import { Controller, Get, Post, Put, Delete, request, response } from "sdk/http" import { Extensions } from "sdk/extensions" -import { ProductLeafletRepository, ProductLeafletEntityOptions } from "../../dao/Products/ProductLeafletRepository"; +import { ProductDocumentRepository, ProductDocumentEntityOptions } from "../../dao/Products/ProductDocumentRepository"; import { ValidationError } from "../utils/ValidationError"; import { HttpUtils } from "../utils/HttpUtils"; -const validationModules = await Extensions.loadExtensionModules("codbex-products-Products-ProductLeaflet", ["validate"]); +const validationModules = await Extensions.loadExtensionModules("codbex-products-Products-ProductDocument", ["validate"]); @Controller -class ProductLeafletService { +class ProductDocumentService { - private readonly repository = new ProductLeafletRepository(); + private readonly repository = new ProductDocumentRepository(); @Get("/") public getAll(_: any, ctx: any) { try { - const options: ProductLeafletEntityOptions = { + const options: ProductDocumentEntityOptions = { $limit: ctx.queryParameters["$limit"] ? parseInt(ctx.queryParameters["$limit"]) : undefined, $offset: ctx.queryParameters["$offset"] ? parseInt(ctx.queryParameters["$offset"]) : undefined, $language: request.getLocale().slice(0, 2) }; - let Title = parseInt(ctx.queryParameters.Title); - Title = isNaN(Title) ? ctx.queryParameters.Title : Title; + let Product = parseInt(ctx.queryParameters.Product); + Product = isNaN(Product) ? ctx.queryParameters.Product : Product; - if (Title !== undefined) { + if (Product !== undefined) { options.$filter = { equals: { - Title: Title + Product: Product } }; } @@ -42,7 +42,7 @@ class ProductLeafletService { try { this.validateEntity(entity); entity.Id = this.repository.create(entity); - response.setHeader("Content-Location", "/services/ts/codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts/" + entity.Id); + response.setHeader("Content-Location", "/services/ts/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts/" + entity.Id); response.setStatus(response.CREATED); return entity; } catch (error: any) { @@ -81,14 +81,14 @@ class ProductLeafletService { public getById(_: any, ctx: any) { try { const id = parseInt(ctx.pathParameters.id); - const options: ProductLeafletEntityOptions = { + const options: ProductDocumentEntityOptions = { $language: request.getLocale().slice(0, 2) }; const entity = this.repository.findById(id, options); if (entity) { return entity; } else { - HttpUtils.sendResponseNotFound("ProductLeaflet not found"); + HttpUtils.sendResponseNotFound("ProductDocument not found"); } } catch (error: any) { this.handleError(error); @@ -116,7 +116,7 @@ class ProductLeafletService { this.repository.deleteById(id); HttpUtils.sendResponseNoContent(); } else { - HttpUtils.sendResponseNotFound("ProductLeaflet not found"); + HttpUtils.sendResponseNotFound("ProductDocument not found"); } } catch (error: any) { this.handleError(error); @@ -134,8 +134,11 @@ class ProductLeafletService { } private validateEntity(entity: any): void { - if (entity.LeafletLink?.length > 500) { - throw new ValidationError(`The 'LeafletLink' exceeds the maximum length of [500] characters`); + if (entity.Link === null || entity.Link === undefined) { + throw new ValidationError(`The 'Link' property is required, provide a valid value`); + } + if (entity.Link?.length > 300) { + throw new ValidationError(`The 'Link' exceeds the maximum length of [300] characters`); } for (const next of validationModules) { next.validate(entity); diff --git a/codbex-products/gen/codbex-products/codbex-products.openapi b/codbex-products/gen/codbex-products/codbex-products.openapi index cf7db64..ae4cf04 100644 --- a/codbex-products/gen/codbex-products/codbex-products.openapi +++ b/codbex-products/gen/codbex-products/codbex-products.openapi @@ -3676,9 +3676,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts: + /codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts: get: - summary: List ProductLeaflet + summary: List ProductDocument parameters: - in: query name: $limit @@ -3706,7 +3706,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' 400: description: Bad Request Error content: @@ -3726,14 +3726,14 @@ paths: schema: $ref: '#/components/schemas/Error' post: - summary: Create ProductLeaflet + summary: Create ProductDocument tags: - Products requestBody: content: application/json: schema: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' required: true responses: 201: @@ -3741,7 +3741,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' 400: description: Bad Request Error content: @@ -3760,9 +3760,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts/{id}: + /codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts/{id}: get: - summary: Get ProductLeaflet by Id + summary: Get ProductDocument by Id parameters: - in: path name: id @@ -3780,7 +3780,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' 404: description: Entity Not Found content: @@ -3800,7 +3800,7 @@ paths: schema: $ref: '#/components/schemas/Error' put: - summary: Update ProductLeaflet by Id + summary: Update ProductDocument by Id parameters: - in: path name: id @@ -3814,7 +3814,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' required: true responses: 200: @@ -3822,7 +3822,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' 400: description: Bad Request Error content: @@ -3848,7 +3848,7 @@ paths: schema: $ref: '#/components/schemas/Error' delete: - summary: Delete ProductLeaflet by Id + summary: Delete ProductDocument by Id parameters: - in: path name: id @@ -3879,9 +3879,9 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts/count: + /codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts/count: get: - summary: Count the number of ProductLeaflet + summary: Count the number of ProductDocument tags: - Products responses: @@ -3905,14 +3905,14 @@ paths: schema: $ref: '#/components/schemas/Error' post: - summary: Count the number of ProductLeaflet by ProductLeafletFilterOptions + summary: Count the number of ProductDocument by ProductDocumentFilterOptions tags: - Products requestBody: content: application/json: schema: - $ref: '#/components/schemas/ProductLeafletFilterOptions' + $ref: '#/components/schemas/ProductDocumentFilterOptions' examples: countWithMultipleCriteria: summary: Count with multiple criteria @@ -3921,7 +3921,7 @@ paths: notEquals: Id: 33 contains: - LeafletLink: "abcd" + Link: "abcd" greaterThan: Id: 0 lessThanOrEqual: @@ -3943,7 +3943,7 @@ paths: value: $filter: contains: - LeafletLink: "abcd" + Link: "abcd" countWithGreaterThan: summary: Count with Greater Than value: @@ -3989,16 +3989,16 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts/search: + /codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts/search: post: - summary: Search ProductLeaflet by ProductLeafletFilterOptions + summary: Search ProductDocument by ProductDocumentFilterOptions tags: - Products requestBody: content: application/json: schema: - $ref: '#/components/schemas/ProductLeafletFilterOptions' + $ref: '#/components/schemas/ProductDocumentFilterOptions' examples: searchWithMultipleCriteria: summary: Search with multiple criteria @@ -4007,7 +4007,7 @@ paths: notEquals: Id: 33 contains: - LeafletLink: "abcd" + Link: "abcd" greaterThan: Id: 0 lessThanOrEqual: @@ -4029,7 +4029,7 @@ paths: value: $filter: contains: - LeafletLink: "abcd" + Link: "abcd" searchWithGreaterThan: summary: Search with Greater Than value: @@ -4063,7 +4063,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/ProductLeaflet' + $ref: '#/components/schemas/ProductDocument' 403: description: Forbidden Error content: @@ -6742,21 +6742,22 @@ components: $limit: type: integer example: 10 - ProductLeaflet: + ProductDocument: type: object required: + - Link properties: Id: type: integer format: int32 - Title: + Product: type: integer format: int32 - LeafletLink: + Link: type: string minLength: 0 - maxLength: 500 - ProductLeafletFilterOptions: + maxLength: 300 + ProductDocumentFilterOptions: type: object properties: $filter: @@ -6773,7 +6774,7 @@ components: items: type: integer format: int32 - Title: + Product: oneOf: - type: integer format: int32 @@ -6781,17 +6782,17 @@ components: items: type: integer format: int32 - LeafletLink: + Link: oneOf: - type: string minLength: 0 - maxLength: 500 + maxLength: 300 - type: array items: type: string format: double minLength: 0 - maxLength: 500 + maxLength: 300 notEquals: type: object properties: @@ -6803,7 +6804,7 @@ components: items: type: integer format: int32 - Title: + Product: oneOf: - type: integer format: int32 @@ -6811,86 +6812,86 @@ components: items: type: integer format: int32 - LeafletLink: + Link: oneOf: - type: string minLength: 0 - maxLength: 500 + maxLength: 300 - type: array items: type: string format: double minLength: 0 - maxLength: 500 + maxLength: 300 contains: type: object properties: Id: - Title: - LeafletLink: + Product: + Link: type: string minLength: 0 - maxLength: 500 + maxLength: 300 greaterThan: type: object properties: Id: type: integer format: int32 - Title: + Product: type: integer format: int32 - LeafletLink: + Link: type: string minLength: 0 - maxLength: 500 + maxLength: 300 greaterThanOrEqual: type: object properties: Id: type: integer format: int32 - Title: + Product: type: integer format: int32 - LeafletLink: + Link: type: string minLength: 0 - maxLength: 500 + maxLength: 300 lessThan: type: object properties: Id: type: integer format: int32 - Title: + Product: type: integer format: int32 - LeafletLink: + Link: type: string minLength: 0 - maxLength: 500 + maxLength: 300 lessThanOrEqual: type: object properties: Id: type: integer format: int32 - Title: + Product: type: integer format: int32 - LeafletLink: + Link: type: string minLength: 0 - maxLength: 500 + maxLength: 300 $select: type: array - example: ["Id", "Title", "LeafletLink"] + example: ["Id", "Product", "Link"] items: type: string $sort: - type: string - example: "Id,Title,LeafletLink" + example: "Id,Product,Link" $order: type: string enum: ["asc", "desc"] diff --git a/codbex-products/gen/codbex-products/dao/Products/ProductDocument.extensionpoint b/codbex-products/gen/codbex-products/dao/Products/ProductDocument.extensionpoint new file mode 100644 index 0000000..57c6b89 --- /dev/null +++ b/codbex-products/gen/codbex-products/dao/Products/ProductDocument.extensionpoint @@ -0,0 +1,4 @@ +{ + "name": "codbex-products-Products-ProductDocument", + "description": "Extension Point for the codbex-products-Products-ProductDocument entity" +} \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/dao/Products/ProductLeafletRepository.ts b/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts similarity index 56% rename from codbex-products/gen/codbex-products/dao/Products/ProductLeafletRepository.ts rename to codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts index 154c938..9c516de 100644 --- a/codbex-products/gen/codbex-products/dao/Products/ProductLeafletRepository.ts +++ b/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts @@ -3,71 +3,71 @@ import { producer } from "sdk/messaging"; import { extensions } from "sdk/extensions"; import { dao as daoApi } from "sdk/db"; -export interface ProductLeafletEntity { +export interface ProductDocumentEntity { readonly Id: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; } -export interface ProductLeafletCreateEntity { - readonly Title?: number; - readonly LeafletLink?: string; +export interface ProductDocumentCreateEntity { + readonly Product?: number; + readonly Link?: string; } -export interface ProductLeafletUpdateEntity extends ProductLeafletCreateEntity { +export interface ProductDocumentUpdateEntity extends ProductDocumentCreateEntity { readonly Id: number; } -export interface ProductLeafletEntityOptions { +export interface ProductDocumentEntityOptions { $filter?: { equals?: { Id?: number | number[]; - Title?: number | number[]; - LeafletLink?: string | string[]; + Product?: number | number[]; + Link?: string | string[]; }; notEquals?: { Id?: number | number[]; - Title?: number | number[]; - LeafletLink?: string | string[]; + Product?: number | number[]; + Link?: string | string[]; }; contains?: { Id?: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; }; greaterThan?: { Id?: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; }; greaterThanOrEqual?: { Id?: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; }; lessThan?: { Id?: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; }; lessThanOrEqual?: { Id?: number; - Title?: number; - LeafletLink?: string; + Product?: number; + Link?: string; }; }, - $select?: (keyof ProductLeafletEntity)[], - $sort?: string | (keyof ProductLeafletEntity)[], + $select?: (keyof ProductDocumentEntity)[], + $sort?: string | (keyof ProductDocumentEntity)[], $order?: 'ASC' | 'DESC', $offset?: number, $limit?: number, $language?: string } -export interface ProductLeafletEntityEvent { +export interface ProductDocumentEntityEvent { readonly operation: 'create' | 'update' | 'delete'; readonly table: string; - readonly entity: Partial; + readonly entity: Partial; readonly key: { name: string; column: string; @@ -75,30 +75,30 @@ export interface ProductLeafletEntityEvent { } } -export interface ProductLeafletUpdateEntityEvent extends ProductLeafletEntityEvent { - readonly previousEntity: ProductLeafletEntity; +export interface ProductDocumentUpdateEntityEvent extends ProductDocumentEntityEvent { + readonly previousEntity: ProductDocumentEntity; } -export class ProductLeafletRepository { +export class ProductDocumentRepository { private static readonly DEFINITION = { - table: "CODBEX_PRODUCTLEAFLET", + table: "CODBEX_PRODUCTDOCUMENT", properties: [ { name: "Id", - column: "PRODUCTLEAFLET_ID", + column: "PRODUCTDOCUMENT_ID", type: "INTEGER", id: true, autoIncrement: true, }, { - name: "Title", - column: "PRODUCTLEAFLET_TITLE", + name: "Product", + column: "PRODUCTDOCUMENT_PRODUCT", type: "INTEGER", }, { - name: "LeafletLink", - column: "PRODUCTLEAFLET_LEAFLETLINK", + name: "Link", + column: "PRODUCTDOCUMENT_LINK", type: "VARCHAR", } ] @@ -107,59 +107,59 @@ export class ProductLeafletRepository { private readonly dao; constructor(dataSource = "DefaultDB") { - this.dao = daoApi.create(ProductLeafletRepository.DEFINITION, undefined, dataSource); + this.dao = daoApi.create(ProductDocumentRepository.DEFINITION, undefined, dataSource); } - public findAll(options: ProductLeafletEntityOptions = {}): ProductLeafletEntity[] { + public findAll(options: ProductDocumentEntityOptions = {}): ProductDocumentEntity[] { let list = this.dao.list(options); return list; } - public findById(id: number, options: ProductLeafletEntityOptions = {}): ProductLeafletEntity | undefined { + public findById(id: number, options: ProductDocumentEntityOptions = {}): ProductDocumentEntity | undefined { const entity = this.dao.find(id); return entity ?? undefined; } - public create(entity: ProductLeafletCreateEntity): number { + public create(entity: ProductDocumentCreateEntity): number { const id = this.dao.insert(entity); this.triggerEvent({ operation: "create", - table: "CODBEX_PRODUCTLEAFLET", + table: "CODBEX_PRODUCTDOCUMENT", entity: entity, key: { name: "Id", - column: "PRODUCTLEAFLET_ID", + column: "PRODUCTDOCUMENT_ID", value: id } }); return id; } - public update(entity: ProductLeafletUpdateEntity): void { + public update(entity: ProductDocumentUpdateEntity): void { const previousEntity = this.findById(entity.Id); this.dao.update(entity); this.triggerEvent({ operation: "update", - table: "CODBEX_PRODUCTLEAFLET", + table: "CODBEX_PRODUCTDOCUMENT", entity: entity, previousEntity: previousEntity, key: { name: "Id", - column: "PRODUCTLEAFLET_ID", + column: "PRODUCTDOCUMENT_ID", value: entity.Id } }); } - public upsert(entity: ProductLeafletCreateEntity | ProductLeafletUpdateEntity): number { - const id = (entity as ProductLeafletUpdateEntity).Id; + public upsert(entity: ProductDocumentCreateEntity | ProductDocumentUpdateEntity): number { + const id = (entity as ProductDocumentUpdateEntity).Id; if (!id) { return this.create(entity); } const existingEntity = this.findById(id); if (existingEntity) { - this.update(entity as ProductLeafletUpdateEntity); + this.update(entity as ProductDocumentUpdateEntity); return id; } else { return this.create(entity); @@ -171,22 +171,22 @@ export class ProductLeafletRepository { this.dao.remove(id); this.triggerEvent({ operation: "delete", - table: "CODBEX_PRODUCTLEAFLET", + table: "CODBEX_PRODUCTDOCUMENT", entity: entity, key: { name: "Id", - column: "PRODUCTLEAFLET_ID", + column: "PRODUCTDOCUMENT_ID", value: id } }); } - public count(options?: ProductLeafletEntityOptions): number { + public count(options?: ProductDocumentEntityOptions): number { return this.dao.count(options); } public customDataCount(): number { - const resultSet = query.execute('SELECT COUNT(*) AS COUNT FROM "CODBEX_PRODUCTLEAFLET"'); + const resultSet = query.execute('SELECT COUNT(*) AS COUNT FROM "CODBEX_PRODUCTDOCUMENT"'); if (resultSet !== null && resultSet[0] !== null) { if (resultSet[0].COUNT !== undefined && resultSet[0].COUNT !== null) { return resultSet[0].COUNT; @@ -197,8 +197,8 @@ export class ProductLeafletRepository { return 0; } - private async triggerEvent(data: ProductLeafletEntityEvent | ProductLeafletUpdateEntityEvent) { - const triggerExtensions = await extensions.loadExtensionModules("codbex-products-Products-ProductLeaflet", ["trigger"]); + private async triggerEvent(data: ProductDocumentEntityEvent | ProductDocumentUpdateEntityEvent) { + const triggerExtensions = await extensions.loadExtensionModules("codbex-products-Products-ProductDocument", ["trigger"]); triggerExtensions.forEach(triggerExtension => { try { triggerExtension.trigger(data); @@ -206,6 +206,6 @@ export class ProductLeafletRepository { console.error(error); } }); - producer.topic("codbex-products-Products-ProductLeaflet").send(JSON.stringify(data)); + producer.topic("codbex-products-Products-ProductDocument").send(JSON.stringify(data)); } } diff --git a/codbex-products/gen/codbex-products/dao/Products/ProductLeaflet.extensionpoint b/codbex-products/gen/codbex-products/dao/Products/ProductLeaflet.extensionpoint deleted file mode 100644 index 08a6caa..0000000 --- a/codbex-products/gen/codbex-products/dao/Products/ProductLeaflet.extensionpoint +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "codbex-products-Products-ProductLeaflet", - "description": "Extension Point for the codbex-products-Products-ProductLeaflet entity" -} \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/schema/codbex-products.schema b/codbex-products/gen/codbex-products/schema/codbex-products.schema index 49193d3..b834fae 100644 --- a/codbex-products/gen/codbex-products/schema/codbex-products.schema +++ b/codbex-products/gen/codbex-products/schema/codbex-products.schema @@ -403,7 +403,7 @@ ] }, { - "name": "CODBEX_PRODUCTLEAFLET", + "name": "CODBEX_PRODUCTDOCUMENT", "type": "TABLE", "columns": [ { @@ -411,18 +411,18 @@ "primaryKey": true, "identity": true, "nullable": true, - "name": "PRODUCTLEAFLET_ID" + "name": "PRODUCTDOCUMENT_ID" }, { "type": "INTEGER", "nullable": true, - "name": "PRODUCTLEAFLET_TITLE" + "name": "PRODUCTDOCUMENT_PRODUCT" }, { "type": "VARCHAR", - "length": 500, + "length": 300, "nullable": true, - "name": "PRODUCTLEAFLET_LEAFLETLINK" + "name": "PRODUCTDOCUMENT_LINK" } ] }, @@ -526,11 +526,11 @@ "referencedColumns": "CAMPAIGN_ID" }, { - "name": "ProductLeaflet_Product", + "name": "ProductDocument_Product", "type": "foreignKey", - "table": "CODBEX_PRODUCTLEAFLET", - "constraintName": "ProductLeaflet_Product", - "columns": "PRODUCTLEAFLET_TITLE", + "table": "CODBEX_PRODUCTDOCUMENT", + "constraintName": "ProductDocument_Product", + "columns": "PRODUCTDOCUMENT_PRODUCT", "referencedTable": "CODBEX_PRODUCT", "referencedColumns": "PRODUCT_ID" } diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/controller.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/controller.js similarity index 71% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/controller.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/controller.js index 3b4196c..ca88de2 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/controller.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/controller.js @@ -1,26 +1,26 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) .config(['EntityServiceProvider', (EntityServiceProvider) => { - EntityServiceProvider.baseUrl = '/services/ts/codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts'; + EntityServiceProvider.baseUrl = '/services/ts/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts'; }]) - .controller('PageController', ($scope, $http, EntityService, Extensions, LocaleService, ButtonStates) => { + .controller('PageController', ($scope, EntityService, Extensions, LocaleService, ButtonStates) => { const Dialogs = new DialogHub(); let translated = { yes: 'Yes', no: 'No', - deleteConfirm: 'Are you sure you want to delete ProductLeaflet? This action cannot be undone.', - deleteTitle: 'Delete ProductLeaflet?' + deleteConfirm: 'Are you sure you want to delete ProductDocument? This action cannot be undone.', + deleteTitle: 'Delete ProductDocument?' }; LocaleService.onInit(() => { translated.yes = LocaleService.t('codbex-products:codbex-products-model.defaults.yes'); translated.no = LocaleService.t('codbex-products:codbex-products-model.defaults.no'); - translated.deleteTitle = LocaleService.t('codbex-products:codbex-products-model.defaults.deleteTitle', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); - translated.deleteConfirm = LocaleService.t('codbex-products:codbex-products-model.messages.deleteConfirm', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); + translated.deleteTitle = LocaleService.t('codbex-products:codbex-products-model.defaults.deleteTitle', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); + translated.deleteConfirm = LocaleService.t('codbex-products:codbex-products-model.messages.deleteConfirm', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); }); //-----------------Custom Actions-------------------// Extensions.getWindows(['codbex-products-custom-action']).then((response) => { - $scope.pageActions = response.data.filter(e => e.perspective === 'Products' && e.view === 'ProductLeaflet' && (e.type === 'page' || e.type === undefined)); - $scope.entityActions = response.data.filter(e => e.perspective === 'Products' && e.view === 'ProductLeaflet' && e.type === 'entity'); + $scope.pageActions = response.data.filter(e => e.perspective === 'Products' && e.view === 'ProductDocument' && (e.type === 'page' || e.type === undefined)); + $scope.entityActions = response.data.filter(e => e.perspective === 'Products' && e.view === 'ProductDocument' && e.type === 'entity'); }); $scope.triggerPageAction = (action) => { @@ -29,7 +29,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer title: LocaleService.t(action.translation.key, action.translation.options, action.label), path: action.path, params: { - selectedMainEntityKey: 'Title', + selectedMainEntityKey: 'Product', selectedMainEntityId: $scope.selectedMainEntityId, }, maxWidth: action.maxWidth, @@ -45,7 +45,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer path: action.path, params: { id: $scope.entity.Id, - selectedMainEntityKey: 'Title', + selectedMainEntityKey: 'Product', selectedMainEntityId: $scope.selectedMainEntityId, }, closeButton: true @@ -73,19 +73,19 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.data = null; }); }}); - Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductLeaflet.clearDetails', handler: () => { + Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductDocument.clearDetails', handler: () => { $scope.$evalAsync(() => { $scope.entity = {}; $scope.action = 'select'; }); }}); - Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductLeaflet.entityCreated', handler: () => { + Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductDocument.entityCreated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); }}); - Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductLeaflet.entityUpdated', handler: () => { + Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductDocument.entityUpdated', handler: () => { $scope.loadPage($scope.dataPage, $scope.filter); }}); - Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductLeaflet.entitySearch', handler: (data) => { + Dialogs.addMessageListener({ topic: 'codbex-products.Products.ProductDocument.entitySearch', handler: (data) => { resetPagination(); $scope.filter = data.filter; $scope.filterEntity = data.entity; @@ -94,7 +94,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer //-----------------Events-------------------// $scope.loadPage = (pageNumber, filter) => { - let Title = $scope.selectedMainEntityId; + let Product = $scope.selectedMainEntityId; $scope.dataPage = pageNumber; if (!filter && $scope.filter) { filter = $scope.filter; @@ -108,7 +108,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer if (!filter.$filter.equals) { filter.$filter.equals = {}; } - filter.$filter.equals.Title = Title; + filter.$filter.equals.Product = Product; EntityService.count(filter).then((resp) => { if (resp.data) { $scope.dataCount = resp.data.count; @@ -120,8 +120,8 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer }, (error) => { const message = error.data ? error.data.message : ''; Dialogs.showAlert({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToLF', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)', message: message }), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), + message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToLF', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)', message: message }), type: AlertTypes.Error }); console.error('EntityService:', error); @@ -129,8 +129,8 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer }, (error) => { const message = error.data ? error.data.message : ''; Dialogs.showAlert({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToCount', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)', message: message }), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), + message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToCount', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)', message: message }), type: AlertTypes.Error }); console.error('EntityService:', error); @@ -144,21 +144,19 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.openDetails = (entity) => { $scope.selectedEntity = entity; Dialogs.showWindow({ - id: 'ProductLeaflet-details', + id: 'ProductDocument-details', params: { action: 'select', entity: entity, - optionsTitle: $scope.optionsTitle, }, }); }; $scope.openFilter = () => { Dialogs.showWindow({ - id: 'ProductLeaflet-filter', + id: 'ProductDocument-filter', params: { entity: $scope.filterEntity, - optionsTitle: $scope.optionsTitle, }, }); }; @@ -166,15 +164,14 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.createEntity = () => { $scope.selectedEntity = null; Dialogs.showWindow({ - id: 'ProductLeaflet-details', + id: 'ProductDocument-details', params: { action: 'create', entity: { - 'Title': $scope.selectedMainEntityId + 'Product': $scope.selectedMainEntityId }, - selectedMainEntityKey: 'Title', + selectedMainEntityKey: 'Product', selectedMainEntityId: $scope.selectedMainEntityId, - optionsTitle: $scope.optionsTitle, }, closeButton: false }); @@ -182,13 +179,12 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.updateEntity = (entity) => { Dialogs.showWindow({ - id: 'ProductLeaflet-details', + id: 'ProductDocument-details', params: { action: 'update', entity: entity, - selectedMainEntityKey: 'Title', + selectedMainEntityKey: 'Product', selectedMainEntityId: $scope.selectedMainEntityId, - optionsTitle: $scope.optionsTitle, }, closeButton: false }); @@ -212,12 +208,12 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer if (buttonId === 'delete-btn-yes') { EntityService.delete(id).then(() => { $scope.loadPage($scope.dataPage, $scope.filter); - Dialogs.triggerEvent('codbex-products.Products.ProductLeaflet.clearDetails'); + Dialogs.triggerEvent('codbex-products.Products.ProductDocument.clearDetails'); }, (error) => { const message = error.data ? error.data.message : ''; Dialogs.showAlert({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToDelete', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)', message: message }), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), + message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToDelete', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)', message: message }), type: AlertTypes.Error, }); console.error('EntityService:', error); @@ -225,33 +221,4 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer } }); }; - - //----------------Dropdowns-----------------// - $scope.optionsTitle = []; - - - $http.get('/services/ts/codbex-products/gen/codbex-products/api/Products/ProductService.ts').then((response) => { - $scope.optionsTitle = response.data.map(e => ({ - value: e.Id, - text: e.Name - })); - }, (error) => { - console.error(error); - const message = error.data ? error.data.message : ''; - Dialogs.showAlert({ - title: 'Title', - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToLoad', { message: message }), - type: AlertTypes.Error - }); - }); - - $scope.optionsTitleValue = function (optionKey) { - for (let i = 0; i < $scope.optionsTitle.length; i++) { - if ($scope.optionsTitle[i].value === optionKey) { - return $scope.optionsTitle[i].text; - } - } - return null; - }; - //----------------Dropdowns-----------------// }); diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/controller.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js similarity index 78% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/controller.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js index 377ae7b..ceb4f87 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/controller.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js @@ -10,7 +10,6 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle $scope.entity = params.entity ?? {}; $scope.selectedMainEntityKey = params.selectedMainEntityKey; $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsTitle = params.optionsTitle; } $scope.filter = () => { @@ -36,13 +35,13 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle if (entity.Id !== undefined) { filter.$filter.equals.Id = entity.Id; } - if (entity.Title !== undefined) { - filter.$filter.equals.Title = entity.Title; + if (entity.Product !== undefined) { + filter.$filter.equals.Product = entity.Product; } - if (entity.LeafletLink) { - filter.$filter.contains.LeafletLink = entity.LeafletLink; + if (entity.Link) { + filter.$filter.contains.Link = entity.Link; } - Dialogs.postMessage({ topic: 'codbex-products.Products.ProductLeaflet.entitySearch', data: { + Dialogs.postMessage({ topic: 'codbex-products.Products.ProductDocument.entitySearch', data: { entity: entity, filter: filter }}); @@ -55,7 +54,7 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle }; $scope.cancel = () => { - Dialogs.closeWindow({ id: 'ProductLeaflet-filter' }); + Dialogs.closeWindow({ id: 'ProductDocument-filter' }); }; $scope.clearErrorMessage = () => { diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html similarity index 74% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/index.html rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html index df62e47..41e5d72 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html @@ -17,20 +17,20 @@ {{ errorMessage }} - +
- {{ 'codbex-products:codbex-products-model.t.PRODUCTLEAFLET_LEAFLETLINK' | t }} + {{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t }}
- - + + placeholder="{{ 'codbex-products:codbex-products-model.messages.inputEnter' | t:{'name':'$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK)'} }}">
diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.extension b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.extension similarity index 79% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.extension rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.extension index 812486e..0ff981c 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.extension +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.extension @@ -1,5 +1,5 @@ { - "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.js", + "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.js", "extensionPoint": "application-windows", "description": "codbex-products - Application Dialog Window" } \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.js similarity index 70% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.js index e49c60c..34391ed 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/view.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/view.js @@ -4,15 +4,15 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: 'ProductLeaflet-filter', - label: 'ProductLeaflet Filter', + id: 'ProductDocument-filter', + label: 'ProductDocument Filter', translation: { key: 'codbex-products:codbex-products-model.extName', options: { - content: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET) $t(codbex-products:codbex-products-model.defaults.filter)', + content: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT) $t(codbex-products:codbex-products-model.defaults.filter)', } }, - path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-filter/index.html', + path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html', perspectiveName: 'Products' }; if (typeof exports !== 'undefined') { diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/controller.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/controller.js similarity index 75% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/controller.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/controller.js index 6731c4f..619d5b1 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/controller.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/controller.js @@ -1,31 +1,31 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntityService']) .config(['EntityServiceProvider', (EntityServiceProvider) => { - EntityServiceProvider.baseUrl = '/services/ts/codbex-products/gen/codbex-products/api/Products/ProductLeafletService.ts'; + EntityServiceProvider.baseUrl = '/services/ts/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts'; }]) .controller('PageController', ($scope, $http, ViewParameters, LocaleService, EntityService) => { const Dialogs = new DialogHub(); const Notifications = new NotificationHub(); let description = 'Description'; - let propertySuccessfullyCreated = 'ProductLeaflet successfully created'; - let propertySuccessfullyUpdated = 'ProductLeaflet successfully updated'; + let propertySuccessfullyCreated = 'ProductDocument successfully created'; + let propertySuccessfullyUpdated = 'ProductDocument successfully updated'; $scope.entity = {}; $scope.forms = { details: {}, }; $scope.formHeaders = { - select: 'ProductLeaflet Details', - create: 'Create ProductLeaflet', - update: 'Update ProductLeaflet' + select: 'ProductDocument Details', + create: 'Create ProductDocument', + update: 'Update ProductDocument' }; $scope.action = 'select'; LocaleService.onInit(() => { description = LocaleService.t('codbex-products:codbex-products-model.defaults.description'); - $scope.formHeaders.select = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadSelect', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); - $scope.formHeaders.create = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadCreate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); - $scope.formHeaders.update = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadUpdate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); - propertySuccessfullyCreated = LocaleService.t('codbex-products:codbex-products-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); - propertySuccessfullyUpdated = LocaleService.t('codbex-products:codbex-products-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)' }); + $scope.formHeaders.select = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadSelect', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); + $scope.formHeaders.create = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadCreate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); + $scope.formHeaders.update = LocaleService.t('codbex-products:codbex-products-model.defaults.formHeadUpdate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); + propertySuccessfullyCreated = LocaleService.t('codbex-products:codbex-products-model.messages.propertySuccessfullyCreated', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); + propertySuccessfullyUpdated = LocaleService.t('codbex-products:codbex-products-model.messages.propertySuccessfullyUpdated', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)' }); }); let params = ViewParameters.get(); @@ -34,16 +34,15 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.entity = params.entity; $scope.selectedMainEntityKey = params.selectedMainEntityKey; $scope.selectedMainEntityId = params.selectedMainEntityId; - $scope.optionsTitle = params.optionsTitle; } $scope.create = () => { let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; EntityService.create(entity).then((response) => { - Dialogs.postMessage({ topic: 'codbex-products.Products.ProductLeaflet.entityCreated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-products.Products.ProductDocument.entityCreated', data: response.data }); Notifications.show({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), description: propertySuccessfullyCreated, type: 'positive' }); @@ -51,8 +50,8 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer }, (error) => { const message = error.data ? error.data.message : ''; Dialogs.showAlert({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToCreate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)', message: message }), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), + message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToCreate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)', message: message }), type: AlertTypes.Error }); console.error('EntityService:', error); @@ -64,9 +63,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer let entity = $scope.entity; entity[$scope.selectedMainEntityKey] = $scope.selectedMainEntityId; EntityService.update(id, entity).then((response) => { - Dialogs.postMessage({ topic: 'codbex-products.Products.ProductLeaflet.entityUpdated', data: response.data }); + Dialogs.postMessage({ topic: 'codbex-products.Products.ProductDocument.entityUpdated', data: response.data }); Notifications.show({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), description: propertySuccessfullyUpdated, type: 'positive' }); @@ -74,15 +73,14 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer }, (error) => { const message = error.data ? error.data.message : ''; Dialogs.showAlert({ - title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTLEAFLET'), - message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToUpdate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTLEAFLET)', message: message }), + title: LocaleService.t('codbex-products:codbex-products-model.t.PRODUCTDOCUMENT'), + message: LocaleService.t('codbex-products:codbex-products-model.messages.error.unableToUpdate', { name: '$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT)', message: message }), type: AlertTypes.Error }); console.error('EntityService:', error); }); }; - $scope.serviceTitle = '/services/ts/codbex-products/gen/codbex-products/api/Products/ProductService.ts'; $scope.alert = (message) => { if (message) Dialogs.showAlert({ @@ -96,6 +94,6 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale', 'EntitySer $scope.cancel = () => { $scope.entity = {}; $scope.action = 'select'; - Dialogs.closeWindow({ id: 'ProductLeaflet-details' }); + Dialogs.closeWindow({ id: 'ProductDocument-details' }); }; }); \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html similarity index 76% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/index.html rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html index b916492..fe8516e 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html @@ -19,23 +19,23 @@
- {{ 'codbex-products:codbex-products-model.t.PRODUCTLEAFLET_LEAFLETLINK' | t }} + {{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t }}
- {{entity.LeafletLink}} + {{entity.Link}}
- - + + placeholder="{{ 'codbex-products:codbex-products-model.messages.inputEnter' | t:{'name':'$t(codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK)'} }}">
diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.extension b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.extension similarity index 79% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.extension rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.extension index cca8322..59733d8 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.extension +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.extension @@ -1,5 +1,5 @@ { - "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.js", + "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.js", "extensionPoint": "application-windows", "description": "codbex-products - Application Dialog Window" } \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.js similarity index 64% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.js index 10d9a4e..dd220f9 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/view.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/view.js @@ -4,12 +4,12 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: 'ProductLeaflet-details', - label: 'ProductLeaflet', + id: 'ProductDocument-details', + label: 'ProductDocument', translation: { - key: 'codbex-products:codbex-products-model.t.PRODUCTLEAFLET', + key: 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT', }, - path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/dialog-window/index.html', + path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html', perspectiveName: 'Products' }; if (typeof exports !== 'undefined') { diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html similarity index 96% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/index.html rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html index c2d171b..2ba2e7a 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html @@ -29,7 +29,7 @@ - + @@ -39,7 +39,7 @@
{{ 'codbex-products:codbex-products-model.t.PRODUCTLEAFLET_LEAFLETLINK' | t:'LeafletLink' }}{{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t:'Link' }}
- {{next.LeafletLink}} + {{next.Link}} diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.extension b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.extension similarity index 84% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.extension rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.extension index 464f04b..d0d0910 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.extension +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.extension @@ -1,5 +1,5 @@ { - "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.js", + "module": "codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.js", "extensionPoint": "application-views", "description": "codbex-products - Application View - Details" } \ No newline at end of file diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.js similarity index 70% rename from codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.js rename to codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.js index 326a3c2..4b9dec6 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/view.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/view.js @@ -4,15 +4,15 @@ * Do not modify the content as it may be re-generated again. */ const viewData = { - id: 'ProductLeaflet', - label: 'ProductLeaflet', + id: 'ProductDocument', + label: 'ProductDocument', translation: { - key: 'codbex-products:codbex-products-model.t.PRODUCTLEAFLET', + key: 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT', }, region: 'bottom', lazyLoad: false, autoFocusTab: true, - path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductLeaflet/index.html', + path: '/services/web/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html', perspectiveName: 'Products' }; if (typeof exports !== 'undefined') { diff --git a/codbex-products/translations/en-US/codbex-products.model.json b/codbex-products/translations/en-US/codbex-products.model.json index 82b8bdc..0cf48e0 100644 --- a/codbex-products/translations/en-US/codbex-products.model.json +++ b/codbex-products/translations/en-US/codbex-products.model.json @@ -156,10 +156,10 @@ "CAMPAIGNENTRY_OLDPRICE": "OldPrice", "CAMPAIGNENTRY_NEWPRICE": "NewPrice", "CAMPAIGNENTRY_GIFT": "Gift", - "PRODUCTLEAFLET": "ProductLeaflet", - "PRODUCTLEAFLET_ID": "Id", - "PRODUCTLEAFLET_TITLE": "Title", - "PRODUCTLEAFLET_LEAFLETLINK": "LeafletLink", + "PRODUCTDOCUMENT": "ProductDocument", + "PRODUCTDOCUMENT_ID": "Id", + "PRODUCTDOCUMENT_PRODUCT": "Product", + "PRODUCTDOCUMENT_LINK": "Link", "Products": "Products", "Categories": "Categories", "Campaigns": "Campaings" From 211177c262d5cbac3eea410092df79377cc0c5db Mon Sep 17 00:00:00 2001 From: NicoleNG18 Date: Mon, 15 Sep 2025 13:55:57 +0300 Subject: [PATCH 2/2] add name to product document --- codbex-products/codbex-products.edm | 3 +- codbex-products/codbex-products.gen | 26 +++++++++ codbex-products/codbex-products.model | 14 +++++ .../api/Products/ProductDocumentService.ts | 6 ++ .../codbex-products/codbex-products.openapi | 55 ++++++++++++++++++- .../dao/Products/ProductDocumentRepository.ts | 14 +++++ .../schema/codbex-products.schema | 6 ++ .../dialog-filter/controller.js | 3 + .../ProductDocument/dialog-filter/index.html | 17 ++++++ .../ProductDocument/dialog-window/index.html | 20 +++++++ .../Product/ProductDocument/index.html | 2 + .../en-US/codbex-products.model.json | 1 + 12 files changed, 164 insertions(+), 3 deletions(-) diff --git a/codbex-products/codbex-products.edm b/codbex-products/codbex-products.edm index d470599..1e594da 100644 --- a/codbex-products/codbex-products.edm +++ b/codbex-products/codbex-products.edm @@ -130,6 +130,7 @@ + @@ -142,5 +143,5 @@ - + \ No newline at end of file diff --git a/codbex-products/codbex-products.gen b/codbex-products/codbex-products.gen index f0d8629..1c3b209 100644 --- a/codbex-products/codbex-products.gen +++ b/codbex-products/codbex-products.gen @@ -3429,6 +3429,32 @@ "dataTypeTypescript": "number", "inputRule": "" }, + { + "dataLength": "100", + "dataName": "PRODUCTDOCUMENT_NAME", + "dataNullable": true, + "dataType": "VARCHAR", + "description": "", + "isRequiredProperty": true, + "name": "Name", + "tooltip": "", + "widgetIsMajor": true, + "widgetLength": "100", + "widgetSize": "", + "widgetType": "TEXTBOX", + "dataNotNull": false, + "dataAutoIncrement": false, + "dataPrimaryKey": false, + "dataUnique": false, + "isCalculatedProperty": false, + "widgetLabel": "Name", + "widgetDropdownUrl": "", + "dataTypeJava": "string", + "dataTypeTypescript": "string", + "minLength": 0, + "maxLength": 100, + "inputRule": "" + }, { "dataLength": "300", "dataName": "PRODUCTDOCUMENT_LINK", diff --git a/codbex-products/codbex-products.model b/codbex-products/codbex-products.model index 6c09152..4312e14 100644 --- a/codbex-products/codbex-products.model +++ b/codbex-products/codbex-products.model @@ -1551,6 +1551,20 @@ "relationshipEntityPerspectiveName": "Products", "relationshipEntityPerspectiveLabel": "Entities" }, + { + "dataLength": "100", + "dataName": "PRODUCTDOCUMENT_NAME", + "dataNullable": "true", + "dataType": "VARCHAR", + "description": "", + "isRequiredProperty": "true", + "name": "Name", + "tooltip": "", + "widgetIsMajor": "true", + "widgetLength": "100", + "widgetSize": "", + "widgetType": "TEXTBOX" + }, { "dataLength": "300", "dataName": "PRODUCTDOCUMENT_LINK", diff --git a/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts b/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts index fed831d..fab3bda 100644 --- a/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts +++ b/codbex-products/gen/codbex-products/api/Products/ProductDocumentService.ts @@ -134,6 +134,12 @@ class ProductDocumentService { } private validateEntity(entity: any): void { + if (entity.Name === null || entity.Name === undefined) { + throw new ValidationError(`The 'Name' property is required, provide a valid value`); + } + if (entity.Name?.length > 100) { + throw new ValidationError(`The 'Name' exceeds the maximum length of [100] characters`); + } if (entity.Link === null || entity.Link === undefined) { throw new ValidationError(`The 'Link' property is required, provide a valid value`); } diff --git a/codbex-products/gen/codbex-products/codbex-products.openapi b/codbex-products/gen/codbex-products/codbex-products.openapi index ae4cf04..9a4e537 100644 --- a/codbex-products/gen/codbex-products/codbex-products.openapi +++ b/codbex-products/gen/codbex-products/codbex-products.openapi @@ -3921,6 +3921,7 @@ paths: notEquals: Id: 33 contains: + Name: "abcd" Link: "abcd" greaterThan: Id: 0 @@ -3943,6 +3944,7 @@ paths: value: $filter: contains: + Name: "abcd" Link: "abcd" countWithGreaterThan: summary: Count with Greater Than @@ -4007,6 +4009,7 @@ paths: notEquals: Id: 33 contains: + Name: "abcd" Link: "abcd" greaterThan: Id: 0 @@ -4029,6 +4032,7 @@ paths: value: $filter: contains: + Name: "abcd" Link: "abcd" searchWithGreaterThan: summary: Search with Greater Than @@ -6745,6 +6749,7 @@ components: ProductDocument: type: object required: + - Name - Link properties: Id: @@ -6753,6 +6758,10 @@ components: Product: type: integer format: int32 + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 @@ -6782,6 +6791,17 @@ components: items: type: integer format: int32 + Name: + oneOf: + - type: string + minLength: 0 + maxLength: 100 + - type: array + items: + type: string + format: double + minLength: 0 + maxLength: 100 Link: oneOf: - type: string @@ -6812,6 +6832,17 @@ components: items: type: integer format: int32 + Name: + oneOf: + - type: string + minLength: 0 + maxLength: 100 + - type: array + items: + type: string + format: double + minLength: 0 + maxLength: 100 Link: oneOf: - type: string @@ -6828,6 +6859,10 @@ components: properties: Id: Product: + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 @@ -6841,6 +6876,10 @@ components: Product: type: integer format: int32 + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 @@ -6854,6 +6893,10 @@ components: Product: type: integer format: int32 + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 @@ -6867,6 +6910,10 @@ components: Product: type: integer format: int32 + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 @@ -6880,18 +6927,22 @@ components: Product: type: integer format: int32 + Name: + type: string + minLength: 0 + maxLength: 100 Link: type: string minLength: 0 maxLength: 300 $select: type: array - example: ["Id", "Product", "Link"] + example: ["Id", "Product", "Name", "Link"] items: type: string $sort: - type: string - example: "Id,Product,Link" + example: "Id,Product,Name,Link" $order: type: string enum: ["asc", "desc"] diff --git a/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts b/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts index 9c516de..126d490 100644 --- a/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts +++ b/codbex-products/gen/codbex-products/dao/Products/ProductDocumentRepository.ts @@ -6,11 +6,13 @@ import { dao as daoApi } from "sdk/db"; export interface ProductDocumentEntity { readonly Id: number; Product?: number; + Name?: string; Link?: string; } export interface ProductDocumentCreateEntity { readonly Product?: number; + readonly Name?: string; readonly Link?: string; } @@ -23,36 +25,43 @@ export interface ProductDocumentEntityOptions { equals?: { Id?: number | number[]; Product?: number | number[]; + Name?: string | string[]; Link?: string | string[]; }; notEquals?: { Id?: number | number[]; Product?: number | number[]; + Name?: string | string[]; Link?: string | string[]; }; contains?: { Id?: number; Product?: number; + Name?: string; Link?: string; }; greaterThan?: { Id?: number; Product?: number; + Name?: string; Link?: string; }; greaterThanOrEqual?: { Id?: number; Product?: number; + Name?: string; Link?: string; }; lessThan?: { Id?: number; Product?: number; + Name?: string; Link?: string; }; lessThanOrEqual?: { Id?: number; Product?: number; + Name?: string; Link?: string; }; }, @@ -96,6 +105,11 @@ export class ProductDocumentRepository { column: "PRODUCTDOCUMENT_PRODUCT", type: "INTEGER", }, + { + name: "Name", + column: "PRODUCTDOCUMENT_NAME", + type: "VARCHAR", + }, { name: "Link", column: "PRODUCTDOCUMENT_LINK", diff --git a/codbex-products/gen/codbex-products/schema/codbex-products.schema b/codbex-products/gen/codbex-products/schema/codbex-products.schema index b834fae..0a0657a 100644 --- a/codbex-products/gen/codbex-products/schema/codbex-products.schema +++ b/codbex-products/gen/codbex-products/schema/codbex-products.schema @@ -418,6 +418,12 @@ "nullable": true, "name": "PRODUCTDOCUMENT_PRODUCT" }, + { + "type": "VARCHAR", + "length": 100, + "nullable": true, + "name": "PRODUCTDOCUMENT_NAME" + }, { "type": "VARCHAR", "length": 300, diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js index ceb4f87..4bd0561 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/controller.js @@ -38,6 +38,9 @@ angular.module('page', ['blimpKit', 'platformView', 'platformLocale']).controlle if (entity.Product !== undefined) { filter.$filter.equals.Product = entity.Product; } + if (entity.Name) { + filter.$filter.contains.Name = entity.Name; + } if (entity.Link) { filter.$filter.contains.Link = entity.Link; } diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html index 41e5d72..7293ab4 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-filter/index.html @@ -18,6 +18,23 @@ + +
+ {{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_NAME' | t }} +
+
+ + + + +
+
{{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t }} diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html index fe8516e..4ad6e82 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/dialog-window/index.html @@ -17,6 +17,26 @@ + +
+ {{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_NAME' | t }} +
+
+ + + + +
+
{{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t }} diff --git a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html index 2ba2e7a..1ed8ac5 100644 --- a/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html +++ b/codbex-products/gen/codbex-products/ui/Products/Product/ProductDocument/index.html @@ -29,6 +29,7 @@ + @@ -38,6 +39,7 @@ + diff --git a/codbex-products/translations/en-US/codbex-products.model.json b/codbex-products/translations/en-US/codbex-products.model.json index 0cf48e0..e7dede4 100644 --- a/codbex-products/translations/en-US/codbex-products.model.json +++ b/codbex-products/translations/en-US/codbex-products.model.json @@ -159,6 +159,7 @@ "PRODUCTDOCUMENT": "ProductDocument", "PRODUCTDOCUMENT_ID": "Id", "PRODUCTDOCUMENT_PRODUCT": "Product", + "PRODUCTDOCUMENT_NAME": "Name", "PRODUCTDOCUMENT_LINK": "Link", "Products": "Products", "Categories": "Categories",
{{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_NAME' | t:'Name' }} {{ 'codbex-products:codbex-products-model.t.PRODUCTDOCUMENT_LINK' | t:'Link' }}
{{'codbex-products:codbex-products-model.messages.noData' | t}}
{{next.Name}} {{next.Link}}