Wednesday, May 31, 2006

DBCopy Plugin Home Page

DBCopy Plugin Home Page: "DB Copy Plugin is a plugin for the SQuirreL SQL Client (1.2beta6 and 2.0 RC1 )
that allows copying database objects (schema def and data) from one session window to another.

The source and destination sessions can be different database vendors (Hibernate is
used internally for data type translation)."

HelpSetMaker - Ein Programm zur Erstellung von Online-Hilfe-Systemen

HelpSetMaker - Ein Programm zur Erstellung von Online-Hilfe-Systemen: "HelpSetMaker - Ein Programm zur Erstellung von Online-Hilfe-Systemen

Hinweis: HelpSetMaker richtet sich grunds�tzlich an Muttersprachler verschiedener Sprachen. Das Programm ist momentan mit deutscher und englischer Benutzeroberfl�che ausgestattet. Die Online-Hilfe und die Seiten bei SourceForge sind aber nur in Englisch verf�gbar."

JHelpDev

JHelpDev

This is an overview of all features that have been implemented in the respective current version of JHelpDev. The requested features section provides an outlook for the future.
Implemented

* creates the map file from existing HTML files in a directory including targets
* convenient TOC editor with a tree view, image support
* smart automatic TOC generation searches HTML files for "title-like" entries and preserves existing entries
* powerful index editor allowing for quickly jumping to the location in the helpset
* two synchronized views for convenient index creation
* HS Editor for the views and labels of the JHelpNavigator
* list of recently visited projects, starts browsing in last directory
* support of subhelpsets
* easy to use preview with the original helpviewer
* one click creation of search database
* a context-sensitive helpsystem created with JHelpDev
* configuration changes are stored in an XML format

Monday, May 22, 2006

XMLmind: Aptconvert

XMLmind: Aptconvert: "Aptconvert is a command-line tool that can be used to convert the APT format to HTML, XHTML, PDF, PostScript, (MS Word loadable) RTF, DocBook SGML and DocBook XML."

Terracotta - Enterprise-class clustering for Java

Terracotta - Enterprise-class clustering for Java: "Clustering the JVM, Not the Application
Terracotta DSO is a runtime solution for clustering JVMs, instead of the application. By extending the Java heap, Terracotta DSO creates one “clustered” JVM that shares object state and behavior. Tuning the clustering behavior can now be done at runtime without code changes. Developers can focus on business logic, not infrastructure."

Marthon User Guide

Marthon User Guide: "Marathon is a general purpose tool for both running and authoring acceptance tests geared at the applications developed using Java and Swing. Included with marathon is a rich suite of components to help you interact with your application at the User Interface Level (GUI).

Marathon tests are scripted using Jython, a 100% pure java implementation of the programming language Python -- the emphasis being on a extremely simple, highly readable syntax that customers, analysts, testers and developers can all be comfortable with. But don't let the simplicity fool you. Python is a mature, full-featured programming language, so testers and developers don't need to sacrafice anything in terms of the power and creativity with which they can express their tests.

To aid with the regression testing of existing applications, Marathon comes bundled with a recorder to capture events as you use and interact with your application. These events are then converted into a valid Marathon test which can subsequently be played back."

Thursday, May 18, 2006

JSqlParser - Home

JSqlParser - Home

BNF Grammars for SQL-92, SQL-99 and SQL-2003

BNF Grammars for SQL-92, SQL-99 and SQL-2003

BNF for Java: Project Home Page

BNF for Java: Project Home Page

jGuru: JaVaCC Grammar modification required.

jGuru: JaVaCC Grammar modification required.

jGuru: JaVaCC Grammar modification required.

jGuru: JaVaCC Grammar modification required.

JaVaCC Grammar modification required.
Topic: JavaLanguage
Vijendra Singh, Mar 14, 2006
Hi, If someone has good command over writing .jj or.jjt files. I need some help in writing code. I need to incorporate in my sqlParser.jj and ultimately sqlParser.java files; so that they can read and parse :- "create view as select * from tablename" statement. This sqlParser.jj files are generating ASCII_char_stream instead Simple_char_stream, but i don't think it will create any problem. So just like it parsers create table...statement,delete,alster tables etc. It sholud also parse view without giving any error. I am giving this file with some modification i tried to do for views but grammar is mistaken please give me some useful way to solve this Thanks Vijendra New Page 1

/**
* Creation date: July 19th, 2000
* This is the JavaCC grammar definition file for the DDL dialect used by
* ZeroCode.
*/


// options {
// DEBUG_PARSER = true;
// }


PARSER_BEGIN(SqlParser)

package zerocode.sqlParser;

import com.sun.java.util.collections.*;
import java.io.*;
import java.util.Enumeration;

import zerocode.dbSupport.*;
import zerocode.core.*;



/**
* The SqlParser class encapsulates parsing of SQL DDL statements to enable
* zeroCode to construct the schema-related data structures. Most of its
* implementation is generated using the
* JavaCC
* application.
*/
public class SqlParser {


public interface ConstraintType {

public static final int UNIQUE = 1;

public static final int PRIMARY_KEY = 2;

}


public static void main (String args[]) throws Exception {
Schema dbSchema = buildSchema (new InputStreamReader (System.in));
System.out.println (dbSchema.toString());
}



public static synchronized Schema buildSchema (Reader stream)
throws ZcException {
_fkConstraints = new ArrayList();
_errorList = new Vector();
_dbSchema = new Schema ("ZeroCodeSchema");
if (_parser == null)
_parser = new SqlParser (stream);
else
_parser.ReInit (stream);
try {
_parser.ddlSequence ();
} catch (ParseException e) {
throw new ZcException
(ErrorCode.INVALID_SCHEMA, "SQL syntax error: " + e.getMessage());
}
_dbSchema.setConstraints (_fkConstraints);


if (_errorList.size() > 0)
throw new ZcException
(ErrorCode.INVALID_SCHEMA,
"Schema errors:\n" + StringUtils.join (_errorList, "\n"));
return _dbSchema;
}



private static void addTable (DbTable table) {
_dbSchema.addTable (table);
}



private static void addSequence (String sequenceName) {
_dbSchema.addSequence (sequenceName);
}



private static int convertToken (String message)
throws ZcException {
try {
int val = Integer.parseInt (token.toString());
return val;
} catch (NumberFormatException e) {
throw new ZcException
(ErrorCode.INVALID_SCHEMA,
message + "token '" + token.toString() + "' line " +
token.beginLine + " column " + token.beginColumn);
}
}

private static void setConstraint (DbTable table, String constraintName,
int constraintType,
StringSet columnNameSet) {
if (constraintType == ConstraintType.PRIMARY_KEY) {
int nCols = columnNameSet.size();
if (nCols > 1) {
// _errorList.add ("Table " + table.name() + ": must have " +
// "exactly one column as primary key.");
// We set the pri key anyway, to inhibit the subsequent
// "No primary key defined" error message.
table.setPrimaryKey (columnNameSet);
} else if (nCols <= 0) {
// _errorList.add ("Table " + table.name() + ": must have " +
// "a primary key.");
} else {
String colName = (String) columnNameSet.asArray()[0];
DbColumn col = table.columnWithName (colName);
if (col == null)
_errorList.add ("Table " + table.name() + ": Column '" +
colName + "', specified in primary key " +
"constraint, is not a declared column.");
else
table.setPrimaryKey (col.name());
}
} else {
// It should be a UNIQUE constraint
table.addUniqueConstraint
(new UniqueConstraint (constraintName, table, columnNameSet));
}
}


private static void addForeignKeyConstraint (String constraintName,
DbTable table,
StringSet columnNameSet,
String toTableName,
String toColName) {
if (columnNameSet.size() != 1) {
// We now silently ignore this problem -- MAS 1/7/2003
// _errorList.add ("Table " + table.name() + ": must have " +
// "exactly one column in foreign key.");
return;
}
String fkColName = columnNameSet.asArray()[0];
DbColumn fkCol = table.columnWithName (fkColName);
if (fkCol == null) {
_errorList.add ("Table " + table.name() +
": Cannot add foreign key constraint: no " +
"foreign key column named '" + fkColName + "'");
return;
}
DbTable toTable = _dbSchema.tableWithName (toTableName);
if (toTable == null) {
_errorList.add ("Table '" + toTableName + "' not found in schema.");
return;
}
DbColumn toColumn = toTable.columnWithName (toColName);
if (toColumn == null) {
_errorList.add ("Attempting to add foreign key from " +
table.name() + "(" +
columnNameSet.joinString(",") + ") to table '" +
toTableName + "': the latter has no column " +
"named '" + toColName + "'");
} else {
String constraintId = constraintName != null
? constraintName
: ("zcFkConstraint" + (++zcFkCount));
ForeignKeyConstraint constraint = new ForeignKeyConstraint
(constraintId, fkCol, toColumn, _fkConstraints.size());
_fkConstraints.add (constraint);
}
}

private static Schema _dbSchema;
private static Vector _errorList;
private static List _fkConstraints;
private static SqlParser _parser;

private static int zcFkCount = 0;
}

PARSER_END(SqlParser)

SKIP :
{
" "
|
"\t"
|
"\n"
|
"\r"
|
"--" : IN_LINE_COMMENT
|
"/*" : IN_COMMENT

}

SKIP:
{
"\n" : DEFAULT
}

MORE:
{
< ~[] >
}

SKIP:
{
"*/" : DEFAULT
}

MORE:
{
< ~[] >
}



TOKEN [IGNORE_CASE] :
{
< ADD: "add" >
| < ALL: "all" >
| < ALTER: "alter" >
| < AND: "and" >
| < ANY: "any" >
| < AS : "as" >
| < ASC: "asc" >
| < BY: "by" >
| < CACHE: "cache" >
| < CASCADE: "cascade" >
| < CHECK: "check" >
| < COLUMN: "column" >
| < COMMENT: "comment" >
| < CONSTRAINT: "constraint" >
| < CONSTRAINTS: "constraints" >
| < CREATE: "create" >
| < CYCLE: "cycle" >
| < DEFAULT_TOK: "default" >
| < DELETE: "delete" >
| < DESC: "desc" >
| < DROP: "drop" >
| < FOREIGN: "foreign" >
| < IDENTITY: "identity" >
| < IN: "in" >
| < INCREMENT: "increment" >
| < INDEX: "index" >
| < IS: "is" >
| < KEY: "key" >
| < MAXVALUE: "maxvalue" >
| < MINVALUE: "minvalue" >
| < NOCACHE: "nocache" >
| < NOCYCLE: "nocycle" >
| < NOMAXVALUE: "nomaxvalue" >
| < NOMINVALUE: "nominvalue" >
| < NOORDER: "noorder" >
| < NOT: "not" >
| < NULL: "null" >
| < ON: "on" >
| < OR: "or" >
| < ORDER: "order" >
| < PRIMARY: "primary" >
| < REFERENCES: "references" >
| < SELECT: "select" >
| < SEQUENCE: "sequence" >
| < SOME: "some" >
| < START: "start" >
| < TABLE: "table" >
| < UNIQUE : "unique" >
| < UPDATE : "update" >
| < VIEW : "view" >
| < WITH: "with" >


| < COMMA: "," >
| < DOT: "." >
| < IDENTIFIER: ["a"-"z","A"-"Z", "_"] (["a"-"z", "_", "0"-"9", "$", "#"])* >
| < LPAREN: "(" >
| < NUMBER: (["0"-"9"])+ >
| < RPAREN: ")" >
| < SEMICOLON: ";" >
| < SLASH: "/" >
| < STRING_LITERAL:
(
"'"
(~["'","\\","\n","\r"])*
"'"
)+
>
}


String allowedColumnName () :
{}
{
(
LOOKAHEAD(2)
< IDENTIFIER >
| < ANY >
| < AS >
| < ASC >
| < BY >
| < CACHE >
| < CASCADE >
| < CHECK >
| < COLUMN >
| < COMMENT >
| < CONSTRAINTS >
| < CREATE >
| < CYCLE >
| < DEFAULT_TOK >
| < DELETE >
| < DESC >
| < DROP >
| < FOREIGN >
| < IDENTITY >
| < IN >
| < INCREMENT >
| < INDEX >
| < IS >
| < KEY >
| < MAXVALUE >
| < MINVALUE >
| < NOCACHE >
| < NOCYCLE >
| < NOMAXVALUE >
| < NOMINVALUE >
| < NOORDER >
| < NOT >
| < NULL >
| < ON >
| < OR >
| < ORDER >
| < PRIMARY >
| < REFERENCES >
| < SELECT >
| < SEQUENCE >
| < SOME >
| < START >
| < TABLE >
| < UNIQUE >
| < UPDATE >
| < VIEW >
| < WITH >
) { return token.toString(); }
}


void ddlSequence () throws ZcException :
{
DbTable table;
String sequenceName;
}

{
(
(
comment()
|
(

(
table = tableDefinition () {
addTable (table);
}

|
indexDefinition ()
|
sequenceName = sequenceDefinition ()
{
addSequence (sequenceName);
}
)
)
|
(

(
view = viewDefinition ()
)
)
|
alterTable ()
|
dropTable()

)
(

|

)+
)+

}


void comment () :
{ }
{


(
(


)
|
(




)
)


}


DbTable tableDefinition () throws ZcException :
{
DbTable table;
DbColumn col;
}
{
{
table = new DbTable
(token.toString(), _dbSchema);
}


col = columnDefinition (table)
(

(
LOOKAHEAD(2)
col = columnDefinition (table)
|
constraint (table)
)

)*


{return table;}
}

//for view modified one
DbTable viewDefinition () throws ZcException :
{
DbTable view;
String col;
}
{
{
view = new DbTable
(token.toString(), _dbSchema);
}

col = columnName (col)
(

(
LOOKAHEAD(2)
col = columnName (col)
)
)*

{return view;}
}
//for view modified one
String columnName (String column)
throws ZcException :
{
String columnName, columnType;
}
{
(
columnName = allowedColumnName()
{columnType = token.toString();}
( {
columnType += " " + token.toString();
}
)

)
{return col;}
}

//for table
DbColumn columnDefinition (DbTable table)
throws ZcException :
{
String columnName, columnType;
int size = 0, precision = 0;
boolean nullable = true;
DbColumn col;
}
{
(
columnName = allowedColumnName()
{columnType = token.toString();}
( {
columnType += " " + token.toString();
}
)?
(

{
size = convertToken ("Integer size expected");
}

(

{
precision = convertToken
("Integer precision expected");
}
)?

)? {
col = new DbColumn
(columnName, columnType, size, precision,
table.columnCount(), nullable, table);
table.addColumn (col);
}
(
columnConstraint(col)
)*
)
{return col;}
}



void columnConstraint (DbColumn col) throws ZcException:
{
boolean nullable = true;
String toTableName, toColumnName, constraintName;
int constraintType;
StringSet colNameSet = null;
}
{
(

{
constraintName = token.toString();
}
(
(

{
constraintType = ConstraintType.UNIQUE;
}
)
|

(

{
constraintType = ConstraintType.PRIMARY_KEY;
col.table().setPrimaryKey (col.name());
}
)

|

(
(


(

)? {
constraintName = token.toString();
}
)?

{
toTableName = token.toString();
DbTable toTable = _dbSchema.tableWithName
(toTableName);
if (toTable == null)
throw new ZcException
(ErrorCode.INTERNAL_ERROR,
"Foreign key reference to nonexistent " +
"table '" + toTableName + "': line " +
token.beginLine + ", column " + token.beginColumn);
toColumnName = toTable.primaryKeyName();
if (toColumnName == null)
throw new ZcException
(ErrorCode.INTERNAL_ERROR,
"Foreign key reference to table '" +
toTableName + "' with no primary key: line " +
token.beginLine + ", column " + token.beginColumn);
}
(

colNameSet = columnNameList()

)? {
DbTable table = col.table();
if (colNameSet != null && colNameSet.size() > 0){
if (colNameSet.size() > 1)
throw new ZcException
(ErrorCode.INVALID_SCHEMA,
"Column " + col + " refers to " +
"more than one column: line " +
token.beginLine + ", column " +
token.beginColumn);
toColumnName = colNameSet.asArray()[0];
}
StringSet colNames = new StringSet();
colNames.add (col.name());
addForeignKeyConstraint
(constraintName, table, colNames, toTableName, toColumnName);
}
)
)
)
|
(


checkCondition()

)
|
(
(
{
col.setNullable (false);
}
)?

)
|
(
defaultClause()
)
|
(

(





)?
{
col.setIdentity ();
}
)
}




void defaultClause () :
{}
{

defaultExpr()
}


void constraint (DbTable table) throws ZcException :
{
String constraintName = null;
int constraintType = 0;
StringSet colNameSet = null, refColNameSet = null;
String toTableName = null;
String toColumn = null;
}
{

(

{
constraintName = token.toString();
}
)?
(
(

(
{
constraintType = ConstraintType.UNIQUE;
}

|

(

{
constraintType = ConstraintType.PRIMARY_KEY;
}
)
)

colNameSet = columnNameList ()
{
setConstraint (table, constraintName,
constraintType, colNameSet);
}
)

|

(


(
{
constraintName = token.toString();
}
)?

colNameSet = columnNameList()


{
toTableName = token.toString();
DbTable toTable = _dbSchema.tableWithName (toTableName);
if (toTable == null)
throw new ZcException
(ErrorCode.INTERNAL_ERROR,
"Foreign key reference to nonexistent " +
"table '" + toTableName + "': line " +
token.beginLine + ", column " + token.beginColumn);
toColumn = toTable.primaryKeyName();
}
(

refColNameSet = columnNameList ()

)? {
if (refColNameSet != null && refColNameSet.size() > 0) {
toColumn = refColNameSet.asArray()[0];
}
addForeignKeyConstraint
(constraintName, table, colNameSet, toTableName, toColumn);
}
)
|
(


checkCondition()

)
)
}





StringSet columnNameList () :
{
StringSet columns = new StringSet();
}
{

{
columns.add (token.toString());
}
(

{
columns.add (token.toString());
}
)*

{return columns;}


}




void alterTable () throws ZcException :
{
String tableName = null;
DbTable table = null;
}
{


{
tableName = token.toString();
table = _dbSchema.tableWithName (tableName);
if (table == null)
throw new ZcException
(ErrorCode.INTERNAL_ERROR,
"Invalid ALTER TABLE: " +
"No table with name '" + tableName + "': line " +
token.beginLine + ", column " + token.beginColumn);
}

(
constraintClause (table)
(

constraintClause (table)
)*
|
(

constraintClause (table)

)
)
}



void constraintClause (DbTable table) throws ZcException:
{
}
{
constraint (table)
(

( | )

)?
}




void dropTable () :
{}
{



(


)?
}





void indexDefinition () :
{}
{
(

)?






(

|

)?
(


(

|

)?
)*

}


String sequenceDefinition () :
{
String name;
}
{

{ name = token.toString(); }
(
(

)
|
(

)
|
(

)
|

|

|

|

|
(

)
|

|
(

)
|

|

)*
{return name;}
}


void defaultExpr () :
{}
{

|

|
(

(

defaultExpr()
(

defaultExpr()
)*

)?
)
|
(

defaultExpr()

)
}


void checkCondition() :
{}
{
(

checkCondition()

)
|
(

checkCondition2()
)
|
(
checkCondition2()
(
(

|

)
checkCondition()
)?
)
}


void checkCondition2() :
{}
{
expr()
(
(
(
"="
|
"!="
|
">"
|
">="
|
"<"
|
"<="
)
(
expr()
|
(

|

|

)
exprList()
)
)
|
(

exprList()
)
)?
}


void expr () :
{}
{
(

|

|

)
(
(
"+"
|
"-"
|
"*"
|

)
expr()
)?
}

void exprList () :
{}
{

expr()
(

expr()
)*

}






JavaCC Grammar Repository

JavaCC Grammar Repository

Zql: a Java SQL parser

Zql: a Java SQL parser

Tuesday, May 16, 2006

Jxp - Introduction

Jxp - Introduction: "Jxp (Java scripted page) is a script-processor/template-engine that can execute template files containing text java code. It contains a parser to parse the script file into an abstract syntax tree and a tree processor (JxpProcessor) that will process the syntax tree to execute the code using reflection API to produce output. Some of the main features of Jxp include:

* Java as template language. Why learn another one? ;)
* support common java language 1.4 constructs (partial 1.5 syntax support on jdk 1.4)
* practical template sources management framework
* support caching of parsed syntax tree to eliminate reparse of template
* a servlet implementation to enable web-scripting
* extensible processing context for defining built-in function on the scripts

Below is an example of a script file"

Friday, May 12, 2006

MMBase: MMBase - Homepage

MMBase: MMBase - Homepage: "MMBase is a Web Content Management System with strong multi media features and advanced portal functionalities. MMBase has a large installed base in The Netherlands, and is used by major Dutch broadcasters, publishers, educational institutes, national and local governments. MMBase is written in Java, it is Open Source Software (MPL) and all standards used are as 'open' as possible. The system can be used with all major operating systems, application servers and databases. "

SVN for Eclipse : Polarion Community

Polarion Community: "About Subversive Project
The Subversive project is a brand new Eclipse plug-in that provides Subversion support. From a user point of view, Subversive provides Subversion support similar to CVS support, which is already part of the standard Eclipse platform. The main use cases, which are familiar to CVS users, are:

* Connection to the repository using different connection types
* Repository browsing
* Check-out
* Synchronization
* Commiting
* Update
* Resolving conflicts
* Adding to the list of ignored resources"

Sunday, May 07, 2006

GraphicPrinter (SAP Mobile Infrastructure 2.5 [API-JavaDoc])

GraphicPrinter (SAP Mobile Infrastructure 2.5 [API-JavaDoc])

Barbecue - Barbecue

Barbecue - Barbecue: "Barbecue

Barbecue is an open-source, Java barcode library that provides the means to create barcodes for printing and display in Java applications. A number of barcode formats are supported and many more can be added via the flexible barcode API. Barcodes can be outputted to Graphics objects, or used as a Swing component, or written out as SVG. Please use the links on the left to find out more about Barbecue."

Welcome to Barcode4J

Welcome to Barcode4J: "Barcode4J is a flexible generator for barcodes written in Java. It's free, available under the Apache License, version 2.0."

Thursday, May 04, 2006

iScreen - The Java Object Validation Framework

iScreen - The Java Object Validation Framework

iScreen is a Java Object Validation Framework, suitable for validating Java Objects (including JavaBeans) to ensure that they are "valid" according to some definition (usually via configuration). The term 'iScreen' means "information screen," where 'screen' means to protect or conceal. Information, represented by Java objects, are passed through the screen. If they are considered acceptable (i.e. valid), then nothing occurs. If not, then an exception is thrown, allowing the application to notify someone or something of the invalid information.