Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/technical-reference/writing-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ sample-extension/

The sub-directory `MOD-INF` contains the Butterfly module's metadata and is what Butterfly looks for when it scans directories for modules. `MOD-INF` serves similar functions as `WEB-INF` in other web frameworks.

Java code is built into the sub-directory `classes` inside `MOD-INF`, and supporting external Java jars are in the `lib` sub-directory. Those will be automatically loaded by Butterfly. (The build.xml script is wired to compile into the `classes` sub-directory.)
Java code is built into the sub-directory `classes` inside `MOD-INF`, and supporting external Java jars are in the `lib` sub-directory. Those will be automatically loaded by Butterfly. (Maven is configured to compile into the `classes` sub-directory.)

Client-side code is in the inner `module` sub-directory. They can be plain old .html, .css, .js, and image files. There are also Velocity .vt files, but they need to be routed inside `MOD-INF/controller.js`.

Expand Down Expand Up @@ -315,15 +315,15 @@ Packages.com.google.refine.model.Project.registerOverlayModel(
Note that you register the **class** , not an instance. The class should implement the following static method for reconstructing an overlay model instance from a JSON blob:

```
static public OverlayModel reconstruct(JSONObject o) throws JSONException {
static public OverlayModel reconstruct(ObjectNode o) throws IOException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for identifying the obsolete reference, but the update isn't a one-to-one replacement. You'll need to check the new code to figure out the proper documentation.

...
}
```

When the project gets saved, the overlay model instance's `write` method will be called:

```
public void write(JSONWriter writer, Properties options) throws JSONException {
public void writeJSON(ObjectMapper writer) throws JsonProcessingException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above. There is no writeJSON method. The documentation on migrating legacy extensions might have the necessary information which could be used to update this.

...
}
```
Expand Down