File functionality

File concept is a file (external or with body stored in SimDM) defined in scope of a SimDM model. It can be some CAD or CAE issued data, AP209e2 STEP file, requirements, specifications (depending from assigned type), log of some operation. The file is normally referred from (attached to) some node(s) and defined on level of whole pbs tree.

file_list_types

returns list of types acceptable for files in target PBS

QUERY_FUNCTION file_list_types: LIST OF STRING


file_create

registers new file in the pbs according to specified input.

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

QUERY_FUNCTION file_create(subject: v_file): v_file

Parameters:
subject input parameter of the file, see v_file
  • subject.item - see v_item
  • subject.item.instance_id - is ignored
  • subject.item.item_type - one of FILE_TYPES or unset by default item_type is set depending of subject.extension
  • subject.item.name - mandatory file name
  • subject.item.cancelled - is ignored
  • subject.item.comments - is ignored
  • subject.item.events - is ignored
  • subject.extension - mandatory file extension
  • subject.owner - db id of owning organization (by default assigned to the first in list user's organization)
  • subject.produced_by - optional software specification where the file (data) is produced
  • subject.interface - optional interface specification
  • subject.OS - optional OS specification
  • subject.original_name - optional file name on user's PC
  • subject.original_format - optional format of original file/data
  • subject.check_sum - optional check sum or time stamp of the original file copy
  • subject.size - optional file size in bytes
  • subject.link - is required for external file
  • subject.body - is ignored
  • subject.model_name - is ignored
  • subject.CAX - is ignored
  • subject.validation - is ignored
  • subject.instances - is ignored
  • subject.errors - is ignored
  • subject.warnings - is ignored
  • subject.derived_files - is ignored
  • subject.derived_from - is ignored

Returns actual attributes of the newly registered file record (see v_file)


file_and_attached_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 file_and_attached_file_create(
      spec              : v_file;
      attachment        : v_attached_file) 
                        : v_attached_file;

Parameters:
spec input parameter of the file, see v_file
  • subject.item - see v_item
  • subject.item.instance_id - is ignored
  • subject.item.item_type - one of FILE_TYPES or unset by default item_type is set depending of subject.extension
  • subject.item.name - mandatory file name
  • subject.item.cancelled - is ignored
  • subject.item.comments - is ignored
  • subject.item.events - is ignored
  • subject.extension - mandatory file extension
  • subject.owner - db id of owning organization (by default assigned to the first in list user's organization)
  • subject.produced_by - optional software specification where the file (data) is produced
  • subject.interface - optional interface specification
  • subject.OS - optional OS specification
  • subject.original_name - optional file name on user's PC
  • subject.original_format - optional format of original file/data
  • subject.check_sum - optional check sum or time stamp of the original file copy
  • subject.size - optional file size in bytes
  • subject.link - is required for external file
  • subject.body - is ignored
  • subject.model_name - is ignored
  • subject.CAX - is ignored
  • subject.validation - is ignored
  • subject.instances - is ignored
  • subject.errors - is ignored
  • subject.warnings - is ignored
  • subject.derived_files - is ignored
  • subject.derived_from - is ignored
attachment input parameter of the attachment, see v_attached_file
some attributes of the input are ignored, like the following:
  • attachment.item.instance_id - generated
  • attachment.item.cancelled - set to FALSE
  • attachment.item.creator - set to logged in user
  • attachment.item.last_changed - set to date/time of the call
  • attachment.item.last_editor - set to logged in user
  • attachment.item.comments - unset
  • attachment.item.events - is populated with a creation event

Returns actual attributes of the newly registered file record (see v_file)


file_get

gets data of a file 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 file_get(id: INTEGER): v_file

Parameters:
id id of the file instance

Returns actual data of the required file (see v_file)


file_list

lists data of files specified by list of their instance id-s

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 file_list(ids: LIST OF INTEGER): LIST OF v_file

Parameters:
ids list of interesting file instance id-s

Returns list of actual data of the required files (see v_file)


file_update

updates data of file registered before. The file is specified by its instance id

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

QUERY_FUNCTION file_update(subject: v_file): v_file

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

the following data could be updated

  • subject.item.item_type
  • subject.item.name
  • subject.item.description
  • subject.item.preview
  • subject.extension
  • subject.owner
  • subject.produced_by
  • subject.interface
  • subject.OS
  • subject.original_name
  • subject.original_format
  • subject.check_sum
  • subject.link

Returns actual data of the updated file (see v_file)


file_cancel

cancels the file specified by instance id and registered in the target pbs. The file is defined as cancelled and could not be used any more in references after that. The instance of the file is removed only if it was not used in any relationships

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

QUERY_FUNCTION file_cancel(id: INTEGER): BOOLEAN

Parameters:
id instance id of the file to be cancelled

Returns TRUE if the instance deleted (was not used), FALSE if just cancelled


file_body_set

accepts uploaded file and assign it to the specified file body

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 file_body_set(
      id,                
      size              : INTEGER;
      file_upload       : STRING) :  v_file
Parameters:
id target - existing ms::file_spec or derived instance id
size the uploaded file size in bytes
file_upload name of uploaded file on the server file system

Returns target file view (see v_file)


file_import_STEP

reads STEP file (stored in target model or uploaded in the call) and produces corresponding data model

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 file_import_STEP(
      id                : INTEGER;
      model_name,
      file_upload,
      import_log        : STRING): v_file
Parameters:
id target - existing ms::file_spec or derived instance id
model_pref (optional) model name pattern if empty - default is used PREF + sequential number where PREF = system_get_config('EXPORT', 'AP209_PREFIX') if not empty can have '%d' if sequential number should be added
file_upload name of uploaded file on the server file system
import_log log of STEP file import to be downloaded then

Returns updates file view (see v_file)


file_CAX_generate

calls CAX file generator against the target file

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

QUERY_FUNCTION file_CAX_generate(
      id             : INTEGER;
      src_file,
      result_file,
      log_file       : STRING;
      store_result   : BOOLEAN):  INTEGER
Parameters:
id instance id of the target ms::EDM_compatible_file
src_file (optional) uploaded source file for the generating: could be used to extract stored file body, or read in case external link
result_file result CAX file that could be downloaded after the call
log_file (optional) path/name of the CAX generating log to be downloaded after the call
store_result TRUE if body of the CAX shall be stored in target model
FALSE if only link to the result cax file shall be stored

Returns generated CAX file's db ID (if store_result is TRUE) or 0


file_validate

calls to standard validation over model imported from the interesting STEP file

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

QUERY_FUNCTION file_validate(
      id,
      options        : INTEGER;
      log_file       : STRING;
      store_result   : BOOLEAN):  validation_line
Parameters:
id instance db ID of the target ms::EDM_compatible_file
options validation options (0 by default) - EDM server help
log_file validation log to be downloaded after the function
store_result TRUE if validation log shall be stored
FALSE if validation results shall not be stored

Returns structure that corresponds to the validation result (see (see validation_line))


file_list_validate

calls to standard validation over model imported from the interesting STEP files

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

QUERY_FUNCTION file_list_validate(
      ids            : LIST OF INTEGER;
      options        : INTEGER;
      log_file       : STRING;
      store_result   : BOOLEAN):  LIST OF validation_line
Parameters:
ids list of instance ids of the target ms::EDM_compatible_file
options validation options (0 by default) - EDM server help
log_file validation log to be downloaded after the function
store_result TRUE if validation log shall be stored
FALSE if validation results shall not be stored

Returns structure that corresponds to the validation result (see validation_line)


file_body_get

extracts body of the attached file and makes it possible for user to download under specified name

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 file_body_get(
      id                : INTEGER;
      downloading_file  : STRING) :  INTEGER
Parameters:
id instance ids of the target file
downloading_file file name on the server file system to be used in download then

Returns accepted file's instance id


file_CAX_set

accepts uploaded CAX file and associates it with specified file

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 file_CAX_set(
      id                : INTEGER;
      CAX_file          : v_file) :  INTEGER
Parameters:
id instance id of the target file (ms::EDM_compatible_file)
CAX_file CAX file specifications (see attributes v_file):
  • CAX_file.item - file name/description/preview
  • owner - file owner
  • produced_by - software name
  • interface - optional
  • OS - optional
  • original_name - optional
  • original_format- source file format
  • check_sum - any check sum
  • size - file size (if the file is uploaded to server) or 0 if just linked
  • link - file location on server (when uploaded) or just file link for external files

Returns accepted file's instance id


file_get_validation_log

makes available downloading validation log for the specified validated before file

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

QUERY_FUNCTION file_get_validation_log(
      id             : INTEGER;
      log_file       : STRING):  INTEGER
Parameters:
id instance id of the target file (ms::EDM_compatible_file)
log_file validation log to be downloaded after the function call

Returns file instance id


file_get_derived_models

returns list of all models where STEP files of the target population were imported to
QUERY_FUNCTION file_get_derived_models:  SET OF STRING

file_get_import

converts specified AP209 model population into master model
QUERY_FUNCTION file_import(
      source_model,
      downloading_file  : STRING): STRING
Parameters:
source_model qualified name of SimDM master model to be converted/exported
downloading_file file name to be downloaded then

Returns qualified name of target AP209 model


Back to Home page