Skip to content

Commit cf4eaaa

Browse files
committed
[neo4j] Finalize neo4j plugin
- Change plugin version to 4.0.0 (4 is for the neo4j version) - Adding neo4j logo - Using one Bundle.properties - Using Bindle.properties for plugin's name, description, ... - Adding some text on UI forms to help the user - Writting readme.md - Code format/improt
1 parent 168f2c4 commit cf4eaaa

16 files changed

Lines changed: 335 additions & 136 deletions

modules/Neo4jPlugin/README.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,55 @@
11
## Neo4j plugin
22

3-
This plugin allows you to import a network from Neo4j database 4.X.
3+
This plugin allows you to import a network from a Neo4j database 4.X.
44

5-
Two modes are availables :
5+
### Import
6+
7+
#### Step 1: Neo4j connection
8+
9+
To import data from Neo4J, you must define how to connect to the Neo4j server.
10+
The plugin uses the official Neo4j driver with neo4j/bolt protocol.
11+
12+
So to create a connection to the database you must fill :
13+
14+
- Neo4j URL (ex: `neo4j://localhost` )
15+
- Database : If empty we will use the default database
16+
- Authentication : Select the authentication mechanism. We support "username/password" and "No authentication" modes.
17+
- Username : Neo4j user with whom you want to connect to the database (ex: `neo4j`)
18+
- Password: Neo4j user's password
19+
20+
You can click on the button *Verify* to test the connection to the database with the provided values.
21+
If an error occurred, its message will be displayed.
22+
23+
#### Step 2: Import configuration
24+
25+
There are two import modes available :
26+
27+
- By selecting labels and relationship types
28+
- By specifying two Cypher queries, one for nodes and the other for edges.
29+
30+
##### By labels and relationship types
31+
32+
On this screen you have two list one for nodes, and the other for edges.
33+
If you select nothing, it's the same as selecting everything.
34+
35+
So for example, if it's the first time you see this screen, you can click on *Finish*, and the plugin will import the whole Neo4j otherwise.
36+
37+
If you want to import a subset of your Neo4j database, you must provide a selection.
38+
In order to do a multi-selection, just use *ctrl + click*.
39+
40+
NOTE: We only import relationships where node extremities are part from the labels selections.
41+
42+
##### By queries
43+
44+
On this screen you can define two Cypher queries :
45+
46+
- One for retrieving nodes
47+
- The other for edges
48+
49+
With this configuration, you can define precisely what you want to import.
50+
It's really useful when you want to project your graph (ex: create the colleagues graph when in your database you have `(:Person)-[:WORK_AT]->(:Company)` )
51+
52+
The node query must return a field named *id* that is the unique identifier of your node.
53+
The edge query must return a field named *id* that is the unique identifier of your edge, but also a *sourceId* & *targetId* that must match an id from the node query
654

7-
- Import just a set of node labels and relationship types
8-
- Import by specifying a query for nodes and edges
955

modules/Neo4jPlugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<groupId>ouestware</groupId>
1212
<artifactId>neo4j-plugin</artifactId>
1313
<name>Neo4j Plugin</name>
14-
<version>1.0.0</version>
14+
<version>4.0.0</version>
1515
<packaging>nbm</packaging>
1616

1717
<properties>
12.7 KB
Loading

modules/Neo4jPlugin/src/main/java/org/gephi/plugins/neo4j/importer/Neo4jDatabaseImporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ private Object neo4jValueToGephi(Value value) {
449449

450450
/**
451451
* Create an
452+
*
452453
* @param list
453454
* @param <T>
454455
* @return

modules/Neo4jPlugin/src/main/java/org/gephi/plugins/neo4j/importer/wizard/Neo4jDatabaseImporterConnectionPanel.form

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<AuxValues>
55
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
66
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
7+
<AuxValue name="FormSettings_formBundle" type="java.lang.String" value="org/gephi/plugins/neo4j/Bundle"/>
78
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
89
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
910
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
@@ -17,7 +18,7 @@
1718
<Component class="javax.swing.JLabel" name="dbUrlLabel">
1819
<Properties>
1920
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
20-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUrlLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
21+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUrlLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
2122
</Property>
2223
<Property name="name" type="java.lang.String" value="dbUrlLabel" noResource="true"/>
2324
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -34,7 +35,7 @@
3435
<Component class="javax.swing.JTextField" name="dbUrl">
3536
<Properties>
3637
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
37-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUrl.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
38+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUrl.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
3839
</Property>
3940
<Property name="name" type="java.lang.String" value="dbUrl" noResource="true"/>
4041
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -50,7 +51,7 @@
5051
<Component class="javax.swing.JLabel" name="dbUsernameLabel">
5152
<Properties>
5253
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
53-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUsernameLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
54+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUsernameLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
5455
</Property>
5556
</Properties>
5657
<Constraints>
@@ -62,7 +63,7 @@
6263
<Component class="javax.swing.JTextField" name="dbUsername">
6364
<Properties>
6465
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
65-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUsername.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
66+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbUsername.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
6667
</Property>
6768
<Property name="name" type="java.lang.String" value="dbUsername" noResource="true"/>
6869
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@@ -78,7 +79,7 @@
7879
<Component class="javax.swing.JLabel" name="dbPasswordLabel">
7980
<Properties>
8081
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
81-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbPasswordLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
82+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbPasswordLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
8283
</Property>
8384
</Properties>
8485
<Constraints>
@@ -89,9 +90,6 @@
8990
</Component>
9091
<Component class="javax.swing.JPasswordField" name="dbPassword">
9192
<Properties>
92-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
93-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbPassword.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
94-
</Property>
9593
<Property name="name" type="java.lang.String" value="dbPassword" noResource="true"/>
9694
</Properties>
9795
<Constraints>
@@ -103,7 +101,7 @@
103101
<Component class="javax.swing.JButton" name="checkBtn">
104102
<Properties>
105103
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
106-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.checkBtn.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
104+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.checkBtn.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
107105
</Property>
108106
</Properties>
109107
<Events>
@@ -118,7 +116,7 @@
118116
<Component class="javax.swing.JLabel" name="dbNameLabel">
119117
<Properties>
120118
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
121-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbNameLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
119+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbNameLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
122120
</Property>
123121
</Properties>
124122
<Constraints>
@@ -129,11 +127,8 @@
129127
</Component>
130128
<Component class="javax.swing.JTextField" name="dbName">
131129
<Properties>
132-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
133-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbName.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
134-
</Property>
135130
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
136-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbName.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
131+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbName.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
137132
</Property>
138133
</Properties>
139134
<Constraints>
@@ -145,7 +140,7 @@
145140
<Component class="javax.swing.JLabel" name="dbAuthTypeLabel">
146141
<Properties>
147142
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
148-
<ResourceString bundle="org/gephi/plugins/neo4j/importer/wizard/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbAuthTypeLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
143+
<ResourceString bundle="org/gephi/plugins/neo4j/Bundle.properties" key="Neo4jDatabaseImporterConnectionPanel.dbAuthTypeLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
149144
</Property>
150145
</Properties>
151146
<Constraints>

modules/Neo4jPlugin/src/main/java/org/gephi/plugins/neo4j/importer/wizard/Neo4jDatabaseImporterConnectionPanel.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3-
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JPanel.java to edit this template
4-
*/
51
package org.gephi.plugins.neo4j.importer.wizard;
62

73
import javax.swing.*;
@@ -35,7 +31,7 @@ public void checkValidity() throws Exception {
3531
if (this.dbAuthType.getSelectedIndex() == 0)
3632
Utils.neo4jCheckConnection(dbUrl.getText(), dbUsername.getText(), dbPassword.getText(), dbName.getText());
3733
else
38-
Utils.neo4jCheckConnection(dbUrl.getText(),null, null, dbName.getText());
34+
Utils.neo4jCheckConnection(dbUrl.getText(), null, null, dbName.getText());
3935

4036
}
4137

@@ -110,7 +106,6 @@ private void initComponents() {
110106
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
111107
add(dbPasswordLabel, gridBagConstraints);
112108

113-
dbPassword.setText(org.openide.util.NbBundle.getMessage(Neo4jDatabaseImporterConnectionPanel.class, "Neo4jDatabaseImporterConnectionPanel.dbPassword.text_1")); // NOI18N
114109
dbPassword.setName("dbPassword"); // NOI18N
115110
gridBagConstraints = new java.awt.GridBagConstraints();
116111
gridBagConstraints.gridx = 2;
@@ -137,7 +132,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
137132
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
138133
add(dbNameLabel, gridBagConstraints);
139134

140-
dbName.setText(org.openide.util.NbBundle.getMessage(Neo4jDatabaseImporterConnectionPanel.class, "Neo4jDatabaseImporterConnectionPanel.dbName.text_1")); // NOI18N
141135
dbName.setToolTipText(org.openide.util.NbBundle.getMessage(Neo4jDatabaseImporterConnectionPanel.class, "Neo4jDatabaseImporterConnectionPanel.dbName.toolTipText")); // NOI18N
142136
gridBagConstraints = new java.awt.GridBagConstraints();
143137
gridBagConstraints.gridx = 2;

modules/Neo4jPlugin/src/main/java/org/gephi/plugins/neo4j/importer/wizard/Neo4jDatabaseImporterConnectionWizard.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public HelpCtx getHelp() {
2323

2424
@Override
2525
public void readSettings(Object settings) {
26-
this.component.getDbUrl().setText(Utils.isEmptyOrNull(Neo4jImporterWizardData.dbUrl) ? "neo4j://localhost" : Neo4jImporterWizardData.dbUrl);
26+
this.component.getDbUrl().setText(Utils.isEmptyOrNull(Neo4jImporterWizardData.dbUrl) ? "neo4j://localhost" : Neo4jImporterWizardData.dbUrl);
2727
this.component.getDbName().setText(Neo4jImporterWizardData.dbName != null ? Neo4jImporterWizardData.dbName : "");
2828
this.component.getDbAuthType().setSelectedIndex(Neo4jImporterWizardData.dbAuthType != null ? Neo4jImporterWizardData.dbAuthType : 0);
29-
this.component.getDbUsername().setText(Utils.isEmptyOrNull(Neo4jImporterWizardData.dbUsername ) ? "neo4j" : Neo4jImporterWizardData.dbUsername);
29+
this.component.getDbUsername().setText(Utils.isEmptyOrNull(Neo4jImporterWizardData.dbUsername) ? "neo4j" : Neo4jImporterWizardData.dbUsername);
3030
this.component.getDbPassword().setText(Neo4jImporterWizardData.dbPassword != null ? Neo4jImporterWizardData.dbPassword : "");
3131
}
3232

0 commit comments

Comments
 (0)