aiM18 Developer Center aiM18 Developer Center
DOC Home
  • Platform

    • Overview
    • Frontend Framework
    • Backend Framework
    • EBI Development
    • JSF Components
    • BPM Extension Interface
    • Telescope Extension Interface
    • Mobile App Setup
  • ERP

    • ERP EJB Interfaces
    • ERP XML Config Files
    • ERP Decorators (Frontend Interfaces)
  • Tutorial

    • Setup Development Environment
    • Sample App
  • Platform

    • Authentication
    • Common JSON Objects
    • Core Services
    • EBI Services
  • Enterprise Resource Planning
  • Human Capital Management
  • Business Process Management
  • Schedule Management
  • Document Management
  • Tutorial

    • Interacting with aiM18 via webservices
Tutorial
GitHub (opens new window)
DOC Home
  • Platform

    • Overview
    • Frontend Framework
    • Backend Framework
    • EBI Development
    • JSF Components
    • BPM Extension Interface
    • Telescope Extension Interface
    • Mobile App Setup
  • ERP

    • ERP EJB Interfaces
    • ERP XML Config Files
    • ERP Decorators (Frontend Interfaces)
  • Tutorial

    • Setup Development Environment
    • Sample App
  • Platform

    • Authentication
    • Common JSON Objects
    • Core Services
    • EBI Services
  • Enterprise Resource Planning
  • Human Capital Management
  • Business Process Management
  • Schedule Management
  • Document Management
  • Tutorial

    • Interacting with aiM18 via webservices
Tutorial
GitHub (opens new window)
  • base

    • Authentication
    • Common JSON Objects
    • Core Services
    • Enduser-driven Business Intelligence
    • Error Code Description
  • Business Process Management

    • Business Process Management
  • Schedule Management

    • Schedule Management
  • Document Management System

    • Document Management System
      • Search DMS File
        • HTTP Request
        • Parameters
        • Result
      • Download DMS File
        • HTTP Request
        • Parameters
        • Result
      • Method to Transfer File Password
  • Enterprise Resource Planning

    • README for ERP
    • Master Data
    • Sales
    • Purchase
    • Stock
    • Consignment
    • Subcontract
    • Production
    • Retail
    • Retail Stored Value
    • Warehouse Management Solution
    • Retail and Third-Party Logistics
    • Trading and Finance
    • Accounting
    • Accounting EBI
  • Human Capital Management

    • README for HCM
    • Attendance Management
    • Hong Kong Labour Law Compliance
    • Leave Management
    • Organization And Personnel Management
    • Payroll Management
    • PRC Labour Law Compliance
    • Appraisal Management
    • Attendance
    • Casual Labour
    • Personnel
    • Leave
    • Medical Claim Management
    • Payroll
    • Recruitment
    • Training & Sponsorship
  • Web Services
  • Document Management System
Multiable
2024-02-23
目录

Document Management System

Version: 1.2 | Release Date: 30/6/2023

# Search DMS File

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://127.0.0.1:8080/jsf/rfws/dms/searchFile?query=hk&target=attr;tag;content&limit=10&offset=0&sortField=title&sortOrder=desc")
  .get()
  .addHeader("authorization", "Bearer OGFiZmU2ZTktMzYzMS00NjIwLWJhNGYtYWU2OGQyNTZhMmNi")
  .addHeader("client_id", "C-SGF2aWQncyBhcHBsaWNhdGlvbjIwMTctMDItMTAxNjc=")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

# HTTP Request

GET http://127.0.0.1:8080/jsf/rfws/dms/searchFile?query=[Query String]&target=[search target]&limit=[limit size]&offset=[]&sortField=[The ordering field]&sortOrder=[sort order]

# Parameters

Name Description Default Example
query Query String (i.e. the string you want to seach) N/A (cannot be empty) Hk
target The parts you want to search, seaparted by colon ;. Available Options:
  • attr: File attributes include file title, author, tags.
  • tag: Header Tags and the file tags
  • content: The file content (the loading time might increase in such case)
N/A (cannot be empty) “attr;tag”
limit The number of records to be retrieved 1000 10
offset The offset (note that this will not be effective if limit is not defined.) 0 20
sortField The ordering field. Available options: title, lastModifyDate, createDate lastModifyDate title
sortOrder The ordering order (note that this will not be effective if sortField is not defined.) Available Options: asc, desc desc asc
authorization Required. Access Token obtained via Oauth2 string(Header)
client_id Required. When registered in [OAuth Applications], generated by the aiM18 string(Header)

# Result

If API runs success, status of the response will be 200. If API runs failed, status of the response will be 400, then it will return the CheckMsg. You can get a CheckMsg JSON array from the response header with key word 'error_info'.

Type Location Description
success Body A JSON array
fail Header(error_info) A CheckMsg

Success Example:

[
    {"lastModifyUser" : "admin",
     "extension" : "png",
     "needPassword" : "true",
     "lastModifyUid" : "5",
     "fileSize" : 125312.0,
     "createUser" : "admin",
     "id" : "35",
     "title" : "untitled23452889",
     "lastModifyDate" : "2016-12-02 17:57:26",
     "tags":""},
   {"lastModifyUser" : "test123",
     "extension" : "doc",
     "needPassword" : "true",
     "lastModifyUid" : "1",
     "fileSize" : 1755136.0,
     "createUser" : "admin",
     "id" : "33",
     "title" : "task121179_hkas_interfacex",
     "lastModifyDate" : "2017-03-10 17:57:26",
     "tags":""},
        
    }
]

Output Parameter:

Parameter Name Meaning
id ID of the file
title Title of the file
extension Extension of the file
fileSize File size of the file
tags Tags of the file
createUser Create User’s username of the file
createUid Create User’s ID of the file
createDate Date of create of the file
lastModifyUser Last Modify User’s username of the file
lastModifyUid Last Modify User’s ID of the file
lastModifyDate Date of last modify of the file
needPassword Whether the file is encrypted with password or not. *

# Download DMS File

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://127.0.0.1:8080/jsf/rfws/dms/getFile?id=10")
  .get()
  .addHeader("authorization", "Bearer OGFiZmU2ZTktMzYzMS00NjIwLWJhNGYtYWU2OGQyNTZhMmNi")
  .addHeader("client_id", "C-SGF2aWQncyBhcHBsaWNhdGlvbjIwMTctMDItMTAxNjc=")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

# HTTP Request

GET http://127.0.0.1:8080/jsf/rfws/dms/getFile?id=[Attachment ID]

# Parameters

Name Type Description
authorization string(Header) Required. Access Token obtained via Oauth2
client_id string(Header) Required. When registered in [OAuth Applications], generated by the aiM18
id long(Query) **Required.**AttachmentID
password string(Query) Requiredwhen the file is encrypted with password, Passwordof the attachment

# Result

If API runs success, status of the response will be 200. If API runs failed , status of the response will be 400, then it will return the CheckMsg. You can get a CheckMsg JSON array from the response header with key word 'error_info'.

Type Location Description
success Body a file
fail Header(error_info) A CheckMsg

# Method to Transfer File Password

Note that the attachment module supports password encryption to the file. If a user would like to pass the password to encrypt or decrypt the file, the user needs to first encrypt the password for security purpose. Our system uses AES mode to encrypt the password for web service transmission.

Here are the example codes:

	private static Key aesKey = new SecretKeySpec("Mac02017Dms02017".getBytes(), "AES");

	public static String encryptDmsTransferPassword(String password) {
		try {
			Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
			// encrypt the text
			cipher.init(Cipher.ENCRYPT_MODE, aesKey);
			byte[] encrypted = cipher.doFinal(password.getBytes());
			return DatatypeConverter.printHexBinary(encrypted);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}
Last Updated: 2025/05/13, 07:58:58
Schedule Management
README for ERP

← Schedule Management README for ERP→

Theme by Vdoing | Copyright © 1990-2025 Multiable | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式