|
Working with documents
(create/update/search/remove)
This software allows you to perform
various operations with documents in Hummingbird DM libraries, such as:
Creating documents
To create a document, you should use the
DOCUMENT element with the attribute
action="create". You can create a new
document in the library by specifying the form of the document in the form
attribute of the PROFILE element and filling out the necessary fields of the
form using FIELD elements.
Example:
< DOCUMENT
id="doc"
action="create"
onerror="break">
<PROFILE
form="DEF_PROF">
<FIELD
name="DOCNAME">The
Jack's document</FIELD>
<FIELD
name="AUTHOR_ID">JACK</FIELD>
<FIELD
name="TYPIST_ID">JACK</FIELD>
<FIELD
name="APP_ID">MS
WORD</FIELD>
<FIELD
name="TYPE_ID">DEFAULT</FIELD>
</PROFILE>
</ DOCUMENT>
Updating documents
If the DOCUMENT element uses the
attribute action="update", the values of the specified form fields are updated
and actions specified in the ACTIONS element are carried out for the found
document.
Example:
< DOCUMENT
action="update"
onerror="break">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE
SYSTEM_ID='%doc.SYSTEM_ID%'
</QUERY>
</SEARCH>
<PROFILE
form="DEF_PROF">
<FIELD
name="ABSTRACT">The
Jack's very important document</FIELD>
</PROFILE>
</ DOCUMENT>
Assigning access rights for documents
The PROFILE element of the DOCUMENT
element contains a child element named SECURITY used to assign access rights.
You can use this element both to override the existing set of rights for a
document and to add new right combinations to those existing. You can also use
this element to disable all restrictions for a document. It is possible to set
access right both for user and for groups.
Example:
< DOCUMENT
action="update"
onerror="break">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE
SYSTEM_ID='%doc.SYSTEM_ID%'
</QUERY>
</SEARCH>
<PROFILE
form="DEF_PROF">
<SECURITY
action="add">
<USER
user_id="MARY">
<ACCESSRIGHTS
view_profile="yes"
edit_profile="yes"
view_content="yes"
retreive_content="yes"
edit_content="yes"
copy_content="yes"
delete_content="yes"
control_access="yes"
assign_to_file="yes"
view_only_published="yes"/>
</USER>
<GROUP
group_id="JACKS_CLIENTS">
<ACCESSRIGHTS
view_profile="yes"
edit_profile="yes"
view_content="yes"
retreive_content="yes"
edit_content="no"
copy_content="no"
delete_content="no"
control_access="no"
assign_to_file="no"
view_only_published="yes"/>
</GROUP>
</SECURITY>
</PROFILE>
</ DOCUMENT>
Creating versions, subversion and
attachments
When you are creating a document, you
can add any number of versions, subversions and attachments to it. To do it, you
should use the elements CREATE_VERSION and
CREATE_ATTACHMENT in the ACTIONS
element of the DOCUMENT element.
Versions, subversions and attachments
can be files loaded to Hummingbird DM from the disk.
Example:
< DOCUMENT
action="update"
onerror="break">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE
SYSTEM_ID='%doc.SYSTEM_ID%'
</QUERY>
</SEARCH>
<ACTIONS>
<CREATE_VERSION
copy="no"
subversion="no"
author="JACK"
typist="JACK"
comment="Document
version 1">
<CONTENT
location="external">..\Docs\Document.doc</CONTENT>
</CREATE_VERSION>
<CREATE_ATTACHMENT
label="XLS"
author="JACK"
typist="JACK"
comment="Document
attachment XLS">
<CONTENT
location="external">..\Docs\Document.xls</CONTENT>
</CREATE_ATTACHMENT>
</ACTIONS>
</ DOCUMENT>
Searching for documents
You can search for documents. Use the
SEARCH element of the
DOCUMENT element for that. Search is carried out not by
the fields of a form, but with the help of an SQL query because it allows you to
search for documents by your algorithms more flexibly.
You can use search to:
-
find out whether there are
documents with the specified parameters in the library (not only the values
of form fields) and automatically change the logic of import depending on
the result (see the ifexists attribute of the DOCUMENT element for more
information)
-
update document attributes
-
update the attributes of all found
documents (see Updating numerous documents with one operation for
more information)
-
refer to document attributes later
(see Using references to items for more information)
Removing documents
If the attribute
action="delete" is used
in the DOCUMENT element, the document found during search is removed.
Example:
< DOCUMENT
action="delete"
onerror="skip">
<SEARCH>
<QUERY>
SELECT DOCNUMBER FROM DOCSADM.PROFILE WHERE SYSTEM_ID =
%doc.SYSTEM_ID%
</QUERY>
</SEARCH>
</ DOCUMENT>
|