EN4J 1.0M2 released - Evernote Java Client

I finally decided to release the project I was working on the last year: A java desktop client for the Evernote service. The distributions for Mac OS X, Linux and Windows can be found on the downloads page. And the source code can be accesses and forked from the git repository on github. The README for EN4J-1.0M2 EN4J What is it? ----------- EN4J is a client to the Evernote services written in Java. It designed to become a replacement to the Evernote client for Windows & Mac. Although currently EN4J is a read-only client and cannot fully replace the official Evernote client. Features -------- * Fast search based on Lucene * Indexing of word documents, zip files, etc. All doc types supported by Apache Tika * Based on Netbeans Platform, runs on Windows, Mac OS X and Linux * Open source TO DO ----- * Editable notes * tags * Keyring api * Rich-text clipboard copy * Ignore diacritical marks during search Bugs ---- If you find any write a bug report on http://github.com/ecerulm/en4j/issues How to build and install ------------------------ First, grab the source from github git clone git://github.com/ecerulm/en4j.git Then proceed to the main directory cd en4j/NBPlatformApp to build the windows zip distribution do ant build-zip to build the mac os x distribution do ant build-mac Then take the output file in NBPlatformApp/dist Contribute ---------- Just fork the project from http://github.com/ecerulm/en4j and send me a pull request with the changes. Licensing --------- Please see the file called LICENSE. Credits ------- Netbeans team for the Netbeans Plaform and Netbeans IDE icons: Tango Icon Library http://tango.freedesktop.org/Tango_Icon_Library icons: Nuvola http://www.icon-king.com/projects/nuvola/ icons: Crystal project http://www.everaldo.com/crystal/ icons: Addictive Flavour. Designed by Mirjami Manninen (http://www.mirkku.com). www.smashingmagazine.com icons: Bunch of Cool Bluish ICONS http://mebaze.com/ GlazedLists: http://publicobject.com/glazedlists/ Apache Thrift: http://incubator.apache.org/thrift/ TimingFramework: https://timingframework.dev.java.net/ Flying Saucer: https://xhtmlrenderer.dev.java.net/ Apache Tika: http://tika.apache.org/ Apache Commons Collections: http://commons.apache.org/collections/ Apache Commons IO: http://commons.apache.org/io/ Apache Commons Math: http://commons.apache.org/math/ Evernote API: http://www.evernote.com/about/developer/api/ Joda Time library: http://joda-time.sourceforge.net/ NekoHTML: http://nekohtml.sourceforge.net/ renderpack: https://renderpack.dev.java.net/ SLF4J: http://www.slf4j.org Woodstox: http://woodstox.codehaus.org/

July 27, 2010

Netbeans "Drop to Frame" debugging

I took me a while to figure out how to rewind the stack while debugging in Netbeans. This feature is called “Drop to Frame” in Eclipse and there is accesible in the toolbar. In Netbeans the feature that allows you to go back in the callstack is called Pop to Here and you invoke it right clicking on the stack. There is also a “Debug / Stack / Pop Topmost Call”

July 15, 2010

Getting rid of the grey empty area on your Netbeans Platform Application (RCP)

The short answer is that the gray area that you are seeing in lower bottom of the window is actually the editor area (aka document area) and you can hide it by adding run.args.extra=-J-Dnetbeans.winsys.hideEmptyDocArea=true to your platform.properties file. Or by calling System.setProperty("netbeans.winsys.hideEmptyDocArea", "true"); from one of your module’s Installers. That’s all you need to know but if you are interested on getting some details and references continue reading. If you create a new Netbeans RCP application and only add TopComponents to modes other than editor (modes which kind=“view”) then you will end up with an empty document area (could be at the bottom, top, left, right or in between TopComponents depending which modes you placed the TCs on). But first, you ask, how do I assign TopComponents to modes? Well you do that in the new Window wizard for example ...

July 3, 2010

NullPointerException when using hideEmptyDocArea

When I put run.args.extra=-J-Dnetbeans.winsys.hideEmptyDocArea=true in my project.properties I got a NullPointerException (NPE) at startup. I though it was a bug and I reported it but then I realized that I got the NPE because I had removed/hidden also the editor.wsmode in my layer.xml ... ... <folder name="Windows2"> <folder name="Modes"> <folder name="editor_hidden"/> <file name="editor.wsmode_hidden"/> </folder> </folder> ... ... As soon as I removed those entries from the layer.xml hideEmptyDocAre worked perfectly.

July 3, 2010

JUnit and Netbeans. Injecting in objects in the default Lookup

If you need to unit test classes in a netbeans module and the classes use the Lookup.getDefault() to “lookup” things that you want to mock you probably wonder how you can place the mock objects in the default Lookup Adding objects to the Netbeans’s default Lookup is relatively simple. Here is the answer: Replace the `Lookup` instance returned by the `Lookup.getDefault()` by defining a new entry in `META-INF/services`. It’s just a matter of adding a file named org.openide.util.Lookup$Provider in the META-INF/services folder inside your Unit Test source folder. That file should contain the fully qualified class name of your own Lookup.Provider implementation. In my case the file contain just the string com.rubenlaguna.en4j.searchlucene.NoteFinderLuceneImplTest because the test class itself implements Lookup.Provider. ...

February 12, 2010

Cancellable tasks and progress indicators [Netbeans Platform]

Progress indicator (indeterminate mode) which allows to cancel the task The easiest way of having a cancellable progress indicator (Progress API) for a task in Netbeans Platform Application is the one below but it’s only worth for tasks that don’t update the progress indicator (indeterminate mode) until the task is finished. If you want to update the progress indicator (ProgressHandle) inside the task itself look at the second example. ...

January 18, 2010

OpenJPA, HSQLDB and proper shutdown

I’m starting to get tired of OpenJPA/HSQLDB setup that I’ve trying: it seems to give more problems than it solves. Now I discovered that the HSQL db wasn’t been properly shutdown and for reasons that I’m investigating, if the HSQL db is not propertly closed (SHUTDOWN command) it’s impossible to reopen it again. It fails with a IndexOutOfBoundsException. Caused by: org.hsqldb.HsqlException: error in script file line: 33 java.io.IOException: java.lang.IndexOutOfBoundsException in statement [SET TABLE PUBLIC.NOTES INDEX '2883070'] at org.hsqldb.Error.error(Error.java:111) at org.hsqldb.scriptio.ScriptReaderText.readDDL(ScriptReaderText.java:132) at org.hsqldb.scriptio.ScriptReaderBase.readAll(ScriptReaderBase.java:88) at org.hsqldb.persist.Log.processScript(Log.java:721) at org.hsqldb.persist.Log.open(Log.java:187) at org.hsqldb.persist.Logger.openPersistence(Logger.java:209) at org.hsqldb.Database.reopen(Database.java:265) at org.hsqldb.Database.open(Database.java:235) at org.hsqldb.DatabaseManager.getDatabase(DatabaseManager.java:222) at org.hsqldb.DatabaseManager.newSession(DatabaseManager.java:145) at org.hsqldb.jdbc.JDBCConnection.<init>(JDBCConnection.java:3219) ... 59 more Annoying. This is not OpenJPA fault, but it gets complicated to actually solve it. ...

January 14, 2010

Two netbeans bugs at the same time

It seems that source attachement for Library Wrapper Modules in Netbeans 6.8 Beta doesn’t work properly. I opened a bug report here https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c9 and it seems that in the process I also spotted that “Swing Layout Extensions” library definition that comes with NB 6.8 it’s also wrong (see https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c7)

November 16, 2009

Netbeans: Compile schemas into JAXB classes with XJC task

To add a XJC task to a Netbeans build.xml you need to add a -pre-compile target to your build.xml. If it’s a netbeans module build.xml then you need to make compile depend on -pre-compile and projectized-common.compile (see example below). For regular Java Applications just define the -pre-compile target as the standard build.xml will call -pre-compile before compile. Then it’s just a matter of defining the <taskdef> with the proper classpath to the jaxb’s jars. ...

October 1, 2009

Netbeans & woodstox: ClassCastException: JAXBContextImpl cannot be cast to JAXBContext

Are you getting a ClassCastException in a Netbeans Platform Application, when you are you sure that the class can be casted? Then check http://wiki.netbeans.org/PlainView.jsp?page=DevFaqModuleCCE. This is most likely the result of the the classes being loaded by different classloaders. So JAXBContextImpl cannot be cast to JAXBContext because that JAXBContext is from Classloader “A” and JAXBContextImpl can only be cast to JAXBContext from Classloader “B”. SEVERE [global] java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to javax.xml.bind.JAXBContext at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:145) at javax.xml.bind.ContextFinder.find(ContextFinder.java:277) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244) at com.rubenlaguna.en4j.mainmodule.ImportEvernoteFile.actionPerformed(ImportEvernoteFile.java:65) at org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:115) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:389) at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95) at java.awt.MenuItem.processActionEvent(MenuItem.java:627) at java.awt.MenuItem.processEvent(MenuItem.java:586) at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:317) at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:305) at java.awt.EventQueue.dispatchEvent(EventQueue.java:638) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) BUILD SUCCESSFUL (total time: 28 minutes 5 seconds) So this could happen for example if you have both woodstox in a Netbeans Library Wrapper module and you make you application dependent on ide11 ⇒ JAXB 2.1 Library . ...

September 28, 2009