|
|
## Command-Line Interface
|
|
|
|
|
|
These pages summarises the ideas about the command-line interface for Datovka.
|
|
|
|
|
|
### Background
|
|
|
|
|
|
Several users have been complaining about a missing CLI. Their wish is to have an interface that could:
|
|
|
|
|
|
* send a message
|
|
|
* check for new messages
|
|
|
* extract a message
|
|
|
* extract content of new messages
|
|
|
|
|
|
The client should not provide any means of sending messages via e-mail. Should only provide a command-line interface for the most common actions with ISDS so that these actions could be incorporated into scripts.
|
|
|
|
|
|
### Inspiration
|
|
|
|
|
|
The command-line interface should resemble [Thunderbird CLI](http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29). Also, there exists a command-line ISDS client called [shigofumi](http://xpisar.wz.cz/shigofumi/) :smiley_cat:. It may be useful to have a look at its CLI too.
|
|
|
|
|
|
## Current CLI
|
|
|
|
|
|
```
|
|
|
Usage: datovka [ options ] [ zfo-file ]
|
|
|
```
|
|
|
|
|
|
#### Options:
|
|
|
* **-h**, **--help** - Displays this help.
|
|
|
* **-v**, **--version** - Displays version information.
|
|
|
* **-D**, **--debug** - Enable logging of debugging information.
|
|
|
* **-L**, **--log-verbosity _level_** - Set verbosity of logged messages to *level*.
|
|
|
* **-V**, **--debug-verbosity _level_** - Set debugging verbosity to *level*.
|
|
|
|
|
|
* **--conf-subdir _conf-subdir_** - Use *conf-subdir* subdirectory for configuration.
|
|
|
* **--load-conf _conf_** - On start load *conf* file.
|
|
|
* **--save-conf _conf_** - On stop save *conf* file.
|
|
|
|
|
|
* **--connect** - Logint into databox. It is mandatory for following services. If Datovka already knows the login information for the related account then the supplied information will be ignored.
|
|
|
|
|
|
#### Arguments:
|
|
|
**zfo-file** - ZFO file to be viewed.
|
|
|
|
|
|
## Proposed CLI
|
|
|
|
|
|
The following options (services) are related to actions that should be performed.
|
|
|
|
|
|
#### Service Names:
|
|
|
* **--get-msg-list** - Download list of received/sent messages.
|
|
|
* **--send-msg** - Create and send a new message.
|
|
|
* **--download-msg** - Download complete message with signature and time stamp MV.
|
|
|
* **--download-delivery-info** - Download delivery info of message with signature and time stamp MV.
|
|
|
* **--get-user-info** - Get information about user and its role and privileges.
|
|
|
* **--get-owner-info** - Get information about owner and its databox.
|
|
|
* **--check-attachment** - Get list of messages where attachment missing (local database only).
|
|
|
|
|
|
#### *string_of_parameters* has format:
|
|
|
|
|
|
```
|
|
|
"param_1='value_1',param_2='value_2', .... param_n='value_n'"
|
|
|
```
|
|
|
|
|
|
#### List of supported parameters for services:
|
|
|
|
|
|
**--connect**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
* *method* - Login method. Values: {user,cert,totp,hotp}. Note: totp = sms code; hotp = security code; Default is user. [Mandatory]
|
|
|
* *type* - Account type. Values: {test,std}. Default is std. [Mandatory]
|
|
|
* *password* - Password. Maximal length is 50 characters. [Mandatory]
|
|
|
* *certificate* - Path to certificate file (DER, PEM). [Optional]
|
|
|
* *otpcode* - Certificate password | Hardware/SMS security code. [Optional]
|
|
|
|
|
|
Return [status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --connect "method='certificate',type='std',username='xxxxxx',password='yyyyyyyy',certificate='C:\temp\certificate.pem'"
|
|
|
```
|
|
|
|
|
|
**--get-msg-list**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
* *dmType* - Type of messages. Values: {sent,received,all}, default is received. [Mandatory]
|
|
|
* *dmStatusFilter* - Filter focused on the message status. Value: {1,2,...,10} - see ISDS for more info, default is -1 = (all message status). [Optional]
|
|
|
* *dmLimit* - Limit of returned messages. Maximal value is 10000. [Optional]
|
|
|
* *dmFromTime* - Delivery time from. Format: YYYY-MM-DD. [Optional] **WARNING: not supported now!**
|
|
|
* *dmToTime* - Delivery time to. Format: YYYY-MM-DD. [Optional] **WARNING: not supported now!**
|
|
|
|
|
|
Return [msgIdList, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --get-msg-list "username='xxxxxx',dmType='received',dmStatusFilter='6'"
|
|
|
```
|
|
|
|
|
|
**--send-msg**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
* *dbIDRecipient* - Box ID of recipient. Length is 7 characters. [Mandatory]
|
|
|
* *dmAnnotation* - Subject (title) of the message. Maximal length is 255 characters. [Mandatory]
|
|
|
* *dmToHands* - Person in recipient organisation. Maximal length is 50 characters. [Optional]
|
|
|
* *dmRecipientRefNumber* - Czech: číslo jednací příjemce. Maximal length is 50 characters. [Optional]
|
|
|
* *dmSenderRefNumber* - Czech: číslo jednací odesílatele. Maximal length is 50 characters. [Optional]
|
|
|
* *dmRecipientIdent* - Czech: spisová značka příjemce. Maximal length is 50 characters. [Optional]
|
|
|
* *dmSenderIdent* - Czech: spisová značka odesílatele. Maximal length is 50 characters. [Optional]
|
|
|
* *dmLegalTitleLaw* - Number of act mandating authority. Maximal length is 4 characters. [Optional]
|
|
|
* *dmLegalTitleYear* - Year of act issue mandating authority. Maximal length is 4 characters. [Optional]
|
|
|
* *dmLegalTitleSect* - Section of act mandating authority (paragraf). Maximal length is 10 characters. [Optional]
|
|
|
* *dmLegalTitlePar* - Paragraph of act mandating authority (odstavec). Maximal length is 10 characters. [Optional]
|
|
|
* *dmLegalTitlePoint* - Point of act mandating authority (písmeno). Maximal length is 1 characters. [Optional]
|
|
|
* *dmPersonalDelivery* - If true, only person with higher privileges can read this message. Values: {0,1}, default is 1.
|
|
|
* *dmAllowSubstDelivery* - Allow delivery through fiction. Values: {0,1}, default is 1.
|
|
|
* *dmType* - Message type (commercial subtypes or government message). Maximal length is 1 character. Values: {I,K,O,V} [Optional]
|
|
|
* *dmOVM* - OVM sending mode. Values: {0,1}, default is 1.
|
|
|
* *dmPublishOwnID* - Allow sender to express his name shall be available to recipient. Values: {0,1}, default is 0.
|
|
|
* *dmAttachment* - Full path to target files separated by semicolon. NOTE: "Semicolon" is not allowed in attachment path or file name! It can cause failure during parse of parameter string. [Mandatory]
|
|
|
|
|
|
Return [dmID, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --send-msg "username='xxxxxx',dbIDRecipient='zzzzzzz',dmAnnotation='Example',dmPersonalDelivery='1',dmAllowSubstDelivery='1',dmOVM='0',dmPublishOwnID='0',dmAttachment='C:\temp\info.doc;C:\temp\food.doc'"
|
|
|
```
|
|
|
|
|
|
**--download-msg**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
* *dmID* - Message ID. Maximal length 20 characters. [Mandatory]
|
|
|
* *dmType* - Type of messages. Values: {sent,received}, default is received. [Mandatory]
|
|
|
|
|
|
Return [msgStruct, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --download-msg "username='xxxxxx',dmID='123456789',dmType='received'"
|
|
|
```
|
|
|
|
|
|
**--download-delivery-info**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
* *dmID* - Message ID. Maximal length 20 characters. [Mandatory]
|
|
|
|
|
|
Return [deliveryStruct, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --download-delivery-info "username='xxxxxx',dmID='123456789'"
|
|
|
```
|
|
|
|
|
|
**--get-user-info**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
|
|
|
Return [userInfoStruct, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --get-user-info "username='xxxxxx'"
|
|
|
```
|
|
|
|
|
|
**--get-owner-info**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
|
|
|
Return [ownerInfoStruct, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --get-owner-info "username='xxxxxx'"
|
|
|
```
|
|
|
|
|
|
|
|
|
**--check-attachment**
|
|
|
* *username* - Username. Length is 6 characters. [Mandatory]
|
|
|
|
|
|
Return [msgIDsList, status]
|
|
|
|
|
|
Example:
|
|
|
|
|
|
```
|
|
|
datovka --check-attachment "username='xxxxxx'"
|
|
|
``` |
|
|
\ No newline at end of file |