
Thanthai Periyar Vazhga.
Anna Pugai Onguga.
Dedicated to Uforians, PSG Tech, Coimbatore.
Acknowledgements
I Sincerely Thank whole heartedly for the Team at SkavaSystems, Coimbatore, Tamilnadu
for their continous monetary and work support provided to produce this technical
specification for "XML based Data Search Case Study".
Great Techincal support provided by Mr. Karthikeyan in this work is
big motivation for bringing this work in to useable form.
Objective:
The power of XML technologies for indexing any text for their context sensitive queries and report production.
TABLE OF CONTENTS
1. INTRODUCTION
2. FEATURES
3. ECLIPSE PLATFORM
4. FEATURE TO PLUGIN MAPPING
5. SCREEN SHOTS
6. APPENDIX
1.0 INTRODUCTION
Aim of the design is to have reusable, easily extensible, user-friendly framework
For XML based data-management Systems.
We now,
1. have device compliance details in the word document as manual instructions to mobile developers.
2. have device details and operator details organised as row in XL sheet
This isolated data are unified into two XML schemas as DeviceDB XML Schema and OperatorDB XML Schema. Some more data fields are added to existing device details and operator details.
Eclipse EMF plug-in used to create, manipulate and persist object from XML schema files.
The whole framework is planned to be implemented as Eclipse Plugin architecture. GUI is designed using Standard Widget Toolkit and JFace. Device and Operator Data objects are persisted in XML files.
2.0 FEATURE REQUIREMENTS
2.1 Able to add/edit/delete JAD properties
(See attached XL document for detailed JAD properties)
2.2 Able to change ICON image from JAR file and updating the MIDlet-Jar-Size JAD property
2.3 Compare Manifest file from JAR with JAD properties for integrity and should not have any conflicts.
2.4 Verify obfuscated classes are not final classes
2.5 Check number of characters in MIDlet-Class names
2.6 Follow the release build naming conventions for different operators
(See attached XL document for detailed Naming conventions format for different operators)
2.24 Check Thumbs.db file in the Jar package
3.0 Eclipse Framework:-
3.1 Introduction:-
The basis for Eclipse is the Rich Client Platform (RCP). The following components constitute the rich client platform:
*
Core platform - boot Eclipse, run plugins
*
OSGi - a standard bundling framework
*
the Standard Widget Toolkit (SWT) - a portable widget toolkit
*
JFace - file buffers, text handling, text editors
*
The Eclipse Workbench - views, editors, perspectives, wizards
Eclipse's widgets are implemented by a widget toolkit for Java called SWT, unlike most Java applications, which use the Java standard Abstract Window Toolkit (AWT) or Swing. Eclipse's user interface also leverages an intermediate GUI layer called JFace, which simplifies the construction of applications based on SWT.
Eclipse employs plugins in order to provide all of its functionality on top of (and including) the rich client platform, in contrast to some other IDEs where functionality is typically hard coded. This plugin mechanism is a lightweight software componentry framework. In addition to allowing Eclipse to be extended using other programming languages such as C and Python, the plugin framework allows Eclipse to work with typesetting languages like LaTeX, networking applications such as telnet and database management systems. The plugin architecture supports writing any desired extension to the environment, such as for configuration management. Java and CVS support is provided in the Eclipse SDK. It does not have to be used solely to support other programming languages.
The Eclipse SDK includes the Eclipse Java Development Tools, offering an IDE with a built-in incremental Java compiler and a full model of the Java source files. This allows for advanced refactoring techniques and code analysis. The IDE also makes use of a workspace, in this case a set of metadata over a flat filespace allowing external file modifications as long as the corresponding workspace "resource" is refreshed afterwards.
Eclipse Plug-in Architecture
Each plug-in
*
Extends 1 or more extension points
*
Depends on 1 or more plug-ins
*
Lives in its own sub-directory
*
May contain Java code or other files
*
May export own Java APIs
*
May declare its own extension points
Details spelled out in the plug-in manifest
*
Manifest declares contributions
*
Code implements contributions and provides API
Eclipse Modeling Framework:-
The Eclipse Modeling Framework (EMF) is a Java open source framework and code-generation facility for building tools and other applications based on a structured model. While the Eclipse Platform provides a powerful integration framework at the UI and file level, EMF enhances this capability to enable fine-grained data sharing among tools and applications.
EMF started out as an implementation of the Object Management Group's (OMG) Meta Object Facility (MOF) specification, which standardizes a metamodel for object oriented analysis and design. Over time, EMF was used to implement a large set of tools and thus evolved into an efficient Java implementation of a core subset of the MOF API.
3.2 Architecture:-
Architecture consists of set of plugin that can be deployed over Eclipse Platform. Device Data, Operator Data are kept in XML document.
Device DB and Operator DB plugin
a. Core data model is derived from DeviceDB.xsd/OpeatorDB.xsd
b. Contributes to extension-point of UI plugin for
i. adding device/operator details
ii. editing device/operator details
iii. viewing device/operator details using filters
iv. deleting device/operator details
c. Contributes Device data objects/Operator data objects to extension-points of other plugins
Packaging Tool plugin
a. Takes contribution from Device DB plugin and Operator DB plugin
b. Modifies JAD properties to produce replicated builds which includes adding new JAD property, editing existing JAD property, deleting existing JAD property.
c. Modifies JAR resource contents to produce replicated builds which includes replacing icon images, checking for inclusion Thumbs.db files
d. Names JAD and JAR files by following operator naming conventions
e. Checks Collateral requirement for operators
[all the features listed in Section 2]
DeviceDB Plugin Interface:
public class DeviceDetails implements IGetDevice{
public DevicedbType getDeviceDetails()
{
}
}
a. DeviceDB_Plugin.xml:-
class="DeviceDetails" />
OperatorDB Plugin Interface:
public interface IGetDevice {
public DevicedbType getDeviceDetails();
}
public class OperatorDetails implements IGetOperator{
public OperatorType getOperatorDetails()
{
}
}
a. OperatorDB_Plugin.xml:-
class="OperatorDetails" />
Packaging Tool Plugin Interface:
public interface IGetOperator {
public DevicedbType getDeviceDetails();
}
public interface IGetDevice {
public DevicedbType getDeviceDetails();
}
a. Packaging Tool Plugin.xml:-
Common Extension Processing Logic:-
/**
* Extension processing logic for the
functions extension-point.
* Extract specific information about each function. Create callback
* function object when required.
*/
public class ProcessServiceMembers {
/**
* The fully-qualified name of the functions extension-point for this plug-in.
*/
private static final String EXTENSION_POINT =
"DeviceDetails";
/**
* Name of the XML attribute designating a function's name.
*/
private static final String FUNCTION_NAME_ATTRIBUTE = "name";
/**
* Name of the XML attribute designating the fully-qualified name
* of the implementation class of a function.
*/
private static final String CLASS_ATTRIBUTE = "class";
/**
* Perform initial extension processing for the members of the
*
DeviceDetails extension-point. Make calls to the user interface
* module to add the functions of an extension to the UI functions grid.
* For each function, a virtual proxy callback object is created and handed
* to the user interface module. The proxy class is a nested top-level
* class and is therefore known at compile time. The actual (real) callback
* objects configured into extensions are instantiated and initialized in
* a lazy fashion by the proxy callback objects.
*
* @param grid The UI functions grid exposing the functions configured
* into
DeviceDetails extensions.
*
*/
public static void process() throws WorkbenchException {
IPluginRegistry registry = Platform.getPluginRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT);
if (extensionPoint == null) {
throw new WorkbenchException(
"unable to resolve extension-point: " + EXTENSION_POINT);
}
IConfigurationElement[] members = extensionPoint.getConfigurationElements();
// For each service:
for (int m = 0; m < members.length; m++)
{
IConfigurationElement member = members[m];
// Get the label of the extender plugin and the ID of the extension.
IExtension extension = member.getDeclaringExtension();
String pluginLabel = extension.getDeclaringPluginDescriptor().getLabel();
if (pluginLabel == null) {
pluginLabel = "[unnamed plugin]";
}
// Get the name of the operation implemented by the service.
// The operation name is a service attribute in the extension's XML specification.
String functionName = member.getAttribute(FUNCTION_NAME_ATTRIBUTE);
if (functionName == null) {
functionName = "[unnamed function]";
}
String label = pluginLabel + "/" + functionName;
IGetDevice proxy = new FunctionProxy(member);
Object obj = proxy.getDeviceDetails();
}
return obj;
}
/**
* Virtual proxy class for arithmetic function invokation.
* Members of this class support lazy processing by fronting the real
* implementations of arithmetic functions configured into extensions.
*/
private static class FunctionProxy implements IGetDevice {
// The "real" implementation of the function.
private IGetDevice delegate = null;
// The configured state of the extension element representing this arithmetic function.
private IConfigurationElement element;
// Whether this function has been invoked before.
// Used for lazy evaluation of the service.
private boolean invoked = false;
/**
* Construct a virtual proxy to stand in place of an extension function.
* The constructor simply keeps track of an arithmetic function's configured state
* without at this time instantiating the implementation of the function.
*
* @param element The configuration of this arithmetic function.
*/
public FunctionProxy(IConfigurationElement element) {
this.element = element;
}
/**
* Compute the function value.
* The proxy computation first instantiates the implementation
* of the function, if this is the first time the function is called,
* and then delegates to that implementation. The instantiation and
* initialization of the delegate implementation uses the standard
* callback object instantiation and initialization methods of Eclipse.
*
* @see com.bolour.sample.eclipse.service.ui.IFunction#compute(long)
*/
public final DevicedbType getDeviceDetails(){
try {
getDelegate();
}
catch (Exception ex) {
}
if (delegate == null) {
}
return delegate.getDeviceDetails();
}
/**
* Instantiate and initialize the implementation of the function if
* this is the first time the proxy has been called.
*
* @return The implementation delegate (same as the instance variable
delegate.
* @throws Exception If the callback object is misconfigured.
*/
private final IGetDevice getDelegate() throws Exception {
if (invoked) {
return delegate;
}
invoked = true;
try {
Object callback = element.createExecutableExtension(CLASS_ATTRIBUTE);
if (!(callback instanceof IFunction)) {
String message =
"callback class '"
+ callback.getClass().getName()
+ "' is not an IFunction";
System.err.println(message);
throw new ClassCastException(message);
}
delegate = (IFunction)callback;
}
catch (CoreException ex) {
System.err.println(ex.getMessage());
ex.printStackTrace();
throw ex;
}
catch (Error err) {
System.err.println(err.getMessage());
err.printStackTrace();
throw err;
}
return delegate;
}
}
}
Architecture Diagram (Release Management Tool)
4.0 FEATURE TO PLUGIN MAPPING
Sno
Features
Plugin
1
JAD properties modification
Packaging Tool
2
JAR Contents addition and deletion
Packaging Tool
3
Manifest and JAD contents verifier
Packaging Tool
4
GUI for Maintaining Knowledge Base
Device Db and Operator DB
5. Screen Shots
I. Fig 1
II. Fig 2
III. Fig 3
6. Appendix
a. Device DB XML Schema:-
b. Operator DB XML Schema:-
c. Installing Eclipse and Plugin Configuration
Step 1: Downloads
1. Download Eclipse 3.2
2. Download VE
3. Download EMF
4. Download GEF
5. Download SWT
Step 2: Extracting Downloads
1. Extract Eclipse to ECLIPSE_HOME/Eclipse folder
2. Extract all other packages to ECLIPSE_HOME path
3. Start ECLIPSE_HOME/Eclipse/eclipse.exe -clearonly once "eclipse -clean" from command prompt 4. Go Help->About Eclipse SDK -> Dialog Box appears -> click "Feature Details"
VE -> Visual Editor
EMF -> Java EMF Model
GEF -> java Graphics Editing Framework entries
5. Copy SWT*.dll files in SWT package to SYSTEM_DIRECTORY/Windows/System32
or Set Virtual Machine Argument under Run Configuration for each project -Djava.library.path="e:\shared\SWT"
This completes the Environment for Eclipse SWT application
Step 3: To work with SWT Plugin
1. Create a Java Project
2. Choose New -> Visual Class and Choose SWT Application
3. Set Java Build Path to point swt.jar
4. Add SWT*.dll files to windows/system32 folder or give -Djava.library.path="e:\swt"
5. Add XMLConfig.java for processing XML document
6. Create "Run..." configuration, choose application specific main class
Note: If the UI Design Editor is not present in the view, right click Some.java file and choose open with -> visual editor option to get Design Editor with Tool Box
Step 4: To work with EMF Plugin
EMF and Eclipse Plugin creation
Step 5: Sample Plugin Case Study
1. Created a New->Java Project-> DeviceDBPrj
2. Added two Java Interfaces to this Project
a. Device.java
b. DeviceModel.java
Created New -> Other -> Eclipse Modeling Framework -> EMF Models
Model Name: device.genmodel
Choose: Load from Annotated java
Finaly Finish
(or)
Choose XML Schema file to create device.genmodel
3. Now we can see more files created automatically in tools.DeviceDBPrj
Click device.genmodel and choose Generate All option in pop-up Menu
4. Now we see our PackageExplorer contains
DeviceDBPrj.edit
DeviceDBPrj.editor
DeviceDBPrj.tests
5. Choose Project -> Build All
6. Choose Run -> Run...-> Eclipse Application
in the dialog box under Plugin choose first option
Launch with all workspace and enabled external plugins
and under Common check the Run & Launch in Background
7. Now new Eclipse Workbench will be launched to check our plugins are created Choose Help- >About Eclipse SDK -> Plugin Details displays
8. Then Create New -> general -> Project
9. Then choose New->Other->Example EMF model Creation wizard -> our data model
10. Opening My.src file will show our Data Model in different views like list, tree, table etc.,
d. References
1. A First Look at Eclipse Plug-In Programming
2. A gentle introduction to SWT and JFace How to use combo, list, table, and tree controls
3. AIMIA Forum View topic - Mobile Device Database
4. All about Eclipse Plug-ins FAQ 97 How do I make my plug-in connect to other plug-ins
5. Ant-contrib Tasks For
6. Bug ID 4030989 Unable to change current directory
7. Build GUIs with the Eclipse Visual Editor project
8. Constructing SWT Layouts
9. Creating Eclipse plug-ins - An introduction to the Eclipse PDE. - HP Dev Resource Central
10. Detect Mouse Down In SWT Tree Item Tree SWT JFace Eclipse Java examples (example source code) Organized by topic
11. Developing your first Eclipse RCP application
12. DevPointer Eclipse articles
13. Eclipse Corner Articles
14. pse Forms Rich UI for Rich Client Applications
15. Eclipse Review
16. Eclipse Tools - EMF Installation
17. Eclipse User Interface Guidelines
18. EclipseCon2005 - Tutorials
19. EclipseME - About Signing
20. EclipseZone - Inter plugin communication. ...
21. EMF goes RCP
22. Enterprise Java Community Binding XML to Java
23. Generating an EMF 1.1 Model
24.Get Eclipse! Simple, fast, on demand [beta]
25. Getting Started.html
26. http--www.cs.umanitoba.ca-~eclipse-1-Install.pdf
27.Implementing a loop in ANT
28. Installation and Running of the ScribbleShare Tutorial
29. Introduction to Service Data Objects
30. Java technology Using OCL to interrogate your EMF model
31. Javalobby - Sun Java, JSP and J2EE technology programming forums, software downloads, jobs and tutorials
32. Mobile Research
33. Model with the Eclipse Modeling Framework, Part 1 Create UML models and generate code
34. Notes on the Eclipse Plug-in Architecture
35. O'Reilly -- Safari Books Online - 032142672X - Eclipse Building Commercial-Quality Plug-ins, Second Edition
36. ONJava.com -- Eclipse Plugins Exposed, Part 1 A First Glimpse
37. Overview (SDO Javadoc)
38. Page 3 - Introduction to Relations in XML Schema
39. PDE Does Plug-ins
40. Rich clients with the SWT and JFace - Java World
41. Sample Combo Combo SWT JFace Eclipse Java examples (example source code) Organized by topic
42. SourceForge.net xqIde - Eclipse Plugin for XQuery
43. The (J)Face of Eclipse
44. The EMF.Edit Framework Overview
45. The Official Eclipse FAQs - Eclipsepedia
46. Trajectories
47. Understanding how Eclipse plug-ins work with OSGi
48. Using EMF
49. Using Service Data Objects with Enterprise Information Integration technology
50. Using the Plug-in Development Environment
51. Using the SDO Data Graph Editor
52. Working XML Define and load extension points
53. XML Tools DTD, XML schema and XML document conversion software tool XML Utilities
Your valuable comments on this type-written text is highly
remembered.
Thanks.
Kindly,
K. Manigandan