edc httpd

Embedded httpd server to serve the help documentation published by edc

License

License

Categories

Categories

Java Languages
GroupId

GroupId

fr.techad
ArtifactId

ArtifactId

edc-httpd-java
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

edc httpd
Embedded httpd server to serve the help documentation published by edc
Project Organization

Project Organization

TECH advantage
Source Code Management

Source Code Management

https://github.com/tech-advantage/edc-httpd-java

Download edc-httpd-java

How to add to project

<!-- https://jarcasting.com/artifacts/fr.techad/edc-httpd-java/ -->
<dependency>
    <groupId>fr.techad</groupId>
    <artifactId>edc-httpd-java</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/fr.techad/edc-httpd-java/
implementation 'fr.techad:edc-httpd-java:1.2.0'
// https://jarcasting.com/artifacts/fr.techad/edc-httpd-java/
implementation ("fr.techad:edc-httpd-java:1.2.0")
'fr.techad:edc-httpd-java:jar:1.2.0'
<dependency org="fr.techad" name="edc-httpd-java" rev="1.2.0">
  <artifact name="edc-httpd-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='fr.techad', module='edc-httpd-java', version='1.2.0')
)
libraryDependencies += "fr.techad" % "edc-httpd-java" % "1.2.0"
[fr.techad/edc-httpd-java "1.2.0"]

Dependencies

compile (7)

Group / Artifact Type Version
com.networknt : server jar 1.5.13
ch.qos.logback : logback-classic jar 1.2.3
commons-io : commons-io jar 2.6
org.apache.commons : commons-lang3 jar 3.6
org.apache.lucene : lucene-core jar 7.3.1
org.apache.lucene : lucene-queryparser jar 7.3.1
org.jsoup : jsoup jar 1.11.3

Project Modules

There are no modules declared in this project.

edc httpd

edc httpd is an embedded httpd server to serve the edc documentation in standalone java application.

The server expose a web service to search in the content. The search is based on a query. The result is sorted as following :

  1. All documents which match the query in the label
  2. Then all documents which match the query in the content

The search is done only in the document and chapter. The bricks are ignored.

edc Version

Current release is compatible with edc v2.2+

How can I get the latest release?

You can pull it from the central Maven repositories:

Maven

<dependency>
  <groupId>fr.techad</groupId>
  <artifactId>edc-httpd-java</artifactId>
  <version>1.2.0</version>
</dependency>

Gradle

    compile group: 'fr.techad', name: 'edc-httpd-java', version: '1.2.0'

How can I search keyword in the content?

Use the web service : /httpd/api/search?query=YourQuery.

The query is based on Lucene. So you can create complex query with the lucene syntax query.

The wildcard is supported.

Example

The query: /httpd/api/search?query=httpd returns help documentations which contain the word httpd.

The query /httpd/api/search?query=httpd AND server returns help documentations which contain the words httpd AND server.

The query /httpd/api/search?query=http* returns help documentations which contain the words which start with http.

How can I reindex the content?

Use the web service : /httpd/api/reindex. This url can be called with your favorite browser (no mandatory to use curl)

Configuration

Define the path

In the src/main/java/resources folder, create the file: webserver.yml. Define the basevariable to define the path to the published documentation.

base: /local/edc-httpd/html

By default, the indexed content is stored in the folder .edc/index in the home user. It is possible to override this value with the variable indexPath. It is possible to activate an extra url to reindex the content on demand with the variable indexUrlEnabled. By default, this url is disabled. To reindex the content, call the url: /httpd/api/reindex.

Example

base: /local/edc-httpd/html
indexPath: /local/edc-httpd/.edc
indexUrlEnabled: true

Optional

It is possible to override the default port (8088). You have to create a server.yml file and define its content like this:

httpPort: 9000
ip: 0.0.0.0
enableHttp: true

Modify the httpPort to define the new port value.

Start the server

Based on the configuration file

To start the server, call EdcWebServer.run();

Example

package fr.techad.edc.demo;

import fr.techad.edc.httpd.EdcWebServer;

public class Main {
    public static void main(String[] args) {
        EdcWebServer.run();
        /* ... */
    }
}

With port scan

To start the server with a port scan, call EdcWebServer.run("slf4j", minPort, maxPort);. The server will start with the first free found port and return it.

Example

package fr.techad.edc.demo;

import fr.techad.edc.httpd.EdcWebServer;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try {
            // Scan port between 8080 and 9080
            int port = EdcWebServer.run("slf4j", 8080, 9080);
            /* ... */
        }
        catch(IOExeption e) {
            /* ... */
        }
        /* ... */
    }
}

License

MIT TECH'advantage

fr.techad

TECH'advantage

@techad_fr

Versions

Version
1.2.0
1.1.1
1.1.0
1.0.0