Details

    • Type: Sub-task
    • Status: Done (View Workflow)
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Share Application
    • Labels:
      None

      Description

      Modify the Metadata in the V0 API response templates to better support the bulk actions on search results.

      Currently the REST API used for the search page in Share only returns the metadata for each node that is required to construct the search view displayed. It does not contain any additional metadata about each node (such as permissions, actions or aspects). The actions displayed for each individual search result are individually retrieved by making an additional XHR request when a user clicks on the "Actions" button.

      Whilst this approach works for individual actions, it does not work for bulk actions. The bulk action relies on the metadata being present for each selected item in order to be able to evaluate whether or not all the selected items meet the conditions for each action. The key data is permissions (for example you can't move an item without Delete permission) and aspects (for Cloud sync, etc).

      We need to update the REST API that is part of the Share Services AMP in order to return the "full fat" node data as found on the Document Library APIs. It should be possible to re-use some of the existing library files used for the Document Library APIs that augment each item with the same metadata (for actions, etc).

      For backwards compatibility reasons - we should maintain the existing attributes on each node so as to avoid breaking the current view (or any 3rd party custom views), e.g. these attribute should be retained (example taken from existing search call):

      "nodeRef": "workspace:\/\/SpacesStore\/43485b48-2ca7-4077-a00c-9bfe810f9fa1",
      "type": "document",
      "name": "sample 1.png",
      "displayName": "sample 1.png",
      "title": "sample 1.png",
      "description": "",
      "modifiedOn": "2011-03-03T10:37:17.994Z",
      "modifiedByUser": "abeecher",
      "modifiedBy": "Alice Beecher",
      "fromDate": "",
      "size": 188533,
      "mimetype": "image\/png",
      "site":
      {
         "shortName": "swsdp",
         "title": "Sample: Web Site Design Project"
      },
      "container": "documentLibrary",
      "path": "Agency Files\/Mock-Ups",
      "lastThumbnailModification":
      [
      ],
      "tags": []
      

      ....what we want to augment that response with is something that is more like the Document Library data:

      {
         "thumbnailDefinitions": [],
         "node": {
            "isLink": false,
            "aspects": ["rn:renditioned", "cm:ownable", "cm:titled", "cm:auditable", "sys:referenceable", "sys:localized", "cm:author", "exif:exif"],
            "isContainer": false,
            "type": "cm:content",
            "encoding": "UTF-8",
            "contentURL": "\/slingshot\/node\/content\/workspace\/SpacesStore\/43485b48-2ca7-4077-a00c-9bfe810f9fa1\/sample%201.png",
            "size": 188533,
            "nodeRef": "workspace:\/\/SpacesStore\/43485b48-2ca7-4077-a00c-9bfe810f9fa1",
            "permissions": {
               "inherited": true,
               "roles": ["ALLOWED;GROUP_EVERYONE;ReadPermissions;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteManager;SiteManager;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteCollaborator;SiteCollaborator;INHERITED", "ALLOWED;GROUP_EVERYONE;SiteConsumer;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteContributor;SiteContributor;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteConsumer;SiteConsumer;INHERITED"],
               "user": {
                  "Delete": true,
                  "Write": true,
                  "CancelCheckOut": false,
                  "ChangePermissions": true,
                  "CreateChildren": true,
                  "Unlock": false
               }
            },
            "isLocked": false,
            "mimetype": "image\/png",
            "properties": {
               "cm:title": "sample 1.png",
               "cm:creator": {
                  "firstName": "Alice",
                  "lastName": "Beecher",
                  "displayName": "Alice Beecher",
                  "userName": "abeecher"
               },
               "cm:modifier": {
                  "firstName": "Alice",
                  "lastName": "Beecher",
                  "displayName": "Alice Beecher",
                  "userName": "abeecher"
               },
               "cm:created": {
                  "iso8601": "2011-03-03T10:37:17.994Z",
                  "value": "Thu Mar 03 10:37:17 GMT 2011"
               },
               "sys:store-protocol": null,
               "sys:store-identifier": null,
               "cm:owner": {
                  "firstName": "Administrator",
                  "lastName": "",
                  "displayName": "Administrator",
                  "userName": "admin"
               },
               "cm:content": null,
               "exif:pixelXDimension": "1067",
               "sys:node-uuid": null,
               "cm:name": "sample 1.png",
               "sys:node-dbid": null,
               "exif:pixelYDimension": "893",
               "sys:locale": null,
               "cm:modified": {
                  "iso8601": "2011-03-03T10:37:17.994Z",
                  "value": "Thu Mar 03 10:37:17 GMT 2011"
               }
            },
            "mimetypeDisplayName": "PNG Image"
         },
         "parent": {
            "isLink": false,
            "nodeRef": "workspace:\/\/SpacesStore\/610771be-4d82-479a-a2d7-796adf498084",
            "permissions": {
               "inherited": true,
               "roles": ["ALLOWED;GROUP_EVERYONE;ReadPermissions;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteManager;SiteManager;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteCollaborator;SiteCollaborator;INHERITED", "ALLOWED;GROUP_EVERYONE;SiteConsumer;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteContributor;SiteContributor;INHERITED", "ALLOWED;GROUP_site_swsdp_SiteConsumer;SiteConsumer;INHERITED"],
               "user": {
                  "Delete": true,
                  "Write": true,
                  "CancelCheckOut": false,
                  "ChangePermissions": true,
                  "CreateChildren": true,
                  "Unlock": false
               }
            },
            "isLocked": false,
            "aspects": ["cm:ownable", "cm:titled", "cm:auditable", "sys:referenceable", "sys:localized"],
            "isContainer": true,
            "type": "cm:folder",
            "properties": {
               "cm:title": "Web wireframes",
               "cm:creator": {
                  "firstName": "Mike",
                  "lastName": "Jackson",
                  "displayName": "Mike Jackson",
                  "userName": "mjackson"
               },
               "cm:modifier": {
                  "firstName": "Mike",
                  "lastName": "Jackson",
                  "displayName": "Mike Jackson",
                  "userName": "mjackson"
               },
               "cm:created": {
                  "iso8601": "2011-02-15T21:14:44.396Z",
                  "value": "Tue Feb 15 21:14:44 GMT 2011"
               },
               "sys:store-protocol": null,
               "sys:store-identifier": null,
               "cm:owner": {
                  "firstName": "Administrator",
                  "lastName": "",
                  "displayName": "Administrator",
                  "userName": "admin"
               },
               "cm:description": "This folder holds the web site mock-ups or wireframes",
               "sys:node-uuid": null,
               "cm:name": "Mock-Ups",
               "sys:node-dbid": null,
               "sys:locale": null,
               "cm:modified": {
                  "iso8601": "2011-02-15T21:14:44.396Z",
                  "value": "Tue Feb 15 21:14:44 GMT 2011"
               }
            }
         },
         "version": "1.0",
         "webdavUrl": "\/webdav\/Sites\/swsdp\/documentLibrary\/Agency%20Files\/Mock-Ups\/sample%201.png",
         "isFavourite": false,
         "likes": {
            "isLiked": false,
            "totalLikes": 0
         },
         "location": {
            "repositoryId": "72568704-b6bc-487d-a818-988c5fab8130",
            "site": {
               "name": "swsdp",
               "title": "Sample: Web Site Design Project",
               "preset": "site-dashboard"
            },
            "container": {
               "name": "documentLibrary",
               "type": "cm:folder",
               "nodeRef": ""
            },
            "path": "\/Agency Files\/Mock-Ups",
            "repoPath": "\/Sites\/swsdp\/documentLibrary\/Agency Files\/Mock-Ups",
            "file": "sample 1.png",
            "parent": {}
         },
         "nodeRef": "workspace:\/\/SpacesStore\/43485b48-2ca7-4077-a00c-9bfe810f9fa1",
         "fileName": "sample 1.png",
         "displayName": "sample 1.png",
         "actionGroupId": "document-browse",
         "actions": [{
            "id": "document-download",
            "icon": "document-download",
            "type": "link",
            "label": "actions.document.download",
            "params": {
               "href": "{downloadUrl}",
               "target": "_blank"
            },
            "index": 99100.0,
            "subgroup": 99.0
         }, {
            "id": "document-view-content",
            "icon": "document-view-content",
            "type": "link",
            "label": "actions.document.view",
            "params": {
               "href": "{viewUrl}"
            },
            "index": 99110.0,
            "subgroup": 99.0
         }, {
            "id": "document-edit-properties",
            "icon": "document-edit-properties",
            "type": "javascript",
            "label": "actions.document.edit-metadata",
            "params": {
               "function": "onActionDetails"
            },
            "index": 99130.0,
            "subgroup": 99.0
         }, {
            "id": "document-upload-new-version",
            "icon": "document-upload-new-version",
            "type": "javascript",
            "label": "actions.document.upload-new-version",
            "params": {
               "function": "onActionUploadNewVersion"
            },
            "index": 99140.0,
            "subgroup": 99.0
         }, {
            "id": "document-edit-offline",
            "icon": "document-edit-offline",
            "type": "javascript",
            "label": "actions.document.edit-offline",
            "params": {
               "function": "onActionEditOffline"
            },
            "index": 99210.0,
            "subgroup": 99.0
         }, {
            "id": "document-copy-to",
            "icon": "document-copy-to",
            "type": "javascript",
            "label": "actions.document.copy-to",
            "params": {
               "function": "onActionCopyTo"
            },
            "index": 99250.0,
            "subgroup": 99.0
         }, {
            "id": "document-move-to",
            "icon": "document-move-to",
            "type": "javascript",
            "label": "actions.document.move-to",
            "params": {
               "function": "onActionMoveTo"
            },
            "index": 99260.0,
            "subgroup": 99.0
         }, {
            "id": "document-delete",
            "icon": "document-delete",
            "type": "javascript",
            "label": "actions.document.delete",
            "params": {
               "function": "onActionDelete"
            },
            "index": 99270.0,
            "subgroup": 99.0
         }, {
            "id": "document-assign-workflow",
            "icon": "document-assign-workflow",
            "type": "javascript",
            "label": "actions.document.assign-workflow",
            "params": {
               "function": "onActionAssignWorkflow"
            },
            "index": 99280.0,
            "subgroup": 99.0
         }, {
            "id": "document-manage-granular-permissions",
            "icon": "document-manage-permissions",
            "type": "link",
            "label": "actions.document.manage-permissions",
            "params": {
               "href": "{managePermissionsUrl}"
            },
            "index": 99297.0,
            "subgroup": 99.0
         }],
         "indicators": [{
            "id": "exif",
            "index": "40",
            "icon": "exif-16.png",
            "label": "status.exif"
         }],
         "metadataTemplate": {
            "id": "default",
            "title": null,
            "banners": [],
            "lines": [{
               "index": "10",
               "template": "{date}{size}",
               "view": ""
            }, {
               "index": "20",
               "template": "{description}",
               "view": "detailed"
            }, {
               "index": "30",
               "template": "{tags}",
               "view": "detailed"
            }, {
               "index": "50",
               "template": "{social}",
               "view": "detailed"
            }]
         }
      }
      

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  jknowles John Knowles [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel