Sun Tech Days @ Hyderabad - report
The NetBeans platform development session went well.... I could cover most of the topics and could demonstrate a simple application to the audience. But due to the last minute issues related to projector compatibility with my laptop (Sony Vaio) I had to use a borrowed laptop and quickly setup my main demo program there. The main demo is being developed here : https://playfull.dev.java.net
On the second day I manned the 'Connected Developer' booth with Ashwin and John (http://kenai.com). Most of the visitors were students. Apart from the typical questions that I get all the time when I meet students (number one is 'How Sun Makes money out of opensource software' blogs.sun.com/images/smileys/smile.gif" class="smiley" alt=":-)" title=":-)" /> ), there were many technical questions on NetBeans and project kenai. Few students were interested in VirtualBox, and I showed them a live demo of Virtual Box running on my laptop. On NetBeans, many students were asking about Server integration for web projects, frameworks such as Hibernate and struts, profiling a web application and questions like 'does NetBeans have a cool HTML editor just like the dreamweaver ? why NetBeans does not support SWT, whats the advantage of NetBeans over eclipse, how can I migrate NetBeans 3.x application into the latest one and where to look for help on this, can I do 'this' in JavaFX, how can I get started with JavaFX and few more questions that I cannot remember now...
Many students were intersted in writing plugins for NetBeans IDE, using VirtualBox, getting started with JavaFX, Project Kenai, Zimbly, OpenSolaris Project looking glass and some more ..
Overall it was a great experience to meet many students and ofcourse, my blog readers blogs.sun.com/images/smileys/smile.gif" class="smiley" alt=":-)" title=":-)" />..
snaps from the event... first my session on NetBeans platform development :
second the fun event in the evening to unwind...
-- Post from Vadiraj. (cross posted from http://blogs.sun.com/vdblog)
Posted at 04:27AM Feb 20, 2009 by vadirajvd in Sun | Comments[0]
NetBeans platform session @ Sun Tech. Days
Vadiraj is speaking @ Sun Tech days on NetBeans platform development on the 18th. Come, learn about the NetBeans platform and see yourself how it helps to build a Java desktop application in less time.
Posted at 07:45PM Feb 16, 2009 by vadirajvd in Sun | Comments[0]
Hibernate support in NetBeans 6.5 IDE, screencast and tutorials
This week's (01/12/2009) NetBeans news-letter posted a new cool screen-cast on Hibernate support in NetBeans 6.5 IDE. The screen-cast available on www.netbeans.tv shows many features as part of the Hibernate support in the IDE, including, creation of Hibernate configuration file, running Hibernate reverse engineering to generate POJOs and finally using HQL Editor to create and execute HQL queries right from the IDE.
Check out the screencast and the following tutorials posted on the Web Application Learning trail page and send us your feedback/comments.
- Using Hibernate in a Web Application
- Using Hibernate in a Visual Web JSF Application
- Using Hibernate with the Java Persistence API (this tutorial shows how to use Java Persistence support built into the IDE and make use of Hibernate as a persistence provider)
Posted at 10:53AM Jan 15, 2009 by vadirajvd in Sun | Comments[0]
Vaividyam-08 @ KLE College Belgaum
IEEE student branch of KLE college Belgaum, Karnataka are arranging a 3 day seminar called "Vaividhyam-08". I am (Vadiraj Deshpande) speaking in this conference about Code For Freedom contest and NetBeans IDE. If you are in and around Belgaum, please come and join the fun :)

Posted at 10:12PM Nov 04, 2008 by vadirajvd in Sun | Comments[0]
NetBeans XML.next
NetBeans XML.next
This document is a collection of requirements for the next generation XML authoring and manipulation support in the NetBeans IDE. Desired features are explained along with their potential usages. Please note that no priority has been defined for any requirements. The document is an attempt to put on paper, the result of the author's brainstorming.
Premise
NetBeans has a poor story for XML authoring support, as compared to it's competitors - IntelliJ IDEA and Eclipse. Many web frameworks are still using XML for configuration, and frameworks like Spring and Hibernate (now shipped with NetBeans base IDE) require significant XML authoring. Hence, top class support for developer authored XML is highly needed for NetBeans.The following sections describe each desired feature of the NetBeans XML Infrastructure giving examples and screeshots of similar features offered by the competition (where applicable).
Syntax Highlighting/Error resilient lexer
The NetBeans XML editor is not as error resilient as it's competitors. When a user is authoring an XML document, the XML is broken most of the times. Even then, the syntax highlighting must make an error resilient attempt to syntax highlight the XML tokens. For eg. in the scenario shown below, NetBeans leaves out coloring tokens of the tag after the broken tag, whereas Eclipse and IntelliJ IDEA both compensate for it. This seems to be a problem with the lexer implementation. Such a scenario also leads to incorrect results in functionality that depends the lexer. For eg. in the scenario depicted below, the XML Text Editor API (syntactic support for XML files), fails to report the bean with id - "sample3". Hence the completion provider does not list the bean with id - "sample3". Our competitors (both Eclipse and IntelliJ IDEA) take care of such scenarios very well.
NetBeans:
IntelliJ IDEA offers a nifty XML bread crumb control on top of the editor which enables the developer to see the XPATH of the tag where the cursor is located as well as navigate to any ancestor of the tag by clicking on the elements of the bread crumbs. NetBeans offers a similar feature through the Navigator. However the bread crumb could be a good addition to have for large documents (typical case of XML) so that the user does not have to go through the pain of locating the element in the navigator and double clicking on it to open it. Also, the navigator does not automatically attached to a document of type text/x-XXX+xml and has to be added manually, which needs to be corrected.
NetBeans:
Frameworks like Spring, Hibernate, Struts(2) and JavaServer Faces make use of XML files for configuration. Such configuration files typically have references to external elements present in the project classpath, for eg. a Spring XML configuration file uses the fully qualified names of the classes defined in the project or it's dependencies. Typically, a way to boost author productivity in such cases is to offer code completion in the XML files (see
The editor code completion API is extremely generic and just gives the document and the caret offset where the completion was invoked. The code completion implementor has to then try to take hold of the context information (typically using tokens and syntax elements) and then return the completion items. This code to find out the completion context is pretty complex and has to duplicated for every completion provider. However, completion in XML documents is typically asked for in fixed places eg. Completion for element names, attribute names, attribute values etc. Hence, the need to have an API and avoid duplication.
I have seen the Schema based code completion code, and a simple approach that comes to mind is extending the schema based code completion module so that the completion provider asks all registered "Completors" for completion items. Completors are registered based on the mime type of the XML document. For eg. the completor for beans configuration xml file will be registered in the layer file as (I am using a shortcut notation):
SchemaBasedCompletionProvider implements CompletionProvider {
query() {
//1. Find all registered completors
List
//2. Create a completion context
CompletionContext ctx = new CompletionContextImpl(doc, offset);
if(ctx.getCompletionType() == CompletionType.UNDEFINED_COMPLETION) return;
//3. Ask each completor for completion information
for(XMLCompletor completor : completors) {
if(ctx.getCompletionType() == CompletionType.ATTRIBUTE_VALUE_COMPLETION) {
completor.getAttributeValueCompletionItems();
}
}
}
}
...
...
interface XMLCompletor {
/* XML completion infrastructure calls this method when completion was invoked for a tag start */
List extends CompletionItem> getTagCompletionItems(CompletionContext context, Tag tag, String typedPrefix);
/* Attributes */
List extends CompletionItem> getAttributeCompletionItems(CompletionContext context, Tag element, String typedPrefix);
/* Attribute values */
List extends CompletionItem> getAttributeValueCompletionItems(CompletionContext context, Tag element, String attribute, String typedPrefix);
}
BeansXMLCompletor implements XMLCompletor {
// implement methods to return completion items
}
However, this completion API has to be generic enough to allow completion to be implemented for documents defined by a schema or a DTD. In totality, the new completion implementations will have a dependency graph as below:
XML Model/Lexer <--- used by ----- XML Completion API <----used by ------- Schema based code completion (provides completion for tags and attributes depending on the schema)
^
|--------------------------------- DTD based code completion (provides completion for tags and attributes depending on the DTD)
|--------------------------------- Spring completion support, Struts completion support etc.
A major roadblock for this proposed API is the current lack of a public API for getting the syntactic structure of an XML document, which would typically be the DOM tree representation for the document (XXX: is XDM module an alternative?). Many completion scenarios require the syntactic structure of the document (DOM nodes) alongwith their position information. Just the lexical tokens are not enough for gathering all the information required. The Tag class used above, is from the XML Text Editor module which is non public and hence the Tag class cannot be exposed as API.
Making the XML Text Editor public might help, but this module gives only a DOM level 1 implementation, whereas complex scenarios in Spring (and possibly other frameworks) require namespaces and other support presented by DOM Level 2 (not implemented by XML Text Editor).
A similar API can be put in place for hyperlinking support.
Hints/Quick Fixes support
Hints and Quick fixes are used in NetBeans for identifying and letting the user know of potential problems and/or best practices while he is editing the document. An example shown below highlights the Hint/Quick fixes in a Ruby editor in NetBeans:
Such a functionality is also needed for XML authoring. For eg. in Spring, a beans configuration file contains numerous references to the java sources in the project, there are possibilities of errors introduced due to references to non existing or altered entities. For eg. A bean referring to a class which is not on the projects classpath. It is important to catch these errors before manual testing of the project. Error conditions, if any, are shown to the user with the help of editor annotations, and wherever possible, the user is given a suggestion to correct those errors. For example:
If the FooBar class does not exist on the project classpath, the user will be given a suggestion to create the class (prototype shown below):
Hence there should be some hints defined by default by the XML editor, like shortening an empty tag, and there needs to be an API to implement hints in XML editing easily.
The Java editor exposes a way to run a task/operation based on the user's caret location (see this link). An example of such a task is the highlighting of all the usages of a variable when the cursor is over the variable. An XML author will benefit heavily from such a functionality. For eg, when the cursor is over a Spring bean in a Spring bean configuration file, all usages of the bean will be highlighted).
Posted at 04:47AM Jun 18, 2008 by gridbag in Sun | Comments[0]
Alfresco SDK in Netbeans
From v1.3 onwards, Alfresco provides a developer oriented download bundle, known as the Alfresco SDK (Software Development Kit) to complement the Alfresco release bundle.
This blog outlines the steps required to start developing with the Alfresco SDK using Netbeans.
Please refer the document(pdf version) found here for a detailed account on this effort.
Posted at 05:38PM Apr 30, 2008 by premkumarl in Sun | Comments[0]
Alfresco build environment in Netbeans
This document outlines the steps required to checkout the Alfresco Subversion Repository and setup a full development environment on Netbeans. This allows for the re-build of Alfresco which is useful when extending or bug fixing the Alfresco product itself.
Please refer the document(pdf version) found here for a detailed account on this effort.
Posted at 05:34PM Apr 30, 2008 by premkumarl in Sun | Comments[0]
MySQL - a.) Deployment/Failover on Solaris Cluster. b.) Sun Studio Compiler options
1.Deployment and Failover study of HA MySQL on Solaris Cluster
http://blogs.sun.com/krishs/entry/deployment_and_failover_study_of
2.Sun Studio Compiler Options for MySQL on Solaris 10 SPARC OS : Performance Study
http://blogs.sun.com/krishs/entry/sun_studio_compiler_options_for
3. Sun Studio Compiler Options for MySQL on Solaris 10 x64 OS : Performance Study
http://blogs.sun.com/krishs/entry/sun_studio_compiler_options_for1
Posted at 03:57PM Apr 08, 2008 by Krish Shankar in Sun | Comments[0]

