Skip to content

Commit

Permalink
move to gulp ; add generic request function ; fix bugs in service_req…
Browse files Browse the repository at this point in the history
…uest ; make service_request provide result data even on error ; fix license header ; update eslint checkers ; add index, unindex, remove and getRunningTasks ; organize
  • Loading branch information
Enet4 committed Nov 7, 2015
1 parent a3f0165 commit f170cbd
Show file tree
Hide file tree
Showing 15 changed files with 413 additions and 314 deletions.
9 changes: 7 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"ecmaFeatures": {
"modules": true
},
"env": {
"commonjs": true
"commonjs": true,
"es6": true
},
"rules": {
"no-alert": 0,
Expand All @@ -20,6 +24,7 @@
"no-extra-semi": 1,
"key-spacing": 1,
"semi-spacing": 1,
"eol-last": 1
"eol-last": 1,
"no-undef": 1
}
}
25 changes: 5 additions & 20 deletions .eslintrc.browser
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
{
"extends": ".eslintrc",
"globals": {
"XDomainRequest": false
},
"env": {
"commonjs": true,
"browser": true
},
"rules": {
"no-alert": 0,
"no-console": 0,
"quotes": 0,
"curly": 0,
"global-strict": 0,
"new-cap": 0,
"no-unused-vars": 0,
"comma-spacing": 0,
"space-infix-ops": 0,
"no-trailing-spaces": 0,
"camelcase": 0,
"comma-dangle": 1,
"no-mixed-spaces-and-tabs": 1,
"no-multi-spaces": 1,
"no-extra-semi": 1,
"key-spacing": 1,
"semi-spacing": 1,
"eol-last": 1,
"no-undef": 2
"no-undef": 1
}
}
23 changes: 1 addition & 22 deletions .eslintrc.node
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
{
"extends": ".eslintrc",
"env": {
"commonjs": true,
"node": true
},
"rules": {
"no-alert": 0,
"no-console": 0,
"quotes": 0,
"curly": 0,
"global-strict": 0,
"new-cap": 0,
"no-unused-vars": 0,
"comma-spacing": 0,
"space-infix-ops": 0,
"no-trailing-spaces": 0,
"camelcase": 0,
"comma-dangle": 1,
"no-mixed-spaces-and-tabs": 1,
"no-multi-spaces": 1,
"no-extra-semi": 1,
"key-spacing": 1,
"semi-spacing": 1,
"eol-last": 1,
"no-undef": 2
}
}
63 changes: 0 additions & 63 deletions Gruntfile.js

This file was deleted.

28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
This is a web service client API to [Dicoogle](http://www.dicoogle.com), the open-source PACS archive, for use in JavaScript applications.
This library is compatible with browser-based JavaScript and Node.js. A CLI application for searching medical images in Dicoogle is also included (`dicoogle-query`).

## Using the CLI client

Install this package globally (`npm install -g dicoogle-client`), then run `dicoogle-query --help` for usage instructions.

## Using the JavaScript API
### Using the JavaScript API

In Node.js and Browserify, install "dicoogle-client" with `npm` and `require` the "dicoogle-client" module.

Expand All @@ -20,17 +16,18 @@ var DicoogleClient = require("dicoogle-client");
When not using Browserify, simply include the "dist/dicoogle-client.min.js" file as a script, thus exposing `DicoogleClient`.

```HTML
<script src='./dist/dicoogle-client.min.js'></script>
<script src='/path/to/my/libs/dicoogle-client.min.js'></script>
```

Afterwards, invoke the `DicoogleClient` module with the Dicoogle server's endpoint to obtain an access object. The object may then be used multiple times.
Afterwards, invoke the `DicoogleClient` module with the Dicoogle server's endpoint to obtain an access object. The object is a singleton that can be used multiple times.
Calling the module function again will change the Dicoogle base URL of that object, or retain the address if no argument is passed.

```JavaScript
var Dicoogle = DicoogleClient("localhost:8080");

...

Dicoogle.search("(PatientName:Pinho^Eduardo)", function(error, result) {
Dicoogle.search("(PatientName:Pinho^Eduardo)", 'lucene', function(error, result) {
if (error) {
console.log(error);
return;
Expand All @@ -39,16 +36,23 @@ Dicoogle.search("(PatientName:Pinho^Eduardo)", function(error, result) {
});
```

At the moment, the documentation of the API can be read directly in the src/dicoogle-client.js source file's documented functions.
A clearer documentation may become available in the future.

The repository includes two examples of dicoogle-client for simple querying:

- "dicoogle-query-cli.js" is a complete stand-alone Node.js application for querying Dicoogle. This is the source code of the `dicoogle-query` application.
- "app.html" is a web page demonstrating simple querying.
- "bin/dicoogle-query-cli.js" is a complete stand-alone Node.js application for querying Dicoogle. This is the source code of the `dicoogle-query` executable.
- "example/app.html" is a web page demonstrating simple querying.

### Using the CLI client

Install this package globally (`npm install -g dicoogle-client`), then run `dicoogle-query --help` for usage instructions.

## Further Notice
### Further Notice

This library is compatible with versions of Dicoogle in the range `>=2.0.0 <2.2.0`. This client wrapper can be updated as new services emerge.

## License
### License

Copyright (C) 2015 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/

Expand Down
File renamed without changes.
138 changes: 0 additions & 138 deletions dicoogle-client.js

This file was deleted.

File renamed without changes.
Loading

0 comments on commit f170cbd

Please sign in to comment.