Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Griffon
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h1>Description</h1> <p>The Neo4j plugin enables lightweight access to database functionality using <a href="http://neo4j.org">Neo4j</a>. This plugin does <strong>NOT</strong> provide domain classes nor dynamic finders like GORM does.</p> <h1>Installation</h1> <p>The current version of <strong>griffon-neo4j</strong> is <strong>0.4</strong><br /> To install just issue the following command</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> griffon install-plugin neo4j </pre></td></tr></table> <h1>Usage</h1> <p>Upon installation the plugin will generate the following artifacts at <code>$appdir/griffon-app/conf</code>:</p> <ul> <li>Neo4jConfig.groovy - contains the database definition properties.</li> <li>BootstrapNeo4j.groovy - defines init/destroy hooks for data to be manipulated during app startup/shutdown.</li> </ul> <p>A new dynamic method named <code>withNeo4j</code> will be injected into all controllers, giving you access to a <code>org.neo4j.graphdb.GraphDatabaseService</code> object, with which you'll be able to make calls to the database. Remember to make all calls to the database off the EDT otherwise your application may appear unresponsive when doing long computations inside the EDT.<br /> This method is aware of multiple datasources. If no datasourceName is specified when calling it then the <code>default</code> dataSource will be selected. Here are two example usages, the first queries against the default datasource while the second queries a datasource whose name has been configured as 'internal'</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> package sample class SampleController { def queryAllDataSources = { withNeo4j { dsName, graphdb -> ... } withNeo4j('internal') { dsName, graphdb -> ... } } } </pre></td></tr></table> <p>This method is also accessible to any component through the singleton <code>griffon.plugins.neo4j.Neo4jConnector</code>. You can inject these methods to non-artifacts via metaclasses. Simply grab hold of a particular metaclass and call <code>Neo4jConnector.enhance(metaClassInstance)</code>.</p> <h2>Scripts</h2> <ul> <li><strong>create-relationship-type</strong> - creates a new enum that implements <code>RelationshipType</code> at <code>src/main</code>.</li> </ul> <h1>Configuration</h1> <h3>Dynamic method injection</h3> <p>The <code>withNeo4j()</code> dynamic method will be added to controllers by default. You can change this setting by adding a configuration flag in <code>Config.groovy</code></p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> griffon.neo4j.injectInto = ["controller", "service"] </pre></td></tr></table> <h2>Events</h2> <p>The following events will be triggered by this addon</p> <ul> <li><strong>Neo4jConnectStart[config, databaseName]</strong> - triggered before connecting to the datastore</li> <li><strong>Neo4jConnectEnd[databaseName, db]</strong> - triggered after connecting to the datastore</li> <li><strong>Neo4jDisconnectStart[config, databaseName, db]</strong> - triggered before disconnecting from the datastore</li> <li><strong>Neo4jDisconnectEnd[config, databaseName]</strong> - triggered after disconnecting from the datastore</li> </ul> <h2>Multiple DataSources</h2> <p>The config file <code>Neo4jConfig.groovy</code> defines a <code>default</code> dataSource block. As the name implies this is the dataSource used by default, however you can configure named dataSources by adding a new config block. For example connecting to a dataSource whose name is 'internal' can be done in this way</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> databases { internal { params = [:] storeDir = 'neo4j/internal' } } </pre></td></tr></table> <p>This block can be used inside the <code>environments()</code> block in the same way as the default database block is used.</p> <h2>Example</h2> <p>A trivial sample application can be found at <a href="https://github.com/aalmiray/griffon_sample_apps/tree/master/persistence/neo4j">https://github.com/aalmiray/griffon_sample_apps/tree/master/persistence/neo4j</a></p> <h1>History</h1> <table class="confluenceTable"><tbody> <tr> <th class="confluenceTh"><p> Version </p></th> <th class="confluenceTh"><p> Date </p></th> <th class="confluenceTh"><p> Notes </p></th> </tr> <tr> <td class="confluenceTd"><p> 0.4 </p></td> <td class="confluenceTd"><p> 10-21-11 </p></td> <td class="confluenceTd"><p> Release sync with Griffon 0.9.4 </p></td> </tr> <tr> <td class="confluenceTd"><p> 0.3.1 </p></td> <td class="confluenceTd"><p> 11-08-10 </p></td> <td class="confluenceTd"><p> Fix a metaclass problem when injecting dynamic methods </p></td> </tr> <tr> <td class="confluenceTd"><p> 0.3 </p></td> <td class="confluenceTd"><p> 10-27-10 </p></td> <td class="confluenceTd"><p> Release sync with Griffon 0.9.1 </p></td> </tr> <tr> <td class="confluenceTd"><p> 0.2 </p></td> <td class="confluenceTd"><p> 07-22-10 </p></td> <td class="confluenceTd"><p> Release sync with Griffon 0.9 </p></td> </tr> <tr> <td class="confluenceTd"><p> 0.1 </p></td> <td class="confluenceTd"><p> 03-25-10 </p></td> <td class="confluenceTd"><p> Initial release </p></td> </tr> </tbody></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced