Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleActualizar documento
PUT /nuxeo/site/api/v1/id/{docId}
{
    "entity-type": "document",
    "repository": "default",
    "uid": "37b1502b-26ff-430f-9f20-4bd0d803191e",
    "properties": {
        "dc:title": "The new title",
        "dc:description": "Document updated via REST API"
        "common:icon": "/icons/file.gif",
        "common:icon-expanded": null,
        "common:size": null
    }
}

 

Hacer consultas

Code Block
titleQueries
http://localhost/nuxeo/api/v1/query/?query={queryNXQL}

A continuación un ejemplo:

Code Block
titleHaciendo queries mediante la API
http://localhost/nuxeo/api/v1/query/?query=SELECT * FROM Document WHERE dc:title='ATHENTO'

Con el cliente como POSTMAN, una llamada como la anterior nos daría una respuesta similar a la quue sigue:

Code Block
titleRespuesta a una llamada con una query
{
    "entity-type": "documents",
    "isPaginable": true,
    "resultsCount": 2,
    "pageSize": 0,
    "maxPageSize": 0,
    "currentPageSize": 2,
    "currentPageIndex": 0,
    "numberOfPages": 1,
    "isPreviousPageAvailable": false,
    "isNextPageAvailable": false,
    "isLastPageAvailable": false,
    "isSortable": true,
    "hasError": false,
    "errorMessage": null,
    "totalSize": 2,
    "pageIndex": 0,
    "pageCount": 1,
    "entries": [
        {
            "entity-type": "document",
            "repository": "default",
            "uid": "9fb66cdb-2e17-4b1a-bc07-6fa04235047d",
            "path": "/Athento/workspaces/Administración/8. Documentación Yerbabu/MARCA/ATHENTO",
            "type": "Folder",
            "state": "project",
            "parentRef": "c141f110-32da-452c-96c3-aae8aeb9a7f7",
            "versionLabel": "",
            "isCheckedOut": true,
            "title": "ATHENTO",
            "lastModified": "2015-09-16T15:52:42.86Z",
            "facets": [
                "DocumentsSizeStatistics",
                "Folderish",
                "DocumentsCountStatistics"
            ],
            "changeToken": "1442418762861",
            "contextParameters": {
                "documentURL": "/nuxeo/nxdoc/default/9fb66cdb-2e17-4b1a-bc07-6fa04235047d/view_documents"
            }
        },
        {
            "entity-type": "document",
            "repository": "default",
            "uid": "92379199-befe-4430-a7ba-401282656987",
            "path": "/InvoiceDemo/workspaces/PROYECTOS/ATHENTO/ATHENTO",
            "type": "Workspace",
            "state": "project",
            "parentRef": "0f6c49df-186d-4ae3-8486-3a72da40dd44",
            "versionLabel": "",
            "isCheckedOut": true,
            "title": "ATHENTO",
            "lastModified": "2016-03-02T15:42:25.75Z",
            "facets": [
                "SuperSpace",
                "DocumentsSizeStatistics",
                "Folderish",
                "DocumentsCountStatistics"
            ],
            "changeToken": "1456933345758",
            "contextParameters": {
                "documentURL": "/nuxeo/nxdoc/default/92379199-befe-4430-a7ba-401282656987/view_documents"
            }
        }
    ]
}

Vemos que el sistema ha encontrado dos documentos cuyo título es "ATHENTO" y nos ha devuelto sus propiedades.