orientechnologies / orientechnologies/orientdb-docs

Dynamic Hook docs missing critical information

Open
#167 1 comment 0 reactions 1 assignee View on GitHub

@santo-it is already working on this.

Since Nov 25, 2016.

enhancement
Dominant language
CSS
Stars
59
Forks
165
PR merge metrics
No merged PRs in 30d

Description

The following page is missing critical information:
http://orientdb.com/docs/last/Dynamic-Hooks.html

Java static methods

Dynamic Hooks can call:

  • Functions, written in SQL, Javascript or any language supported by OrientDB and JVM
  • Java static methods
    There isn't any mention of how a dynamic hook can call a java static method.

Delete hook

A section should be added describing how to delete a hook. For example:

To delete a hook, set the event value to null
e.g. ALTER CLASS Invoice CUSTOM onAfterCreate=null

Variables available inside the hook

Add a description for all of the variables that are provided inside of a hook.
For example:

In a javascript hook, a var called "doc" is provided that represents the current document.

Describing a few common use cases would be helpful such

  1. Retrieving old vs new values of a doc
  2. Getting the correct OrientBaseGraph from the document

For example

var db = doc.getDatabase();
var orientBaseGraph =(db.getTransaction().isActive())
    ?new com.tinkerpop.blueprints.impls.orient.OrientGraph(db)
    :new com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx(db);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.