Skip to content

Commit

Permalink
Updated installation instructions for Neo4j 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mneedham committed Jul 14, 2020
1 parent c6ab443 commit 16581f3
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 51 deletions.
38 changes: 38 additions & 0 deletions docs/asciidoc/_installation.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[[installation]]
== Installation

[abstract]
--
This section contains instructions for installing the APOC standard library.
--

_APOC Core_ is packaged with Neo4j and can be found in the `$NEO4J_HOME/labs` directory.
_APOC Full_ can be downloaded using one of the methods described in the sections below.

[WARNING]
====
_APOC Full_ contains all the procedures and functions included in _APOC Core_.
You *must not* install both libraries.
====

=== APOC Core

_APOC Core_ can be installed by moving the APOC jar file from the `$NEO4J_HOME/labs` directory to the `$NEO4J_HOME/plugins` directory and restarting Neo4j.

=== Neo4j Desktop

include::../../readme.adoc[tags=install-desktop,leveloffset=2]
image::desktop-apoc.jpg[width=800]

=== Neo4j Server

include::../../readme.adoc[tags=install,leveloffset=2]

=== Docker

include::../../readme.adoc[tags=docker,leveloffset=1]


=== Restricted procedures/functions

include::../../readme.adoc[tags=warnings,leveloffset=1]
4 changes: 4 additions & 0 deletions docs/asciidoc/_usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[usage]]
== Usage

include::../../readme.adoc[tags=usage]
25 changes: 8 additions & 17 deletions docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ This is the user guide for Neo4j APOC {docs-version}, authored by the Neo4j Labs
The guide covers the following areas:

* <<introduction>> -- An Introduction to the APOC library.
* <<installation>> -- Installation instructions for the library.
* <<usage>> -- A usage example.
* <<help>> -- In-built help in the library.
* <<overview>> -- A list of all APOC procedures and functions.
* <<config>> -- Configuration options used by the library.
Expand Down Expand Up @@ -65,28 +67,17 @@ include::../../readme.adoc[tags=intro-text]
include::../../readme.adoc[tags=name-history-text]
====

Starting from Neo4j 4.1.1, there are two available versions of the APOC Library:

[[installation]]
=== Installation
_APOC Core_ :: battle hardened procedures and functions that don't have external dependencies or require configuration.
_APOC Full_ :: contains everything in APOC core, as well as additional procedures and functions.

include::../../readme.adoc[tags=install-desktop,leveloffset=2]
image::desktop-apoc.jpg[width=800]
A list of functions and procedures in _APOC Core_ and _APOC Full_ can be found in <<overview>>.

include::../../readme.adoc[tags=install,leveloffset=2]

include::../../readme.adoc[tags=warnings,leveloffset=1]

include::../../readme.adoc[tags=docker,leveloffset=1]

[[usage]]
=== Usage

include::../../readme.adoc[tags=usage]

[[feedback]]
=== Feedback
include::../../readme.adoc[tags=feedback]
include::_installation.adoc[]

include::_usage.adoc[]

include::help.adoc[]

Expand Down
6 changes: 6 additions & 0 deletions docs/docbook/content-map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<d:tocentry linkend="apoc"><?dbhtml filename="index.html"?>

<d:tocentry linkend="introduction"><?dbhtml filename="introduction/index.html"?>
</d:tocentry>

<d:tocentry linkend="installation"><?dbhtml filename="installation/index.html"?>
</d:tocentry>

<d:tocentry linkend="usage"><?dbhtml filename="usage/index.html"?>
</d:tocentry>

<d:tocentry linkend="help"><?dbhtml filename="help/index.html"?>
Expand Down
4 changes: 2 additions & 2 deletions docs/javascript/version.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
window.docMeta = (function () {
var version = '4.0';
var version = '4.1';
var name = 'apoc';
var href = window.location.href;
return {
name: name,
version: version,
availableDocVersions: ["3.5", "4.0"],
availableDocVersions: ["3.5", "4.0", "4.1"],
thisPubBaseUri: href.substring(0, href.indexOf(name) + name.length) + '/' + version,
unversionedDocBaseUri: href.substring(0, href.indexOf(name) + name.length) + '/',
commonDocsBaseUri: href.substring(0, href.indexOf(name) - 1)
Expand Down
28 changes: 22 additions & 6 deletions full/src/test/java/DocsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import org.reflections.scanners.TypeAnnotationsScanner;
import org.reflections.util.ConfigurationBuilder;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -147,17 +144,36 @@ public void generateDocs() {
docs.put("apoc.periodic.submit|apoc.periodic.schedule|apoc.periodic.list|apoc.periodic.countdown", "periodic-background");
docs.put("apoc.model.jdbc", "database-modeling");

Set<String> extended = new HashSet<>();
try (InputStream stream = getClass().getClassLoader().getResourceAsStream("extended.txt")) {
if (stream != null) {
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String name;
while ((name = reader.readLine()) != null) {
extended.add(name);
}
}
} catch (IOException e) {
// Failed to load extended file
}

try (Writer writer = new OutputStreamWriter( new FileOutputStream( new File(GENERATED_DOCUMENTATION_DIR, "documentation.csv")), StandardCharsets.UTF_8 ))
{
writer.write("¦type¦qualified name¦signature¦description¦documentation\n");
writer.write("¦type¦qualified name¦signature¦description¦core¦documentation\n");
for (Row row : rows) {

Optional<String> documentation = docs.keySet().stream()
.filter((key) -> Pattern.compile(key).matcher(row.name).matches())
.map(value -> String.format("<<%s>>", docs.get(value)))
.findFirst();

writer.write(String.format("¦%s¦%s¦%s¦%s¦%s\n", row.type, row.name, row.signature, row.description, documentation.orElse("")));
writer.write(String.format("¦%s¦%s¦%s¦%s¦%s¦%s\n",
row.type,
row.name,
row.signature,
row.description,
!extended.contains(row.name),
documentation.orElse("")));
}

}
Expand Down
49 changes: 23 additions & 26 deletions readme.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:readme:
:branch: 4.0
:branch: 4.1
:docs: https://neo4j.com/docs/labs/apoc/current
:apoc-release: 4.0.0.5
:neo4j-version: 4.0.0
:apoc-release: 4.1.0.0
:neo4j-version: 4.1.0
:img: https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/{branch}/docs/images

= Awesome Procedures for Neo4j {branch}.x
Expand Down Expand Up @@ -38,11 +38,13 @@ http://matrix.wikia.com/wiki/Apoc[Apoc^] was the technician and driver on board
// end::name-history-text[]
// end::name-history[]

// tag::install-desktop[]

== Installation: With Neo4j Desktop

APOC is easily installed with http://neo4j.com/download[Neo4j Desktop], after creating your database just go to the "Manage" screen and the "Plugins" tab.
Then click "Install" in the APOC box and you're done.
// tag::install-desktop[]

APOC Full can be installed with http://neo4j.com/download[Neo4j Desktop], after creating your database, by going to the `Manage` screen, and then the `Plugins` tab.
Click `Install` in the APOC box and wait until you see the "Installed" message.

// end::install-desktop[]
image::{img}/desktop-apoc.jpg[width=800]
Expand Down Expand Up @@ -142,11 +144,11 @@ h| Output Return Columns |

// end::signature[]

// tag::install[]

== Manual Installation: Download latest release

Since APOC relies in some places on Neo4j's internal APIs you need to use the *matching APOC version* for your Neo4j installaton.
// tag::install[]

Since APOC relies on Neo4j's internal APIs you need to use the *matching APOC version* for your Neo4j installaton.
Make sure that the *first two version numbers match between Neo4j and APOC*.

Go to http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/{apoc-release}[the latest release] for *Neo4j version {branch}* and download the binary jar to place into your `$NEO4J_HOME/plugins` folder.
Expand All @@ -157,19 +159,22 @@ You can find http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/[all

== Manual Configuration

// tag::warnings[]


[WARNING]
====
Procedures that use internal APIs have to be allowed in `$NEO4J_HOME/conf/neo4j.conf` with, e.g. `+dbms.security.procedures.unrestricted=apoc.*+` for security reasons.
// tag::warnings[]
For security reasons, procedures that use internal APIs are disabled by default.
They can be enabled by specifying config in `$NEO4J_HOME/conf/neo4j.conf` e.g. `+dbms.security.procedures.unrestricted=apoc.*+`
If you want to use this via docker, you need to amend `+-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*+` to your `docker run ...` command.
If you want to do this when using the Neo4j Docker container, you need to amend `+-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*+` to your `docker run ...` command.
The three backslashes are necessary to prevent wildcard expansions.
You _can_ also whitelist procedures and functions in general to be loaded using: `+dbms.security.procedures.whitelist=apoc.coll.*,apoc.load.*+`
// end::warnings[]
====

// end::warnings[]


// tag::version-matrix[]
=== Version Compatibility Matrix
Expand All @@ -182,13 +187,8 @@ The trailing `<apoc>` part of the version number will be incremented with every
[opts=header]
|===
|apoc version | neo4j version
<<<<<<< HEAD
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/4.0.0.7[4.0.0.7^] | 4.0.0 (4.0.x)
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.5.0.10[3.5.0.10^] | 3.5.16 (3.5.x)
=======
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/4.0.0.11[4.0.0.11#^] | 4.0.4 (4.0.x)
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/4.0.0.16[4.0.0.16#^] | 4.0.6 (4.0.x)
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.5.0.11[3.5.0.11^] | 3.5.16 (3.5.x)
>>>>>>> 457008c3... add docker instructions
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.4.0.4[3.4.0.6^] | 3.4.12 (3.4.x)
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.3.0.4[3.3.0.4^] | 3.3.6 (3.3.x)
| http://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/3.2.3.6[3.2.3.6^] | 3.2.9 (3.2.x)
Expand All @@ -211,11 +211,13 @@ To know your current `apoc` version you can use the *function* :
RETURN apoc.version();
----

// tag::docker[]


=== Using APOC with the Neo4j Docker image

APOC can be used with the https://hub.docker.com/_/neo4j/[Neo4j Docker image] via the `NEO4JLABS_PLUGINS` environment variable.
// tag::docker[]

APOC Full can be used with the https://hub.docker.com/_/neo4j/[Neo4j Docker image] via the `NEO4JLABS_PLUGINS` environment variable.
If we use this environment variable, the APOC plugin will be downloaded and configured at runtime.

[NOTE]
Expand Down Expand Up @@ -271,11 +273,6 @@ docker run \
neo4j
----

====
If you want to allow APOC's procedures that use internal APIs, you need to amend `+-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*+` to your `docker run ...` command.
The three backslashes are necessary to prevent wildcard expansions.
====
// end::docker[]
// tag::build[]

Expand Down

0 comments on commit 16581f3

Please sign in to comment.