How to access document properties from a webscript in Alfresco?

144 Views Asked by At

I am using Alfresco Enterprise 6.2. I want to restrict a document upload and display a pop up message if a document title contain a certain text. I have looked at upload.post.js and could not see document properties containing titlr, description etc... Is there a way to access them from this webscript?

1

There are 1 best solutions below

0
On

The below webscript will Provide you the document properties in Alfresco.

URI-/alfresco/api/-default-/public/alfresco/versions/1/nodes/{nodeId}/children

{
    "list": {
        "pagination": {
            "count": 3,
            "hasMoreItems": false,
            "totalItems": 3,
            "skipCount": 0,
            "maxItems": 100
        },
        "entries": [
            {
                "entry": {
                    "createdAt": "2011-03-03T10:32:15.048+0000",
                    "isFolder": false,
                    "isFile": true,
                    "createdByUser": {
                        "id": "mjackson",
                        "displayName": "Mike Jackson"
                    },
                    "modifiedAt": "2011-03-03T10:32:15.048+0000",
                    "modifiedByUser": {
                        "id": "mjackson",
                        "displayName": "Mike Jackson"
                    },
                    "name": "doclib",
                    "id": "e725ee47-62c6-4ae9-a761-9b69ba2835c5",
                    "nodeType": "cm:thumbnail",
                    "content": {
                        "mimeType": "image/png",
                        "mimeTypeName": "PNG Image",
                        "sizeInBytes": 6540,
                        "encoding": "UTF-8"
                    },
                    "parentId": "5515d3e1-bb2a-42ed-833c-52802a367033"
                }
            },
            {
                "entry": {
                    "createdAt": "2020-12-03T23:06:16.844+0000",
                    "isFolder": false,
                    "isFile": true,
                    "createdByUser": {
                        "id": "admin",
                        "displayName": "Administrator"
                    },
                    "modifiedAt": "2020-12-03T23:06:16.844+0000",
                    "modifiedByUser": {
                        "id": "admin",
                        "displayName": "Administrator"
                    },
                    "name": "pdf",
                    "id": "b58f10ff-771a-4b44-8c54-9fcebe68fb3f",
                    "nodeType": "cm:thumbnail",
                    "content": {
                        "mimeType": "application/pdf",
                        "mimeTypeName": "Adobe PDF Document",
                        "sizeInBytes": 622418,
                        "encoding": "UTF-8"
                    },
                    "parentId": "5515d3e1-bb2a-42ed-833c-52802a367033"
                }
            },
            {
                "entry": {
                    "createdAt": "2011-03-03T10:32:32.773+0000",
                    "isFolder": false,
                    "isFile": true,
                    "createdByUser": {
                        "id": "mjackson",
                        "displayName": "Mike Jackson"
                    },
                    "modifiedAt": "2011-03-03T10:32:32.773+0000",
                    "modifiedByUser": {
                        "id": "mjackson",
                        "displayName": "Mike Jackson"
                    },
                    "name": "webpreview",
                    "id": "41c25437-ce2e-47e1-8e3d-a2f3008e7456",
                    "nodeType": "cm:thumbnail",
                    "content": {
                        "mimeType": "application/x-shockwave-flash",
                        "mimeTypeName": "Shockwave Flash",
                        "sizeInBytes": 672905,
                        "encoding": "UTF-8"
                    },
                    "parentId": "5515d3e1-bb2a-42ed-833c-52802a367033"
                }
            }
        ]
    }
}