Attached File functionality

Attached File is a relationship between some stored file and a node + meta data of the relationship.

attached_file_list_types

returns list of types acceptable for attachments in target PBS

QUERY_FUNCTION attached_file_list_types(id: INTEGER): LIST OF STRING

Parameter:
id target node instance id

attached_file_create

creates file attachment record in the specified node in current state of pbs according to input

To call the query logged in user shall be associated with a person granted with editor privileges in target node (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_create(subj: v_attached_file): v_attached_file

Parameter:
subj input parameter of the attachment, see v_attached_file
some attributes of the input are ignored, like the following:
  • subj.item.instance_id - generated
  • subj.item.cancelled - set to FALSE
  • subj.item.creator - set to logged in user
  • subj.item.last_changed - set to date/time of the call
  • subj.item.last_editor - set to logged in user
  • subj.item.comments - unset
  • subj.item.events - is populated with a creation event

Returns actual attributes of the newly registered attachment (see v_attached_file)


attached_file_and_file_create

registers new file in the pbs and the file attachment to the specified node according to input.

To call the query logged in user shall be associated with a person granted with editor privileges in target node (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_and_file_create(
      spec              : v_file;
      attachment        : v_attached_file) 
                        : v_attached_file;

Parameter:
spec updated data to be stored in model (see v_file). Target instance specified by spec.item.instance_id.

the following data could be updated

  • spec.item.item_type
  • spec.item.name
  • spec.item.description
  • spec.item.preview
  • spec.extension
  • spec.owner
  • spec.produced_by
  • spec.interface
  • spec.OS
  • spec.original_name
  • spec.original_format
  • spec.check_sum
  • spec.link
attachment input parameter of the attachment, see v_attached_file
some attributes of the input are ignored, like the following:
  • spec.item.instance_id - generated
  • spec.item.cancelled - set to FALSE
  • spec.item.creator - set to logged in user
  • spec.item.last_changed - set to date/time of the call
  • spec.item.last_editor - set to logged in user
  • spec.item.comments - unset
  • spec.item.events - is populated with a creation event

Returns actual attributes of the newly registered attachment (see v_attached_file)


attached_file_get

gets data of a file attachment specified by its instance id

To call the query logged in user shall be associated with a person granted with reader privileges over whole pbs (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_get(id: INTEGER): v_attached_file

Parameter:
id id of the attachment instance

Returns actual data of the required attachment (see v_attached_file)


attached_file_list

lists data of attachments specified by list of their instance ids. Normally source of the the list is v_node returned by get_node function

To call the query logged in user shall be associated with a person granted with reader privileges in target node (READER_TYPE, EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_list(ids: LIST OF INTEGER): LIST OF v_attached_file

Parameter:
ids list of interesting attachment instance id-s

Returns list of actual data of the required attachments (see v_attached_file)


attached_file_select

attachmets search is not implemented in current realize
QUERY_FUNCTION attached_file_select(
      node,
      creator           : INTEGER;
      before,
      after             : STRING;
      attached_file_type: STRING)  :  LIST OF v_attached_file
Parameters:
node (optional) parent node instance id
creator (optional) instance id of person who introduced the attachment
before (optional) upper date/time of the instance creation in format "YYYY/MM/DD hh:mm:ss"
after (optional) earlier date/time of the instance creation in format "YYYY/MM/DD hh:mm:ss"
attached_file_type (optional) attachment type

Returns list of found attachments (see v_attached_file)


attached_file_update

updates data of the attachment. The attachment is specified by its instance id

To call the query logged in user shall be associated with a person granted with editor privileges in target node (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_update(subject: v_attached_file): v_attached_file

Parameter:
subject updated data of the attachment to be stored in model (see v_attached_file).

The following attributes are ignored:

  • subject.domain - is leaved in parent node
  • subject.item.introduced - is leaved as before
  • subject.item.creator - is leaved as before
  • subject.item.last_changed - set to current date/time
  • subject.item.last_editor - set to calling user
  • subject.item.comments - is leaved as before
  • subject.item.event - is added with update event

Returns actual data of the updated attachment (see v_attached_file)


attached_file_delete

removes an attachment and file body (bodies) specified by its instance id from the current state of pbs

To call the query logged in user shall be associated with a person granted with editor privileges in target node (EDITOR_TYPE, ADMIN_TYPE for the person or group where the person is registered)

QUERY_FUNCTION attached_file_delete(id: INTEGER): BOOLEAN

Parameter:
id instance id of the attachment to be deleted

Returns TRUE


Back to Home page