Update Component (Update)

The Update component allows you to create a browser-based utility for editing content collections hosted by NXT 4. Users who have the appropriate permissions can use HTML forms with Update component parameters embedded in them to do such things as add or delete documents from the site.

URL Parameters

Name Value Description
c delete |
get |
lock |
mkcol |
proppatch |
put |
unlock
Command to perform. Multiple commands can be performed in a single request by separating them with semicolons (for example, update_c=put;lock). Multiple commands are performed in the order given in the parameter.

All operations that work on a document also work on a folder, the difference between the two being explicit only when necessary.

Terms in parenthesis are the actual command name passed to the component through a URL or form. Most names are taken from HTTP and WebDAV methods.

Delete – Delete a document and all descendants.

Get – Retrieve a document without any server-side modifications, and attempt to force the browser's "Save As..." dialog to appear for all content types.

Lock – Lock a specified document. Locking the document prevents other users from modifying the document or its properties.

Make Collection(mkcol) – Create a folder at a given location (a document with no content).

Property Patch(proppatch) – Set or remove properties for a document. All URL parameters or form items prefixed with prop_ are assumed to be properties.

Put – Store a document at a given location. This can replace an existing document, or create a new document.

Unlock – Unlock a specified document. Unlocking allows other users to obtain a lock. Usually the unlock will be preceded by a put.
cmt yes | no Commit flag. If the value is yes, any pending documents are committed (including any sent in the same request that has the cmt parameter). The default value is yes.
d domain string Domain of document(s) to operate on (for multiple documents, usually).
file file The actual content of the file for a put operation. When uploading a file with a multipart/form-data form, this should be the name of the "file" INPUT.
file_ct content-type Content-type of the file to put. Only used if the file parameter is not sent through a file INPUT in a multipart/form-data form.
file_name file name Name of the file to put, or the collection to create with mkcol. Only used with a put if the file parameter is not sent through a "file" INPUT in a multipart/form-data form.
fp name path The full path to the document to operate on.
ow yes | no Over-write flag. If the value is no and the resource exists on a put operation, it will fail. The default value is yes. Usually adding a document has ow=no, while checking in a document has ow=yes.
p name path Path of a document to operate on. Overrides PATH_INFO. If a file_name parameter is present, or if a file is being uploaded, the file name is appended to this path.
prop_property property value Node property to set with a proppatch operation. Any URL parameter prefixed with update_prop_ is assumed to be a property (for example, update_prop_title=newTitle sets the title property to newTitle).
r percent escaped URL Redirect URL. If specified, the component redirects to the given URL after completing its own processing. Since the Update component doesn't return a response in a success case, it may be desirable to redirect to some other page.
wf yes | no Enable workflow. If yes then documents and metadata are left in a pending state that is not visible on the main site, and some other mechanism (such as another component) must be used for approving changes. If no, changes are immediately committed and visible on the site.

Metadata

The Update component can change values of many node properties and metadata. The put parameter, for example, changes the last-modified property. Some node properties are read-only and cannot be changed.

The proppatch parameter allows the user to create metadata properties by writing to the metadata property. The metadata property must be an XML document. It is highly recommended that it also conform to the RDF standard, and use Dublin Core elements.