Software

Tuesday, March 06, 2012

Inheritance in XML Schema

Nice description of that is here:-

http://www.codesynthesis.com/pipermail/xsd-users/2005-September/000029.html

Wednesday, October 05, 2011

Configuring a Mail Resource with SSL on Apache Tomcat 7.x

Configuring a Mail Resource with SSL on Apache Tomcat 7.x

Add the following entry to the context xml for the application:-

<Resource name="mail/MailSession" type="javax.mail.Session" protocol="smtp" host="example.com" auth="Container" user="test@example.com" password="test" class="javax.net.ssl.SSLSocketFactory" port="465" debug="true"/>

Sunday, February 03, 2008

Layout Mechanism in Draw2D

Laying out the Widgets is the basic requirement of any UI Toolkit let it be
Swing,AWT or SWT. Understanding the different API methods related to the
layout mechanism is a essential for those who develop Applications using
these toolkits. This article looks at how this is designed in the Draw2D
library (which is written on top SWT).

General UI Tookit related terms:-
Control: Any UI Widget like Button, Label, Combo Box, Text Control etc.
Container: A Container as the name suggests contains a groupd of Controls
or Containers. It is the parent of all the Controls and Containers inside
it.
Layout Manager: The component which is resposible for laying out the
Controls within a Control. This is associated with a Container and has
the layout algorithm.

In the case of Draw2d the IFigure class takes up the role of both the Control
and Container.

Requirement 1:-
When the size of the Container increases/decreases the sizes of the controls
inside it should be increased/decreased accordingly.
For this the layout method of the Figure is called which inturn delegates the
call to the #layout() method of the Layout Manager. Following is the sequence
of methods:-
LayoutManager#layout()


|
|
|

Using the methods Figure#calculatePreferredSize()
or Figure#calculateMinimumSize() it determines
the new size to be set on each of the controls
inside it. (Actually if the child is inturn a
Container, then the size is determined by it's
Layout Manager, otherwise the Control's getSize()
is returned. See IFigure#getPreferredSize()).

|
|
|

Invokes #setBounds(newSize) on each of the Child Controls.

|
|
|

If the size of a Control has changed then it should
be painted again and for this reason the Control is
invalidated by calling #invalidate(). Any cached layout
info about each of the Controls should be invalidated again.
Now if any of the Child is a Container by itself, then it
should see to it that the sizes of it's children are updated
accordingly.

|
|
|

UpdateManager#addDirtyRegion() method registers the Area
occupied by the Figure as a Dirty Region and registers the
Figure as invalidFigure, with the UpdateManager. As part of
this the UpdateManager should validate() the Figure. It's upto
the implementation of the UpdateManager whether the repaint
and validation should be done synchronously or in a different
Thread.

|
|
|

DeferredUpdateManager#performUpdate() method does the actual
work. #performValidation() validates the figure by calling
Figure#validate() on the list of invalid figures. Within
the #performUpdate() method after validation of all the figures
is done, the whole Dirty Region is painted.

|
|
|

Figure#validate() method marks the figure as valid and also
invoke #layout() method on it so that all the children of this
Container get laid out properly. And the same process
continues recursively until all Figures in the Hierarchy
are laid out assigning new sizes. In addition to invoking
the layout() method, the validate() method, also calls validate
recursively on all it's children.

Requirement 2:-
When the size of one of the Figures within a Figure Hierarchy is
explicitly changed by programmitically invoking setSize() method
or indirectly changes by invoking any other method like setBorder()
then all other figures in the hierarchy might also get affected
and so should be laid out again. To support this the #revalidate()
exists.
Figure#revalidate() method invaldiates the current figure and
traverses up the Figure Hierarchy until it reaches the Root Figure
or the Validation Root.

|
|
|

Adds the Root figure or the validation Root to the list of invalid
figures maintained by the UpdateManager via the method
UpdateManager#addInvalidFigure().

|
|
|

The UpdateManager at some point later in time goes through all the
invalid figures and Updates them so that all the figures in the
hierarchy are laid out properly and repainted.

Tuesday, January 09, 2007

What pages link your home page

Type this in Google Search:

link:_your_site_url

and you'll get a listing of all the pages on the net
that link to your site.

Tuesday, November 29, 2005

Tweaking the Windows Registry

1. The place in the registry where the contents of the "right-click" menu of Folder go is HKEY_CLASSES_ROOT\Directory\shell

Tuesday, July 12, 2005

Now I know what an ESB is :-)

This is what I got to read from "Andreas Mueller" on this thread
http://www.theserverside.com/user/userthreads.tss?user_id=13939

What they mean is just a form of workflow, based on P2P. A service is listening on an input queue, processes a message, does some generic or specific transformation, calls an EIS or a Web Service, generates an output message and sends it to another queue which is input of another service and so on. So in fact, this is just plain workflow, based on messaging. The 'bus' is a logical term of a messaging infrastructure, connected by routing connections. It's just the ability to address queues, located wherever.

AJAX

Had been wondering what this new technology called AJAX (Asynchronous Javascript and XML) is.
This article explains very clearly what it is:
http://java.sun.com/developer/technicalArticles/J2EE/AJAX/

Saturday, July 09, 2005

Nice article on ERP

Have been hearing of this stuff called ERP, CRM etc. Knew about them at some abstract level but never was very clear until I stumbled on this nice piece of article on ERP.
http://www.cio.com/research/erp/edit/erpbasics.html
Ends the article with this note:-

The difficulty of getting ERP and e-commerce applications to work together—not to mention the other applications that demand ERP information such as supply chain and CRM software—has led companies to consider software known alternately as middleware and EAI software. These applications act as software translators that take information from ERP and convert it into a format that e-commerce and other applications can understand.