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

Page, Template APIs TMI #23203

Closed
wezell opened this issue Oct 21, 2022 · 3 comments · Fixed by #23868
Closed

Page, Template APIs TMI #23203

wezell opened this issue Oct 21, 2022 · 3 comments · Fixed by #23868

Comments

@wezell
Copy link
Contributor

wezell commented Oct 21, 2022

Currently, our page and template rest apis recurse way too deeply into our objects and return just too much information (TMI). This is not good for performance of the APIs and make the responses hard to parse. When using the page api, zero people care about the

template's > container's > host's > children folder's > permissions.

I marked this as a breaking change, but I don't actually believe it will break anyone. Maybe I'll be proven wrong.
Screen Shot 2022-10-21 at 10 14 49 AM

@fmontes
Copy link
Member

fmontes commented Feb 7, 2023

@fmontes fmontes linked a pull request Feb 7, 2023 that will close this issue
fmontes pushed a commit that referenced this issue Feb 13, 2023
* #23203 adding jsonignore to props

* #23203 adding back parent permissionable
@fmontes fmontes reopened this Feb 15, 2023
@rjvelazco
Copy link
Contributor

rjvelazco commented Feb 17, 2023

Passed Internal QA

Docker Image: dotcms/dotcms:master_be0bf8fa

Now the response includes neither theHost nor the Permission property.

{
  "entity": {
    "body": "...",
    "canPublish": true,
    "canRead": true,
    "canWrite": true,
    "categoryId": "93d20343-5600-449f-b427-b048f5892215",
    "containers": {
      "//demo.dotcms.com/application/containers/banner/": {
        "archived": false,
        "categoryId": "1d9165ad-f8ea-4006-8017-b103eb0d9f9b",
        "deleted": false,
        "friendlyName": "container",
        "hostId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
        "hostName": "demo.dotcms.com",
        "iDate": 1600437115745,
        "idate": 1600437115745,
        "identifier": "5e8c9a71-8cae-4d96-a2f7-d25b9cf69a83",
        "inode": "1d9165ad-f8ea-4006-8017-b103eb0d9f9b",
        "languageId": 1,
        "live": true,
        "locked": false,
        "maxContentlets": 25,
        "modDate": 1600437115745,
        "modUser": "dotcms.org.1",
        "name": "Banner",
        "new": false,
        "notes": "Banner",
        "owner": "dotcms.org.1",
        "parentPermissionable": {
          "aliases": "localhost\n127.0.0.1",
          "archived": false,
          "categoryId": "59bb8831-6706-4589-9ca0-ff74016e02b2",
          "contentTypeId": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
          "default": true,
          "dotAsset": false,
          "fileAsset": false,
          "folder": "SYSTEM_FOLDER",
          "form": false,
          "host": "SYSTEM_HOST",
          "hostThumbnail": null,
          "hostname": "demo.dotcms.com",
          "htmlpage": false,
          "identifier": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "indexPolicyDependencies": "DEFER",
          "inode": "59bb8831-6706-4589-9ca0-ff74016e02b2",
          "keyValue": false,
          "languageId": 1,
          "live": true,
          "locked": false,
          "lowIndexPriority": false,
          "modDate": 1634235141702,
          "modUser": "dotcms.org.1",
          "name": "demo.dotcms.com",
          "new": false,
          "owner": "dotcms.org.1",
          "parent": true,
          "permissionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "permissionType": "com.dotmarketing.portlets.contentlet.model.Contentlet",
          "persona": false,
          "sortOrder": 0,
          "structureInode": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
          "systemHost": false,
          "tagStorage": "SYSTEM_HOST",
          "title": "demo.dotcms.com",
          "titleImage": null,
          "type": "contentlet",
          "vanityUrl": false,
          "variantId": "DEFAULT",
          "versionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "working": true
        },
        "path": "//demo.dotcms.com/application/containers/banner/",
        "permissionId": "5e8c9a71-8cae-4d96-a2f7-d25b9cf69a83",
        "permissionType": "com.dotmarketing.portlets.containers.model.FileAssetContainer",
        "postLoop": "#dotParse(\"//demo.dotcms.com/application/containers/banner/postloop.vtl\")",
        "preLoop": "#dotParse(\"//demo.dotcms.com/application/containers/banner/preloop.vtl\")",
        "showOnMenu": false,
        "sortOrder": 0,
        "source": "FILE",
        "title": "Banner",
        "type": "containers",
        "useDiv": false,
        "versionId": "5e8c9a71-8cae-4d96-a2f7-d25b9cf69a83",
        "versionType": "containers",
        "working": true
      },
      "//demo.dotcms.com/application/containers/default/": {
        "archived": false,
        "categoryId": "f04b5078-1679-4965-bb12-446d3cb5948f",
        "deleted": false,
        "friendlyName": "container",
        "hostId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
        "hostName": "demo.dotcms.com",
        "iDate": 1599065323032,
        "idate": 1599065323032,
        "identifier": "69b3d24d-7e80-4be6-b04a-d352d16493ee",
        "inode": "f04b5078-1679-4965-bb12-446d3cb5948f",
        "languageId": 1,
        "live": true,
        "locked": false,
        "maxContentlets": 25,
        "modDate": 1599065323032,
        "modUser": "dotcms.org.1",
        "name": "Default",
        "new": false,
        "notes": "New File Container",
        "owner": "dotcms.org.1",
        "parentPermissionable": {
          "aliases": "localhost\n127.0.0.1",
          "archived": false,
          "categoryId": "59bb8831-6706-4589-9ca0-ff74016e02b2",
          "contentTypeId": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
          "default": true,
          "dotAsset": false,
          "fileAsset": false,
          "folder": "SYSTEM_FOLDER",
          "form": false,
          "host": "SYSTEM_HOST",
          "hostThumbnail": null,
          "hostname": "demo.dotcms.com",
          "htmlpage": false,
          "identifier": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "indexPolicyDependencies": "DEFER",
          "inode": "59bb8831-6706-4589-9ca0-ff74016e02b2",
          "keyValue": false,
          "languageId": 1,
          "live": true,
          "locked": false,
          "lowIndexPriority": false,
          "modDate": 1634235141702,
          "modUser": "dotcms.org.1",
          "name": "demo.dotcms.com",
          "new": false,
          "owner": "dotcms.org.1",
          "parent": true,
          "permissionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "permissionType": "com.dotmarketing.portlets.contentlet.model.Contentlet",
          "persona": false,
          "sortOrder": 0,
          "structureInode": "855a2d72-f2f3-4169-8b04-ac5157c4380c",
          "systemHost": false,
          "tagStorage": "SYSTEM_HOST",
          "title": "demo.dotcms.com",
          "titleImage": null,
          "type": "contentlet",
          "vanityUrl": false,
          "variantId": "DEFAULT",
          "versionId": "48190c8c-42c4-46af-8d1a-0cd5db894797",
          "working": true
        },
        "path": "//demo.dotcms.com/application/containers/default/",
        "permissionId": "69b3d24d-7e80-4be6-b04a-d352d16493ee",
        "permissionType": "com.dotmarketing.portlets.containers.model.FileAssetContainer",
        "postLoop": "#dotParse(\"//demo.dotcms.com/application/containers/default/postloop.vtl\")",
        "preLoop": "#dotParse(\"//demo.dotcms.com/application/containers/default/preloop.vtl\")",
        "showOnMenu": false,
        "sortOrder": 0,
        "source": "FILE",
        "title": "Default",
        "type": "containers",
        "useDiv": false,
        "versionId": "69b3d24d-7e80-4be6-b04a-d352d16493ee",
        "versionType": "containers",
        "working": true
      }
    },
    "countAddContainer": 0,
    "countContainers": 0,
    "deleted": false,
    "drawed": true,
    "drawedBody": "...",
    "footer": "null",
    "friendlyName": "",
    "hasLiveVersion": true,
    "headCode": null,
    "header": "null",
    "identifier": "73c53826-3dcc-4f33-952e-486389062223",
    "image": "",
    "inode": "93d20343-5600-449f-b427-b048f5892215",
    "layout": {
      "body": {
        "rows": [
          {
            "columns": [
              {
                "containers": [
                  {
                    "identifier": "//demo.dotcms.com/application/containers/banner/",
                    "uuid": "1"
                  }
                ],
                "leftOffset": 1,
                "styleClass": null,
                "width": 12
              }
            ],
            "styleClass": null
          },
          {
            "columns": [
              {
                "containers": [
                  {
                    "identifier": "//demo.dotcms.com/application/containers/default/",
                    "uuid": "1"
                  }
                ],
                "leftOffset": 1,
                "styleClass": null,
                "width": 6
              },
              {
                "containers": [
                  {
                    "identifier": "//demo.dotcms.com/application/containers/default/",
                    "uuid": "2"
                  }
                ],
                "leftOffset": 7,
                "styleClass": null,
                "width": 6
              }
            ],
            "styleClass": null
          },
          {
            "columns": [
              {
                "containers": [
                  {
                    "identifier": "//demo.dotcms.com/application/containers/default/",
                    "uuid": "3"
                  }
                ],
                "leftOffset": 1,
                "styleClass": null,
                "width": 12
              }
            ],
            "styleClass": null
          }
        ]
      },
      "footer": true,
      "header": false,
      "sidebar": null,
      "title": null,
      "width": "responsive"
    },
    "live": true,
    "locked": false,
    "lockedBy": null,
    "modDate": 1609946196149,
    "modUser": "dotcms.org.1",
    "name": "Destination",
    "new": false,
    "owner": "dotcms.org.1",
    "selectedimage": null,
    "showOnMenu": true,
    "sortOrder": 0,
    "theme": "d7b0ebc2-37ca-4a5a-b769-e8a3ff187661",
    "themeName": null,
    "title": "Destination",
    "working": true
  },
  "errors": [
    
  ],
  "i18nMessagesMap": {
    
  },
  "messages": [
    
  ],
  "permissions": [
    
  ]
}

@josemejias07
Copy link

Approved QA - Tested on 23.03_22c57977_SNAPSHOT // Docker // macOS 13.0 // FF v110.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment