Versions Compared

Key

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


Page Properties
hiddentrue
idPROGRESS

Product Version2.4
Report Notepresentable
AssigneeAntje, Nils

Resources & Remarks

Modification History

NameDateProduct VersionAction
Antje08 FEB 20212.4New page properties macro.



As of Version2.4
HTTP MethodPOST
Response FormatJSON
Description

This Interceptor can be trigger by 

  • an object import,
  • an update of the content
  • an update or the metadata
  • or a tag update.

A multipart request body is posted. It always contains a "data" part, that contains an object list with the metadata of the affected objects. On an import or content update it can contains further parts as with renditions.

The majority of the metadata in the "data" part is still raw. That means it is not yet normalized, validated and system properties are not yet set. Only content properties are available in case of import or content update. For more details take a look at the examples below.

If the regular import route should be continued, pass the multipart to http://registry/api/dms/objects.
The metadata of the final objects are returned.

Requirements for external endpointThe target URL must be a POST endpoint accepting a multipart request body and returning a list of objects.
Affected API Requests

POST /api/dms/objects

POST /api/dms/objects/{objectId}
PATCH /api/dms/objects/{objectId}
POST /api/dms/objects/{objectId}/contents/file

POST /api/dms/objects/tags/{name}/state/{state}?query=<SQL>

DELETE /api/dms/objects/{objectId}/tags/{name}
POST /api/dms/objects/{objectId}/tags/{name}/state/{state}

Restart Service

Repository service

HeaderAuthorization-Header
Predicate

The predicate is applied on all objects of the object list in the "data" part. If at least one object matches, the interceptor is called.

Examples

Import with Content

If an object with content is imported, the received data part in the interceptor contains content properties. And depending on the document there can also be a text rendition.


Code Block
titledata part of the original request
{
  "objects" : [ {
    "properties" : {
      "system:objectTypeid" : {
        "value" : "miscellaneous"
      },
      "name" : {
        "value" : "my document"
      },
      "description" : {
        "value" : "this is a test document"
      }
    },
    "contentStreams" : [ {
      "mimeType" : "message/rfc822",
      "fileName" : "content.eml",
      "cid" : "content"
    } ]
  } ]
}



Code Block
titledata part in the interceptor
{
  "objects" : [ {
    "properties" : {
      "system:objectTypeid" : {
        "value" : "miscellaneous"
      },
      "name" : {
        "value" : "my document"
      },
      "description" : {
        "value" : "this is a test document"
      }
    },
    "contentStreams" : [ {
      "contentStreamId" : "85E76328-6651-11EB-88B6-71C8C8177575",
      "archivePath" : "default/DOCUMENT/5E/76/3/",
      "length" : 42938,
      "mimeType" : "message/rfc822",
      "fileName" : "content.eml",
      "digest" : "328B2AF519C144050A43EBBFFE21CC722C4E5A6DB40CD1DDCD5A7A54AFA6EE72",
      "repositoryId" : "repo242"
    } ],
    "renditions" : [ {
      "mimeType" : "text/plain",
      "kind" : "text",
      "contentStream" : {
        "length" : 40963,
        "mimeType" : "text/plain",
        "fileName" : "content.txt",
        "cid" : "rendition_195"
      }
    } ],
    "options" : {
      "traceid" : "a78d178f712cbd75",
      "analyzeMimeType" : true,
      "analyzeContent" : true
    }
  } ]
}


Update of the content

A content update can be identified by the existence of a "currentVersion" and the action "updateContent" in the options. As with the import scenario content properties are available and depending on the document a text rendition can also be available.

There is no "data" part in the original request




Code Block
titledata part in the interceptor
{
  "objects" : [ {
    "properties" : {
      "system:objectId" : {
        "value" : "50971948-019a-493f-bdf5-571e91e61236"
      },
      "system:objectTypeId" : {
        "value" : "appTest:miscellaneous"
      }
    },
    "contentStreams" : [ {
      "contentStreamId" : "9C9EDCC3-6716-11EB-B18C-A9EA85931B27",
      "archivePath" : "default/DOCUMENT/C9/ED/C/",
      "length" : 14157,
      "mimeType" : "image/jpeg",
      "fileName" : "test2.txt",
      "digest" : "998FAFD7B3045767B64463C46AB267A7DCC442E28F0FAF5D68C6A32E7DA8987F",
      "repositoryId" : "repo242"
    } ],
    "options" : {
      "currentVersion" : {
        "properties" : {
          "system:traceId" : {
            "value" : "8e57d683bdc36de5"
          },
          "system:objectTypeId" : {
            "value" : "appTest:miscellaneous"
          },
          "system:versionNumber" : {
            "value" : 3
          },
          "system:createdBy" : {
            "value" : "275c826c-6a61-4e89-9512-8d935a1631e5"
          },
          "system:creationDate" : {
            "value" : "2021-02-03T21:17:36.400Z"
          },
          "appTest:name" : {
            "value" : "my document"
          },
          "system:lastModificationDate" : {
            "value" : "2021-02-04T13:01:37.120Z"
          },
          "system:baseTypeId" : {
            "value" : "system:document"
          },
          "system:tenant" : {
            "value" : "default"
          },
          "appTest:description" : {
            "value" : "this is a new description"
          },
          "system:lastModifiedBy" : {
            "value" : "275c826c-6a61-4e89-9512-8d935a1631e5"
          },
          "system:objectId" : {
            "value" : "50971948-019a-493f-bdf5-571e91e61236"
          }
        }
      },
      "traceid" : "9a00c294eaf1e2af",
      "action" : "updateContent"
    }
  } ]
}



Update of the metadata

A metadata update can be identified by the existence of a "currentVersion" and the action "updateMetadata" in the options. The object id is added to the properties of the original request.


Code Block
titledata part of the original request
{
  "objects" : [ {
    "properties" : {
      "description" : {
        "value" : "this is a new description"
      }
    }
  } ]
}



Code Block
titledata part in the interceptor
{
  "objects" : [ {
    "properties" : {
      "description" : {
        "value" : "this is a new description"
      },
      "system:objectId" : {
        "value" : "50971948-019a-493f-bdf5-571e91e61236"
      }
    },
    "options" : {
	  "action" : "updateMetadata",
      "preserve_missing_properties" : true,
      "currentVersion" : {
        "properties" : {
          "system:traceId" : {
            "value" : "df4735bd88e94678"
          },
          "system:objectTypeId" : {
            "value" : "appTest:miscellaneous"
          },
          "system:versionNumber" : {
            "value" : 1
          },
          "system:createdBy" : {
            "value" : "275c826c-6a61-4e89-9512-8d935a1631e5"
          },
          "system:creationDate" : {
            "value" : "2021-02-03T21:17:36.400Z"
          },
          "appTest:name" : {
            "value" : "my document"
          },
          "system:lastModificationDate" : {
            "value" : "2021-02-03T21:17:36.400Z"
          },
          "system:baseTypeId" : {
            "value" : "system:document"
          },
          "system:tenant" : {
            "value" : "default"
          },
          "appTest:description" : {
            "value" : "this is a test document"
          },
          "system:lastModifiedBy" : {
            "value" : "275c826c-6a61-4e89-9512-8d935a1631e5"
          },
          "system:objectId" : {
            "value" : "50971948-019a-493f-bdf5-571e91e61236"
          }
        }
      }
    }
  } ]
}