23
Documenta DMS Documenta DMS Documenta Web services Approvals Barcutean Adrian 1 Autor INFRASOFT SRL Data creare Iulie 2014 Data ultimului review Iunie 2014 Document Ref DMS.SUP.01 Versiune 1.0 Descriere Documentul contine descrierea procedurii de suport tehnic si management al incidentelor. Audienta Prezentul document este destinat utiliatorilor sistemului Documenta DMS Documenta Web services

resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Embed Size (px)

Citation preview

Page 1: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Documenta DMS

Documenta Web services

Approvals

Barcutean Adrian

1

AutorINFRASOFT SRL

Data creareIulie 2014

Data ultimului reviewIunie 2014

Document RefDMS.SUP.01

Versiune1.0

Descriere

Documentul contine descrierea procedurii de suport tehnic si management al incidentelor.

Audienta

Prezentul document este destinat utiliatorilor sistemului Documenta DMS

Documenta Web services

Page 2: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

ContentsLogin............................................................................................................................................................4

Check token validity....................................................................................................................................6

Link for inline file download, using File ID...................................................................................................6

Link for file inline download, base on file server path.................................................................................8

Get File List from Folder ID..........................................................................................................................8

Get File list from Folder Path.......................................................................................................................9

Get Root Dir (folder) ID for current user......................................................................................................9

Get folder name..........................................................................................................................................9

Get ID Director by path................................................................................................................................9

Get subfolders...........................................................................................................................................10

Get All Document Templates.....................................................................................................................10

Generate from template...........................................................................................................................10

Get Ms WORD Document Templates........................................................................................................10

Get Ms EXCEL Document Templates.........................................................................................................11

Get Document Category by File ID............................................................................................................11

Get file metadata and values for metadata – only Label and Value..........................................................11

Get users list..............................................................................................................................................11

Change user’s password............................................................................................................................11

Change language.......................................................................................................................................11

Get file download link................................................................................................................................11

Upload File.................................................................................................................................................11

File Check In...............................................................................................................................................12

Get Metadata for a Category ID................................................................................................................13

Get File Metadata and Values – full metadata description plus value.......................................................13

Get File General Properties.......................................................................................................................13

Get File Security.........................................................................................................................................13

Set File Metadata Values...........................................................................................................................14

Set Document Category.............................................................................................................................14

List all document types..............................................................................................................................15

Get LOV available values...........................................................................................................................15

Get all lovs.................................................................................................................................................15

2

Page 3: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

http;//<URL>/api/v1/lov/{token}/get_all_lovs/........................................................................................15

Get PDF Preview for file.............................................................................................................................15

Get Flows List............................................................................................................................................15

Get All Workflows for one Documenta unit..............................................................................................16

Get Compliant Workflows for FileId..........................................................................................................16

Get Worflow Details..................................................................................................................................16

Send File on Flow.......................................................................................................................................16

Act on File on FLow....................................................................................................................................16

Get Flow Steps...........................................................................................................................................16

Block File...................................................................................................................................................16

Get all user flows.......................................................................................................................................17

Filename by formula..................................................................................................................................17

Search........................................................................................................................................................17

Create new folder......................................................................................................................................17

Get flows for category...............................................................................................................................17

Get flows for categoryID............................................................................................................................17

Check file exists.........................................................................................................................................18

Check in force............................................................................................................................................18

Add document category............................................................................................................................18

Add document category with idFolder......................................................................................................18

List all master attributes............................................................................................................................18

Add attribute from master attributes........................................................................................................18

Add new master attribute.........................................................................................................................19

Delete attribute.........................................................................................................................................19

Get file output format...............................................................................................................................19

Get document output format....................................................................................................................19

Register file................................................................................................................................................19

Get user’s registry list................................................................................................................................19

Get registry list for document type...........................................................................................................20

Get all registry for file ID............................................................................................................................20

3

Page 4: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Notes !

1. Http headers are important – to be used as described in current document;2. Respect also Mime-type;

Obtain TOKEN at login.

Token is valid for one hour.

After one hour / when token became invalid – you need to re-login for a new token.

For testing - use WizTools REST Client: http://code.fosshub.com/WizToolsorg-RESTClient/downloads

Login

ITEM VALUEURL http://<URL>/api/api/v1/login/METHOD PUTHEADER accept=application/xmlBODY <user>

<username>myUsernameHere</username><password>myPasswordHere</password></user>

EXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><userToken> <expires>1404462835243</expires><token>c38ac2af28060e1865c38c06c39c68c389c2bc27c2ac6858c38a1f0de280b0c396476fe280a03741485133e280b9c2a8</token> <userId>user_id_here</userId> <valid>true</valid>

4

Page 5: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

</userToken>

Login to obtain a TOKEN that is valid for one hour

5

Page 6: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

All following request will be run with this TOKEN

Check token validity

ITEM VALUEURL http://<URL>/api/api/v1/login/token_hereMETHOD GETHEADER accept=application/xmlBODY N/AEXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><userToken> <expires>1404466320000</expires> <token> token_here </token> <userId>user_id_here</userId> <valid>true</valid></userToken>

Link for inline file download, using File ID

ITEM VALUEURL http://<URL>/api/api/v1/file/token_here/link_by_id/file_id_hereMETHOD GETHEADER accept=application/xmlBODY N/AEXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><fileLink> <id>file_id_here</id> <downloadLink>documenta-dms.com/ws_download_file?token=c38bc3a9c2a9c2b60143c38e22c3b7c3afe280981402c3bfc390e280a17fc399c3b8c5b859c399efbfbde280a13c2715c2adc5bd4e345a</downloadLink></fileLink>

Returns a link used for downloading the file

6

Page 7: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Link for file inline download, base on file server path

7

Page 8: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Acest pas deschide un fisier din Documenta pe baza locatiei unde este salvat, fara a mai fi nevoie de logare.

Calea trebuie scrisa in BODY altfel nu ar putea fi interpretat datorita caracterelor ‘/’.

ITEM VALUEURL http://<URL>/api/api/v1/file/token_here/link_by_pathMETHOD POSTHEADER accept=application/xmlBODY <fileLink>

<path>SITE\folder1\folder2\my_file.docx</path></fileLink>

EXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><fileLink> <id>file_id_here</id> <downloadLink>documenta-dms.com/ws_download_file?token=c3adc2b061c2a4c3b4c3883de280ba0cc3a34e0c2216e2809ce280ba2574c5935dc3bcc2b654c39d461a56e280a2c39044c3b3c395</downloadLink> <path> SITE\folder1\folder2\my_file.docx</path></fileLink>

Get File List from Folder ID

ITEM VALUEURL http://<URL>/api/api/v1/dir/token_here/link_by_id/dir_id_hereMETHOD GETHEADER accept=application/xmlBODY N/AEXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><dirLink> <id>dir_id_here</id> <fileLinks> <id>file_1_id_here</id> <downloadLink>documenta-dms.com /ws_download_file?token=efbfbde2809c5dc2b6164052c2bb72c2a002c387c5b8e280a01875c3b5c5b8657c0724c2ac63397623763de2809969c385</downloadLink> </fileLinks> <fileLinks> <id>file_2_id_here</id> <downloadLink>new.documenta.ro/ws_download_file?token=5d3577c2ab795bc2a9175561c3b856e280a23fe280a02ec3a53fc2b6c2bec5a1460477c2b2c3a80725721fc388c2b1</downloadLink> </fileLinks></dirLink>

8

Page 9: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get File list from Folder PathITEM VALUEURL http://<URL>/api/api/v1/dir/token_here/link_by_pathMETHOD POSTHEADER accept=application/xmlBODY <dirLink>

<path>SITE\folder1\folder2\</path></dirLink >

EXPECTED RESPONSE

<?xml version="1.0" encoding="UTF-8"?><dirLink> <id>dir_id_here</id> <fileLinks> <id>file_1_id_here</id> <downloadLink>documenta-dms.com /ws_download_file?token=efbfbde2809c5dc2b6164052c2bb72c2a002c387c5b8e280a01875c3b5c5b8657c0724c2ac63397623763de2809969c385</downloadLink> </fileLinks> <fileLinks> <id>file_2_id_here</id> <downloadLink>new.documenta.ro/ws_download_file?token=5d3577c2ab795bc2a9175561c3b856e280a23fe280a02ec3a53fc2b6c2bec5a1460477c2b2c3a80725721fc388c2b1</downloadLink> </fileLinks></dirLink>

Get Root Dir (folder) ID for current userhttp://<URL>/api/api/v1/dir/{token}/get_root

Get folder namehttp://<URL>//api/v1/dir/{token}/get_folder_name/{dirId}

Get ID Director by pathhttp://<URL>/api/v1/dir/{token}/get_dirid_by_path/{dirPath}

Returns DIR_ID and DIR_NAME

Parameter example: 'SITE\ERP\4.Development\src\SQL\ERP UPD 1.1\PTM\'

9

Page 10: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

This web service is using also “[“character as path delimiter. Example: 'SITE[ERP[4.Development[src[SQL[ERP UPD 1.1[PTM['

Get subfoldershttp://<URL>/api/api/v1/dir/{token}/get_ subfolders/ {FolderID}

Get All Document Templateshttp://<URL>/api/api/v1/ template/{token}/doc_template_list

Generate from templatehttp://<URL>/api/v1/template/{token}/gen_from_template/{templateId}/{folderId}

Get Ms WORD Document Templateshttp://<URL>/api/api/v1/ template/{token}/doc_template_list_filter/WORD

Get Ms EXCEL Document Templateshttp://<URL>/api/api/v1/ template/{token}/doc_template_list_filter/EXCEL

10

Page 11: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get Document Category by File IDhttp://<URL>/ api/v1/file/{token}/category_by_id/{fileId}

Get file metadata and values for metadata – only Label and Valuehttp://<URL>/api/api/v1/file/{token}/meta_by_id/{fileId}

Get users listhttp://<URL>/api/v1/utilizator/{token}/get_list

Change user’s passwordhttp://<URL>/api/v1/utilizator/{token}/change_password/{oldPassword}/{newPassword}

Change languagehttp://<URL>/api/v1/lang/{token}/change_language/{language}

Get file download linkhttp://<URL>/ api /api/v1/file/{token}/link_by_id/{fileId}

Upload Filehttp://<URL>/ api /api/v1/file/upload/

method = RequestMethod.POST, consumes = "multipart/form-data", produces = {"application/xml", "application/json"}

Parameters:

byte[] uploadData, HttpServletRequest request, @RequestParam("token") String token, @RequestParam("dirId") Integer dirId,

11

Page 12: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

@RequestParam("userId") Integer userId, @RequestParam("fileData") MultipartFile fileData

Example:

File Check Inhttp://<URL>/ api /api/v1/file/checkIn/

@RequestMapping(value = "/api/v1/file/checkIn/", method = RequestMethod.POST, consumes = "multipart/form-data", produces = {"application/xml", "application/json"})

Parameters:

byte[] uploadData, HttpServletRequest request, @RequestParam("finishEdit") Integer finishEdit, @RequestParam("fileId") Integer fileId, @RequestParam("token") String token, @RequestParam("userId") Integer userId, @RequestParam("comment") String comment @RequestParam("fileData") MultipartFile fileData

Example:

12

Page 13: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get Metadata for a Category IDhttp://<URL>/api/ api/v1/attribute/{token}/ list_by_category/{categoryId}

Get File Metadata and Values – full metadata description plus valuehttp://<URL>/api/ api/v1/attribute/{token}/file_attr_list_by_id/{fileId}

Get File General Propertieshttp://<URL>/api/ api/v1/attribute/{token}/file_attr_general_by_id/{fileId}

Get File Securityhttp://<URL>/api/ api/v1/attribute/{token}/file_security_by_id/{fileId}

Set File Metadata Valueshttp://<URL>/api/ api/v1/attribute/{token}/set_attr_list/{fileId}

13

Page 14: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

@RequestMapping(value = "/set_attr_list/{fileId}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}, produces = {"application/xml", "application/json"})

Parametrii sunt:

public BaseModel setDocAttributes(@PathVariable String token, @PathVariable Integer fileId, @RequestBody DocAttrLinkList docAttrLinkList)

Unde AttLinkList contine o lista XML de:

private Integer attributeId; private String value; private String label; private String dataType; private Integer length; private Integer precision; private Boolean mandatory; private Integer selectionType; private Integer lovId; private Integer position; private Boolean readOnly; private Boolean hidden; private Boolean multipleSelection.

Set Document Categoryhttp://<URL>/api/ api/v1/attribute/{token}/set_document_category/{fileId}/{categoryId}

List all document classes

http://<URL>/api/v1/attribute/{token}/list_all_document_types/

Returns all document classes filtered by unit_id

List all document typeshttp://<URL>/api/v1/attribute/{token}/list_all_categories/

Returns all document categories

14

Page 15: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get LOV available valueshttp://<URL>/api/ api/v1/lov/{token}/values_by_id/{LovId}

LOV ID is obtained from Category / Metadata

Get all lovshttp;//<URL>/api/v1/lov/{token}/get_all_lovs/

Get PDF Preview for filehttp://<URL>/api/api/v1/file/token_here/pdf_by_id/file_id_here

Returns a link for inline download for PDF version of that document. If PDF Version is not available an error messaje will be shown.

For PDF and images – JPEG, Gif, Tiff, JPG – this web service call is not needed – the client will display directly the image/PDF.

Get Flows Listhttp://<URL>/api/api/v1/flow/{token}/get/{flowStatus}/{stepStatus}/{stepType}

Parameters:

flowStatus: A = active; F=Finalized stepStatus: F=Finalized; W=Current step to the current user; P = Pending stepType:

o INFORMARE=Informationo APROBARE=Approvalo ATRIBUIRE=Allocatedo RESPINS=Rejectedo DELEGARE=Delegation of responsability

15

Page 16: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get All Workflows for one Documenta unithttp://<URL>/api/v1/flow/{token}/list_all_workflows/

Returns all defined workflows on one Documenta unit

Get Compliant Workflows for FileIdhttp://<URL>/api/api/v1/flow/{token}/get/{fileId}/

Get Worflow Detailshttp://<URL>/api/api/v1/flow/{token}/get_details/{workflowId}/

Send File on Flowhttp://<URL>/api/api/v1/flow/{token}/get/{fileId}/{flowId}/{info}/{userId}

Act on File on FLowhttp://<URL>api/api/v1/flow/{token}/get/{fileId}/{flowId}/{comment}/{action}/{pas}/{idUser}

Where action=

YES or NO

Get Flow Stepshttp://<URL>/api/api/v1/flow/{token}/get_flow_steps/{fileId}/{flowId}/

Block Filehttp://<URL>/ api/v1/file/{token}/checkOut/{fileId}/{userId}

Get all user flowshttp://<URL>/api/v1/flow/{token}/get/all_user_flows/

Filename by formulahttp://<URL>/api/v1/file/{token}/filename_by_formula/{fileId}

16

Page 17: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Sets and returns filename after DMS label rules implementation according to document type

Searchhttp://<URL>/api/api/v1/file/{token}/search/{dirId}/{searchName}

<dirId> – Director’s ID that one is looking in <searchName> -what is looking for

Create new folderhttp://<URL> /api/v1/dir/{token}/create_dir/{ParentDirId}/{FolderName}

RETURNS: Name (new folder name) Id (new folder ID)

If error: ID=-1; Name wil contain ERROR CODE (error messages should be displayed from win.properties to the user) :

ERR_NO_VSS_CRE_DIR_ROLE ERR_NO_WRITE_RIGHTS_ON_PARENT ERR_FOLDER_ALREAD_EXISTS

Get flows for categoryhttp://<URL>/api /api/v1/flow/{token}/get_flows_for_category/

Get flows for categoryIDhttp://<URL>/api/v1/flow/{token}/get_flows_for_category/{categoryId}

Check file existshttp://<URL>/api/v1/file/{token}/check_file_exists/{dirId}/{fileName}

Returns FileID with all data including filename– if the file exists.

17

Page 18: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Check in forcehttp://<URL>/api/v1/file/check_in_force/

Parameters (byte[] uploadData, HttpServletRequest request): @RequestParam("forceIfOtherUser") Integer forceIfOtherUser, @RequestParam("fileId") Integer fileId, @RequestParam("token") String token, @RequestParam("userId") Integer userId, @RequestParam("comment") String comment, @RequestParam("fileData") MultipartFile fileData) – similar cu /api/v1/file/checkIn/ sau upload

Add document categoryhttp://<URL>/api/v1/attribute/{token}/add_document_category/{code}/{name}/{position}/

Returns new document category

Add document category with idFolderhttp://<URL>/api/v1/attribute/{token}/add_document/{idTip}/{code}/{name}/{position}/{idFolder}/

List all master attributeshttp://<URL>/api/v1/attribute/{token}/get_all_master_attributes/

Add attribute from master attributeshttp://<URL>/api/v1/attribute/{token}/add_attribute_from_master/{p_id_document_to}/{p_id_master_atribute}/

Add new master attributehttp://<URL>/api/v1/attribute/{token}/add_new_master_attribute/{p_name}/{p_description}/{p_date_type}/{p_length}/{p_precision}/{p_mandatory}/{p_default_value}/{p_selection_type}/{p_lov_id}/{p_position}/{p_formula_calcul}/{p_read_only}/{p_hidden}/{p_multiple_selection}/

18

Page 19: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

All parameters with no value will be replaced with “+”

Delete attributehttp://<URL>/api/v1/attribute/{token}/delete/{attributeId}/{documentId}

Get file output formathttp://<URL>/api/v1/file/{token}/get_file_output_version/{fileId}

Get document output formathttp://<URL>/api/v1/file/{token}/get_document_output_format/{documentId}

Register filehttp://<URL>/api/v1/file/{token}/register/{fileId}/{registerId}/{from}/{nrTert}/{dateProvider}/{source}/{to}/{description}

Get user’s registry listhttp://<URL>/api/v1/register/{token}/get_user_list/

Returns all registry with access rights for current user.

Get registry list for document typehttp://<URL>/api/v1/register/{token} /get_list_for_type/{documentTypeId}

Returns all registry with access rights for parameter document type ID.

19

Page 20: resurse.documenta-dms.com€¦ · Web viewCheck token validity6. Link for inline file download, using File ID6. Link for file inline download, base on file server path8 . Get File

Documenta DMS

Get all registry for file IDhttp://<URL>/api/v1/register/{token} /get_list_for_file/{fileId}

Returns all registry with access rights for parameter document type ID.

20