|
Updating numerous
documents with one operation
With this software, you can easily
perform the same actions on several documents (folders) in one operation.
If several documents (folders) have been
found during search (see such elements as DOCUMENT /
SEARCH / QUERY ), actions
that were defined in the action attribute of the DOCUMENT element will be
applied to all found documents (folders).
For example, if
action="delete", all
found documents will be removed.
Example:
< DOCUMENT
action="delete"
onerror="break">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE DOCNAME LIKE '%test%'
</QUERY>
</SEARCH>
</ DOCUMENT>
This example shows how all documents
whose title contains the word "test" are removed with the help of one DOCUMENT
element.
If
action="update", form fields are
updated and/or actions specified in the ACTIONS element of the DOCUMENT element
are performed for all found documents.
Example:
< DOCUMENT
id="doc"
action="use"
onerror="break">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE DOCNAME = 'test'
</QUERY>
</SEARCH>
</ DOCUMENT>
< FOLDER
action="update"
onerror="break">
<SEARCH>
<QUERY>
SELECT PR.DOCNUMBER
FROM DOCSADM.APPS A, DOCSADM.PEOPLE P, DOCSADM.PROFILE PR
WHERE P.USER_ID = 'TEST' AND PR.AUTHOR = P.SYSTEM_ID AND
A.APPLICATION = 'FOLDER' AND PR.APPLICATION = A.SYSTEM_ID
</QUERY>
</SEARCH>
<PROFILE
form="DEF_PROF">
<FIELD
name="COMMENT">Document
"test" has been added</FIELD>
</PROFILE>
<ACTIONS>
<ADD_ITEM
docnumber="%doc.DOCNUMBER%"/>
</ACTIONS>
</ FOLDER>
In this example, a document with the
title "test" is added to all folders created by the user with the TEST ID. At
the same time, the text «document "test" has been added» is written to the
COMMENT field of each folder.
Note: a reference to a previously found
item is used in this example. See Using references to items for more
information.
You can use such bulk operations not
only to perform various operations while importing documents, but also use XML
to perform administration operations on the server. For example, it is much
easier to perform operations that you cannot perform using an SQL query directly
in the database.
|